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

kopete/libkopete

Kopete::UI::ContactAddedNotifyDialog

Kopete::UI::ContactAddedNotifyDialog Class Reference

#include <contactaddednotifydialog.h>

Inheritance diagram for Kopete::UI::ContactAddedNotifyDialog:

Inheritance graph
[legend]

List of all members.


Detailed Description

Dialog which is shown when a contact added you in the contact list.

This dialog asks the user to give authorization for the addition to the person who added the user and also asks the user if the contact who you've received the notification for should be added to the user's contact list

example of usage

    Kopete::UI::ContactAddedNotifyDialog *dialog =
            new ContactAddedNotifyDialog(contactId, QString::null,account); //krazy:exclude=nullstrassign for old broken gcc
    QObject::connect(dialog,SIGNAL(applyClicked(const QString&)),this,SLOT(contactAddedDialogApplied()));
    QObject::connect(dialog,SIGNAL(infoClicked(const QString&)),this,SLOT(contactAddedDialogInfo()));
    dialog->show();

and in your contactAddedDialogApplied slot

    const Kopete::UI::ContactAddedNotifyDialog *dialog =
            dynamic_cast<const Kopete::UI::ContactAddedNotifyDialog *>(sender());
    if(!dialog)
        return;
    if(dialog->authorized())
        socket->authorize(contactId);
    if(dialog->added())
        dialog->addContact();

Note that you can also use exec() but this is not recommended

Author:
Olivier Goffart

Definition at line 69 of file contactaddednotifydialog.h.


Public Types

enum  HideWidget {
  DefaultHide = 0x00, InfoButton = 0x01, AuthorizeCheckBox = 0x02, AddCheckBox = 0x04,
  AddGroupBox = 0x08
}

Public Slots

MetaContact * addContact () const

Signals

void applyClicked (const QString &contactId)
void infoClicked (const QString &contactId)

Public Member Functions

 ContactAddedNotifyDialog (const QString &contactId, const QString &contactNick=QString::null, Kopete::Account *account=0L, const HideWidgetOptions &hide=DefaultHide)
 ~ContactAddedNotifyDialog ()
bool authorized () const
bool added () const
QString displayName () const
Group * group () const

Member Enumeration Documentation

enum Kopete::UI::ContactAddedNotifyDialog::HideWidget

All widget in the dialog that may be hidden.

Enumerator:
DefaultHide  Internal default.
InfoButton  the button which ask for more info about the contact
AuthorizeCheckBox  the checkbox which ask for authorize the contact
AddCheckBox  the checkbox which ask if the contact should be added
AddGroupBox  all the widget about metacontact properties

Definition at line 76 of file contactaddednotifydialog.h.


Constructor & Destructor Documentation

Kopete::UI::ContactAddedNotifyDialog::ContactAddedNotifyDialog ( const QString &  contactId,
const QString &  contactNick = QString::null,
Kopete::Account *  account = 0L,
const HideWidgetOptions &  hide = DefaultHide 
) [explicit]

Constructor.

The dialog is by default not modal, and will delete itself when closed

Parameters:
contactId the contactId of the contact which just added the user
contactNick the nickname of the contact if available.
account is used to display the account icon and informaiton about the account
hide a bitmask of HideWidget used to hide some widget. By default, everything is shown.

Definition at line 54 of file contactaddednotifydialog.cpp.

Kopete::UI::ContactAddedNotifyDialog::~ContactAddedNotifyDialog (  ) 

Destructor.

Definition at line 111 of file contactaddednotifydialog.cpp.


Member Function Documentation

bool Kopete::UI::ContactAddedNotifyDialog::authorized (  )  const

return if the user has checked the "authorize" checkbox

Returns:
true if the authorize checkbox is checked, false otherwise

Definition at line 122 of file contactaddednotifydialog.cpp.

bool Kopete::UI::ContactAddedNotifyDialog::added (  )  const

return if the user has checked the "add" checkbox

Returns:
true if the add checkbox is checked, false otherwise

Definition at line 117 of file contactaddednotifydialog.cpp.

QString Kopete::UI::ContactAddedNotifyDialog::displayName (  )  const

return the display name the user has entered

Definition at line 127 of file contactaddednotifydialog.cpp.

Group * Kopete::UI::ContactAddedNotifyDialog::group (  )  const

return the group the user has selected

If the user has entered a group which doesn't exist yet, it will be created now

Definition at line 132 of file contactaddednotifydialog.cpp.

MetaContact * Kopete::UI::ContactAddedNotifyDialog::addContact (  )  const [slot]

create a metacontact.

This function only works if the add checkbox is checked, 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 141 of file contactaddednotifydialog.cpp.

void Kopete::UI::ContactAddedNotifyDialog::applyClicked ( const QString &  contactId  )  [signal]

the dialog has been applied

Parameters:
contactId is the id of the contact passed in the constructor.

void Kopete::UI::ContactAddedNotifyDialog::infoClicked ( const QString &  contactId  )  [signal]

the button "info" has been pressed If you haven't hidden the more info button, you should connect this signal to a slot which show a dialog with more info about the contact.

hint: you can use sender() as parent of the new dialog

Parameters:
contactId is the id of the contact passed in the constructor.


The documentation for this class was generated from the following files:
  • contactaddednotifydialog.h
  • contactaddednotifydialog.cpp

kopete/libkopete

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal