kopete/libkopete
Kopete::AddedInfoEvent Class Reference
#include <kopeteaddedinfoevent.h>

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
Kopete::AddedInfoEvent* event = new Kopete::AddedInfoEvent( contactId, account ); QObject::connect( event, SIGNAL(actionActivated(uint)), this, SLOT(addedInfoEventActionActivated(uint)) ); event->sendEvent();
and in your addedInfoEventActionActivated slot
Kopete::AddedInfoEvent *event = dynamic_cast<Kopete::AddedInfoEvent *>(sender()); if ( !event ) return; switch ( actionId ) { case Kopete::AddedInfoEvent::AddContactAction: event->addContact(); break; case Kopete::AddedInfoEvent::AuthorizeAction: socket->authorize( event->contactId() ); break; case Kopete::AddedInfoEvent::InfoAction: showInfo(); break; }
Definition at line 67 of file 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 Member Functions | |
| Kopete::Account * | account () const |
| MetaContact * | addContact () const |
| AddedInfoEvent (const QString &contactId, Kopete::Account *account) | |
| QString | contactId () const |
| void | setContactNickname (const QString &nickname) |
| void | showActions (ShowActionOptions actions) |
| ~AddedInfoEvent () | |
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 addContact()this is only emitted if activate(uint) isn't replaced.
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.
| void Kopete::AddedInfoEvent::activate | ( | uint | actionId | ) | [virtual, slot] |
Activate the action specified action.
Reimplemented from Kopete::InfoEvent.
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 111 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.
| void Kopete::AddedInfoEvent::sendEvent | ( | ) | [virtual, slot] |
Emit the event.
Reimplemented from Kopete::InfoEvent.
Definition at line 119 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:
KDE 4.2 API Reference