accounts-qt 1.10

- Main Page
- Related Pages
- Classes
- Files

- File List

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 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 bool isSingleAccount() const;
65 const QDomDocument domDocument() const;
66
67 friend inline bool operator==(const Accounts::Provider &p1,
68 const Accounts::Provider &p2) {
69 return p1.m_provider == p2.m_provider || p1.name() == p2.name();
70 }
71
72 private:
73 // \cond
74 friend class Manager;
75 Provider(AgProvider *provider, ReferenceMode mode = AddReference);
76 AgProvider *provider() const;
77 AgProvider *m_provider;
78 // \endcond
79 };
80
81 } //namespace Accounts
82
83 #endif // ACCOUNTS_PROVIDER_H
Accounts::Manager
Manager of accounts, services and providers.
Definition: manager.h:51
Accounts::Provider
Representation of an account provider.
Definition: provider.h:48
Accounts::Provider::name
QString name() const
Get the name of the provider.
Definition: provider.cpp:103