kopete/libkopete
kopetecontact.cpp
Go to the documentation of this file.
130 connect( d->metaContact, SIGNAL(destroyed(QObject*)), this, SLOT(slotMetaContactDestroyed(QObject*)) );
227 if ( d->statusMessage.title() == statusMessage.title() && d->statusMessage.message() == statusMessage.message() )
238 kDebug(14010) << "Setting up the status message property with this: " << statusMessage.message();
290 titleText = QString::fromLatin1( "%1 <%2> (%3)" ).arg( nick, contactId(), onlineStatus().description() );
293 if( metaContact() && metaContact()->isTemporary() && contactId() != account()->myself()->contactId() )
295 KAction *actionAddContact = new KAction( KIcon("list-add-user"), i18n( "&Add to Your Contact List" ), menu );
302 // FIXME: After KDE 3.2 we should make isReachable do the isConnected call so it can be removed here - Martijn
336 KAction* changeMetaContact = KopeteStdAction::changeMetaContact( this, SLOT(changeMetaContact()), menu );
340 d->toggleAlwaysVisibleAction->setChecked( property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool() );
342 connect( d->toggleAlwaysVisibleAction, SIGNAL(toggled(bool)), this, SLOT(toggleAlwaysVisible()) );
347 #if 0 //this is not fully implemented yet (and doesn't work). disable for now - Olivier 2005-01-11
349 KopeteStdAction::unblockContact( this, SLOT(slotUnblock()), menu, "actionUnblockContact" )->plug( menu );
351 KopeteStdAction::blockContact( this, SLOT(slotBlock()), menu, "actionBlockContact" )->plug( menu );
362 bool alwaysVisible = property( Kopete::Global::Properties::self()->isAlwaysVisible() ).value().toBool();
378 selector->setLabelMessage(i18n( "Select the meta contact to which you want to move this contact:" ));
381 QCheckBox *chkCreateNew = new QCheckBox( i18n( "Create a new metacontact for this contact" ), w );
382 chkCreateNew ->setWhatsThis( i18n( "If you select this option, a new metacontact will be created in the top-level group "
384 QObject::connect( chkCreateNew , SIGNAL(toggled(bool)) , selector , SLOT (setDisabled(bool)) ) ;
451 // it is necessary to call this write here, because MetaContact::addContact() does not differentiate
452 // between adding completely new contacts (which should be written to kabc) and restoring upon restart
491 KopeteView *v=manager( CanCreate )->view(true, Kopete::BehaviorSettings::self()->viewPlugin() );
498 i18n( "This user is not reachable at the moment. Please try a protocol that supports offline sending, or wait "
507 d->contactId ), i18n( "Remove Contact" ), KGuiItem(i18n("Remove"), QString::fromLatin1("list-remove-user") ), KStandardGuiItem::cancel(),
663 // FIXME: It shouldn't use QString to identity the properties. Instead it should use PropertyTmpl::key()
700 "<br /><b>Status Title:</b> %1", Kopete::Emoticons::parseEmoticons( Kopete::Message::escape(statusTitle) ) );
709 "<br /><b>Status Message:</b> %1", Kopete::Emoticons::parseEmoticons( Kopete::Message::escape(statusmsg) ) );
851 const QString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString();
865 const QString name = property( Kopete::Global::Properties::self()->customName() ).value().toString();
virtual bool isReachable()
Get whether this contact can receive messages.
Definition: kopetecontact.cpp:464
void setStatusMessage(const Kopete::StatusMessage &statusMessage)
Set the contact's status message.
Definition: kopetecontact.cpp:223
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:1045
void truncate(int position)
void setTemporary(bool b=true, Kopete::Group *group=0L)
Set if this is a temporary contact.
Definition: kopetemetacontact.cpp:1150
void propertyChanged(Kopete::PropertyContainer *container, const QString &key, const QVariant &oldValue, const QVariant &newValue)
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:360
void execute()
The user clicked on the contact, do the default action.
Definition: kopetecontact.cpp:486
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:262
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:420
QDateTime toDateTime() const
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.
QTime toTime() const
int size() const
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:538
void removeContact(Contact *c, bool deleted=false)
remove the contact from this metacontact
Definition: kopetemetacontact.cpp:165
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
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
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.
Formatted name (first and/or last name)
Definition: kopetecontact.h:87
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:128
Custom name set by user and stored on server contact list, can be changed.
Definition: kopetecontact.h:86
void setLabelMessage(const QString &msg)
sets the widget label message example: Please select a contact or, Choose a contact to delete ...
Definition: metacontactselectorwidget.cpp:296
const char * name() const
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:173
Protocol * protocol() const
Get the protocol that the contact belongs to.
Definition: kopetecontact.cpp:533
static QString escape(const QString &)
Transform a plaintext message into HTML.
Definition: kopetemessage.cpp:351
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:260
bool isEmpty() const
void setPhoto(const QString &photoPath)
Convience method to set the photo property.
Definition: kopetecontact.cpp:871
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...
bool isEmpty() const
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:1279
bool hasProperty(const QString &key) const
Check for existence of a certain property stored using "key".
Definition: kopetepropertycontainer.cpp:106
void deleteLater()
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:367
iterator end()
void setParent(QObject *parent)
Kopete::StatusMessage statusMessage() const
Get the current status message of the contact.
Definition: kopetecontact.cpp:218
static AppearanceSettings * self()
Definition: kopeteappearancesettings.cpp:23
const PropertyTmpl & lastSeen() const
Definition: kopeteglobal.cpp:146
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:516
bool isChecked() const
const PropertyTmpl & statusMessage() const
Definition: kopeteglobal.cpp:158
QDate toDate() const
void setWhatsThis(const QString &)
QDateTime currentDateTime()
MetaContact * metaContact() const
Get the metacontact for this contact.
Definition: kopetecontact.cpp:523
void addContact(Contact *c)
Add a contact which has just been deserialised to the meta contact.
Definition: kopetemetacontact.cpp:91
void serialize(Kopete::MetaContact *metaContact)
Serialize meta contact into the metacontact's plugin data Call serialize() for all contained contacts...
Definition: kopeteprotocol.cpp:175
NameType preferredNameType() const
Returns prefered name type, used by displayName function Default is CustomName.
Definition: kopetecontact.cpp:908
Definition: kopeteproperty.h:150
QString escape(const QString &plain)
const PropertyTmpl & onlineSince() const
Return default template for a contact's online-since time (i.e.
Definition: kopeteglobal.cpp:140
static const QString nameTypeToString(NameType nameType)
Definition: kopetecontact.cpp:106
void setFileCapable(bool filecap)
Set the file transfer capability of this contact.
Definition: kopetecontact.cpp:581
void setPreferredNameType(NameType type)
Set preferred name type, used by displayName function.
Definition: kopetecontact.cpp:894
static BehaviorSettings * self()
Definition: kopetebehaviorsettings.cpp:23
QString customName() const
Convenience method to retrieve the customName property.
Definition: kopetecontact.cpp:863
typedef ConstIterator
QByteArray toPercentEncoding(const QString &input, const QByteArray &exclude, const QByteArray &include)
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:122
bool toBool() const
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:545
Definition: kopetemetacontact.h:54
QString fromLatin1(const char *str, int size)
virtual QList< KAction * > * customContextMenuActions()
Get the set of custom menu items for this contact.
Definition: kopetecontact.cpp:561
bool isFileCapable() const
Get whether or not this contact is capable of file transfers.
Definition: kopetecontact.cpp:576
static NameType nameTypeFromString(const QString &nameType)
These functions do conversion between enum NameType and QString Usefull for protocol serialize/deseri...
Definition: kopetecontact.cpp:91
Kopete::OnlineStatus accountOfflineStatus() const
Returns the status used for contacts when accounts of this protocol are offline.
Definition: kopeteprotocol.cpp:94
Definition: kopetecontact.h:297
void setNickName(const QString &name)
Convenience method to set the nickName property to the specified value.
Definition: kopetecontact.cpp:844
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:555
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
const_iterator constEnd() const
const_iterator constBegin() const
Type type() const
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
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
void setCustomName(const QString &name)
Convenience method to set the customkName property to the specified value.
Definition: kopetecontact.cpp:858
virtual void serialize(QMap< QString, QString > &serializedData, QMap< QString, QString > &addressBookData)
Serialize the contact for storage in the contact list.
Definition: kopetecontact.cpp:459
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
void setOnlineStatus(const OnlineStatus &status)
Set the contact's online status.
Definition: kopetecontact.cpp:181
static QStringList toolTipContents()
Get Contact properties that contact tooltip will show.
Definition: kopeteappearancesettings.h:384
Kopete::MetaContact * metaContact()
Definition: metacontactselectorwidget.cpp:231
iterator begin()
void destroyed(QObject *obj)
void setIdleTime(unsigned long int)
Set the current idle time in seconds.
Definition: kopetecontact.cpp:603
const PropertyTmpl & statusTitle() const
Definition: kopeteglobal.cpp:152
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-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
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.