• 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
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Signals inherited from Kopete::InfoEvent
void actionActivated (uint actionId)
 
void changed ()
 
void eventClosed (Kopete::InfoEvent *event)
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 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