kopete/libkopete
Kopete::MetaContact Class Reference
#include <kopetemetacontact.h>

Detailed Description
A metacontact represent a person. This is a kind of entry to the contact list. All information of a contact is contained in the metacontact. Plugins can store data in it with all ContactListElement methods
Definition at line 52 of file kopetemetacontact.h.
Member Typedef Documentation
| typedef QList<MetaContact *> Kopete::MetaContact::List |
Definition at line 68 of file kopetemetacontact.h.
Member Enumeration Documentation
Enumeration of possible sources for a property (which may be photos, see setPhotoSource() for instance).
- Enumerator:
-
SourceContact Data comes from the contact itself. SourceKABC Data comes from KABC (addressbook). SourceCustom Data comes from somewhere else.
Definition at line 73 of file kopetemetacontact.h.
Constructor & Destructor Documentation
| Kopete::MetaContact::MetaContact | ( | ) |
| Kopete::MetaContact::~MetaContact | ( | ) |
Member Function Documentation
| QString Kopete::MetaContact::metaContactId | ( | ) | const |
Returns this metacontact's ID.
Every metacontact has a unique id, set by when creating the contact, or reading the contact list TODO: make it real
| void Kopete::MetaContact::setMetaContactId | ( | const QString & | newMetaContactId | ) |
Add or change the link to a KDE addressbook (KABC) Addressee.
FIXME: Use with care. You could create 1 to many relationships with the current implementation
Definition at line 1019 of file kopetemetacontact.cpp.
Retrieve the list of contacts that are part of the meta contact.
Definition at line 1114 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::findContact | ( | const QString & | protocolId, | |
| const QString & | accountId, | |||
| const QString & | contactId | |||
| ) |
Find the Contact to a given contact.
If contact is not found, a null pointer is returned. if protocolId or accountId are null, it is searched over all protocols/accounts
Definition at line 232 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setDisplayNameSource | ( | PropertySource | source | ) |
Set the source of metacontact displayName.
This method selects the display name source for one of the sources defined in PropertySource
- See also:
- PropertySource
Definition at line 258 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setDisplayNameSource | ( | const QString & | nameSourcePID, | |
| const QString & | nameSourceAID, | |||
| const QString & | nameSourceCID | |||
| ) |
Definition at line 267 of file kopetemetacontact.cpp.
| MetaContact::PropertySource Kopete::MetaContact::displayNameSource | ( | ) | const |
get the source of metacontact display name
This method obtains the current name source for one of the sources defined in PropertySource
- See also:
- PropertySource
Definition at line 274 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setPhotoSource | ( | PropertySource | source | ) |
Set the source of metacontact photo.
This method selects the photo source for one of the sources defined in PropertySource
- See also:
- PropertySource
Definition at line 279 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setPhotoSource | ( | const QString & | photoSourcePID, | |
| const QString & | photoSourceAID, | |||
| const QString & | photoSourceCID | |||
| ) |
Definition at line 289 of file kopetemetacontact.cpp.
| MetaContact::PropertySource Kopete::MetaContact::photoSource | ( | ) | const |
get the source of metacontact photo
This method obtains the current photo source for one of the sources defined in PropertySource
- See also:
- PropertySource
Definition at line 296 of file kopetemetacontact.cpp.
| QString Kopete::MetaContact::displayName | ( | ) | const |
the display name showed in the contact list window
The displayname is the name which should be shown almost everywere to represent the metacontact. (in the contact list, in the chatwindow, ...)
This is a kind of alias, set by the kopete user, as opposed to a nickname set by the contact itself.
If the protocol support alias serverside, the metacontact displayname should probably be synchronized with the alias on the server.
This displayName is obtained from the source set with setDisplayNameSource
| QImage Kopete::MetaContact::photo | ( | ) | const |
the photo showed in the contact list window
Returns a image for the metacontact. If the metacontact photo source is the KDE addressbook. it will return the picture stored in the addressbook It can also use a subcontact as the photo source.
This photo is obtained from the source set with setPhotoSource
- Deprecated:
- Use picture().image() instead.
Definition at line 669 of file kopetemetacontact.cpp.
| Picture & Kopete::MetaContact::picture | ( | ) | const |
Return the correct Kopete::Picture object depending of the metacontact photo source.
This photo is obtained from the source set with setPhotoSource
KDE4 TODO: Rename this to photo() and use the new object.
Definition at line 674 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setDisplayName | ( | const QString & | name | ) |
Set the custom displayName.
This display name is used when name source is Custom this metohd may emit displayNameChanged signal. And will call Kopete::Contact::sync
- See also:
- displayName()
Definition at line 558 of file kopetemetacontact.cpp.
| QString Kopete::MetaContact::customDisplayName | ( | ) | const |
Returns the custom display name.
- See also:
- displayName()
Definition at line 584 of file kopetemetacontact.cpp.
| KUrl Kopete::MetaContact::customPhoto | ( | ) | const |
Returns the custom display photo.
- See also:
- photo()
Definition at line 653 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setPhoto | ( | const KUrl & | url | ) |
Set the custom photo.
This photo is used when photo source is set toCustom this metohd may emit photoChanged signal.
- See also:
- photo()
Definition at line 658 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::displayNameSourceContact | ( | ) | const |
get the subcontact being tracked for its displayname (null if not set)
The MetaContact will adjust its displayName() every time the "nameSource" changes its nickname property.
Definition at line 744 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setDisplayNameSourceContact | ( | Contact * | contact | ) |
set the subcontact whose name is to be tracked (set to null to disable tracking)
- See also:
- nameSource
Definition at line 754 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::photoSourceContact | ( | ) | const |
get the subcontact being tracked for its photo
Definition at line 749 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setPhotoSourceContact | ( | Contact * | contact | ) |
set the subcontact to use for SourceContact source
Definition at line 764 of file kopetemetacontact.cpp.
| bool Kopete::MetaContact::isPhotoSyncedWithKABC | ( | ) | const |
- Returns:
- true if when a subcontact change his photo, the photo will be set to the kabc contact.
Definition at line 1046 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setPhotoSyncedWithKABC | ( | bool | b | ) |
Set if the photo should be synced with the adressbook when the photosource change his photo.
If b is true, the photo will be synced immediately if possible
Definition at line 1051 of file kopetemetacontact.cpp.
| bool Kopete::MetaContact::isTemporary | ( | ) | const |
Temporary contacts will not be serialized.
If they are added to the contact list, they appears in a special "Not in your contact list" group. (the Group::temporary group)
| void Kopete::MetaContact::addContact | ( | Contact * | c | ) |
Add a contact which has just been deserialised to the meta contact.
- Parameters:
-
c The Contact being added
Definition at line 75 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::removeContact | ( | Contact * | c, | |
| bool | deleted = false | |||
| ) |
remove the contact from this metacontact
set 'deleted' to true if the Contact is already deleted
- Parameters:
-
c is the contact to remove deleted : if it is false, it will disconnect the old contact, and call some method.
Definition at line 143 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::preferredContact | ( | ) |
- Returns:
- the preferred child Contact for communication, or 0 if none is suitable (all unreachable).
Definition at line 338 of file kopetemetacontact.cpp.
| QString Kopete::MetaContact::statusIcon | ( | ) | const |
| QString Kopete::MetaContact::statusString | ( | ) | const |
| bool Kopete::MetaContact::isOnline | ( | ) | const |
Returns whether this contact can be reached online for at least one FIXME: Make that an enum, because status can be unknown for certain protocols.
| bool Kopete::MetaContact::canAcceptFiles | ( | ) | const |
Returns whether this contact can accept files.
- Returns:
- True if the user is online with a file capable protocol, false otherwise
| OnlineStatus::StatusType Kopete::MetaContact::status | ( | ) | const |
Return a more fine-grained status.
Online means at least one sub-contact is online, away means at least one is away, but nobody is online and offline speaks for itself
Definition at line 480 of file kopetemetacontact.cpp.
| bool Kopete::MetaContact::isReachable | ( | ) | const |
| unsigned long int Kopete::MetaContact::idleTime | ( | ) | const |
return the time in second the contact is idle.
Definition at line 416 of file kopetemetacontact.cpp.
| QString Kopete::MetaContact::addressBookField | ( | Kopete::Plugin * | p, | |
| const QString & | app, | |||
| const QString & | key | |||
| ) | const |
Get or set a field for the KDE address book backend.
Fields not registered during the call to Plugin::addressBookFields() cannot be altered!
- Parameters:
-
p The Plugin by which uses this field app refers to the application id in the libkabc database. This should be a standardized format to make sense in the address book in the first place - if you could use "" as application then probably you should use the plugin data API instead of the address book fields. key The name of the address book field to get or set
- Todo:
- : In the code the requirement that fields are registered first is already lifted, but the API needs some review before we can remove it here too. Probably it requires once more some rewrites to get it working properly :( - Martijn
Definition at line 930 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::setAddressBookField | ( | Kopete::Plugin * | p, | |
| const QString & | app, | |||
| const QString & | key, | |||
| const QString & | value | |||
| ) |
set an address book field
- See also:
- also addressBookField()
- Parameters:
-
p The Plugin by which uses this field app The application ID in the KABC database key The name of the address book field to set value The value of the address book field to set
Definition at line 935 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::sendFile | ( | const KUrl & | sourceURL, | |
| const QString & | altFileName = QString(), |
|||
| unsigned long | fileSize = 0L | |||
| ) | [slot] |
Send a file to this metacontact.
This is the MetaContact level slot for sending files. It may be called through the "Send File" entry in the GUI, or over DCOP. If the function is called through the GUI, no parameters are sent and they assume default values. This slot calls the slotSendFile with identical params of the highest ranked contact capable of sending files (if any)
- Parameters:
-
sourceURL The actual KUrl of the file you are sending altFileName (Optional) An alternate name for the file - what the receiver will see fileSize (Optional) Size of the file being sent. Used when sending a nondeterminate file size (such as over a socket)
Definition at line 527 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::emitAboutToSave | ( | ) | [slot] |
Emit aboutToSave signal to notify plugins that this metaContact is going to be saved.
Definition at line 547 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::aboutToSave | ( | Kopete::MetaContact * | metaContact | ) | [signal] |
This metaContact is going to be saved to the contact list.
Plugins should connect to this signal to update data with setPluginData()
| void Kopete::MetaContact::contactIdleStateChanged | ( | Kopete::Contact * | contact | ) | [signal] |
One of the subcontacts' idle status has changed.
As with online status, this can occur without the metacontact changing idle state
| void Kopete::MetaContact::moveToGroup | ( | Kopete::Group * | from, | |
| Kopete::Group * | to | |||
| ) | [slot] |
| void Kopete::MetaContact::removeFromGroup | ( | Kopete::Group * | from | ) | [slot] |
| void Kopete::MetaContact::addToGroup | ( | Kopete::Group * | to | ) | [slot] |
| void Kopete::MetaContact::setTemporary | ( | bool | b = true, |
|
| Kopete::Group * | group = 0L | |||
| ) | [slot] |
Set if this is a temporary contact.
(see isTemporary)
- Parameters:
-
b if the contact is or not temporary group if the contact was temporary and b is false, then the contact will be moved to this group. if group is null, it will be moved to top-level
Definition at line 986 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::execute | ( | ) | [slot] |
Contact another user.
Depending on the config settings, call sendMessage() or startChat()
returns the Contact that was chosen as the preferred
Definition at line 397 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::sendMessage | ( | ) | [slot] |
Send a single message, classic ICQ style.
The actual sending is done by the Contact, but the meta contact does the GUI side of things. This is a slot to allow being called easily from e.g. a GUI.
returns the Contact that was chosen as the preferred
Definition at line 302 of file kopetemetacontact.cpp.
| Contact * Kopete::MetaContact::startChat | ( | ) | [slot] |
Start a chat in a persistent chat window.
Like sendMessage, but this time a full-blown chat will be opened. Most protocols can't distinguish between the two and are either completely session based like MSN or completely message based like ICQ the only true difference is the GUI shown to the user.
returns the Contact that was chosen as the preferred
Definition at line 320 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::slotAllPluginsLoaded | ( | ) | [slot] |
When all the plugins are loaded, set the Contact Source.
Definition at line 952 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::slotPluginLoaded | ( | Kopete::Plugin * | plugin | ) | [slot] |
If a plugin is loaded, maybe data about this plugin are already cached in the metacontact.
Definition at line 940 of file kopetemetacontact.cpp.
| void Kopete::MetaContact::onlineStatusChanged | ( | Kopete::MetaContact * | contact, | |
| Kopete::OnlineStatus::StatusType | status | |||
| ) | [signal] |
The MetaContact online status changed.
| void Kopete::MetaContact::contactStatusChanged | ( | Kopete::Contact * | contact, | |
| const Kopete::OnlineStatus & | status | |||
| ) | [signal] |
A contact's online status changed.
this signal differs from onlineStatusChanged because a contact can change his status without changing MetaContact status. It is mainly used to update the small icons in the contact list
| void Kopete::MetaContact::displayNameChanged | ( | const QString & | oldName, | |
| const QString & | newName | |||
| ) | [signal] |
The meta contact's display name changed.
| void Kopete::MetaContact::photoChanged | ( | ) | [signal] |
The meta contact's photo changed.
| void Kopete::MetaContact::movedToGroup | ( | Kopete::MetaContact * | contact, | |
| Kopete::Group * | from, | |||
| Kopete::Group * | to | |||
| ) | [signal] |
The contact was moved.
| void Kopete::MetaContact::removedFromGroup | ( | Kopete::MetaContact * | contact, | |
| Kopete::Group * | group | |||
| ) | [signal] |
The contact was removed from group.
| void Kopete::MetaContact::addedToGroup | ( | Kopete::MetaContact * | contact, | |
| Kopete::Group * | to | |||
| ) | [signal] |
The contact was added to another group.
| void Kopete::MetaContact::contactAdded | ( | Kopete::Contact * | c | ) | [signal] |
a contact has been added into this metacontact
This signal is emitted when a contact is added to this metacontact
| void Kopete::MetaContact::contactRemoved | ( | Kopete::Contact * | c | ) | [signal] |
a contact has been removed from this metacontact
This signal is emitted when a contact is removed from this metacontact
| void Kopete::MetaContact::persistentDataChanged | ( | ) | [signal] |
Some part of this object's persistent data (as returned by toXML) has changed.
| QImage Kopete::MetaContact::photoFromCustom | ( | ) | const [protected] |
Definition at line 688 of file kopetemetacontact.cpp.
Property Documentation
QString Kopete::MetaContact::displayName [read, write] |
Definition at line 56 of file kopetemetacontact.h.
QString Kopete::MetaContact::statusString [read] |
Definition at line 57 of file kopetemetacontact.h.
QString Kopete::MetaContact::statusIcon [read] |
Definition at line 58 of file kopetemetacontact.h.
bool Kopete::MetaContact::isOnline [read] |
Definition at line 59 of file kopetemetacontact.h.
bool Kopete::MetaContact::isReachable [read] |
Definition at line 60 of file kopetemetacontact.h.
bool Kopete::MetaContact::isTemporary [read] |
Definition at line 61 of file kopetemetacontact.h.
bool Kopete::MetaContact::canAcceptFiles [read] |
Definition at line 62 of file kopetemetacontact.h.
QString Kopete::MetaContact::metaContactId [read, write] |
Definition at line 64 of file kopetemetacontact.h.
bool Kopete::MetaContact::photoSyncedWithKABC [read, write] |
Definition at line 65 of file kopetemetacontact.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference