• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/libkopete

  • Kopete
  • AddedInfoEvent
Public Types | Public Slots | Public Member Functions | List of all members
Kopete::AddedInfoEvent Class Reference

#include <kopeteaddedinfoevent.h>

Inheritance diagram for Kopete::AddedInfoEvent:
Inheritance graph
[legend]

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

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;
}
Author
Roman Jarosz kedge.nosp@m.dev@.nosp@m.centr.nosp@m.um.c.nosp@m.z

Definition at line 67 of file kopeteaddedinfoevent.h.

Member Enumeration Documentation

enum Kopete::AddedInfoEvent::ShowAction

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
contactIdthe contactId of the contact which has added you
accountthe 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)
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.

void Kopete::AddedInfoEvent::sendEvent ( )
virtualslot

Emit the event.

Definition at line 120 of file kopeteaddedinfoevent.cpp.

void Kopete::AddedInfoEvent::setContactNickname ( const QString &  nickname)

Set contact nickname.

Parameters
nicknamethe 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
actionsa 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:
  • kopeteaddedinfoevent.h
  • kopeteaddedinfoevent.cpp
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

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal