kopete/libkopete
kopetemetacontact.cpp
Go to the documentation of this file.
56 connect( this, SIGNAL(iconChanged(Kopete::ContactListElement::IconState,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()) );
66 connect(KABCPersistence::self()->addressBook(), SIGNAL(addressBookChanged(AddressBook*)), this, SLOT(slotUpdateAddressBookPicture()));
101 connect( c, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
170 bool wasTrackingName = ( !displayNameSourceContact() && (displayNameSource() == SourceContact) );
228 disconnect( c, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
229 this, SLOT(slotContactStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
250 Contact *MetaContact::findContact( const QString &protocolId, const QString &accountId, const QString &contactId )
259 if( ( c->contactId() == contactId ) && ( c->protocol()->pluginId() == protocolId || protocolId.isNull() ) )
289 void MetaContact::setDisplayNameSource( const QString &nameSourcePID, const QString &nameSourceAID, const QString &nameSourceCID )
311 void MetaContact::setPhotoSource( const QString &photoSourcePID, const QString &photoSourceAID, const QString &photoSourceCID )
331 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 "
349 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 "
426 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 "
532 if ( c && c->property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool() )
569 void MetaContact::sendFile( const KUrl &sourceURL, const QString &altFileName, unsigned long fileSize )
605 void MetaContact::slotContactStatusChanged( Contact * c, const OnlineStatus &status, const OnlineStatus &/*oldstatus*/ )
688 // kDebug( 14010 ) << " source == SourceContact , but there is no displayNameSourceContact for contact " << metaContactId();
702 kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
792 kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
969 // Here we abuse the onlineStatusChanged signal to force the contact list to refresh and hide the
971 if ( key == Kopete::Global::Properties::self()->isAlwaysVisible().key() && oldValue != newValue )
1016 if ( !group || !groups().contains( group ) || ( isTemporary() && group->type() == Group::Temporary ) )
1071 QString MetaContact::addressBookField( Kopete::Plugin * /* p */, const QString &app, const QString & key ) const
1076 void Kopete::MetaContact::setAddressBookField( Kopete::Plugin * /* p */, const QString &app, const QString &key, const QString &value )
1111 setDisplayNameSourceContact( findContact( d->nameSourcePID, d->nameSourceAID, d->nameSourceCID) );
1112 setPhotoSourceContact( findContact( d->photoSourcePID, d->photoSourceAID, d->photoSourceCID) );
1124 kDebug( 14010 ) << "no KABC::Addressee found for ( " << id << " ) " << " in current address book";
1170 return c->protocol()->pluginId()+QString::fromUtf8(":")+c->account()->accountId()+QString::fromUtf8(":") + c->contactId() ;
1277 // comparing the status of the previous and new preferred contact is the determining factor in deciding to notify
1283 else // the last child contact has gone offline or otherwise unreachable, so take the changed contact's online status
1297 if ( d->notifyOnlineStatus.status() == Kopete::OnlineStatus::Unknown || newNotifyOnlineStatus.status() == Kopete::OnlineStatus::Unknown )
1299 t = noEvent; // This means the contact's changed from or to unknown - due to a protocol state change, not a contact state change
1316 else if ( d->notifyOnlineStatus > newNotifyOnlineStatus || d->notifyOnlineStatus < newNotifyOnlineStatus ) // operator!= is useless because it's an identity operator, not an equivalence operator
1339 notify = new KNotification( QString("kopete_contact_online"), Kopete::UI::Global::mainWidget() );
1343 notify = new KNotification( QString("kopete_contact_status_change"), Kopete::UI::Global::mainWidget() );
1347 notify = new KNotification( QString("kopete_contact_offline"), Kopete::UI::Global::mainWidget() );
1364 notify->addContext( qMakePair( QString::fromLatin1("group") , QString::number( g->groupId() ) ) );
virtual bool isReachable()
Get whether this contact can receive messages.
Definition: kopetecontact.cpp:424
void setPhotoSourceContact(Contact *contact)
set the subcontact to use for SourceContact source
Definition: kopetemetacontact.cpp:836
QMap< QString, ContactDataList > pluginContactData() const
Get the settings as stored previously by calls to setPluginContactData() Note that plugins shouldn't ...
Definition: kopetecontactlistelement.cpp:112
static ContactList * self()
The contact list is a singleton object.
Definition: kopetecontactlist.cpp:71
Definition: kopeteonlinestatus.h:68
Picture contactPicture
Definition: kopetemetacontact_p.h:71
QString nameSourceCID
Definition: kopetemetacontact_p.h:67
void addToGroup(Kopete::Group *to)
Add a contact to another group.
Definition: kopetemetacontact.cpp:1037
void movedToGroup(Kopete::MetaContact *contact, Kopete::Group *from, Kopete::Group *to)
The contact was moved.
void sendFile(const KUrl &sourceURL, const QString &altFileName=QString(), unsigned long fileSize=0L)
Send a file to this metacontact.
Definition: kopetemetacontact.cpp:569
QString statusIcon() const
The name of the icon associated with the contact's status.
QList< ContactData > ContactDataList
Definition: kopetecontactlistelement.h:116
void setTemporary(bool b=true, Kopete::Group *group=0L)
Set if this is a temporary contact.
Definition: kopetemetacontact.cpp:1142
void propertyChanged(Kopete::PropertyContainer *container, const QString &key, const QVariant &oldValue, const QVariant &newValue)
void setDisplayName(const QString &name)
Set the custom displayName.
Definition: kopetemetacontact.cpp:614
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse, const QStringList &exclude=QStringList())
Definition: kopeteemoticons.cpp:36
QString nameFromContact(Kopete::Contact *c)
Definition: kopetemetacontact.cpp:713
void execute()
The user clicked on the contact, do the default action.
Definition: kopetecontact.cpp:446
void contactRemoved(Kopete::Contact *c)
a contact has been removed from this metacontact
const PropertyTmpl & nickName() const
Definition: kopeteglobal.cpp:205
KDE_DEPRECATED QImage photo() const
the photo showed in the contact list window
Definition: kopetemetacontact.cpp:739
void setDisplayNameSourceContact(Contact *contact)
set the subcontact whose name is to be tracked (set to null to disable tracking)
Definition: kopetemetacontact.cpp:824
void removeFromGroup(Kopete::Group *from)
Remove a contact from one group.
Definition: kopetemetacontact.cpp:1014
Contact * findContact(const QString &protocolId, const QString &accountId, const QString &contactId)
Find the Contact to a given contact.
Definition: kopetemetacontact.cpp:250
QString photoSourceAID
Definition: kopetemetacontact_p.h:68
void contactAdded(Kopete::Contact *c)
a contact has been added into this metacontact
void write(MetaContact *mc)
Change the KABC data associated with this metacontact.
Definition: kabcpersistence.cpp:102
QString nameSourceAID
Definition: kopetemetacontact_p.h:67
Refers to protocols where state cannot be determined.
Definition: kopeteonlinestatus.h:90
const Kopete::Property & property(const QString &key) const
Get the value of a property with key "key".
Definition: kopetepropertycontainer.cpp:111
State where you really cannot be contacted.
Definition: kopeteonlinestatus.h:98
void slotAllPluginsLoaded()
When all the plugins are loaded, set the Contact Source.
Definition: kopetemetacontact.cpp:1108
the contact has been moved between groups
Definition: kopetecontact.h:80
Account * account() const
Get the account that this contact belongs to.
Definition: kopetecontact.cpp:498
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
void removeContact(Contact *c, bool deleted=false)
remove the contact from this metacontact
Definition: kopetemetacontact.cpp:161
bool isDefinitelyOnline() const
Definition: kopeteonlinestatus.cpp:287
PropertySource
Enumeration of possible sources for a property (which may be photos, see setPhotoSource() for instanc...
Definition: kopetemetacontact.h:75
PropertySource photoSource
Definition: kopetemetacontact_p.h:44
Contact * photoSourceContact() const
get the subcontact being tracked for its photo
Definition: kopetemetacontact.cpp:819
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:1071
void useCustomIconChanged(bool useCustomIcon)
The useCustomIcon property has changed.
void onlineStatusNotification(Kopete::Contact *c)
Definition: kopetemetacontact.cpp:1275
QString customDisplayName() const
Returns the custom display name.
Definition: kopetemetacontact.cpp:657
void setPhotoSyncedWithKABC(bool b)
Set if the photo should be synced with the adressbook when the photosource change his photo...
Definition: kopetemetacontact.cpp:1207
Contact * sendMessage()
Send a single message, classic ICQ style.
Definition: kopetemetacontact.cpp:324
static bool enableEventsWhileAway()
Get Enable events while away.
Definition: kopetebehaviorsettings.h:504
OnlineStatus onlineStatus() const
Get the online status of the contact.
Definition: kopetecontact.cpp:133
Data comes from the contact itself.
Definition: kopetemetacontact.h:76
void setDisplayNameSource(PropertySource source)
Set the source of metacontact displayName.
Definition: kopetemetacontact.cpp:276
const PropertyTmpl & isAlwaysVisible() const
Definition: kopeteglobal.cpp:211
void contactIdleStateChanged(Kopete::Contact *contact)
One of the subcontacts' idle status has changed.
PropertySource displayNameSource() const
get the source of metacontact display name
Definition: kopetemetacontact.cpp:296
Protocol * protocol() const
Get the protocol that the contact belongs to.
Definition: kopetecontact.cpp:493
void addedToGroup(Kopete::MetaContact *contact, Kopete::Group *to)
The contact was added to another group.
void moveToGroup(Kopete::Group *from, Kopete::Group *to)
Move a contact from one group to another.
Definition: kopetemetacontact.cpp:975
bool canAcceptFiles() const
Returns whether this contact can accept files.
Picture customPicture
Definition: kopetemetacontact_p.h:71
Picture & picture() const
Return the correct Kopete::Picture object depending of the metacontact photo source.
Definition: kopetemetacontact.cpp:744
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
OnlineStatus::StatusType status() const
Return a more fine-grained status.
Definition: kopetemetacontact.cpp:509
QString photoSourcePID
Definition: kopetemetacontact_p.h:68
Data comes from KABC (addressbook).
Definition: kopetemetacontact.h:77
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:220
virtual ChatSession * manager(CanCreateFlags canCreate=CannotCreate)=0
Returns the primary message manager affiliated with this contact Although a contact can have more tha...
QString photoSourceCID
Definition: kopetemetacontact_p.h:68
QImage photoFromContact(Kopete::Contact *contact)
Definition: kopetemetacontact.cpp:763
the displayname of the contact changed
Definition: kopetecontact.h:81
QList< Contact * > contacts() const
Retrieve the list of contacts that are part of the meta contact.
Definition: kopetemetacontact.cpp:1270
bool hasProperty(const QString &key) const
Check for existence of a certain property stored using "key".
Definition: kopetepropertycontainer.cpp:106
void clearPluginContactData()
Clear all plugin specific data.
Definition: kopetecontactlistelement.cpp:125
Definition: kopetegroup.h:56
QString icon(IconState state=None) const
return the icon for this object, in the given state.
Definition: kopetecontactlistelement.cpp:162
PropertySource displayNameSource
Definition: kopetemetacontact_p.h:45
Contact * displayNameSourceContact
Definition: kopetemetacontact_p.h:48
Definition: kopetecontact.h:58
bool photoSyncedWithKABC
Definition: kopetemetacontact_p.h:63
Refers to a true online state, i.e.
Definition: kopeteonlinestatus.h:129
void iconChanged(Kopete::ContactListElement::IconState, const QString &)
The icon to use for some state has changed.
OnlineStatus notifyOnlineStatus
Definition: kopetemetacontact_p.h:64
void removedFromGroup(Kopete::MetaContact *contact, Kopete::Group *group)
The contact was removed from group.
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
PropertySource photoSource() const
get the source of metacontact photo
Definition: kopetemetacontact.cpp:318
QString nameSourcePID
Definition: kopetemetacontact_p.h:67
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
const PropertyTmpl & photo() const
default template for a contact's photo.
Definition: kopeteglobal.cpp:217
virtual void deserializeContactList(MetaContact *metaContact, const QList< QMap< QString, QString > > &dataList)
Deserialize the plugin data for a meta contact's contacts.
Definition: kopeteprotocol.cpp:231
QString displayName() const
the display name showed in the contact list window
void slotPluginLoaded(Kopete::Plugin *plugin)
If a plugin is loaded, maybe data about this plugin are already cached in the metacontact.
Definition: kopetemetacontact.cpp:1086
bool isOnline() const
Returns whether this contact can be reached online for at least one FIXME: Make that an enum...
void setMetaContactId(const QUuid &newMetaContactId)
Definition: kopetemetacontact.cpp:85
StatusMessage statusMessage() const
The status message of metacontact.
Definition: kopetemetacontact.cpp:1081
void setPhotoSource(PropertySource source)
Set the source of metacontact photo.
Definition: kopetemetacontact.cpp:301
void addContact(Contact *c)
Add a contact which has just been deserialised to the meta contact.
Definition: kopetemetacontact.cpp:90
void serialize(Kopete::MetaContact *metaContact)
Serialize meta contact into the metacontact's plugin data Call serialize() for all contained contacts...
Definition: kopeteprotocol.cpp:175
void slotProtocolLoaded(Kopete::Protocol *p)
If a protocol is loaded, deserialize cached data.
Definition: kopetemetacontact.cpp:1098
Contact * photoSourceContact
Definition: kopetemetacontact_p.h:49
Kopete::StatusMessage statusMessage
Definition: kopetemetacontact_p.h:73
void serialize()
Serialize this metaContact This causes each Kopete::Protocol subclass to serialise its contacts' data...
Definition: kopetemetacontact.cpp:589
static BehaviorSettings * self()
Definition: kopetebehaviorsettings.cpp:23
quint32 idleTime() const
return the time in second the contact is idle.
Definition: kopetemetacontact.cpp:438
QList< Group * > groups() const
The groups the contact is stored in.
Definition: kopetemetacontact.cpp:1061
static KABC::AddressBook * addressBook()
Access Kopete's KDE address book instance.
Definition: kabcpersistence.cpp:92
bool suppressStatusNotification
Definition: kopeteaccount.h:83
bool isAlwaysVisible() const
Returns whether this contact is visible even if offline.
Definition: kopetemetacontact.cpp:526
void contactStatusChanged(Kopete::Contact *contact, const Kopete::OnlineStatus &status)
A contact's online status changed.
void persistentDataChanged()
Some part of this object's persistent data (as returned by toXML) has changed.
void onlineStatusChanged(Kopete::MetaContact *contact, Kopete::OnlineStatus::StatusType status)
The MetaContact online status changed.
OnlineStatus::StatusType onlineStatus
Definition: kopetemetacontact_p.h:62
Definition: kopetemetacontact.h:54
bool isReachable() const
Like isOnline, but returns true even if the contact is not online, but can be reached trough offline-...
Refers to a state where you can be technically reached, but for one reason or another it is often not...
Definition: kopeteonlinestatus.h:117
QImage photoFromCustom() const
Definition: kopetemetacontact.cpp:758
Definition: kopetegroup.h:56
void displayNameChanged(const QString &oldName, const QString &newName)
The meta contact's display name changed.
void setAddressBookField(Plugin *p, const QString &app, const QString &key, const QString &value)
set an address book field
Definition: kopetemetacontact.cpp:1076
void notify(QPixmap pic, const QString &eventid, const QString &caption, const QString &message, const QString explanation, const QString debugInfo)
Definition: kopeteutils.cpp:64
const PluginDataMap pluginData() const
return plugin-specific data for all plugins
Definition: kopetecontactlistelement.cpp:107
Contact * startChat()
Start a chat in a persistent chat window.
Definition: kopetemetacontact.cpp:342
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:1175
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:555
void pluginDataChanged()
The plugin data was changed (by a plugin)
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
QList< Contact * > contacts
Definition: kopetemetacontact_p.h:38
static KABCPersistence * self()
Retrieve the instance of AccountManager.
Definition: kabcpersistence.cpp:86
Contact * preferredContact()
Definition: kopetemetacontact.cpp:360
void statusMessageChanged(Kopete::MetaContact *metaContact)
Status title or message has changed.
Definition: kopetecontact.h:283
bool useCustomIcon() const
return if yes or no the user wants to display some custom icon.
Definition: kopetecontactlistelement.cpp:181
void setMessage(const QString &message)
Set a new status message.
Definition: kopetestatusmessage.cpp:70
QMap< QString, QMap< QString, QString > > addressBook
Definition: kopetemetacontact_p.h:59
bool isPhotoSyncedWithKABC() const
Definition: kopetemetacontact.cpp:1202
State where the user is not available on the network yet but trying to get onto.
Definition: kopeteonlinestatus.h:104
Contact * displayNameSourceContact() const
get the subcontact being tracked for its displayname (null if not set)
Definition: kopetemetacontact.cpp:814
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.