• Skip to content
  • Skip to link menu
  • KDE API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • KTp
global-presence.h
Go to the documentation of this file.
1 /*
2  * Global Presence - wraps calls to set and get presence for all accounts.
3  *
4  * Copyright (C) 2011 David Edmundson <kde@davidedmundson.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef GLOBALPRESENCE_H
22 #define GLOBALPRESENCE_H
23 
24 #include <QObject>
25 #include <TelepathyQt/AccountManager>
26 #include <TelepathyQt/AccountSet>
27 
28 #include <KTp/ktp-export.h>
29 #include "presence.h"
30 
31 namespace KTp
32 {
33 
38 class KTP_EXPORT GlobalPresence : public QObject
39 {
40  Q_OBJECT
41 public:
42  explicit GlobalPresence(QObject *parent = 0);
43 
47  void setAccountManager(const Tp::AccountManagerPtr &accountManager);
48 
50  Tp::ConnectionStatus connectionStatus() const;
51 
53  Presence currentPresence() const;
54 
57  Presence requestedPresence() const;
58 
60  bool isChangingPresence() const;
61 
63  bool hasEnabledAccounts() const;
64 
65  Tp::AccountSetPtr onlineAccounts() const;
66 
67 Q_SIGNALS:
68  void requestedPresenceChanged(const KTp::Presence &customPresence);
69  void currentPresenceChanged(const KTp::Presence &presence);
70  void changingPresence(bool isChanging);
71  void connectionStatusChanged(Tp::ConnectionStatus);
72 
73 public Q_SLOTS:
75  void setPresence(const Tp::Presence &presence);
76 
78  void saveCurrentPresence();
80  void restoreSavedPresence();
81 
82 private Q_SLOTS:
83  void onCurrentPresenceChanged();
84  void onRequestedPresenceChanged();
85  void onChangingPresence();
86  void onConnectionStatusChanged();
87 
88  void onAccountAdded(const Tp::AccountPtr &account);
89 
90 private:
91  Tp::AccountSetPtr m_enabledAccounts;
92  Tp::AccountSetPtr m_onlineAccounts;
93 
95  KTp::Presence m_savedPresence;
97  KTp::Presence m_requestedPresence;
99  KTp::Presence m_currentPresence;
100 
101  Tp::ConnectionStatus m_connectionStatus;
102  bool m_changingPresence;
103 };
104 
105 }
106 
107 #endif // GLOBALPRESENCE_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 22 2013 10:58:52 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktp-common-internals API Reference

Skip menu "ktp-common-internals API Reference"
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal