• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • interfaces
 

interfaces

  • interfaces
  • tdeimproxy
  • library
tdeimproxy.h
1 /*
2  tdeimproxy.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 TDEIMPROXY_H
25 #define TDEIMPROXY_H
26 
27 #include <tqdict.h>
28 #include <tqmap.h>
29 #include <tqptrdict.h>
30 #include <tqstringlist.h>
31 
32 
33 #define IM_SERVICE_TYPE "DCOP/InstantMessenger"
34 #define IM_CLIENT_PREFERENCES_FILE "default_components"
35 #define IM_CLIENT_PREFERENCES_SECTION "InstantMessenger"
36 #define IM_CLIENT_PREFERENCES_ENTRY "imClient"
37 
38 #include "tdeimproxyiface.h"
39 
40 class DCOPClient;
41 class KIMIface_stub;
42 class KURL;
43 class ContactPresenceListCurrent;
44 
46 typedef TQMap<TQCString, int> AppPresence; // appId->presence; contains all applications' ideas of a user's presence
47 typedef TQDict<AppPresence> PresenceMap; // uid->AppPresence; contains a AppPresences for all users
49 typedef TQMap<TQString, ContactPresenceListCurrent> PresenceStringMap;
50 
107 class TDEIMPROXY_EXPORT KIMProxy : public TQObject, virtual public KIMProxyIface
108 {
109  Q_OBJECT
110  struct Private;
111 
112  template<class> friend class KStaticDeleter;
113  ~KIMProxy();
114 
115  public:
131  static KIMProxy * instance( DCOPClient * client );
132 
147  bool initialize();
148 
166  TQStringList allContacts();
167 
182  TQStringList reachableContacts();
183 
202  TQStringList onlineContacts();
203 
224  TQStringList fileTransferContacts();
225 
244  bool isPresent( const TQString& uid );
245 
266  TQString displayName( const TQString& uid );
267 
307  int presenceNumeric( const TQString& uid );
308 
343  TQString presenceString( const TQString& uid );
344 
372  TQPixmap presenceIcon( const TQString& uid );
373 
389  bool canReceiveFiles( const TQString & uid );
390 
414  bool canRespond( const TQString & uid );
415 
432  TQString locate( const TQString & contactId, const TQString & protocol );
433 
454  TQString context( const TQString & uid );
455 
467  void chatWithContact( const TQString& uid );
468 
484  void messageContact( const TQString& uid, const TQString& message );
485 
503  void sendFile(const TQString &uid, const KURL &sourceURL,
504  const TQString &altFileName = TQString::null, uint fileSize = 0);
505 
519  bool addContact( const TQString &contactId, const TQString &protocol );
520 
533  bool imAppsAvailable();
534 
540  bool startPreferredApp();
541 
545  void contactPresenceChanged( TQString uid, TQCString appId, int presence );
546 
547  public slots:
560  void registeredToDCOP( const TQCString& appId );
561 
579  void unregisteredFromDCOP( const TQCString& appId );
580  signals:
591  void sigContactPresenceChanged( const TQString &uid );
592 
600  void sigPresenceInfoExpired();
601  protected:
605  void pollApp( const TQCString & appId );
609  void pollAll( const TQString &uid );
610 
614  bool updatePresence( const TQString &uid, const TQCString &appId, int presence );
615 
619  TQString preferredApp();
620 
624  KIMIface_stub * stubForUid( const TQString &uid );
625 
630  KIMIface_stub * stubForProtocol( const TQString &protocol );
631 
632  private:
633  // client stubs used to get presence
634  // appId (from DCOP) -> KIMIface_stub
635  TQDict<KIMIface_stub> m_im_client_stubs;
636  // map containing numeric presence and the originating application ID for each KABC uid we know of
637  // KABC Uid -> (appId, numeric presence )(AppPresence)
638  PresenceMap m_presence_map;
639  // cache of the client strings in use by each application
640  // dictionary of KIMIface_stub -> map of numeric presence -> string presence
641  // FIXME: remove for KDE4 - UNUSED but maintained for binary compatibility in KDE 3.4
642  TQPtrDict<int> m_client_presence_strings;
643  Private * d;
644  bool m_apps_available;
645  bool m_initialized;
649  KIMProxy( DCOPClient * client);
650  static KIMProxy * s_instance;
651 };
652 
653 #endif
654 
KURL
KStaticDeleter
DCOPClient
KIMProxy
Provides access to instant messenger programs which implement KDE's instant messanger interface KIMIf...
Definition: tdeimproxy.h:107
locate
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())

interfaces

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

interfaces

Skip menu "interfaces"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for interfaces by doxygen 1.8.8
This website is maintained by Timothy Pearson.