summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/ui/addressbookselectordialog.h
blob: db676a3ce5594b51209b36024889cbc42db2affe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
    AddressBookSelectorDialog
    Nice Dialog to select a KDE AddressBook contact

    Copyright (c) 2005 by Duncan Mac-Vicar Prett <[email protected]>

    Kopete    (c) 2002-2005 by the Kopete developers  <[email protected]>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef ADDRESSBOOKSELECTORDIALOG_H
#define ADDRESSBOOKSELECTORDIALOG_H

#include <kdemacros.h>
#include "kopete_export.h"
#include <kdialogbase.h>

namespace KABC
{
		class AddressBook;
		class Addressee;
}

namespace Kopete
{
namespace UI
{

class AddressBookSelectorWidget;

/**
 * A dialog that uses AddressBookSelectorWidget to allow the user
 * to select a KDE addressbook contact. If you want to use special features
 * you can use @see addressBookSelectorWidget() to get the pointer to the 
 * AddressBookSelectorWidget object and set the desired options there.
 *
 * @author Duncan Mac-Vicar Prett <[email protected]>
 */
class KOPETE_EXPORT AddressBookSelectorDialog : public KDialogBase
{
	Q_OBJECT
  TQ_OBJECT
public:
   /**
	* The constructor of an empty AddressBookSelectorWidget
	*/
	AddressBookSelectorDialog( const TQString &title, const TQString &message, const TQString &preSelectUid, TQWidget *tqparent=0L, const char *name=0L, bool modal = false );
   /**
	* The destructor of the dialog
	*/
	~AddressBookSelectorDialog();

   /**
	* @returns the AddressBookSelectorWidget widget so that additional
	* parameters can be set by using it.
	*/
	AddressBookSelectorWidget *addressBookSelectorWidget() const
	{ return m_addressBookSelectorWidget; };

   /**
	* Creates a modal dialog, lets the user to select a addressbook contact
	* and returns when the dialog is closed.
	*
	* @returns the selected contact, or a null addressee if the user 
	* pressed the Cancel button. Optionally
	*/
	static KABC::Addressee getAddressee( const TQString &title, const TQString &message, const TQString &preSelectUid, TQWidget *tqparent = 0L );

protected slots:
	virtual void accept();
	virtual void reject();
	void slotWidgetAddresseeListClicked( TQListViewItem *addressee );
protected:
	 AddressBookSelectorWidget *m_addressBookSelectorWidget;
};

} // namespace UI
} // namespace Kopete

#endif

// vim: set noet ts=4 sts=4 sw=4: