• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • interfaces/tdeimproxy/library
 

interfaces/tdeimproxy/library

  • interfaces
  • tdeimproxy
  • library
tdeimproxy.cpp
1/*
2 tdeimproxy.cpp
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#include <tqglobal.h>
25#include <tqpixmapcache.h>
26#include <dcopclient.h>
27#include <tdeapplication.h>
28#include <kdcopservicestarter.h>
29#include <kdebug.h>
30#include <tdemessagebox.h>
31#include <ksimpleconfig.h>
32#include <kiconloader.h>
33#include <kservice.h>
34#include <kservicetype.h>
35
36#include "kimiface_stub.h"
37
38#include "tdeimproxy.h"
39
40static KStaticDeleter<KIMProxy> _staticDeleter;
41
42KIMProxy * KIMProxy::s_instance = 0L;
43
44struct AppPresenceCurrent
45{
46 TQCString appId;
47 int presence;
48};
49
50class ContactPresenceListCurrent : public TQValueList<AppPresenceCurrent>
51{
52 public:
53 // return value indicates if the supplied parameter was better than any existing presence
54 bool update( const AppPresenceCurrent );
55 AppPresenceCurrent best();
56};
57
58
59struct KIMProxy::Private
60{
61 DCOPClient * dc;
62 // list of the strings in use by KIMIface
63 TQStringList presence_strings;
64 // list of the icon names in use by KIMIface
65 TQStringList presence_icons;
66 // map of presences
67 PresenceStringMap presence_map;
68};
69
70bool ContactPresenceListCurrent::update( AppPresenceCurrent ap )
71{
72 if ( isEmpty() )
73 {
74 append( ap );
75 return true;
76 }
77
78 bool bestChanged = false;
79 AppPresenceCurrent best;
80 best.presence = -1;
81 ContactPresenceListCurrent::iterator it = begin();
82 const ContactPresenceListCurrent::iterator itEnd = end();
83 ContactPresenceListCurrent::iterator existing = itEnd;
84
85 while ( it != itEnd )
86 {
87 if ( (*it).presence > best.presence )
88 best = (*it);
89 if ( (*it).appId == ap.appId )
90 existing = it;
91 ++it;
92 }
93
94 if ( ap.presence > best.presence ||
95 best.appId == ap.appId )
96 bestChanged = true;
97
98 if ( existing != itEnd )
99 {
100 remove( existing );
101 append( ap );
102 }
103 return bestChanged;
104}
105
106AppPresenceCurrent ContactPresenceListCurrent::best()
107{
108 AppPresenceCurrent best;
109 best.presence = -1;
110 ContactPresenceListCurrent::iterator it = begin();
111 const ContactPresenceListCurrent::iterator itEnd = end();
112 while ( it != itEnd )
113 {
114 if ( (*it).presence > best.presence )
115 best = (*it);
116 ++it;
117 }
118 // if it's still -1 here, we have no presence data, so we return Unknown
119 if ( best.presence == -1 )
120 best.presence = 0;
121 return best;
122}
123
124// int bestPresence( AppPresence* ap )
125// {
126// Q_ASSERT( ap );
127// AppPresence::const_iterator it;
128// it = ap->begin();
129// int best = 0; // unknown
130// if ( it != ap->end() )
131// {
132// best = it.data();
133// ++it;
134// for ( ; it != ap->end(); ++it )
135// {
136// if ( it.data() > best )
137// best = it.data();
138// }
139// }
140// return best;
141// }
142//
143// TQCString bestAppId( AppPresence* ap )
144// {
145// Q_ASSERT( ap );
146// AppPresence::const_iterator it;
147// TQCString bestAppId;
148// it = ap->begin();
149// if ( it != ap->end() )
150// {
151// int best = it.data();
152// bestAppId = it.key();
153// ++it;
154// for ( ; it != ap->end(); ++it )
155// {
156// if ( it.data() > best )
157// {
158// best = it.data();
159// bestAppId = it.key();
160// }
161// }
162// }
163// return bestAppId;
164// }
165
166KIMProxy * KIMProxy::instance( DCOPClient * client )
167{
168 if ( client )
169 {
170 if ( !s_instance )
171 _staticDeleter.setObject( s_instance, new KIMProxy( client ) );
172 return s_instance;
173 }
174 else
175 return 0L;
176}
177
178KIMProxy::KIMProxy( DCOPClient* dc ) : DCOPObject( "KIMProxyIface" ), TQObject(), d( new Private )
179{
180 m_im_client_stubs.setAutoDelete( true );
181
182 d->dc = dc;
183 m_initialized = false;
184 connect( d->dc, TQ_SIGNAL( applicationRemoved( const TQCString& ) ) , this, TQ_SLOT( unregisteredFromDCOP( const TQCString& ) ) );
185 connect( d->dc, TQ_SIGNAL( applicationRegistered( const TQCString& ) ) , this, TQ_SLOT( registeredToDCOP( const TQCString& ) ) );
186 d->dc->setNotifications( true );
187
188 d->presence_strings.append( "Unknown" );
189 d->presence_strings.append( "Offline" );
190 d->presence_strings.append( "Connecting" );
191 d->presence_strings.append( "Away" );
192 d->presence_strings.append( "Online" );
193
194 d->presence_icons.append( "presence_unknown" );
195 d->presence_icons.append( "presence_offline" );
196 d->presence_icons.append( "presence_connecting" );
197 d->presence_icons.append( "presence_away" );
198 d->presence_icons.append( "presence_online" );
199
200 //TQCString senderApp = "Kopete";
201 //TQCString senderObjectId = "KIMIface";
202 TQCString method = "contactPresenceChanged( TQString, TQCString, int )";
203 //TQCString receiverObjectId = "KIMProxyIface";
204
205 // FIXME: make this work when the sender object id is set to KIMIFace
206 if ( !connectDCOPSignal( 0, 0, method, method, false ) )
207 kdWarning() << "Couldn't connect DCOP signal. Won't receive any status notifications!" << endl;
208}
209
210KIMProxy::~KIMProxy( )
211{
212 //d->dc->setNotifications( false );
213}
214
215bool KIMProxy::initialize()
216{
217 if ( !m_initialized )
218 {
219 m_initialized = true; // we should only do this once, as registeredToDCOP() will catch any new starts
220 // So there is no error from a failed query when using tdelibs 3.2, which don't have this servicetype
221 if ( KServiceType::serviceType( IM_SERVICE_TYPE ) )
222 {
223 //kdDebug( 790 ) << k_funcinfo << endl;
224 TQCString dcopObjectId = "KIMIface";
225
226 // see what apps implementing our service type are out there
227 KService::List offers = KServiceType::offers( IM_SERVICE_TYPE );
228 KService::List::iterator offer;
229 typedef TQValueList<TQCString> QCStringList;
230 QCStringList registeredApps = d->dc->registeredApplications();
231 QCStringList::iterator app;
232 const QCStringList::iterator end = registeredApps.end();
233 // for each registered app
234 for ( app = registeredApps.begin(); app != end; ++app )
235 {
236 //kdDebug( 790 ) << " considering: " << *app << endl;
237 //for each offer
238 for ( offer = offers.begin(); offer != offers.end(); ++offer )
239 {
240 TQCString dcopService = (*offer)->property("X-DCOP-ServiceName").toString().latin1();
241 if ( !dcopService.isEmpty() )
242 {
243 //kdDebug( 790 ) << " is it: " << dcopService << "?" << endl;
244 // get the application name ( minus any process ID )
245 TQCString instanceName = (*app).left( dcopService.length() );
246 // if the application implements the dcop service, add it
247 if ( instanceName == dcopService )
248 {
249 m_apps_available = true;
250 //kdDebug( 790 ) << " app name: " << (*offer)->name() << ", has instance " << *app << ", dcopService: " << dcopService << endl;
251 if ( !m_im_client_stubs.find( dcopService ) )
252 {
253 kdDebug( 790 ) << "App " << *app << ", dcopObjectId " << dcopObjectId << " found, using it for presence info." << endl;
254 m_im_client_stubs.insert( *app, new KIMIface_stub( d->dc, *app, dcopObjectId ) );
255 pollApp( *app );
256 }
257 }
258 }
259 }
260 }
261 }
262 }
263 return !m_im_client_stubs.isEmpty();
264}
265
266void KIMProxy::registeredToDCOP( const TQCString& appId )
267{
268 //kdDebug( 790 ) << k_funcinfo << " appId '" << appId << "'" << endl;
269 // check that appId implements our service
270 // if the appId ends with a number, i.e. a pid like in foobar-12345,
271 if ( appId.isEmpty() )
272 return;
273
274 bool newApp = false;
275 // get an up to date list of offers in case a new app was installed
276 // and check each of the offers that implement the service type we're looking for,
277 // to see if any of them are the app that just registered
278 const KService::List offers = KServiceType::offers( IM_SERVICE_TYPE );
279 KService::List::const_iterator it;
280 for ( it = offers.begin(); it != offers.end(); ++it )
281 {
282 TQCString dcopObjectId = "KIMIface";
283 TQCString dcopService = (*it)->property("X-DCOP-ServiceName").toString().latin1();
284 if ( appId.left( dcopService.length() ) == dcopService )
285 {
286 // if it's not already known, insert it
287 if ( !m_im_client_stubs.find( appId ) )
288 {
289 newApp = true;
290 kdDebug( 790 ) << "App: " << appId << ", dcopService: " << dcopService << " started, using it for presence info."<< endl;
291 m_im_client_stubs.insert( appId, new KIMIface_stub( d->dc, appId, dcopObjectId ) );
292 }
293 }
294 //else
295 // kdDebug( 790 ) << "App doesn't implement our ServiceType" << endl;
296 }
297 //if ( newApp )
298 // emit sigPresenceInfoExpired();
299}
300
301void KIMProxy::unregisteredFromDCOP( const TQCString& appId )
302{
303 //kdDebug( 790 ) << k_funcinfo << appId << endl;
304 if ( m_im_client_stubs.find( appId ) )
305 {
306 kdDebug( 790 ) << appId << " quit, removing its presence info." << endl;
307
308 PresenceStringMap::Iterator it = d->presence_map.begin();
309 const PresenceStringMap::Iterator end = d->presence_map.end();
310 for ( ; it != end; ++it )
311 {
312 ContactPresenceListCurrent list = it.data();
313 ContactPresenceListCurrent::iterator cpIt = list.begin();
314 while( cpIt != list.end() )
315 {
316 ContactPresenceListCurrent::iterator gone = cpIt++;
317 if ( (*gone).appId == appId )
318 {
319 list.remove( gone );
320 }
321 }
322 }
323 m_im_client_stubs.remove( appId );
324 emit sigPresenceInfoExpired();
325 }
326}
327
328void KIMProxy::contactPresenceChanged( TQString uid, TQCString appId, int presence )
329{
330 // update the presence map
331 //kdDebug( 790 ) << k_funcinfo << "uid: " << uid << " appId: " << appId << " presence " << presence << endl;
332 ContactPresenceListCurrent current;
333 current = d->presence_map[ uid ];
334 //kdDebug( 790 ) << "current best presence from : " << current.best().appId << " is: " << current.best().presence << endl;
335 AppPresenceCurrent newPresence;
336 newPresence.appId = appId;
337 newPresence.presence = presence;
338
339 if ( current.update( newPresence ) )
340 {
341 d->presence_map.insert( uid, current );
342 emit sigContactPresenceChanged( uid );
343 }
344}
345
346int KIMProxy::presenceNumeric( const TQString& uid )
347{
348 AppPresenceCurrent ap;
349 ap.presence = 0;
350 if ( initialize() )
351 {
352 ContactPresenceListCurrent presence = d->presence_map[ uid ];
353 ap = presence.best();
354 }
355 return ap.presence;
356}
357
358TQString KIMProxy::presenceString( const TQString& uid )
359{
360 AppPresenceCurrent ap;
361 ap.presence = 0;
362 if ( initialize() )
363 {
364 ContactPresenceListCurrent presence = d->presence_map[ uid ];
365 ap = presence.best();
366 }
367 if ( ap.appId.isEmpty() )
368 return TQString::null;
369 else
370 return d->presence_strings[ ap.presence ];
371}
372
373TQPixmap KIMProxy::presenceIcon( const TQString& uid )
374{
375 AppPresenceCurrent ap;
376 ap.presence = 0;
377 if ( initialize() )
378 {
379 ContactPresenceListCurrent presence = d->presence_map[ uid ];
380 ap = presence.best();
381 }
382 if ( ap.appId.isEmpty() )
383 {
384 //kdDebug( 790 ) << k_funcinfo << "returning a null TQPixmap because we were asked for an icon for a uid we know nothing about" << endl;
385 return TQPixmap();
386 }
387 else
388 {
389 //kdDebug( 790 ) << k_funcinfo << "returning this: " << d->presence_icons[ ap.presence ] << endl;
390 return SmallIcon( d->presence_icons[ ap.presence ]);
391 }
392}
393
394TQStringList KIMProxy::allContacts()
395{
396 TQStringList value = d->presence_map.keys();
397 return value;
398}
399
400TQStringList KIMProxy::reachableContacts()
401{
402 TQStringList value;
403
404 if ( initialize() )
405 {
406 TQDictIterator<KIMIface_stub> it( m_im_client_stubs );
407 for ( ; it.current(); ++it )
408 {
409 value += it.current()->reachableContacts( );
410 }
411 }
412 return value;
413}
414
415TQStringList KIMProxy::onlineContacts()
416{
417 TQStringList value;
418 PresenceStringMap::iterator it = d->presence_map.begin();
419 const PresenceStringMap::iterator end= d->presence_map.end();
420 for ( ; it != end; ++it )
421 if ( it.data().best().presence > 2 /*Better than Connecting, ie Away or Online*/ )
422 value.append( it.key() );
423
424 return value;
425}
426
427TQStringList KIMProxy::fileTransferContacts()
428{
429 TQStringList value;
430
431 if ( initialize() )
432 {
433 TQDictIterator<KIMIface_stub> it( m_im_client_stubs );
434 for ( ; it.current(); ++it )
435 {
436 value += it.current()->fileTransferContacts( );
437 }
438 }
439 return value;
440}
441
442bool KIMProxy::isPresent( const TQString& uid )
443{
444 return ( !d->presence_map[ uid ].isEmpty() );
445}
446
447TQString KIMProxy::displayName( const TQString& uid )
448{
449 TQString name;
450 if ( initialize() )
451 {
452 if ( KIMIface_stub* s = stubForUid( uid ) )
453 name = s->displayName( uid );
454 }
455 //kdDebug( 790 ) << k_funcinfo << name << endl;
456 return name;
457}
458
459bool KIMProxy::canReceiveFiles( const TQString & uid )
460{
461 if ( initialize() )
462 {
463 if ( KIMIface_stub* s = stubForUid( uid ) )
464 return s->canReceiveFiles( uid );
465 }
466 return false;
467}
468
469bool KIMProxy::canRespond( const TQString & uid )
470{
471 if ( initialize() )
472 {
473 if ( KIMIface_stub* s = stubForUid( uid ) )
474 return s->canRespond( uid );
475 }
476 return false;
477}
478
479TQString KIMProxy::context( const TQString & uid )
480{
481 if ( initialize() )
482 {
483 if ( KIMIface_stub* s = stubForUid( uid ) )
484 return s->context( uid );
485 }
486 return TQString::null;
487}
488
489void KIMProxy::chatWithContact( const TQString& uid )
490{
491 if ( initialize() )
492 {
493 if ( KIMIface_stub* s = stubForUid( uid ) )
494 {
495 tdeApp->updateRemoteUserTimestamp( s->app() );
496 s->chatWithContact( uid );
497 }
498 }
499 return;
500}
501
502void KIMProxy::messageContact( const TQString& uid, const TQString& message )
503{
504 if ( initialize() )
505 {
506 if ( KIMIface_stub* s = stubForUid( uid ) )
507 {
508 tdeApp->updateRemoteUserTimestamp( s->app() );
509 s->messageContact( uid, message );
510 }
511 }
512 return;
513}
514
515void KIMProxy::sendFile(const TQString &uid, const KURL &sourceURL, const TQString &altFileName, uint fileSize )
516{
517 if ( initialize() )
518 {
519 TQDictIterator<KIMIface_stub> it( m_im_client_stubs );
520 for ( ; it.current(); ++it )
521 {
522 if ( it.current()->canReceiveFiles( uid ) )
523 {
524 tdeApp->updateRemoteUserTimestamp( it.current()->app() );
525 it.current()->sendFile( uid, sourceURL, altFileName, fileSize );
526 break;
527 }
528 }
529 }
530 return;
531}
532
533bool KIMProxy::addContact( const TQString &contactId, const TQString &protocol )
534{
535 if ( initialize() )
536 {
537 if ( KIMIface_stub* s = stubForProtocol( protocol ) )
538 return s->addContact( contactId, protocol );
539 }
540 return false;
541}
542
543TQString KIMProxy::locate( const TQString & contactId, const TQString & protocol )
544{
545 if ( initialize() )
546 {
547 if ( KIMIface_stub* s = stubForProtocol( protocol ) )
548 return s->locate( contactId, protocol );
549 }
550 return TQString::null;
551}
552
553bool KIMProxy::imAppsAvailable()
554{
555 return ( !m_im_client_stubs.isEmpty() );
556}
557
558bool KIMProxy::startPreferredApp()
559{
560 TQString preferences = TQString("[X-DCOP-ServiceName] = '%1'").arg( preferredApp() );
561 // start/find an instance of DCOP/InstantMessenger
562 TQString error;
563 TQCString dcopService;
564 // Get a preferred IM client.
565 // The app will notify itself to us using registeredToDCOP, so we don't need to record a stub for it here
566 // FIXME: error in preferences, see debug output
567 preferences = TQString::null;
568 int result = KDCOPServiceStarter::self()->findServiceFor( IM_SERVICE_TYPE, TQString::null, preferences, &error, &dcopService );
569
570 kdDebug( 790 ) << k_funcinfo << "error was: " << error << ", dcopService: " << dcopService << endl;
571
572 return ( result == 0 );
573}
574
575
576void KIMProxy::pollAll( const TQString &uid )
577{
578/* // We only need to call this function if we don't have any data at all
579 // otherwise, the data will be kept fresh by received presence change
580 // DCOP signals
581 if ( !d->presence_map.contains( uid ) )
582 {
583 AppPresence *presence = new AppPresence();
584 // record current presence from known clients
585 TQDictIterator<KIMIface_stub> it( m_im_client_stubs );
586 for ( ; it.current(); ++it )
587 {
588 presence->insert( it.currentKey().ascii(), it.current()->presenceStatus( uid ) ); // m_im_client_stubs has qstring keys...
589 }
590 d->presence_map.insert( uid, presence );
591 }*/
592}
593
594void KIMProxy::pollApp( const TQCString & appId )
595{
596 //kdDebug( 790 ) << k_funcinfo << endl;
597 KIMIface_stub * appStub = m_im_client_stubs[ appId ];
598 TQStringList contacts = m_im_client_stubs[ appId ]->allContacts();
599 TQStringList::iterator it = contacts.begin();
600 TQStringList::iterator end = contacts.end();
601 for ( ; it != end; ++it )
602 {
603 ContactPresenceListCurrent current = d->presence_map[ *it ];
604 AppPresenceCurrent ap;
605 ap.appId = appId;
606 ap.presence = appStub->presenceStatus( *it );
607 current.append( ap );
608
609 d->presence_map.insert( *it, current );
610 if ( current.update( ap ) )
611 emit sigContactPresenceChanged( *it );
612 //kdDebug( 790 ) << " uid: " << *it << " presence: " << ap.presence << endl;
613 }
614}
615
616KIMIface_stub * KIMProxy::stubForUid( const TQString &uid )
617{
618 // get best appPresence
619 AppPresenceCurrent ap = d->presence_map[ uid ].best();
620 // look up the presence string from that app
621 return m_im_client_stubs.find( ap.appId );
622}
623
624KIMIface_stub * KIMProxy::stubForProtocol( const TQString &protocol)
625{
626 KIMIface_stub * app;
627 // see if the preferred client supports this protocol
628 TQString preferred = preferredApp();
629 if ( ( app = m_im_client_stubs.find( preferred ) ) )
630 {
631 if ( app->protocols().grep( protocol ).count() > 0 )
632 return app;
633 }
634 // preferred doesn't do this protocol, try the first of the others that says it does
635 TQDictIterator<KIMIface_stub> it( m_im_client_stubs );
636 for ( ; it.current(); ++it )
637 {
638 if ( it.current()->protocols().grep( protocol ).count() > 0 )
639 return it.current();
640 }
641 return 0L;
642}
643
644TQString KIMProxy::preferredApp()
645{
646 TDEConfig *store = new KSimpleConfig( IM_CLIENT_PREFERENCES_FILE );
647 store->setGroup( IM_CLIENT_PREFERENCES_SECTION );
648 TQString preferredApp = store->readEntry( IM_CLIENT_PREFERENCES_ENTRY );
649 //kdDebug( 790 ) << k_funcinfo << "found preferred app: " << preferredApp << endl;
650 return preferredApp;
651}
652
653#include "tdeimproxy.moc"
DCOPClient
DCOPObject
DCOPObject::connectDCOPSignal
bool connectDCOPSignal(const TQCString &sender, const TQCString &senderObj, const TQCString &signal, const TQCString &slot, bool Volatile)
KIMProxy
Provides access to instant messenger programs which implement KDE's instant messanger interface KIMIf...
Definition: tdeimproxy.h:108
KIMProxy::stubForProtocol
KIMIface_stub * stubForProtocol(const TQString &protocol)
Get the app stub for this protocol.
Definition: tdeimproxy.cpp:624
KIMProxy::sigContactPresenceChanged
void sigContactPresenceChanged(const TQString &uid)
Indicates that the specified IM-contact's presence changed.
KIMProxy::presenceIcon
TQPixmap presenceIcon(const TQString &uid)
Obtain the icon representing the IM presence for the specified contact.
Definition: tdeimproxy.cpp:373
KIMProxy::onlineContacts
TQStringList onlineContacts()
Obtain a list of IM-contacts that are currently online.
Definition: tdeimproxy.cpp:415
KIMProxy::canReceiveFiles
bool canReceiveFiles(const TQString &uid)
Indicate if a given contact can receive files.
Definition: tdeimproxy.cpp:459
KIMProxy::unregisteredFromDCOP
void unregisteredFromDCOP(const TQCString &appId)
Updates the proxy's data after an application unregistered with DCOP.
Definition: tdeimproxy.cpp:301
KIMProxy::sigPresenceInfoExpired
void sigPresenceInfoExpired()
Indicates that presence information obtained earlier on might not be valid any longer.
KIMProxy::chatWithContact
void chatWithContact(const TQString &uid)
Start a chat session with the specified contact.
Definition: tdeimproxy.cpp:489
KIMProxy::allContacts
TQStringList allContacts()
Obtain a list of IM-contacts known to IM-applications.
Definition: tdeimproxy.cpp:394
KIMProxy::initialize
bool initialize()
Get the proxy ready to connect.
Definition: tdeimproxy.cpp:215
KIMProxy::presenceNumeric
int presenceNumeric(const TQString &uid)
Obtain the IM presence as a number for the specified contact.
Definition: tdeimproxy.cpp:346
KIMProxy::isPresent
bool isPresent(const TQString &uid)
Confirm if a given contact is known to the proxy.
Definition: tdeimproxy.cpp:442
KIMProxy::messageContact
void messageContact(const TQString &uid, const TQString &message)
Send a single message to the specified contact.
Definition: tdeimproxy.cpp:502
KIMProxy::fileTransferContacts
TQStringList fileTransferContacts()
Obtain a list of IM-contacts who may receive file transfers.
Definition: tdeimproxy.cpp:427
KIMProxy::displayName
TQString displayName(const TQString &uid)
Obtain the proxy's idea of the contact's display name.
Definition: tdeimproxy.cpp:447
KIMProxy::startPreferredApp
bool startPreferredApp()
Start the user's preferred IM application.
Definition: tdeimproxy.cpp:558
KIMProxy::imAppsAvailable
bool imAppsAvailable()
Checks if there are any compatible instant messaging applications available.
Definition: tdeimproxy.cpp:553
KIMProxy::canRespond
bool canRespond(const TQString &uid)
Indicate if a given contact will be able to respond.
Definition: tdeimproxy.cpp:469
KIMProxy::registeredToDCOP
void registeredToDCOP(const TQCString &appId)
Updates the proxy's data after a new application registered with DCOP.
Definition: tdeimproxy.cpp:266
KIMProxy::contactPresenceChanged
void contactPresenceChanged(TQString uid, TQCString appId, int presence)
Just exists to let the IDL compiler make the DCOP signal for this.
Definition: tdeimproxy.cpp:328
KIMProxy::reachableContacts
TQStringList reachableContacts()
Obtain a list of IM-contacts that are currently reachable.
Definition: tdeimproxy.cpp:400
KIMProxy::pollAll
void pollAll(const TQString &uid)
Bootstrap our presence data by polling all known apps.
Definition: tdeimproxy.cpp:576
KIMProxy::locate
TQString locate(const TQString &contactId, const TQString &protocol)
Obtain the KABC UID corresponding to the given IM address.
Definition: tdeimproxy.cpp:543
KIMProxy::context
TQString context(const TQString &uid)
Obtain the given contact's current context (home, work, or any)
Definition: tdeimproxy.cpp:479
KIMProxy::stubForUid
KIMIface_stub * stubForUid(const TQString &uid)
Get the app stub best able to reach this uid.
Definition: tdeimproxy.cpp:616
KIMProxy::sendFile
void sendFile(const TQString &uid, const KURL &sourceURL, const TQString &altFileName=TQString::null, uint fileSize=0)
Send a file to the contact.
Definition: tdeimproxy.cpp:515
KIMProxy::addContact
bool addContact(const TQString &contactId, const TQString &protocol)
Add a new contact given its protocol specific identifier.
Definition: tdeimproxy.cpp:533
KIMProxy::instance
static KIMProxy * instance(DCOPClient *client)
Obtain an instance of KIMProxy.
Definition: tdeimproxy.cpp:166
KIMProxy::pollApp
void pollApp(const TQCString &appId)
Bootstrap our presence data for a newly registered app.
Definition: tdeimproxy.cpp:594
KIMProxy::preferredApp
TQString preferredApp()
Get the name of the user's IM application of choice.
Definition: tdeimproxy.cpp:644
KIMProxy::presenceString
TQString presenceString(const TQString &uid)
Obtain the IM presence as a i18ned string for the specified contact.
Definition: tdeimproxy.cpp:358

interfaces/tdeimproxy/library

Skip menu "interfaces/tdeimproxy/library"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

interfaces/tdeimproxy/library

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