accounts-qt  1.16
provider.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /*
3  * This file is part of libaccounts-qt
4  *
5  * Copyright (C) 2009-2011 Nokia Corporation.
6  * Copyright (C) 2012-2016 Canonical Ltd.
7  *
8  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * version 2.1 as published by the Free Software Foundation.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  */
29 #ifndef ACCOUNTS_PROVIDER_H
30 #define ACCOUNTS_PROVIDER_H
31 
32 #include "Accounts/accountscommon.h"
33 
34 #include <QStringList>
35 #include <QDomDocument>
36 
37 extern "C"
38 {
39  typedef struct _AgProvider AgProvider;
40 }
41 
42 namespace Accounts
43 {
44 class Provider;
45 
46 typedef QList<Provider> ProviderList;
47 
48 class ACCOUNTS_EXPORT Provider
49 {
50 public:
51  Provider();
52  Provider(const Provider &other);
53  Provider &operator=(const Provider &other);
54  ~Provider();
55 
56  bool isValid() const;
57 
58  QString name() const;
59  QString displayName() const;
60  QString description() const;
61  QString pluginName() const;
62  QString trCatalog() const;
63  QString iconName() const;
64  QString domainsRegExp() const;
65  bool isSingleAccount() const;
66  const QDomDocument domDocument() const;
67 
68  friend inline bool operator==(const Accounts::Provider &p1,
69  const Accounts::Provider &p2) {
70  return p1.m_provider == p2.m_provider || p1.name() == p2.name();
71  }
72 
73 private:
74  // \cond
75  friend class Manager;
76  Provider(AgProvider *provider, ReferenceMode mode = AddReference);
77  AgProvider *provider() const;
78  AgProvider *m_provider;
79  // \endcond
80 };
81 
82 } //namespace Accounts
83 
84 #endif // ACCOUNTS_PROVIDER_H
Accounts::Manager
Manager of accounts, services and providers.
Definition: manager.h:52
Accounts::Provider::name
QString name() const
Get the name of the provider.
Definition: provider.cpp:105
Accounts::Provider
Representation of an account provider.
Definition: provider.h:49