accounts-qt 1.10

- Main Page
- Related Pages
- Classes
- Files

- File List

service.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 * Copyright (C) 2012 Intel Corporation.
8 *
9 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
10 * Contact: Jussi Laako <jussi.laako@linux.intel.com>
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * version 2.1 as published by the Free Software Foundation.
15 *
16 * This library is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 */
31 #ifndef ACCOUNTS_SERVICE_H
32 #define ACCOUNTS_SERVICE_H
33
34 #include "Accounts/accountscommon.h"
35
36 #include <QString>
37 #include <QSet>
38 #include <QDomDocument>
39 #include <QStringList>
40
41 extern "C"
42 {
43 typedef struct _AgService AgService;
44 }
45
46 namespace Accounts
47 {
48 class ACCOUNTS_EXPORT Service
49 {
50 public:
51 Service();
52 Service(const Service &other);
53 Service &operator=(const Service &other);
54 ~Service();
55
56 bool isValid() const;
57
58 QString name() const;
59 QString displayName() const;
60 QString trCatalog() const;
61 QString serviceType() const;
62 QString provider() const;
63 QString iconName() const;
64 bool hasTag(const QString &tag) const;
65 QSet<QString> tags() const;
66
67 const QDomDocument domDocument() const;
68
69 friend inline bool operator==(const Accounts::Service &s1,
70 const Accounts::Service &s2) {
71 return s1.m_service == s2.m_service || s1.name() == s2.name();
72 }
73
74 private:
75 // \cond
76 friend class Account;
77 friend class AccountService;
78 friend class AccountServicePrivate;
79 friend class Application;
80 friend class Manager;
81 Service(AgService *service, ReferenceMode mode = AddReference);
82 AgService *service() const;
83 AgService *m_service;
84 mutable QSet<QString> *m_tags;
85 // \endcond
86 };
87
88 typedef QList<Service> ServiceList;
89
90 } //namespace Accounts
91
92 #endif // ACCOUNTS_SERVICE_H
Accounts::Manager
Manager of accounts, services and providers.
Definition: manager.h:51
Accounts::AccountService
Account settings for a specific service.
Definition: account-service.h:39
Accounts::Service
Representation of an account service.
Definition: service.h:48
Accounts::Service::name
QString name() const
Get the name of the service.
Definition: service.cpp:114
Accounts::Application
Information on the client applications of libaccounts.
Definition: application.h:40