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

Interfaces

  • sources
  • kde-4.12
  • kdelibs
  • interfaces
  • kimproxy
  • library
kimproxy.h
Go to the documentation of this file.
1 /*
2  kimproxy.h
3 
4  IM service library for KDE
5 
6  Copyright (c) 2004 Will Stephenson <lists@stevello.free-online.co.uk>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef KIMPROXY_H
25 #define KIMPROXY_H
26 
27 #include <QtCore/QHash>
28 #include <QtCore/QMap>
29 #include <QtCore/QStringList>
30 #include <QtGui/QPixmap>
31 
32 #include <kimproxy_export.h>
33 
34 #define IM_SERVICE_TYPE "DBUS/InstantMessenger"
35 #define IM_CLIENT_PREFERENCES_FILE "default_components"
36 #define IM_CLIENT_PREFERENCES_SECTION "InstantMessenger"
37 #define IM_CLIENT_PREFERENCES_ENTRY "imClient"
38 
39 class KUrl;
40 class ContactPresenceListCurrent;
41 class OrgKdeKIMInterface;
42 
44 typedef QMap<QString, int> AppPresence; // appId->presence; contains all applications' ideas of a user's presence
45 typedef QHash<QString, AppPresence*> PresenceMap; // uid->AppPresence; contains a AppPresences for all users
47 typedef QMap<QString, ContactPresenceListCurrent> PresenceStringMap;
48 
68 class KIMPROXY_EXPORT KIMProxy : public QObject
69 {
70  Q_OBJECT
71  public:
72  ~KIMProxy();
77  static KIMProxy * instance();
78 
84  bool initialize();
85 
86  public Q_SLOTS:
92  QStringList allContacts();
93 
99  QStringList reachableContacts();
100 
106  QStringList onlineContacts();
107 
113  QStringList fileTransferContacts();
114 
120  bool isPresent( const QString& uid );
121 
128  QString displayName( const QString& uid );
129 
135  int presenceNumeric( const QString& uid );
136 
142  QString presenceString( const QString& uid );
143 
149  QPixmap presenceIcon( const QString& uid );
150 
156  bool canReceiveFiles( const QString & uid );
157 
163  bool canRespond( const QString & uid );
164 
172  QString locate( const QString & contactId, const QString & protocol );
173 
179  QString context( const QString & uid );
180 
185  void chatWithContact( const QString& uid );
186 
194  void messageContact( const QString& uid, const QString& message );
195 
203  void sendFile(const QString &uid, const QString &sourceURL, const QString &altFileName = QString(), uint fileSize = 0);
204 
211  bool addContact( const QString &contactId, const QString &protocol );
212 
217  bool imAppsAvailable();
218 
223  bool startPreferredApp();
224 
228  void contactPresenceChanged( const QString& uid, const QString& appId, int presence );
229 
230  private Q_SLOTS:
231  void nameOwnerChanged( const QString &name, const QString &oldOwner, const QString &newOwner);
232  Q_SIGNALS:
237  void sigContactPresenceChanged( const QString &uid );
238 
243  void sigPresenceInfoExpired();
244  protected:
248  void pollApp( const QString & appId );
252  void pollAll( const QString &uid );
253 
257  bool updatePresence( const QString &uid, const QString &appId, int presence );
258 
262  QString preferredApp();
263 
267  OrgKdeKIMInterface * stubForUid( const QString &uid );
268 
273  OrgKdeKIMInterface * stubForProtocol( const QString &protocol );
274 
275  private:
276  // client stubs used to get presence
277  // appId (from D-Bus) -> KIMIface_stub
278  QHash<QString, OrgKdeKIMInterface*> m_im_client_stubs;
279  // map containing numeric presence and the originating application ID for each KABC uid we know of
280  // KABC Uid -> (appId, numeric presence )(AppPresence)
281  PresenceMap m_presence_map;
282  // cache of the client strings in use by each application
283  // dictionary of KIMIface_stub -> map of numeric presence -> string presence
284  class Private;
285 
286  Private * const d;
287  bool m_apps_available;
288  bool m_initialized;
292  KIMProxy();
293 };
294 
295 #endif
296 
message
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
AppPresence
QMap< QString, int > AppPresence
FIXME: remove for KDE4, binary compatibility again.
Definition: kimproxy.h:41
kimproxy_export.h
name
const char * name(StandardAction id)
QString
QHash< QString, AppPresence * >
QObject
KUrl
QStringList
PresenceStringMap
QMap< QString, ContactPresenceListCurrent > PresenceStringMap
FIXME: remove presenceMap and call this presenceMap in KDE4.
Definition: kimproxy.h:47
KIMProxy
This class provides an easy-to-use interface to any instant messengers or chat programs that you have...
Definition: kimproxy.h:68
QMap< QString, int >
PresenceMap
QHash< QString, AppPresence * > PresenceMap
Definition: kimproxy.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Interfaces

Skip menu "Interfaces"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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