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

kopete/libkopete

  • Kopete
  • UI
  • ContactAddedNotifyDialog
Public Types | Public Slots | Signals | Public Member Functions | List of all members
Kopete::UI::ContactAddedNotifyDialog Class Reference

#include <contactaddednotifydialog.h>

Inheritance diagram for Kopete::UI::ContactAddedNotifyDialog:
Inheritance graph
[legend]

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 added () const
 
bool authorized () const
 
QString displayName () const
 
Group * group () const
 

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.

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
contactIdthe contactId of the contact which just added the user
contactNickthe nickname of the contact if available.
accountis used to display the account icon and informaiton about the account
hidea 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 110 of file contactaddednotifydialog.cpp.

Member Function Documentation

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 140 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 116 of file contactaddednotifydialog.cpp.

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

the dialog has been applied

Parameters
contactIdis the id of the contact passed in the constructor.
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 121 of file contactaddednotifydialog.cpp.

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

return the display name the user has entered

Definition at line 126 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 131 of file contactaddednotifydialog.cpp.

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
contactIdis the id of the contact passed in the constructor.

The documentation for this class was generated from the following files:
  • contactaddednotifydialog.h
  • contactaddednotifydialog.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