kopete/libkopete
kopetecontact.cpp
Go to the documentation of this file.
95 connect( d->metaContact, SIGNAL(destroyed(QObject*)), this, SLOT(slotMetaContactDestroyed(QObject*)) );
187 if ( d->statusMessage.title() == statusMessage.title() && d->statusMessage.message() == statusMessage.message() )
198 kDebug(14010) << "Setting up the status message property with this: " << statusMessage.message();
250 titleText = QString::fromLatin1( "%1 <%2> (%3)" ).arg( nick, contactId(), onlineStatus().description() );
253 if( metaContact() && metaContact()->isTemporary() && contactId() != account()->myself()->contactId() )
255 KAction *actionAddContact = new KAction( KIcon("list-add-user"), i18n( "&Add to Your Contact List" ), menu );
262 // FIXME: After KDE 3.2 we should make isReachable do the isConnected call so it can be removed here - Martijn
296 KAction* changeMetaContact = KopeteStdAction::changeMetaContact( this, SLOT(changeMetaContact()), menu );
300 d->toggleAlwaysVisibleAction->setChecked( property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool() );
302 connect( d->toggleAlwaysVisibleAction, SIGNAL(toggled(bool)), this, SLOT(toggleAlwaysVisible()) );
307 #if 0 //this is not fully implemented yet (and doesn't work). disable for now - Olivier 2005-01-11
309 KopeteStdAction::unblockContact( this, SLOT(slotUnblock()), menu, "actionUnblockContact" )->plug( menu );
311 KopeteStdAction::blockContact( this, SLOT(slotBlock()), menu, "actionBlockContact" )->plug( menu );
322 bool alwaysVisible = property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool();
338 selector->setLabelMessage(i18n( "Select the meta contact to which you want to move this contact:" ));
341 QCheckBox *chkCreateNew = new QCheckBox( i18n( "Create a new metacontact for this contact" ), w );
342 chkCreateNew ->setWhatsThis( i18n( "If you select this option, a new metacontact will be created in the top-level group "
344 QObject::connect( chkCreateNew , SIGNAL(toggled(bool)) , selector , SLOT (setDisabled(bool)) ) ;
411 // it is necessary to call this write here, because MetaContact::addContact() does not differentiate
412 // between adding completely new contacts (which should be written to kabc) and restoring upon restart
451 KopeteView *v=manager( CanCreate )->view(true, Kopete::BehaviorSettings::self()->viewPlugin() );
458 i18n( "This user is not reachable at the moment. Please try a protocol that supports offline sending, or wait "
467 d->contactId ), i18n( "Remove Contact" ), KGuiItem(i18n("Remove"), QString::fromLatin1("list-remove-user") ), KStandardGuiItem::cancel(),
624 // FIXME: It shouldn't use QString to identity the properties. Instead it should use PropertyTmpl::key()
661 "<br /><b>Status Title:</b> %1", Kopete::Emoticons::parseEmoticons( Kopete::Message::escape(statusTitle) ) );
670 "<br /><b>Status Message:</b> %1", Kopete::Emoticons::parseEmoticons( Kopete::Message::escape(statusmsg) ) );
812 const QString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString();
virtual bool isReachable()
Get whether this contact can receive messages.
Definition: kopetecontact.cpp:424
void setStatusMessage(const Kopete::StatusMessage &statusMessage)
Set the contact's status message.
Definition: kopetecontact.cpp:183
MetaContact * myself()
return the metacontact that represent the user itself.
Definition: kopetecontactlist.cpp:349
static ContactList * self()
The contact list is a singleton object.
Definition: kopetecontactlist.cpp:71
Definition: kopeteonlinestatus.h:68
static KAction * changeMetaContact(const QObject *recvr, const char *slot, QObject *parent)
Standard action to change a contacts Kopete::MetaContact.
Definition: kopetestdaction.cpp:116
void addToGroup(Kopete::Group *to)
Add a contact to another group.
Definition: kopetemetacontact.cpp:1037
void setTemporary(bool b=true, Kopete::Group *group=0L)
Set if this is a temporary contact.
Definition: kopetemetacontact.cpp:1142
static QString parseEmoticons(const QString &text, KEmoticonsTheme::ParseMode mode=KEmoticonsTheme::DefaultParse, const QStringList &exclude=QStringList())
Definition: kopeteemoticons.cpp:36
void toggleAlwaysVisible()
Toggle the visibility of this contact even if offline.
Definition: kopetecontact.cpp:320
void execute()
The user clicked on the contact, do the default action.
Definition: kopetecontact.cpp:446
void canAcceptFilesChanged()
Emitted when the file transfer capability of this contact has changed.
void excludeMetaContact(Kopete::MetaContact *mc)
excludes a metacontact from being shown in the list if the metacontact is already excluded...
Definition: metacontactselectorwidget.cpp:261
void onlineStatusChanged(Kopete::Contact *contact, const Kopete::OnlineStatus &status, const Kopete::OnlineStatus &oldStatus)
The contact's online status changed.
QString & icon() const
Returns the name of the icon to use for this contact If null, the protocol icon need to be used...
void setMetaContact(MetaContact *m)
Move this contact to a new MetaContact.
Definition: kopetecontact.cpp:380
static KAction * unblockContact(const QObject *recvr, const char *slot, QObject *parent)
Standard action to unblock a contact.
Definition: kopetestdaction.cpp:139
void write(MetaContact *mc)
Change the KABC data associated with this metacontact.
Definition: kabcpersistence.cpp:102
void idleStateChanged(Kopete::Contact *contact)
The contact's idle state changed.
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
Account * account() const
Get the account that this contact belongs to.
Definition: kopetecontact.cpp:498
void removeContact(Contact *c, bool deleted=false)
remove the contact from this metacontact
Definition: kopetemetacontact.cpp:161
bool isDefinitelyOnline() const
Definition: kopeteonlinestatus.cpp:287
bool isRichText() const
Returns true if this property is HTML formatted.
Definition: kopeteproperty.cpp:244
Global facility to query/store templates that are needed by KopeteProperty.
Definition: kopeteglobal.h:45
Definition: kopetechatsession.h:74
bool canAcceptFiles() const
Get whether or not this contact can accept file transfers.
QString nickName() const
Convenience method to retrieve the nickName property.
void statusMessageChanged(Kopete::Contact *contact)
The contact's status message changed.
QString formattedName() const
Returns a formatted string of "firstName" and/or "lastName" properties if present.
void contactDestroyed(Kopete::Contact *contact)
The contact is about to be destroyed.
const PropertyTmpl & fullName() const
Definition: kopeteglobal.cpp:127
void setLabelMessage(const QString &msg)
sets the widget label message example: Please select a contact or, Choose a contact to delete ...
Definition: metacontactselectorwidget.cpp:295
static KAction * sendFile(const QObject *recvr, const char *slot, QObject *parent)
Standard action to initiate sending a file to a contact.
Definition: kopetestdaction.cpp:96
OnlineStatus onlineStatus() const
Get the online status of the contact.
Definition: kopetecontact.cpp:133
Protocol * protocol() const
Get the protocol that the contact belongs to.
Definition: kopetecontact.cpp:493
static QString escape(const QString &)
Transform a plaintext message into HTML.
Definition: kopetemessage.cpp:350
const PropertyTmpl & tmpl() const
Getter for this properties template.
Definition: kopeteproperty.cpp:234
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
void setPhoto(const QString &photoPath)
Convience method to set the photo property.
Definition: kopetecontact.cpp:819
static KAction * sendMessage(const QObject *recvr, const char *slot, QObject *parent)
Standard action to send a single message.
Definition: kopetestdaction.cpp:86
virtual ChatSession * manager(CanCreateFlags canCreate=CannotCreate)=0
Returns the primary message manager affiliated with this contact Although a contact can have more tha...
static KAction * blockContact(const QObject *recvr, const char *slot, QObject *parent)
Standard action to block a contact.
Definition: kopetestdaction.cpp:134
static KAction * contactInfo(const QObject *recvr, const char *slot, QObject *parent)
Standard action to open a user info dialog.
Definition: kopetestdaction.cpp:91
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
QString formattedIdleTime() const
Returns a formatted string of idleTime().
static KAction * chat(const QObject *recvr, const char *slot, QObject *parent)
Standard action to start a chat.
Definition: kopetestdaction.cpp:81
void changeMetaContact()
Changes the MetaContact that this contact is a part of.
Definition: kopetecontact.cpp:327
Kopete::StatusMessage statusMessage() const
Get the current status message of the contact.
Definition: kopetecontact.cpp:178
static AppearanceSettings * self()
Definition: kopeteappearancesettings.cpp:23
const PropertyTmpl & lastSeen() const
Definition: kopeteglobal.cpp:145
void removeProperty(const Kopete::PropertyTmpl &tmpl)
Remove a property if it exists.
Definition: kopetepropertycontainer.cpp:158
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
void addMetaContact(Kopete::MetaContact *c)
Add the metacontact into the contact list When calling this method, the contact has to be already pla...
Definition: kopetecontactlist.cpp:235
virtual KDE_DEPRECATED void deleteContact()
Definition: kopetecontact.cpp:476
const PropertyTmpl & statusMessage() const
Definition: kopeteglobal.cpp:157
MetaContact * metaContact() const
Get the metacontact for this contact.
Definition: kopetecontact.cpp:483
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
Definition: kopeteproperty.h:150
const PropertyTmpl & onlineSince() const
Return default template for a contact's online-since time (i.e.
Definition: kopeteglobal.cpp:139
void setFileCapable(bool filecap)
Set the file transfer capability of this contact.
Definition: kopetecontact.cpp:541
static BehaviorSettings * self()
Definition: kopetebehaviorsettings.cpp:23
void removeMetaContact(Kopete::MetaContact *contact)
Remove a metacontact from the contact list.
Definition: kopetecontactlist.cpp:251
QString toolTip() const
Get the tooltip for this contact Makes use of formattedName() and formattedIdleTime().
Contact(Account *account, const QString &id, MetaContact *parent, const QString &icon=QString())
Create new contact.
Definition: kopetecontact.cpp:87
void setProperty(const Kopete::PropertyTmpl &tmpl, const QVariant &value)
Add or Set a property for this contact.
Definition: kopetepropertycontainer.cpp:129
virtual void sync(unsigned int changed=0xFF)
Syncronise the server and the metacontact.
Definition: kopetecontact.cpp:505
Definition: kopetemetacontact.h:54
virtual QList< KAction * > * customContextMenuActions()
Get the set of custom menu items for this contact.
Definition: kopetecontact.cpp:521
bool isFileCapable() const
Get whether or not this contact is capable of file transfers.
Definition: kopetecontact.cpp:536
Kopete::OnlineStatus accountOfflineStatus() const
Returns the status used for contacts when accounts of this protocol are offline.
Definition: kopeteprotocol.cpp:94
Definition: kopetecontact.h:283
void setNickName(const QString &name)
Convenience method to set the nickName property to the specified value.
Definition: kopetecontact.cpp:805
bool isNull() const
Returns true if this object is an empty Property (i.e.
Definition: kopeteproperty.cpp:239
void setIcon(const QString &icon)
Change the icon to use for this contact If you don't want to have the protocol icon as icon for this ...
Definition: kopetecontact.cpp:515
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
KopeteView * view(bool canCreate=false, const QString &requestedPlugin=QString())
the manager's view
Definition: kopetechatsession.cpp:641
Definition: kopeteview.h:40
static KABCPersistence * self()
Retrieve the instance of AccountManager.
Definition: kabcpersistence.cpp:86
virtual void serialize(QMap< QString, QString > &serializedData, QMap< QString, QString > &addressBookData)
Serialize the contact for storage in the contact list.
Definition: kopetecontact.cpp:419
void setOnlineStatus(const OnlineStatus &status)
Set the contact's online status.
Definition: kopetecontact.cpp:141
static QStringList toolTipContents()
Get Contact properties that contact tooltip will show.
Definition: kopeteappearancesettings.h:384
Kopete::MetaContact * metaContact()
Definition: metacontactselectorwidget.cpp:230
void setIdleTime(unsigned long int)
Set the current idle time in seconds.
Definition: kopetecontact.cpp:563
const PropertyTmpl & statusTitle() const
Definition: kopeteglobal.cpp:151
static KAction * deleteContact(const QObject *recvr, const char *slot, QObject *parent)
Standard action to delete a contact.
Definition: kopetestdaction.cpp:121
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.