kopete/libkopete
#include <kopeteaddedinfoevent.h>
Public Types | |
enum | ShowAction { AddAction = 0x001, AuthorizeAction = 0x002, BlockAction = 0x004, InfoAction = 0x008, AddContactAction = 0x100, AllActions = 0x00F } |
Public Slots | |
virtual void | activate (uint actionId) |
virtual void | sendEvent () |
Public Slots inherited from Kopete::InfoEvent | |
virtual void | activate (uint actionId) |
void | close () |
virtual void | sendEvent () |
Public Member Functions | |
AddedInfoEvent (const QString &contactId, Kopete::Account *account) | |
~AddedInfoEvent () | |
Kopete::Account * | account () const |
MetaContact * | addContact () const |
QString | contactId () const |
void | setContactNickname (const QString &nickname) |
void | showActions (ShowActionOptions actions) |
Public Member Functions inherited from Kopete::InfoEvent | |
InfoEvent (QObject *parent=0) | |
~InfoEvent () | |
QMap< uint, QString > | actions () const |
void | addAction (uint actionId, const QString &actionText) |
QString | additionalText () const |
bool | isClosed () const |
void | setAdditionalText (const QString &text) |
void | setShowOnSend (bool showOnSend) |
void | setText (const QString &text) |
void | setTitle (const QString &title) |
bool | showOnSend () const |
QString | text () const |
QString | title () const |
Additional Inherited Members | |
Signals inherited from Kopete::InfoEvent | |
void | actionActivated (uint actionId) |
void | changed () |
void | eventClosed (Kopete::InfoEvent *event) |
Detailed Description
Event which is shown when a contact added you into the contact list or requested authorization.
This event allows the user to give authorization for the addition to the person who added the user and also allows the user to add the person into the user's contact list.
The title()
and text()
will be filled with predefined text. If you want to add additional information use setAdditionalText()
The actionActivated(uint)
signal can be emitted more than once. All AddedInfoEvent object will be closed and deleted automatically.
example of usage
and in your addedInfoEventActionActivated slot
Definition at line 67 of file kopeteaddedinfoevent.h.
Member Enumeration Documentation
All actions that may be shown and emitted.
Enumerator | |
---|---|
AddAction | |
AuthorizeAction |
Add action was activated. The default implementation shows ContactAddedNotifyDialog if activate(uint) isn't replaced |
BlockAction |
You should authorize the contact. |
InfoAction |
You should block this and future requests. |
AddContactAction |
You should show info about contact. |
AllActions |
You should add contact to Kopete contact list with |
Definition at line 74 of file kopeteaddedinfoevent.h.
Constructor & Destructor Documentation
Kopete::AddedInfoEvent::AddedInfoEvent | ( | const QString & | contactId, |
Kopete::Account * | account | ||
) |
Constructor.
- Parameters
-
contactId the contactId of the contact which has added you account the account which has generated this event
Definition at line 40 of file kopeteaddedinfoevent.cpp.
Kopete::AddedInfoEvent::~AddedInfoEvent | ( | ) |
Definition at line 50 of file kopeteaddedinfoevent.cpp.
Member Function Documentation
Kopete::Account * Kopete::AddedInfoEvent::account | ( | ) | const |
Return the account that has generated this event.
Definition at line 63 of file kopeteaddedinfoevent.cpp.
|
virtualslot |
Activate the action specified action.
Definition at line 78 of file kopeteaddedinfoevent.cpp.
MetaContact * Kopete::AddedInfoEvent::addContact | ( | ) | const |
create a metacontact.
This function only works if the AddContactAction action was activated, otherwise it will return 0L.
it uses the Account::addContact function to add the contact
- Returns
- the new metacontact created, or 0L if the operation failed.
Definition at line 112 of file kopeteaddedinfoevent.cpp.
QString Kopete::AddedInfoEvent::contactId | ( | ) | const |
Return the contactId of a contact which has added you.
Definition at line 58 of file kopeteaddedinfoevent.cpp.
|
virtualslot |
Emit the event.
Definition at line 120 of file kopeteaddedinfoevent.cpp.
void Kopete::AddedInfoEvent::setContactNickname | ( | const QString & | nickname | ) |
Set contact nickname.
- Parameters
-
nickname the nickname of the contact.
Definition at line 73 of file kopeteaddedinfoevent.cpp.
void Kopete::AddedInfoEvent::showActions | ( | ShowActionOptions | actions | ) |
Set which actions should be shown.
- Parameters
-
actions a bitmask of ShowAction used to show specific actions.
- Note
- by default everything is shown.
Definition at line 68 of file kopeteaddedinfoevent.cpp.
The documentation for this class was generated from the following files:
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.