accounts-qt  1.13
provider.h
00001 /* vi: set et sw=4 ts=4 cino=t0,(0: */
00002 /*
00003  * This file is part of libaccounts-qt
00004  *
00005  * Copyright (C) 2009-2011 Nokia Corporation.
00006  * Copyright (C) 2012-2014 Canonical Ltd.
00007  *
00008  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public License
00012  * version 2.1 as published by the Free Software Foundation.
00013  *
00014  * This library is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00022  * 02110-1301 USA
00023  */
00029 #ifndef ACCOUNTS_PROVIDER_H
00030 #define ACCOUNTS_PROVIDER_H
00031 
00032 #include "Accounts/accountscommon.h"
00033 
00034 #include <QStringList>
00035 #include <QDomDocument>
00036 
00037 extern "C"
00038 {
00039     typedef struct _AgProvider AgProvider;
00040 }
00041 
00042 namespace Accounts
00043 {
00044 class Provider;
00045 
00046 typedef QList<Provider> ProviderList;
00047 
00048 class ACCOUNTS_EXPORT Provider
00049 {
00050 public:
00051     Provider();
00052     Provider(const Provider &other);
00053     Provider &operator=(const Provider &other);
00054     ~Provider();
00055 
00056     bool isValid() const;
00057 
00058     QString name() const;
00059     QString displayName() const;
00060     QString description() const;
00061     QString pluginName() const;
00062     QString trCatalog() const;
00063     QString iconName() const;
00064     QString domainsRegExp() const;
00065     bool isSingleAccount() const;
00066     const QDomDocument domDocument() const;
00067 
00068     friend inline bool operator==(const Accounts::Provider &p1,
00069                                   const Accounts::Provider &p2) {
00070         return p1.m_provider == p2.m_provider || p1.name() == p2.name();
00071     }
00072 
00073 private:
00074     // \cond
00075     friend class Manager;
00076     Provider(AgProvider *provider, ReferenceMode mode = AddReference);
00077     AgProvider *provider() const;
00078     AgProvider *m_provider;
00079     // \endcond
00080 };
00081 
00082 } //namespace Accounts
00083 
00084 #endif // ACCOUNTS_PROVIDER_H