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

kopete/libkopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • libkopete
kopetemetacontact.cpp
Go to the documentation of this file.
1 /*
2  kopetemetacontact.cpp - Kopete Meta Contact
3 
4  Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
5  Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@kde.org>
6  Copyright (c) 2002-2004 by Duncan Mac-Vicar Prett <duncan@kde.org>
7  Copyright (c) 2005 by MichaĆ«l Larouche <larouche@kde.org>
8 
9  Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
10 
11  *************************************************************************
12  * *
13  * This library is free software; you can redistribute it and/or *
14  * modify it under the terms of the GNU Lesser General Public *
15  * License as published by the Free Software Foundation; either *
16  * version 2 of the License, or (at your option) any later version. *
17  * *
18  *************************************************************************
19 */
20 
21 #include "kopetemetacontact.h"
22 #include "kopetemetacontact_p.h"
23 
24 #include <QTextDocument>
25 
26 #include <kabc/addressbook.h>
27 #include <kabc/addressee.h>
28 
29 #include <kdebug.h>
30 #include <klocale.h>
31 #include <kmessagebox.h>
32 #include <kdeversion.h>
33 #include <knotification.h>
34 
35 #include "kabcpersistence.h"
36 #include "kopetecontactlist.h"
37 #include "kopetecontact.h"
38 #include "kopeteaccountmanager.h"
39 #include "kopeteprotocol.h"
40 #include "kopeteaccount.h"
41 #include "kopetepluginmanager.h"
42 #include "kopetegroup.h"
43 #include "kopeteglobal.h"
44 #include "kopeteuiglobal.h"
45 #include "kopetebehaviorsettings.h"
46 #include "kopeteemoticons.h"
47 
48 namespace Kopete {
49 
50 MetaContact::MetaContact()
51  : ContactListElement( ContactList::self() ), d(new Private())
52 {
53  d->metaContactId = QUuid::createUuid();
54 
55  connect( this, SIGNAL(pluginDataChanged()), SIGNAL(persistentDataChanged()) );
56  connect( this, SIGNAL(iconChanged(Kopete::ContactListElement::IconState,QString)), SIGNAL(persistentDataChanged()) );
57  connect( this, SIGNAL(useCustomIconChanged(bool)), SIGNAL(persistentDataChanged()) );
58  connect( this, SIGNAL(displayNameChanged(QString,QString)), SIGNAL(persistentDataChanged()) );
59  connect( this, SIGNAL(movedToGroup(Kopete::MetaContact*,Kopete::Group*,Kopete::Group*)), SIGNAL(persistentDataChanged()) );
60  connect( this, SIGNAL(removedFromGroup(Kopete::MetaContact*,Kopete::Group*)), SIGNAL(persistentDataChanged()) );
61  connect( this, SIGNAL(addedToGroup(Kopete::MetaContact*,Kopete::Group*)), SIGNAL(persistentDataChanged()) );
62  connect( this, SIGNAL(contactAdded(Kopete::Contact*)), SIGNAL(persistentDataChanged()) );
63  connect( this, SIGNAL(contactRemoved(Kopete::Contact*)), SIGNAL(persistentDataChanged()) );
64 
65  // TODO: speed up: this slot is called when any kabc contact is changed and is called in *every* metacontact instance. also slot is slow because it finding kabc id
66  // Update the KABC picture when the KDE Address book change.
67  connect(KABCPersistence::self()->addressBook(), SIGNAL(addressBookChanged(AddressBook*)), this, SLOT(slotUpdateAddressBookPicture()));
68 
69  // make sure MetaContact is at least in one group
70  addToGroup( Group::topLevel() );
71  // I'm not sure this is correct -Olivier
72  // we probably should do the check in groups() instead
73 
74 }
75 
76 MetaContact::~MetaContact()
77 {
78  delete d;
79 }
80 
81 QUuid MetaContact::metaContactId() const
82 {
83  return d->metaContactId;
84 }
85 
86 void MetaContact::setMetaContactId( const QUuid& newUuid)
87 {
88  d->metaContactId = newUuid;
89 }
90 
91 void MetaContact::addContact( Contact *c )
92 {
93  if( d->contacts.contains( c ) )
94  {
95  kWarning(14010) << "Ignoring attempt to add duplicate contact " << c->contactId() << "!";
96  }
97  else
98  {
99  const QString oldDisplayName = displayName();
100 
101  d->contacts.append( c );
102  connect( c, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
103  SLOT(slotContactStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
104 
105  connect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
106  this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
107 
108  connect( c, SIGNAL(displayNameChanged(QString,QString)),
109  this, SLOT(slotContactDisplayNameChanged(QString,QString)) );
110 
111  connect( c, SIGNAL(contactDestroyed(Kopete::Contact*)),
112  this, SLOT(slotContactDestroyed(Kopete::Contact*)) );
113 
114  connect( c, SIGNAL(idleStateChanged(Kopete::Contact*)),
115  this, SIGNAL(contactIdleStateChanged(Kopete::Contact*)) );
116 
117  emit contactAdded(c);
118 
119  updateOnlineStatus();
120 
121  // if this is the first contact, probbaly was created by a protocol
122  // so it has empty custom properties, then set sources to the contact
123  if ( d->contacts.count() == 1 )
124  {
125  const QString newDisplayName = displayName();
126  if ( oldDisplayName != newDisplayName )
127  {
128  emit displayNameChanged( oldDisplayName , displayName() );
129  QListIterator<Kopete::Contact *> it( d->contacts );
130  while ( it.hasNext() )
131  ( it.next() )->sync(Contact::DisplayNameChanged);
132  }
133  if ( picture().isNull() )
134  {
135  setPhotoSourceContact(c);
136  setPhotoSource(SourceContact);
137  }
138  }
139  }
140 }
141 
142 void MetaContact::updateOnlineStatus()
143 {
144  Kopete::OnlineStatus::StatusType newStatus = Kopete::OnlineStatus::Unknown;
145  Kopete::OnlineStatus mostSignificantStatus;
146 
147  QListIterator<Contact *> it(d->contacts);
148  while ( it.hasNext() )
149  {
150  Contact *c = it.next();
151  // find most significant status
152  if ( c->onlineStatus() > mostSignificantStatus )
153  mostSignificantStatus = c->onlineStatus();
154  }
155 
156  newStatus = mostSignificantStatus.status();
157 
158  if( newStatus != d->onlineStatus )
159  {
160  d->onlineStatus = newStatus;
161  emit onlineStatusChanged( this, d->onlineStatus );
162  }
163 }
164 
165 void MetaContact::removeContact(Contact *c, bool deleted)
166 {
167  if( !d->contacts.contains( c ) )
168  {
169  kDebug(14010) << " Contact is not in this metaContact ";
170  }
171  else
172  {
173  // must check before removing, or will always be false
174  bool wasTrackingName = ( !displayNameSourceContact() && (displayNameSource() == SourceContact) );
175  bool wasTrackingPhoto = ( !photoSourceContact() && (photoSource() == SourceContact) );
176  // save for later use
177  QString currDisplayName = displayName();
178 
179  d->contacts.removeAll( c );
180 
181  // if the contact was a source of property data, clean
182  if (displayNameSourceContact() == c)
183  setDisplayNameSourceContact(0L);
184  if (photoSourceContact() == c)
185  setPhotoSourceContact(0L);
186 
187 
188  if ( wasTrackingName )
189  {
190  // Oh! this contact was the source for the metacontact's name
191  // lets do something
192  // is this the only contact?
193  if ( d->contacts.isEmpty() )
194  {
195  // fallback to a custom name as we don't have
196  // more contacts to chose as source.
197  setDisplayNameSource(SourceCustom);
198  // perhaps the custom display name was empty
199  // no problems baby, I saved the old one.
200  setDisplayName(currDisplayName);
201  }
202  else
203  {
204  // we didn't fallback to SourceCustom above so lets use the next
205  // contact as source
206  setDisplayNameSourceContact( d->contacts.first() );
207  }
208  }
209 
210  if ( wasTrackingPhoto )
211  {
212  // Oh! this contact was the source for the metacontact's photo
213  // lets do something
214  // is this the only contact?
215  if ( d->contacts.isEmpty() )
216  {
217  // fallback to a custom photo as we don't have
218  // more contacts to chose as source.
219  setPhotoSource(SourceCustom);
220  // FIXME set the custom photo
221  }
222  else
223  {
224  // we didn't fallback to SourceCustom above so lets use the next
225  // contact as source
226  setPhotoSourceContact( d->contacts.first() );
227  }
228  }
229 
230  if(!deleted)
231  { //If this function is tell by slotContactRemoved, c is maybe just a QObject
232  disconnect( c, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
233  this, SLOT(slotContactStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
234  disconnect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
235  this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
236  disconnect( c, SIGNAL(displayNameChanged(QString,QString)),
237  this, SLOT(slotContactDisplayNameChanged(QString,QString)) );
238  disconnect( c, SIGNAL(contactDestroyed(Kopete::Contact*)),
239  this, SLOT(slotContactDestroyed(Kopete::Contact*)) );
240  disconnect( c, SIGNAL(idleStateChanged(Kopete::Contact*)),
241  this, SIGNAL(contactIdleStateChanged(Kopete::Contact*)) );
242 
243  kDebug( 14010 ) << "Contact disconnected";
244 
245  KABCPersistence::self()->write( this );
246  }
247 
248  // Reparent the contact
249  c->setParent( 0 );
250 
251  emit contactRemoved( c );
252  }
253  updateOnlineStatus();
254 }
255 
256 Contact *MetaContact::findContact( const QString &protocolId, const QString &accountId, const QString &contactId )
257 {
258  //kDebug( 14010 ) << "Num contacts: " << d->contacts.count();
259  QListIterator<Contact *> it( d->contacts );
260  while ( it.hasNext() )
261  {
262  Contact *c = it.next();
263  //kDebug( 14010 ) << "Trying " << it.current()->contactId() << ", proto "
264  //<< it.current()->protocol()->pluginId() << ", account " << it.current()->accountId() << endl;
265  if( ( c->contactId() == contactId ) && ( c->protocol()->pluginId() == protocolId || protocolId.isNull() ) )
266  {
267  if ( accountId.isNull() )
268  return c;
269 
270  if(c->account())
271  {
272  if(c->account()->accountId() == accountId)
273  return c;
274  }
275  }
276  }
277 
278  // Contact not found
279  return 0L;
280 }
281 
282 void MetaContact::setDisplayNameSource(PropertySource source)
283 {
284  QString oldName = displayName();
285  d->displayNameSource = source;
286  QString newName = displayName();
287  if ( oldName != newName) {
288  emit displayNameChanged( oldName, newName );
289  QListIterator<Kopete::Contact *> it( d->contacts );
290  while ( it.hasNext() )
291  ( it.next() )->sync(Contact::DisplayNameChanged);
292  }
293 }
294 
295 void MetaContact::setDisplayNameSource( const QString &nameSourcePID, const QString &nameSourceAID, const QString &nameSourceCID )
296 {
297  d->nameSourcePID = nameSourcePID;
298  d->nameSourceAID = nameSourceAID;
299  d->nameSourceCID = nameSourceCID;
300 }
301 
302 MetaContact::PropertySource MetaContact::displayNameSource() const
303 {
304  return d->displayNameSource;
305 }
306 
307 void MetaContact::setPhotoSource(PropertySource source)
308 {
309  PropertySource oldSource = photoSource();
310  d->photoSource = source;
311  if ( source != oldSource )
312  {
313  emit photoChanged();
314  }
315 }
316 
317 void MetaContact::setPhotoSource( const QString &photoSourcePID, const QString &photoSourceAID, const QString &photoSourceCID )
318 {
319  d->photoSourcePID = photoSourcePID;
320  d->photoSourceAID = photoSourceAID;
321  d->photoSourceCID = photoSourceCID;
322 }
323 
324 MetaContact::PropertySource MetaContact::photoSource() const
325 {
326  return d->photoSource;
327 }
328 
329 
330 Contact *MetaContact::sendMessage()
331 {
332  Contact *c = preferredContact();
333 
334  if( !c )
335  {
336  KMessageBox::queuedMessageBox( UI::Global::mainWidget(), KMessageBox::Sorry,
337  i18n( "This user is not reachable at the moment. Please make sure you are connected and using a protocol that supports offline sending, or wait "
338  "until this user comes online." ), i18n( "User is Not Reachable" ) );
339  }
340  else
341  {
342  c->sendMessage();
343  return c;
344  }
345  return 0L;
346 }
347 
348 Contact *MetaContact::startChat()
349 {
350  Contact *c = preferredContact();
351 
352  if( !c )
353  {
354  KMessageBox::queuedMessageBox( UI::Global::mainWidget(), KMessageBox::Sorry,
355  i18n( "This user is not reachable at the moment. Please make sure you are connected and using a protocol that supports offline sending, or wait "
356  "until this user comes online." ), i18n( "User is Not Reachable" ) );
357  }
358  else
359  {
360  c->startChat();
361  return c;
362  }
363  return 0L;
364 }
365 
366 Contact *MetaContact::preferredContact()
367 {
368  /*
369  This function will determine what contact will be used to reach the contact.
370 
371  The preferred contact is choose with the following criterias: (in that order)
372  1) If a contact was an open chatwindow already, we will use that one.
373  2) The contact with the better online status is used. But if that
374  contact is not reachable, we prefer return no contact.
375  3) If all the criterias aboxe still gives ex-eaquo, we use the preffered
376  account as selected in the account preferances (with the arrows)
377  */
378 
379  Contact *contact = 0;
380  bool hasOpenView=false; //has the selected contact already an open chatwindow
381  QListIterator<Contact *> it(d->contacts);
382  while ( it.hasNext() )
383  {
384  Contact *c=it.next();
385 
386  //Does the contact an open chatwindow?
387  if( c->manager( Contact::CannotCreate ) )
388  { //no need to check the view. having a manager is enough
389  if( !hasOpenView )
390  {
391  contact=c;
392  hasOpenView=true;
393  if( c->isReachable() )
394  continue;
395  } //else, several contact might have an open view, uses following criterias
396  }
397  else if( hasOpenView && contact->isReachable() )
398  continue; //This contact has not open view, but the selected contact has, and is reachable
399 
400  // FIXME: The isConnected call should be handled in Contact::isReachable
401  // after KDE 3.2 - Martijn
402  if ( !c->account() || !c->account()->isConnected() || !c->isReachable() )
403  continue; //if this contact is not reachable, we ignore it.
404 
405  if ( !contact )
406  { //this is the first contact.
407  contact= c;
408  continue;
409  }
410 
411  if( c->onlineStatus().status() > contact->onlineStatus().status() )
412  contact=c; //this contact has a better status
413  else if ( c->onlineStatus().status() == contact->onlineStatus().status() )
414  {
415  if( c->account()->priority() > contact->account()->priority() )
416  contact=c;
417  else if( c->account()->priority() == contact->account()->priority()
418  && c->onlineStatus().weight() > contact->onlineStatus().weight() )
419  contact = c; //the weight is not supposed to follow the same scale for each protocol
420  }
421  }
422  return contact;
423 }
424 
425 Contact *MetaContact::execute()
426 {
427  Contact *c = preferredContact();
428 
429  if( !c )
430  {
431  KMessageBox::queuedMessageBox( UI::Global::mainWidget(), KMessageBox::Sorry,
432  i18n( "This user is not reachable at the moment. Please make sure you are connected and using a protocol that supports offline sending, or wait "
433  "until this user comes online." ), i18n( "User is Not Reachable" ) );
434  }
435  else
436  {
437  c->execute();
438  return c;
439  }
440 
441  return 0L;
442 }
443 
444 quint32 MetaContact::idleTime() const
445 {
446  unsigned long int time = 0;
447  QListIterator<Contact *> it( d->contacts );
448  while ( it.hasNext() )
449  {
450  Contact *c = it.next();
451  unsigned long int i = c->idleTime();
452  if( (c->isOnline() && i < time) || time == 0 )
453  {
454  time = i;
455  }
456  }
457  return time;
458 }
459 
460 QString MetaContact::statusIcon() const
461 {
462  switch( status() )
463  {
464  case OnlineStatus::Online:
465  if( useCustomIcon() )
466  return icon( ContactListElement::Online );
467  else
468  return QString::fromUtf8( "user-online" );
469  case OnlineStatus::Away:
470  if( useCustomIcon() )
471  return icon( ContactListElement::Away );
472  else
473  return QString::fromUtf8( "user-away" );
474  case OnlineStatus::Busy:
475  if( useCustomIcon() )
476  return icon( ContactListElement::Away ); //Might want to create custom for busy too
477  else
478  return QString::fromUtf8( "user-busy" );
479 
480  case OnlineStatus::Unknown:
481  if( useCustomIcon() )
482  return icon( ContactListElement::Unknown );
483  if ( d->contacts.isEmpty() )
484  return QString::fromUtf8( "metacontact_unknown" );
485  else
486  return QString::fromUtf8( "user-offline" );
487 
488  case OnlineStatus::Offline:
489  default:
490  if( useCustomIcon() )
491  return icon( ContactListElement::Offline );
492  else
493  return QString::fromUtf8( "user-offline" );
494  }
495 }
496 
497 QString MetaContact::statusString() const
498 {
499  switch( status() )
500  {
501  case OnlineStatus::Online:
502  return i18n( "Online" );
503  case OnlineStatus::Away:
504  return i18n( "Away" );
505  case OnlineStatus::Busy:
506  return i18n( "Busy" );
507  case OnlineStatus::Offline:
508  return i18n( "Offline" );
509  case OnlineStatus::Unknown:
510  default:
511  return i18n( "Status not available" );
512  }
513 }
514 
515 OnlineStatus::StatusType MetaContact::status() const
516 {
517  return d->onlineStatus;
518 }
519 
520 bool MetaContact::isOnline() const
521 {
522  QListIterator<Contact *> it( d->contacts );
523  while ( it.hasNext() )
524  {
525  Contact* c = it.next();
526  if( c && c->isOnline() )
527  return true;
528  }
529  return false;
530 }
531 
532 bool MetaContact::isAlwaysVisible() const
533 {
534  QListIterator<Contact *> it( d->contacts );
535  while ( it.hasNext() )
536  {
537  Contact* c = it.next();
538  if ( c && c->property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool() )
539  return true;
540  }
541  return false;
542 }
543 
544 bool MetaContact::isReachable() const
545 {
546  if ( isOnline() )
547  return true;
548 
549  QListIterator<Contact *> it( d->contacts );
550  while ( it.hasNext() )
551  {
552  Contact *c = it.next();
553  if ( c->account()->isConnected() && c->isReachable() )
554  return true;
555  }
556  return false;
557 }
558 
559 //Determine if we are capable of accepting file transfers
560 bool MetaContact::canAcceptFiles() const
561 {
562  if( !isOnline() )
563  return false;
564 
565  QListIterator<Contact *> it( d->contacts );
566  while ( it.hasNext() )
567  {
568  if( it.next()->canAcceptFiles() )
569  return true;
570  }
571  return false;
572 }
573 
574 //Slot for sending files
575 void MetaContact::sendFile( const KUrl &sourceURL, const QString &altFileName, unsigned long fileSize )
576 {
577  //If we can't send any files then exit
578  if( d->contacts.isEmpty() || !canAcceptFiles() )
579  return;
580 
581  //Find the highest ranked protocol that can accept files
582  Contact *contact = d->contacts.first();
583  QListIterator<Contact *> it( d->contacts );
584  while ( it.hasNext() )
585  {
586  Contact *curr = it.next();
587  if( (curr)->onlineStatus() > contact->onlineStatus() && (curr)->canAcceptFiles() )
588  contact = curr;
589  }
590 
591  //Call the sendFile slot of this protocol
592  contact->sendFile( sourceURL, altFileName, fileSize );
593 }
594 
595 void MetaContact::serialize()
596 {
597  clearPluginContactData();
598 
599  QSet<Kopete::Protocol*> protocolSet;
600  foreach ( Kopete::Contact* c, contacts() )
601  {
602  Kopete::Protocol* protocol = c->protocol();
603  if ( !protocolSet.contains( protocol ) )
604  {
605  protocolSet.insert( protocol );
606  protocol->serialize( this );
607  }
608  }
609 }
610 
611 void MetaContact::slotContactStatusChanged( Contact * c, const OnlineStatus &status, const OnlineStatus &/*oldstatus*/ )
612 {
613  updateOnlineStatus();
614  emit contactStatusChanged( c, status );
615 
616  if ( c != c->account()->myself() )
617  onlineStatusNotification( c );
618 }
619 
620 void MetaContact::setDisplayName( const QString &name )
621 {
622  /*kDebug( 14010 ) << "Change displayName from " << d->displayName <<
623  " to " << name << ", d->trackChildNameChanges=" << d->trackChildNameChanges << endl;
624  kDebug(14010) << kBacktrace(6);*/
625 
626  if( name == d->displayName )
627  return;
628 
629  if ( loading() )
630  {
631  d->displayName = name;
632  }
633  else
634  {
635  //check if there is another contact with the same display name.
636  //if this is the case, merge them
637  if(!this->d->temporary && !name.isEmpty())
638  foreach(MetaContact *m, ContactList::self()->metaContacts())
639  {
640  if( !m->d->temporary && m != this && m->customDisplayName() == name)
641  {
642  //merge
643  while(!m->d->contacts.isEmpty())
644  {
645  m->d->contacts.first()->setMetaContact(this);
646  }
647  //the contact will be automatically removed when the last contact is removed
648  //that's why we merge othe other into this one and not the opposite;
649  break;
650  }
651  }
652 
653  const QString old = d->displayName;
654  d->displayName = name;
655 
656  emit displayNameChanged( old , name );
657  QListIterator<Kopete::Contact *> it( d->contacts );
658  while ( it.hasNext() )
659  ( it.next() )->sync(Contact::DisplayNameChanged);
660  }
661 }
662 
663 QString MetaContact::customDisplayName() const
664 {
665  return d->displayName;
666 }
667 
668 QString MetaContact::displayName() const
669 {
670  PropertySource source = displayNameSource();
671  if ( source == SourceKABC )
672  {
673  // kabc source, try to get from addressbook
674  // if the metacontact has a kabc association
675  if ( !kabcId().isEmpty() )
676  return nameFromKABC(kabcId());
677  }
678  else if ( source == SourceContact || d->displayName.isEmpty())
679  {
680  if ( d->displayNameSourceContact==0 )
681  {
682  if( d->contacts.count() >= 1 )
683  {// don't call setDisplayNameSource , or there will probably be an infinite loop
684  d->displayNameSourceContact=d->contacts.first();
685 // kDebug( 14010 ) << " setting displayname source for " << metaContactId();
686  }
687  }
688  if ( displayNameSourceContact() != 0L )
689  {
690  return nameFromContact(displayNameSourceContact());
691  }
692  else
693  {
694 // kDebug( 14010 ) << " source == SourceContact , but there is no displayNameSourceContact for contact " << metaContactId();
695  }
696  }
697  return d->displayName;
698 }
699 
700 QString nameFromKABC( const QString &id ) /*const*/
701 {
702  KABC::AddressBook* ab = KABCPersistence::self()->addressBook();
703  if ( ! id.isEmpty() && !id.contains(':') )
704  {
705  KABC::Addressee theAddressee = ab->findByUid(id);
706  if ( theAddressee.isEmpty() )
707  {
708  kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
709  }
710  else
711  {
712  return theAddressee.formattedName();
713  }
714  }
715  // no kabc association, return null image
716  return QString();
717 }
718 
719 QString nameFromContact( Kopete::Contact *c) /*const*/
720 {
721  if ( !c )
722  return QString();
723 
724  QString contactName = c->displayName();
725  //the remove is there to workaround the Bug 95444
726  return contactName.remove('\n');
727 }
728 
729 KUrl MetaContact::customPhoto() const
730 {
731  return KUrl(d->customPicture.path());
732 }
733 
734 void MetaContact::setPhoto( const KUrl &url )
735 {
736  d->photoUrl = url;
737  d->customPicture.setPicture(url.toLocalFile());
738 
739  if ( photoSource() == SourceCustom )
740  {
741  emit photoChanged();
742  }
743 }
744 
745 QImage MetaContact::photo() const
746 {
747  return picture().image();
748 }
749 
750 Picture &MetaContact::picture() const
751 {
752  if ( photoSource() == SourceKABC )
753  {
754  return d->kabcPicture;
755  }
756  else if ( photoSource() == SourceContact )
757  {
758  return d->contactPicture;
759  }
760 
761  return d->customPicture;
762 }
763 
764 QImage MetaContact::photoFromCustom() const
765 {
766  return d->customPicture.image();
767 }
768 
769 QImage photoFromContact( Kopete::Contact *contact) /*const*/
770 {
771  if ( contact == 0L )
772  return QImage();
773 
774  QVariant photoProp;
775  if ( contact->hasProperty( Kopete::Global::Properties::self()->photo().key() ) )
776  photoProp = contact->property( Kopete::Global::Properties::self()->photo().key() ).value();
777 
778  QImage img;
779  if(photoProp.canConvert( QVariant::Image ))
780  img= photoProp.value<QImage>();
781  else if(photoProp.canConvert( QVariant::Pixmap ))
782  img=photoProp.value<QPixmap>().toImage();
783  else if(!photoProp.toString().isEmpty())
784  {
785  img=QPixmap( photoProp.toString() ).toImage();
786  }
787  return img;
788 }
789 
790 QImage photoFromKABC( const QString &id ) /*const*/
791 {
792  KABC::AddressBook* ab = KABCPersistence::self()->addressBook();
793  if ( ! id.isEmpty() && !id.contains(':') )
794  {
795  KABC::Addressee theAddressee = ab->findByUid(id);
796  if ( theAddressee.isEmpty() )
797  {
798  kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
799  }
800  else
801  {
802  KABC::Picture pic = theAddressee.photo();
803  if ( pic.data().isNull() && pic.url().isEmpty() )
804  pic = theAddressee.logo();
805 
806  if ( pic.isIntern())
807  {
808  return pic.data();
809  }
810  else
811  {
812  return QPixmap( pic.url() ).toImage();
813  }
814  }
815  }
816  // no kabc association, return null image
817  return QImage();
818 }
819 
820 Contact *MetaContact::displayNameSourceContact() const
821 {
822  return d->displayNameSourceContact;
823 }
824 
825 Contact *MetaContact::photoSourceContact() const
826 {
827  return d->photoSourceContact;
828 }
829 
830 void MetaContact::setDisplayNameSourceContact( Contact *contact )
831 {
832  Contact *old = d->displayNameSourceContact;
833  d->displayNameSourceContact = contact;
834  if ( contact && displayNameSource() == SourceContact ) {
835  emit displayNameChanged( nameFromContact(old), nameFromContact(contact));
836  QListIterator<Kopete::Contact *> it( d->contacts );
837  while ( it.hasNext() )
838  ( it.next() )->sync(Contact::DisplayNameChanged);
839  }
840 }
841 
842 void MetaContact::setPhotoSourceContact( Contact *contact )
843 {
844  d->photoSourceContact = contact;
845 
846  // Create a cache for the contact photo.
847  if(d->photoSourceContact != 0L)
848  {
849  QVariant photoProp;
850  if ( contact->hasProperty( Kopete::Global::Properties::self()->photo().key() ) )
851  {
852  photoProp = contact->property( Kopete::Global::Properties::self()->photo().key() ).value();
853 
854  if(photoProp.canConvert( QVariant::Image ))
855  {
856  d->contactPicture.setPicture( photoProp.value<QImage>() );
857  }
858  else if(photoProp.canConvert( QVariant::Pixmap ))
859  {
860  d->contactPicture.setPicture( photoProp.value<QPixmap>().toImage() );
861  }
862  else if(!photoProp.toString().isEmpty())
863  {
864  d->contactPicture.setPicture(photoProp.toString());
865  }
866  else
867  {
868  d->contactPicture.clear();
869  }
870  }
871  else
872  {
873  d->contactPicture.clear();
874  }
875  }
876  else
877  {
878  d->contactPicture.clear();
879  }
880 
881  if ( photoSource() == SourceContact )
882  {
883  emit photoChanged();
884  }
885 }
886 
887 void MetaContact::slotContactDisplayNameChanged(const QString &oldName, const QString &newName)
888 {
889  Contact *subcontact = static_cast<Contact *>(sender());
890  if ( displayNameSource() == SourceContact ||
891  (d->displayName.isEmpty() && displayNameSource() == SourceCustom) )
892  {
893  if (displayNameSourceContact() == subcontact)
894  {
895  emit displayNameChanged(oldName, newName);
896  QListIterator<Kopete::Contact *> it( d->contacts );
897  while ( it.hasNext() )
898  ( it.next() )->sync(Contact::DisplayNameChanged);
899  }
900  else
901  {
902  // HACK the displayName that changed is not from the contact we are tracking, but
903  // as the current one is null, lets use this new one
904  if (displayName().isEmpty())
905  setDisplayNameSourceContact(subcontact);
906  }
907  }
908 }
909 
910 void MetaContact::slotPropertyChanged( PropertyContainer* _subcontact, const QString &key,
911  const QVariant &oldValue, const QVariant &newValue )
912 {
913  Contact *subcontact=static_cast<Contact*>(_subcontact);
914 
915  if (photoSource() == SourceContact)
916  {
917  if ( key == Global::Properties::self()->photo().key() )
918  {
919  if (photoSourceContact() != subcontact)
920  {
921  // HACK the displayName that changed is not from the contact we are tracking, but
922  // as the current one is null, lets use this new one
923  if (picture().isNull())
924  setPhotoSourceContact(subcontact);
925 
926  }
927  else if(photoSourceContact() == subcontact)
928  {
929  if(d->photoSyncedWithKABC)
930  setPhotoSyncedWithKABC(true);
931 
932  setPhotoSourceContact(subcontact);
933  }
934  }
935  }
936 
937  if ( (key == Kopete::Global::Properties::self()->statusMessage().key() ||
938  key == Kopete::Global::Properties::self()->statusTitle().key()) && oldValue != newValue )
939  {
940  QString statusText;
941 
942  bool allOffline = !this->isOnline();
943  if ( newValue.toString().isEmpty() || ( !subcontact->isOnline() && !allOffline ) )
944  {
945  // try to find a more suitable away message to be displayed when:
946  // -new away message is empty or
947  // -contact who set it is offline and there are contacts online in the metacontact
948  foreach ( Kopete::Contact *c, d->contacts )
949  {
950  QString curStatusText( c->property( key ).value().toString() );
951  if ( ( allOffline || c->isOnline() ) && !curStatusText.isEmpty() )
952  {
953  // display this contact's away message when:
954  // -this contact's away message is not empty and
955  // -this contact is online or there are no contacts online at all
956  statusText = curStatusText;
957  break;
958  }
959  }
960  }
961  else
962  {
963  // just use new away message when:
964  // -new away message is not empty and
965  // -contact who set it is online or there are no contacts online at all
966  statusText = newValue.toString();
967  }
968 
969  if ( key == Kopete::Global::Properties::self()->statusMessage().key() )
970  d->statusMessage.setMessage( statusText );
971  else
972  d->statusMessage.setTitle( statusText );
973 
974  emit statusMessageChanged( this );
975  }
976 
977  // Here we abuse the onlineStatusChanged signal to force the contact list to refresh and hide the
978  // contact if he is offline and his isAlwaysVisible property changed to false
979  if ( key == Kopete::Global::Properties::self()->isAlwaysVisible().key() && oldValue != newValue )
980  emit onlineStatusChanged( this, d->onlineStatus );
981 }
982 
983 void MetaContact::moveToGroup( Group *from, Group *to )
984 {
985  if ( !from || !groups().contains( from ) )
986  {
987  // We're adding, not moving, because 'from' is illegal
988  addToGroup( to );
989  return;
990  }
991 
992  // Do nothing (same group)
993  if ( from == to )
994  return;
995 
996  if ( !to || groups().contains( to ) )
997  {
998  // We're removing, not moving, because 'to' is illegal
999  removeFromGroup( from );
1000  return;
1001  }
1002 
1003  if ( to->type() == Group::Offline )
1004  return;
1005 
1006  if ( isTemporary() && to->type() != Group::Temporary )
1007  return;
1008 
1009 
1010  //kDebug( 14010 ) << from->displayName() << " => " << to->displayName();
1011 
1012  d->groups.removeAll( from );
1013  d->groups.append( to );
1014 
1015  QListIterator<Contact *> it(d->contacts);
1016  while( it.hasNext() )
1017  it.next()->sync(Contact::MovedBetweenGroup);
1018 
1019  emit movedToGroup( this, from, to );
1020 }
1021 
1022 void MetaContact::removeFromGroup( Group *group )
1023 {
1024  if ( !group || !groups().contains( group ) || ( isTemporary() && group->type() == Group::Temporary ) )
1025  {
1026  return;
1027  }
1028 
1029  d->groups.removeAll( group );
1030 
1031  // make sure MetaContact is at least in one group
1032  if ( d->groups.isEmpty() )
1033  {
1034  d->groups.append( Group::topLevel() );
1035  emit addedToGroup( this, Group::topLevel() );
1036  }
1037 
1038  QListIterator<Contact *> it(d->contacts);
1039  while( it.hasNext() )
1040  it.next()->sync(Contact::MovedBetweenGroup);
1041 
1042  emit removedFromGroup( this, group );
1043 }
1044 
1045 void MetaContact::addToGroup( Group *to )
1046 {
1047  if ( !to || groups().contains( to ) )
1048  return;
1049 
1050  if ( d->temporary && to->type() != Group::Temporary )
1051  return;
1052 
1053  // FIXME: This breaks copying MC with drag&drop from topLevel group
1054  if ( d->groups.contains( Group::topLevel() ) )
1055  {
1056  d->groups.removeAll( Group::topLevel() );
1057  emit removedFromGroup( this, Group::topLevel() );
1058  }
1059 
1060  d->groups.append( to );
1061 
1062  QListIterator<Contact *> it(d->contacts);
1063  while( it.hasNext() )
1064  it.next()->sync(Contact::MovedBetweenGroup);
1065 
1066  emit addedToGroup( this, to );
1067 }
1068 
1069 QList<Group *> MetaContact::groups() const
1070 {
1071  return d->groups;
1072 }
1073 
1074 void MetaContact::slotContactDestroyed( Contact *contact )
1075 {
1076  removeContact(contact,true);
1077 }
1078 
1079 QString MetaContact::addressBookField( Kopete::Plugin * /* p */, const QString &app, const QString & key ) const
1080 {
1081  return d->addressBook[ app ][ key ];
1082 }
1083 
1084 void Kopete::MetaContact::setAddressBookField( Kopete::Plugin * /* p */, const QString &app, const QString &key, const QString &value )
1085 {
1086  d->addressBook[ app ][ key ] = value;
1087 }
1088 
1089 Kopete::StatusMessage MetaContact::statusMessage() const
1090 {
1091  return d->statusMessage;
1092 }
1093 
1094 void MetaContact::slotPluginLoaded( Plugin *p )
1095 {
1096  if( !p )
1097  return;
1098 
1099  QMap<QString, QString> map= pluginData( p );
1100  if(!map.isEmpty())
1101  {
1102  p->deserialize(this,map);
1103  }
1104 }
1105 
1106 void MetaContact::slotProtocolLoaded( Protocol *p )
1107 {
1108  if( !p )
1109  return;
1110 
1111  ContactDataList dataList = pluginContactData( p );
1112  if ( !dataList.isEmpty() )
1113  p->deserializeContactList( this, dataList );
1114 }
1115 
1116 void MetaContact::slotAllPluginsLoaded()
1117 {
1118  // Now that the plugins and subcontacts are loaded, set the source contact.
1119  setDisplayNameSourceContact( findContact( d->nameSourcePID, d->nameSourceAID, d->nameSourceCID) );
1120  setPhotoSourceContact( findContact( d->photoSourcePID, d->photoSourceAID, d->photoSourceCID) );
1121 }
1122 
1123 void MetaContact::slotUpdateAddressBookPicture()
1124 {
1125  KABC::AddressBook* ab = KABCPersistence::self()->addressBook();
1126  QString id = kabcId();
1127  if ( !id.isEmpty() && !id.contains(':') )
1128  {
1129  KABC::Addressee theAddressee = ab->findByUid(id);
1130  if ( theAddressee.isEmpty() )
1131  {
1132  kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
1133  }
1134  else
1135  {
1136  KABC::Picture pic = theAddressee.photo();
1137  if ( pic.data().isNull() && pic.url().isEmpty() )
1138  pic = theAddressee.logo();
1139 
1140  d->kabcPicture.setPicture(pic);
1141  }
1142  }
1143 }
1144 
1145 bool MetaContact::isTemporary() const
1146 {
1147  return d->temporary;
1148 }
1149 
1150 void MetaContact::setTemporary( bool isTemporary, Group *group )
1151 {
1152  d->temporary = isTemporary;
1153  Group *temporaryGroup = Group::temporary();
1154  if ( d->temporary )
1155  {
1156  addToGroup (temporaryGroup);
1157  QListIterator<Group *> it(d->groups);
1158  while ( it.hasNext() )
1159  {
1160  Group *g = it.next();
1161  if(g != temporaryGroup)
1162  removeFromGroup(g);
1163  }
1164  }
1165  else
1166  moveToGroup(temporaryGroup, group ? group : Group::topLevel());
1167 }
1168 
1169 QString MetaContact::kabcId() const
1170 {
1171  if(d->kabcId.isEmpty())
1172  {
1173  if(d->contacts.isEmpty())
1174  return QString();
1175  Contact *c=d->contacts.first();
1176  if(!c)
1177  return QString();
1178  return c->protocol()->pluginId()+QString::fromUtf8(":")+c->account()->accountId()+QString::fromUtf8(":") + c->contactId() ;
1179  }
1180  return d->kabcId;
1181 }
1182 
1183 void MetaContact::setKabcId( const QString& newKabcId )
1184 {
1185  if(newKabcId == d->kabcId)
1186  return;
1187 
1188  // 1) Check the Id is not already used by another contact
1189  // 2) cause a kabc write ( only in response to metacontactLVIProps calling this, or will
1190  // write be called twice when creating a brand new MC? )
1191  // 3) What about changing from one valid kabc to another, are kabc fields removed?
1192  // 4) May be called with Null to remove an invalid kabc uid by KMC::toKABC()
1193  // 5) Is called when reading the saved contact list
1194 
1195  // Don't remove IM addresses from kabc if we are changing contacts;
1196  // other programs may have written that data and depend on it
1197  d->kabcId = newKabcId;
1198  if ( loading() )
1199  {
1200  // TODO: speed up: this slot is called in *every* metacontact instance and is slow because it finding kabc id
1201  slotUpdateAddressBookPicture();
1202  }
1203  else
1204  {
1205  KABCPersistence::self()->write( this );
1206  emit onlineStatusChanged( this, d->onlineStatus );
1207  emit persistentDataChanged();
1208  }
1209 }
1210 
1211 bool MetaContact::isPhotoSyncedWithKABC() const
1212 {
1213  return d->photoSyncedWithKABC;
1214 }
1215 
1216 void MetaContact::setPhotoSyncedWithKABC(bool b)
1217 {
1218  d->photoSyncedWithKABC=b;
1219  if( b && !loading() )
1220  {
1221  QVariant newValue;
1222 
1223  switch( photoSource() )
1224  {
1225  case SourceContact:
1226  {
1227  Contact *source = photoSourceContact();
1228  if(source != 0L)
1229  newValue = source->property( Kopete::Global::Properties::self()->photo() ).value();
1230  break;
1231  }
1232  case SourceCustom:
1233  {
1234  if( !d->customPicture.isNull() )
1235  newValue = d->customPicture.path();
1236  break;
1237  }
1238  // Don't sync the photo with KABC if the source is KABC !
1239  default:
1240  return;
1241  }
1242 
1243  if ( !d->kabcId.isEmpty() && !newValue.isNull())
1244  {
1245  KABC::Addressee theAddressee = KABCPersistence::self()->addressBook()->findByUid( kabcId() );
1246 
1247  if ( !theAddressee.isEmpty() )
1248  {
1249  QImage img;
1250  if(newValue.canConvert( QVariant::Image ))
1251  img=newValue.value<QImage>();
1252  else if(newValue.canConvert( QVariant::Pixmap ))
1253  img=newValue.value<QPixmap>().toImage();
1254 
1255  if(img.isNull())
1256  {
1257  // Some protocols like MSN save the photo as a url in
1258  // contact properties, we should not use this url
1259  // to sync with kabc but try first to embed the
1260  // photo data in the kabc addressee, because it could
1261  // be remote resource and the local url makes no sense
1262  QImage fallBackImage = QImage(newValue.toString());
1263  if(fallBackImage.isNull())
1264  theAddressee.setPhoto(newValue.toString());
1265  else
1266  theAddressee.setPhoto(fallBackImage);
1267  }
1268  else
1269  theAddressee.setPhoto(img);
1270 
1271  KABCPersistence::self()->addressBook()->insertAddressee(theAddressee);
1272  KABCPersistence::self()->writeAddressBook( theAddressee.resource() );
1273  }
1274 
1275  }
1276  }
1277 }
1278 
1279 QList<Contact *> MetaContact::contacts() const
1280 {
1281  return d->contacts;
1282 }
1283 
1284 void MetaContact::onlineStatusNotification( Kopete::Contact * c )
1285 {
1286  // comparing the status of the previous and new preferred contact is the determining factor in deciding to notify
1287  Kopete::OnlineStatus newNotifyOnlineStatus;
1288 
1289  Kopete::Contact * pc = preferredContact();
1290  if ( pc )
1291  newNotifyOnlineStatus = pc->onlineStatus();
1292  else // the last child contact has gone offline or otherwise unreachable, so take the changed contact's online status
1293  newNotifyOnlineStatus = c->onlineStatus();
1294 
1295  // ensure we are not suppressing notifications, because connecting or disconnected
1296  if ( !c->account()->suppressStatusNotification() && c->account()->isConnected()
1297  && c->account()->myself()->onlineStatus().status() != OnlineStatus::Connecting
1298  && c->account()->myself()->onlineStatus().status() != OnlineStatus::Busy
1299  && (Kopete::BehaviorSettings::self()->enableEventsWhileAway() || !c->account()->isAway()) )
1300  {
1301  // figure out what's happened
1302  enum ChangeType { noChange, noEvent, signedIn, changedStatus, signedOut };
1303  ChangeType t = noChange;
1304 
1305  // first, exclude changes due to blocking or subscription changes at the protocol level
1306  if ( d->notifyOnlineStatus.status() == Kopete::OnlineStatus::Unknown || newNotifyOnlineStatus.status() == Kopete::OnlineStatus::Unknown )
1307  {
1308  t = noEvent; // This means the contact's changed from or to unknown - due to a protocol state change, not a contact state change
1309  }
1310  else
1311  { // we're dealing with a genuine contact state change
1312  if ( d->notifyOnlineStatus.status() == Kopete::OnlineStatus::Offline )
1313  {
1314  if ( newNotifyOnlineStatus.status() != Kopete::OnlineStatus::Offline )
1315  {
1316  t = signedIn; // contact has gone from offline to something else, it's a sign-in
1317  }
1318  }
1319  else if ( d->notifyOnlineStatus.isDefinitelyOnline()) //Is that correct?
1320  {
1321  if ( newNotifyOnlineStatus.status() == Kopete::OnlineStatus::Offline )
1322  {
1323  t = signedOut; // contact has gone from an online state to an offline state, it's a sign out
1324  }
1325  else if ( d->notifyOnlineStatus > newNotifyOnlineStatus || d->notifyOnlineStatus < newNotifyOnlineStatus ) // operator!= is useless because it's an identity operator, not an equivalence operator
1326  {
1327  // contact has changed online states, it's a status change,
1328  // and the preferredContact changed status, or there is a new preferredContacat
1329  // so it's worth notifying
1330  t = changedStatus;
1331  }
1332  }
1333  else if ( d->notifyOnlineStatus != newNotifyOnlineStatus )
1334  {
1335  // catch-all for any other status change we don't know about
1336  t = noEvent;
1337  }
1338  }
1339 
1340  // now issue the appropriate notification
1341  KNotification *notify = 0;
1342  switch ( t )
1343  {
1344  case noEvent:
1345  case noChange:
1346  break;
1347  case signedIn:
1348  notify = new KNotification( QString("kopete_contact_online"), Kopete::UI::Global::mainWidget() );
1349  notify->setActions( QStringList( i18nc("@action", "Chat") ) );
1350  break;
1351  case changedStatus:
1352  notify = new KNotification( QString("kopete_contact_status_change"), Kopete::UI::Global::mainWidget() );
1353  notify->setActions( QStringList( i18nc("@action", "Chat") ) );
1354  break;
1355  case signedOut:
1356  notify = new KNotification( QString("kopete_contact_offline"), Kopete::UI::Global::mainWidget() );
1357  break;
1358  }
1359 
1360  if( notify )
1361  {
1362  QString text = i18n( "<qt><i>%1</i> is now %2.</qt>",
1363  Kopete::Emoticons::parseEmoticons( Qt::escape( displayName() ) ),
1364  Qt::escape( c->onlineStatus().description() ) );
1365 
1366  notify->setText( text );
1367  notify->setPixmap( QPixmap::fromImage( picture().image() ) );
1368  connect( notify, SIGNAL(activated(uint)) , this, SLOT(execute()) );
1369 
1370  notify->addContext( qMakePair( QString::fromLatin1("contact"), metaContactId().toString() ) );
1371  foreach( Kopete::Group *g , groups() )
1372  {
1373  notify->addContext( qMakePair( QString::fromLatin1("group") , QString::number( g->groupId() ) ) );
1374  }
1375  notify->sendEvent();
1376  }
1377  }
1378  d->notifyOnlineStatus = newNotifyOnlineStatus;
1379 }
1380 
1381 
1382 } //END namespace Kopete
1383 
1384 #include "kopetemetacontact.moc"
1385 
1386 // vim: set noet ts=4 sts=4 sw=4:
Kopete::Contact::isReachable
virtual bool isReachable()
Get whether this contact can receive messages.
Definition: kopetecontact.cpp:464
QVariant::canConvert
bool canConvert(Type t) const
Kopete::MetaContact::setPhotoSourceContact
void setPhotoSourceContact(Contact *contact)
set the subcontact to use for SourceContact source
Definition: kopetemetacontact.cpp:842
Kopete::ContactListElement::pluginContactData
QMap< QString, ContactDataList > pluginContactData() const
Get the settings as stored previously by calls to setPluginContactData() Note that plugins shouldn't ...
Definition: kopetecontactlistelement.cpp:112
kopetemetacontact.h
Kopete::ContactList::self
static ContactList * self()
The contact list is a singleton object.
Definition: kopetecontactlist.cpp:71
Kopete::OnlineStatus
Definition: kopeteonlinestatus.h:68
status
OnlineStatus::StatusType status
Definition: kopeteonlinestatus.cpp:103
Kopete::MetaContact::Private::contactPicture
Picture contactPicture
Definition: kopetemetacontact_p.h:71
Kopete::ContactList
manage contacts and metacontact
Definition: kopetecontactlist.h:49
Kopete::MetaContact::Private::nameSourceCID
QString nameSourceCID
Definition: kopetemetacontact_p.h:67
Kopete::Account::myself
Contact * myself() const
Retrieve the 'myself' contact.
Definition: kopeteaccount.cpp:537
Kopete::Picture
Represent a picture in Kopete context.
Definition: kopetepicture.h:61
Kopete::MetaContact::addToGroup
void addToGroup(Kopete::Group *to)
Add a contact to another group.
Definition: kopetemetacontact.cpp:1045
Kopete::MetaContact::movedToGroup
void movedToGroup(Kopete::MetaContact *contact, Kopete::Group *from, Kopete::Group *to)
The contact was moved.
Kopete::MetaContact::sendFile
void sendFile(const KUrl &sourceURL, const QString &altFileName=QString(), unsigned long fileSize=0L)
Send a file to this metacontact.
Definition: kopetemetacontact.cpp:575
Kopete::Account::priority
uint priority
Definition: kopeteaccount.h:84
Kopete::MetaContact::statusIcon
QString statusIcon() const
The name of the icon associated with the contact's status.
kopetemetacontact_p.h
Kopete::MetaContact::setTemporary
void setTemporary(bool b=true, Kopete::Group *group=0L)
Set if this is a temporary contact.
Definition: kopetemetacontact.cpp:1150
Kopete::PropertyContainer::propertyChanged
void propertyChanged(Kopete::PropertyContainer *container, const QString &key, const QVariant &oldValue, const QVariant &newValue)
Kopete::MetaContact::setDisplayName
void setDisplayName(const QString &name)
Set the custom displayName.
Definition: kopetemetacontact.cpp:620
Kopete::MetaContact::Private::temporary
bool temporary
Definition: kopetemetacontact_p.h:60
Kopete::Emoticons::parseEmoticons
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse, const QStringList &exclude=QStringList())
Definition: kopeteemoticons.cpp:36
Kopete::MetaContact::kabcId
QString kabcId() const
Get the KABC id for this metacontact.
Definition: kopetemetacontact.cpp:1169
QListIterator::next
const T & next()
Kopete::Global::Properties::self
static Properties * self()
Singleton accessor for this class.
Definition: kopeteglobal.cpp:49
Kopete::nameFromContact
QString nameFromContact(Kopete::Contact *c)
Definition: kopetemetacontact.cpp:719
Kopete::Contact::execute
void execute()
The user clicked on the contact, do the default action.
Definition: kopetecontact.cpp:486
Kopete::ContactListElement::loading
bool loading() const
Check if we are in loading stage.
Definition: kopetecontactlistelement.cpp:61
kopeteaccount.h
Kopete::OnlineStatus::description
QString description() const
Return the description.
Definition: kopeteonlinestatus.cpp:262
Kopete::MetaContact::contactRemoved
void contactRemoved(Kopete::Contact *c)
a contact has been removed from this metacontact
Kopete::Contact::contactId
QString contactId
Definition: kopetecontact.h:70
Kopete::MetaContact::photo
KDE_DEPRECATED QImage photo() const
the photo showed in the contact list window
Definition: kopetemetacontact.cpp:745
QObject::sender
QObject * sender() const
Kopete::StatusMessage
This class encapsulate a status message.
Definition: kopetestatusmessage.h:48
Kopete::MetaContact::statusString
QString statusString() const
The status string of the contact.
Kopete::MetaContact::setDisplayNameSourceContact
void setDisplayNameSourceContact(Contact *contact)
set the subcontact whose name is to be tracked (set to null to disable tracking)
Definition: kopetemetacontact.cpp:830
Kopete::MetaContact::removeFromGroup
void removeFromGroup(Kopete::Group *from)
Remove a contact from one group.
Definition: kopetemetacontact.cpp:1022
Kopete::MetaContact::findContact
Contact * findContact(const QString &protocolId, const QString &accountId, const QString &contactId)
Find the Contact to a given contact.
Definition: kopetemetacontact.cpp:256
Kopete::MetaContact::Private::photoSourceAID
QString photoSourceAID
Definition: kopetemetacontact_p.h:68
Kopete::MetaContact::photoChanged
void photoChanged()
The meta contact's photo changed.
Kopete::MetaContact::contactAdded
void contactAdded(Kopete::Contact *c)
a contact has been added into this metacontact
Kopete::KABCPersistence::write
void write(MetaContact *mc)
Change the KABC data associated with this metacontact.
Definition: kabcpersistence.cpp:102
Kopete::Protocol
base class of every protocol.
Definition: kopeteprotocol.h:62
Kopete::MetaContact::Private::nameSourceAID
QString nameSourceAID
Definition: kopetemetacontact_p.h:67
kabcpersistence.h
Kopete::MetaContact::Private::kabcPicture
Picture kabcPicture
Definition: kopetemetacontact_p.h:71
Kopete::Account::isConnected
bool isConnected
Definition: kopeteaccount.h:81
QMap
Kopete::OnlineStatus::Unknown
Refers to protocols where state cannot be determined.
Definition: kopeteonlinestatus.h:90
Kopete::PropertyContainer::property
const Kopete::Property & property(const QString &key) const
Get the value of a property with key "key".
Definition: kopetepropertycontainer.cpp:111
Kopete::OnlineStatus::Offline
State where you really cannot be contacted.
Definition: kopeteonlinestatus.h:98
Kopete::MetaContact::slotAllPluginsLoaded
void slotAllPluginsLoaded()
When all the plugins are loaded, set the Contact Source.
Definition: kopetemetacontact.cpp:1116
QUuid
QVariant::value
T value() const
Kopete::Contact::MovedBetweenGroup
the contact has been moved between groups
Definition: kopetecontact.h:80
kopetegroup.h
Kopete::Contact::isOnline
bool isOnline
Definition: kopetecontact.h:66
Kopete::Contact::account
Account * account() const
Get the account that this contact belongs to.
Definition: kopetecontact.cpp:538
QPixmap::fromImage
QPixmap fromImage(const QImage &image, QFlags< Qt::ImageConversionFlag > flags)
Kopete::OnlineStatus::weight
unsigned weight() const
Return the weight.
Definition: kopeteonlinestatus.cpp:252
Kopete::ContactList::metaContacts
QList< MetaContact * > metaContacts() const
return a list of all metacontact of the contact list Retrieve the list of all available meta contacts...
Definition: kopetecontactlist.cpp:112
Kopete::MetaContact::customPhoto
KUrl customPhoto() const
Returns the custom display photo.
Definition: kopetemetacontact.cpp:729
QImage::isNull
bool isNull() const
Kopete::MetaContact::removeContact
void removeContact(Contact *c, bool deleted=false)
remove the contact from this metacontact
Definition: kopetemetacontact.cpp:165
QSet::insert
const_iterator insert(const T &value)
QString::remove
QString & remove(int position, int n)
Kopete::OnlineStatus::status
StatusType status() const
Return the status.
Definition: kopeteonlinestatus.cpp:242
Kopete::OnlineStatus::isDefinitelyOnline
bool isDefinitelyOnline() const
Definition: kopeteonlinestatus.cpp:287
Kopete::MetaContact::Private::kabcId
QString kabcId
Definition: kopetemetacontact_p.h:52
QObject::disconnect
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Kopete::MetaContact::PropertySource
PropertySource
Enumeration of possible sources for a property (which may be photos, see setPhotoSource() for instanc...
Definition: kopetemetacontact.h:75
Kopete::MetaContact::Private::photoSource
PropertySource photoSource
Definition: kopetemetacontact_p.h:44
Kopete::MetaContact::photoSourceContact
Contact * photoSourceContact() const
get the subcontact being tracked for its photo
Definition: kopetemetacontact.cpp:825
Kopete::MetaContact::addressBookField
QString addressBookField(Plugin *p, const QString &app, const QString &key) const
Get or set a field for the KDE address book backend.
Definition: kopetemetacontact.cpp:1079
Kopete::ContactListElement::useCustomIconChanged
void useCustomIconChanged(bool useCustomIcon)
The useCustomIcon property has changed.
kopeteuiglobal.h
Kopete::MetaContact::onlineStatusNotification
void onlineStatusNotification(Kopete::Contact *c)
Definition: kopetemetacontact.cpp:1284
QString::isNull
bool isNull() const
Kopete::MetaContact::SourceCustom
Data comes from somewhere else.
Definition: kopetemetacontact.h:78
Kopete::Picture::image
QImage image()
Return the current picture as QImage.
Definition: kopetepicture.cpp:78
Kopete::MetaContact::customDisplayName
QString customDisplayName() const
Returns the custom display name.
Definition: kopetemetacontact.cpp:663
Kopete::MetaContact::setPhotoSyncedWithKABC
void setPhotoSyncedWithKABC(bool b)
Set if the photo should be synced with the adressbook when the photosource change his photo...
Definition: kopetemetacontact.cpp:1216
Kopete::MetaContact::MetaContact
MetaContact()
constructor
Definition: kopetemetacontact.cpp:50
QObject::name
const char * name() const
Kopete::MetaContact::sendMessage
Contact * sendMessage()
Send a single message, classic ICQ style.
Definition: kopetemetacontact.cpp:330
Kopete::MetaContact::~MetaContact
~MetaContact()
destructor
Definition: kopetemetacontact.cpp:76
Kopete::ContactListElement::Offline
Definition: kopetecontactlistelement.h:158
Kopete::BehaviorSettings::enableEventsWhileAway
static bool enableEventsWhileAway()
Get Enable events while away.
Definition: kopetebehaviorsettings.h:504
Kopete::Contact::onlineStatus
OnlineStatus onlineStatus() const
Get the online status of the contact.
Definition: kopetecontact.cpp:173
Kopete::MetaContact::SourceContact
Data comes from the contact itself.
Definition: kopetemetacontact.h:76
Kopete::MetaContact::setDisplayNameSource
void setDisplayNameSource(PropertySource source)
Set the source of metacontact displayName.
Definition: kopetemetacontact.cpp:282
Kopete::photoFromKABC
QImage photoFromKABC(const QString &id)
Definition: kopetemetacontact.cpp:790
Kopete::Global::Properties::isAlwaysVisible
const PropertyTmpl & isAlwaysVisible() const
Definition: kopeteglobal.cpp:218
Kopete::MetaContact::contactIdleStateChanged
void contactIdleStateChanged(Kopete::Contact *contact)
One of the subcontacts' idle status has changed.
QString::number
QString number(int n, int base)
Kopete::MetaContact::displayNameSource
PropertySource displayNameSource() const
get the source of metacontact display name
Definition: kopetemetacontact.cpp:302
QList::count
int count(const T &value) const
Kopete::Contact::protocol
Protocol * protocol() const
Get the protocol that the contact belongs to.
Definition: kopetecontact.cpp:533
QList::append
void append(const T &value)
Kopete::MetaContact::addedToGroup
void addedToGroup(Kopete::MetaContact *contact, Kopete::Group *to)
The contact was added to another group.
Kopete::MetaContact::moveToGroup
void moveToGroup(Kopete::Group *from, Kopete::Group *to)
Move a contact from one group to another.
Definition: kopetemetacontact.cpp:983
Kopete::MetaContact::canAcceptFiles
bool canAcceptFiles() const
Returns whether this contact can accept files.
QString::fromUtf8
QString fromUtf8(const char *str, int size)
Kopete::MetaContact::Private::customPicture
Picture customPicture
Definition: kopetemetacontact_p.h:71
Kopete::StatusMessage::setTitle
void setTitle(const QString &title)
Set a new status title.
Definition: kopetestatusmessage.cpp:104
Kopete::Picture::clear
void clear()
Reset the picture.
Definition: kopetepicture.cpp:146
QVariant::isNull
bool isNull() const
Kopete::ContactListElement
Definition: kopetecontactlistelement.h:46
Kopete::MetaContact::picture
Picture & picture() const
Return the correct Kopete::Picture object depending of the metacontact photo source.
Definition: kopetemetacontact.cpp:750
kopeteemoticons.h
Kopete::Group::groupId
uint groupId
Definition: kopetegroup.h:47
Kopete::OnlineStatus::Busy
Means that you have other things to do and don't want to get involved in messaging ('Busy' or 'Do not...
Definition: kopeteonlinestatus.h:123
Kopete::MetaContact::status
OnlineStatus::StatusType status() const
Return a more fine-grained status.
Definition: kopetemetacontact.cpp:515
Kopete::MetaContact::Private::photoSourcePID
QString photoSourcePID
Definition: kopetemetacontact_p.h:68
Kopete::Account::accountId
QString accountId
Definition: kopeteaccount.h:77
Kopete::Plugin::pluginId
QString pluginId() const
Get the plugin id.
Definition: kopeteplugin.cpp:46
Kopete::MetaContact::SourceKABC
Data comes from KABC (addressbook).
Definition: kopetemetacontact.h:77
kopeteprotocol.h
Kopete::Contact::sendFile
virtual void sendFile(const KUrl &sourceURL=KUrl(), const QString &fileName=QString(), uint fileSize=0L)
This is the Contact level slot for sending files.
Definition: kopetecontact.cpp:260
QList::isEmpty
bool isEmpty() const
Kopete::Contact::manager
virtual ChatSession * manager(CanCreateFlags canCreate=CannotCreate)=0
Returns the primary message manager affiliated with this contact Although a contact can have more tha...
QString::isEmpty
bool isEmpty() const
QList::removeAll
int removeAll(const T &value)
Kopete::MetaContact::Private::photoSourceCID
QString photoSourceCID
Definition: kopetemetacontact_p.h:68
Kopete::photoFromContact
QImage photoFromContact(Kopete::Contact *contact)
Definition: kopetemetacontact.cpp:769
kopetecontactlist.h
Kopete::Contact::DisplayNameChanged
the displayname of the contact changed
Definition: kopetecontact.h:81
Kopete::MetaContact::contacts
QList< Contact * > contacts() const
Retrieve the list of contacts that are part of the meta contact.
Definition: kopetemetacontact.cpp:1279
Kopete::PropertyContainer::hasProperty
bool hasProperty(const QString &key) const
Check for existence of a certain property stored using "key".
Definition: kopetepropertycontainer.cpp:106
Kopete::MetaContact::Private::metaContactId
QUuid metaContactId
Definition: kopetemetacontact_p.h:42
Kopete::ContactListElement::clearPluginContactData
void clearPluginContactData()
Clear all plugin specific data.
Definition: kopetecontactlistelement.cpp:125
QSet
QList::first
T & first()
Kopete::Group::Offline
Definition: kopetegroup.h:56
Kopete::Account::isAway
bool isAway
Definition: kopeteaccount.h:82
QString
Kopete::ContactListElement::icon
QString icon(IconState state=None) const
return the icon for this object, in the given state.
Definition: kopetecontactlistelement.cpp:162
QList< Group * >
Kopete::Contact::startChat
void startChat()
This should typically pop up a KopeteChatWindow.
Definition: kopetecontact.cpp:472
Kopete::MetaContact::Private::displayNameSource
PropertySource displayNameSource
Definition: kopetemetacontact_p.h:45
Kopete::MetaContact::Private::displayNameSourceContact
Contact * displayNameSourceContact
Definition: kopetemetacontact_p.h:48
Kopete::Contact
Definition: kopetecontact.h:58
Kopete::MetaContact::Private::photoSyncedWithKABC
bool photoSyncedWithKABC
Definition: kopetemetacontact_p.h:63
QStringList
Kopete::Picture::path
QString path()
Return the local path of the current picture.
Definition: kopetepicture.cpp:108
QPixmap
Kopete::OnlineStatus::Online
Refers to a true online state, i.e.
Definition: kopeteonlinestatus.h:129
Kopete::Plugin
Base class for all plugins or protocols.
Definition: kopeteplugin.h:84
QObject::setParent
void setParent(QObject *parent)
Kopete::ContactListElement::iconChanged
void iconChanged(Kopete::ContactListElement::IconState, const QString &)
The icon to use for some state has changed.
QList::contains
bool contains(const T &value) const
QImage
Kopete::MetaContact::Private::notifyOnlineStatus
OnlineStatus notifyOnlineStatus
Definition: kopetemetacontact_p.h:64
Kopete::MetaContact::removedFromGroup
void removedFromGroup(Kopete::MetaContact *contact, Kopete::Group *group)
The contact was removed from group.
QSet::contains
bool contains(const T &value) const
Kopete::MetaContact::Private
Definition: kopetemetacontact_p.h:30
Kopete::UI::Global::mainWidget
KOPETE_EXPORT QWidget * mainWidget()
Returns the main widget - this is the widget that message boxes and KNotify stuff should use as a par...
Definition: kopeteuiglobal.cpp:37
Kopete::MetaContact::photoSource
PropertySource photoSource() const
get the source of metacontact photo
Definition: kopetemetacontact.cpp:324
Kopete::MetaContact::Private::nameSourcePID
QString nameSourcePID
Definition: kopetemetacontact_p.h:67
Kopete::Plugin::deserialize
virtual void deserialize(MetaContact *metaContact, const QMap< QString, QString > &data)
deserialize() and tell the plugin to apply the previously stored data again.
Definition: kopeteplugin.cpp:85
Kopete::Global::Properties::photo
const PropertyTmpl & photo() const
default template for a contact's photo.
Definition: kopeteglobal.cpp:224
Kopete::Protocol::deserializeContactList
virtual void deserializeContactList(MetaContact *metaContact, const QList< QMap< QString, QString > > &dataList)
Deserialize the plugin data for a meta contact's contacts.
Definition: kopeteprotocol.cpp:234
Kopete::MetaContact::displayName
QString displayName() const
the display name showed in the contact list window
Kopete::Group::topLevel
static Group * topLevel()
Definition: kopetegroup.cpp:35
Kopete::MetaContact::slotPluginLoaded
void slotPluginLoaded(Kopete::Plugin *plugin)
If a plugin is loaded, maybe data about this plugin are already cached in the metacontact.
Definition: kopetemetacontact.cpp:1094
Kopete::MetaContact::isOnline
bool isOnline() const
Returns whether this contact can be reached online for at least one FIXME: Make that an enum...
Kopete::MetaContact::setMetaContactId
void setMetaContactId(const QUuid &newMetaContactId)
Definition: kopetemetacontact.cpp:86
Kopete::MetaContact::statusMessage
StatusMessage statusMessage() const
The status message of metacontact.
Definition: kopetemetacontact.cpp:1089
Kopete::MetaContact::setPhotoSource
void setPhotoSource(PropertySource source)
Set the source of metacontact photo.
Definition: kopetemetacontact.cpp:307
Kopete::MetaContact::addContact
void addContact(Contact *c)
Add a contact which has just been deserialised to the meta contact.
Definition: kopetemetacontact.cpp:91
Kopete::Protocol::serialize
void serialize(Kopete::MetaContact *metaContact)
Serialize meta contact into the metacontact's plugin data Call serialize() for all contained contacts...
Definition: kopeteprotocol.cpp:175
Kopete::MetaContact::slotProtocolLoaded
void slotProtocolLoaded(Kopete::Protocol *p)
If a protocol is loaded, deserialize cached data.
Definition: kopetemetacontact.cpp:1106
Kopete::MetaContact::Private::photoSourceContact
Contact * photoSourceContact
Definition: kopetemetacontact_p.h:49
Kopete::MetaContact::Private::statusMessage
Kopete::StatusMessage statusMessage
Definition: kopetemetacontact_p.h:73
Qt::escape
QString escape(const QString &plain)
Kopete::MetaContact::serialize
void serialize()
Serialize this metaContact This causes each Kopete::Protocol subclass to serialise its contacts' data...
Definition: kopetemetacontact.cpp:595
Kopete::BehaviorSettings::self
static BehaviorSettings * self()
Definition: kopetebehaviorsettings.cpp:23
kopeteaccountmanager.h
Kopete::MetaContact::execute
Contact * execute()
Contact another user.
Definition: kopetemetacontact.cpp:425
Kopete::MetaContact::Private::groups
QList< Group * > groups
Definition: kopetemetacontact_p.h:58
Kopete::ContactListElement::Unknown
Definition: kopetecontactlistelement.h:158
Kopete::MetaContact::Private::displayName
QString displayName
Definition: kopetemetacontact_p.h:55
Kopete::MetaContact::isTemporary
bool isTemporary() const
Temporary contacts will not be serialized.
Kopete::MetaContact::idleTime
quint32 idleTime() const
return the time in second the contact is idle.
Definition: kopetemetacontact.cpp:444
Kopete::MetaContact::groups
QList< Group * > groups() const
The groups the contact is stored in.
Definition: kopetemetacontact.cpp:1069
Kopete::Group
Class which represents the Group.
Definition: kopetegroup.h:44
Kopete::KABCPersistence::addressBook
static KABC::AddressBook * addressBook()
Access Kopete's KDE address book instance.
Definition: kabcpersistence.cpp:92
Kopete::Account::suppressStatusNotification
bool suppressStatusNotification
Definition: kopeteaccount.h:83
Kopete::PropertyContainer
Definition: kopetepropertycontainer.h:39
Kopete::MetaContact::isAlwaysVisible
bool isAlwaysVisible() const
Returns whether this contact is visible even if offline.
Definition: kopetemetacontact.cpp:532
Kopete::MetaContact::contactStatusChanged
void contactStatusChanged(Kopete::Contact *contact, const Kopete::OnlineStatus &status)
A contact's online status changed.
Kopete::MetaContact::persistentDataChanged
void persistentDataChanged()
Some part of this object's persistent data (as returned by toXML) has changed.
Kopete::MetaContact::onlineStatusChanged
void onlineStatusChanged(Kopete::MetaContact *contact, Kopete::OnlineStatus::StatusType status)
The MetaContact online status changed.
Kopete::ContactListElement::Away
Definition: kopetecontactlistelement.h:158
Kopete::Contact::displayName
QString displayName() const
Returns display name of contact.
Definition: kopetecontact.cpp:913
Kopete::Contact::sendMessage
void sendMessage()
Pops up an email type window.
Definition: kopetecontact.cpp:479
Kopete::Property::value
const QVariant & value() const
Getter for this properties value.
Definition: kopeteproperty.cpp:229
Kopete::MetaContact::Private::onlineStatus
OnlineStatus::StatusType onlineStatus
Definition: kopetemetacontact_p.h:62
Kopete::ContactListElement::Online
Definition: kopetecontactlistelement.h:158
Kopete::nameFromKABC
QString nameFromKABC(const QString &id)
Definition: kopetemetacontact.cpp:700
Kopete::MetaContact
Definition: kopetemetacontact.h:54
QString::fromLatin1
QString fromLatin1(const char *str, int size)
Kopete::MetaContact::isReachable
bool isReachable() const
Like isOnline, but returns true even if the contact is not online, but can be reached trough offline-...
Kopete::OnlineStatus::Away
Refers to a state where you can be technically reached, but for one reason or another it is often not...
Definition: kopeteonlinestatus.h:117
Kopete::MetaContact::photoFromCustom
QImage photoFromCustom() const
Definition: kopetemetacontact.cpp:764
Kopete::Group::Temporary
Definition: kopetegroup.h:56
Kopete::Picture::isNull
bool isNull()
Check if the picture is null.
Definition: kopetepicture.cpp:134
Kopete::MetaContact::displayNameChanged
void displayNameChanged(const QString &oldName, const QString &newName)
The meta contact's display name changed.
Kopete::MetaContact::setAddressBookField
void setAddressBookField(Plugin *p, const QString &app, const QString &key, const QString &value)
set an address book field
Definition: kopetemetacontact.cpp:1084
QListIterator
Kopete::Utils::notify
void notify(QPixmap pic, const QString &eventid, const QString &caption, const QString &message, const QString explanation, const QString debugInfo)
Definition: kopeteutils.cpp:65
Kopete::Picture::setPicture
void setPicture(const QImage &image)
Set the picture content.
Definition: kopetepicture.cpp:154
Kopete::ContactListElement::pluginData
const PluginDataMap pluginData() const
return plugin-specific data for all plugins
Definition: kopetecontactlistelement.cpp:107
Kopete::MetaContact::Private::photoUrl
KUrl photoUrl
Definition: kopetemetacontact_p.h:56
QMap::isEmpty
bool isEmpty() const
Kopete::MetaContact::startChat
Contact * startChat()
Start a chat in a persistent chat window.
Definition: kopetemetacontact.cpp:348
Kopete::MetaContact::setKabcId
void setKabcId(const QString &newKabcId)
Set the KABC id for this metacontact Use with care! You could create a one to many relationship...
Definition: kopetemetacontact.cpp:1183
Kopete::Contact::idleTime
virtual unsigned long int idleTime() const
Get the time (in seconds) this contact has been idle It will return the time set in setIdleTime() wit...
Definition: kopetecontact.cpp:595
Kopete::ContactListElement::pluginDataChanged
void pluginDataChanged()
The plugin data was changed (by a plugin)
QPixmap::toImage
QImage toImage() const
Kopete::OnlineStatus::StatusType
StatusType
The available global states.
Definition: kopeteonlinestatus.h:78
Kopete::PropertyTmpl::key
const QString & key() const
Getter for the unique key.
Definition: kopeteproperty.cpp:137
Kopete::Group::type
GroupType type() const
Definition: kopetegroup.cpp:127
Kopete::KABCPersistence::writeAddressBook
void writeAddressBook(KABC::Resource *res)
Request an address book write, will be delayed to bundle any others happening around the same time...
Definition: kabcpersistence.cpp:177
Kopete::MetaContact::Private::contacts
QList< Contact * > contacts
Definition: kopetemetacontact_p.h:38
Kopete::KABCPersistence::self
static KABCPersistence * self()
Retrieve the instance of AccountManager.
Definition: kabcpersistence.cpp:86
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Kopete::MetaContact::preferredContact
Contact * preferredContact()
Definition: kopetemetacontact.cpp:366
Kopete::ContactListElement::IconState
IconState
The various icon states.
Definition: kopetecontactlistelement.h:158
Kopete::MetaContact::statusMessageChanged
void statusMessageChanged(Kopete::MetaContact *metaContact)
Status title or message has changed.
kopetebehaviorsettings.h
Kopete::Contact::CannotCreate
Definition: kopetecontact.h:297
QVariant::toString
QString toString() const
Kopete::ContactListElement::useCustomIcon
bool useCustomIcon() const
return if yes or no the user wants to display some custom icon.
Definition: kopetecontactlistelement.cpp:181
Kopete::MetaContact::metaContactId
QUuid metaContactId() const
Returns this metacontact's ID.
kopetepluginmanager.h
kopetecontact.h
Kopete::MetaContact::setPhoto
void setPhoto(const KUrl &url)
Set the custom photo.
Definition: kopetemetacontact.cpp:734
kopeteglobal.h
QUuid::createUuid
QUuid createUuid()
Kopete::StatusMessage::setMessage
void setMessage(const QString &message)
Set a new status message.
Definition: kopetestatusmessage.cpp:70
Kopete::MetaContact::Private::addressBook
QMap< QString, QMap< QString, QString > > addressBook
Definition: kopetemetacontact_p.h:59
Kopete::Group::temporary
static Group * temporary()
Definition: kopetegroup.cpp:43
name
const char * name
Definition: kopeteonlinestatus.cpp:104
Kopete::MetaContact::isPhotoSyncedWithKABC
bool isPhotoSyncedWithKABC() const
Definition: kopetemetacontact.cpp:1211
QVariant
Kopete::OnlineStatus::Connecting
State where the user is not available on the network yet but trying to get onto.
Definition: kopeteonlinestatus.h:104
Kopete::MetaContact::displayNameSourceContact
Contact * displayNameSourceContact() const
get the subcontact being tracked for its displayname (null if not set)
Definition: kopetemetacontact.cpp:820
QListIterator::hasNext
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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