1.1.46
by Alessandro Ghersi
Import upstream version 4.3.80 |
1 |
/*
|
2 |
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
|
|
3 |
||
4 |
This library is free software; you can redistribute it and/or modify it
|
|
5 |
under the terms of the GNU Library General Public License as published by
|
|
6 |
the Free Software Foundation; either version 2 of the License, or (at your
|
|
7 |
option) any later version.
|
|
8 |
||
9 |
This library is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
|
|
12 |
License for more details.
|
|
13 |
||
14 |
You should have received a copy of the GNU Library General Public License
|
|
15 |
along with this library; see the file COPYING.LIB. If not, write to the
|
|
16 |
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
17 |
02110-1301, USA.
|
|
18 |
*/
|
|
19 |
||
20 |
#ifndef CONTACTSELECTIONWIDGET_H
|
|
21 |
#define CONTACTSELECTIONWIDGET_H
|
|
22 |
||
23 |
#include <QtGui/QWidget> |
|
24 |
||
25 |
#include <kabc/addressee.h> |
|
26 |
||
27 |
class QCheckBox; |
|
28 |
class QItemSelectionModel; |
|
29 |
class QLabel; |
|
30 |
class QRadioButton; |
|
31 |
||
32 |
||
33 |
namespace Akonadi |
|
34 |
{
|
|
35 |
class Collection; |
|
36 |
class CollectionComboBox; |
|
37 |
}
|
|
38 |
||
39 |
/**
|
|
40 |
* @short A widget to select a group of contacts.
|
|
41 |
*
|
|
42 |
* @author Tobias Koenig <tokoe@kde.org>
|
|
43 |
*/
|
|
44 |
class ContactSelectionWidget : public QWidget |
|
45 |
{
|
|
46 |
Q_OBJECT
|
|
47 |
||
48 |
public: |
|
49 |
/**
|
|
50 |
* Creates a new contact selection widget.
|
|
51 |
*
|
|
52 |
* @param selectionModel The model that contains the currently selected contacts.
|
|
53 |
* @param parent The parent widget.
|
|
54 |
*/
|
|
0.2.13
by Philip Muškovac
Import upstream version 4.7.0 |
55 |
ContactSelectionWidget( QItemSelectionModel *selectionModel, QWidget *parent = 0 ); |
1.1.46
by Alessandro Ghersi
Import upstream version 4.3.80 |
56 |
|
57 |
/**
|
|
58 |
* Sets the @p message text.
|
|
59 |
*/
|
|
60 |
void setMessageText( const QString &message ); |
|
61 |
||
62 |
/**
|
|
63 |
* Sets the default addressbook.
|
|
64 |
*/
|
|
65 |
void setDefaultAddressBook( const Akonadi::Collection &addressBook ); |
|
66 |
||
67 |
/**
|
|
68 |
* Returns the list of selected contacts.
|
|
69 |
*/
|
|
70 |
KABC::Addressee::List selectedContacts() const; |
|
71 |
||
72 |
private: |
|
73 |
void initGui(); |
|
74 |
||
75 |
KABC::Addressee::List collectAllContacts() const; |
|
76 |
KABC::Addressee::List collectSelectedContacts() const; |
|
77 |
KABC::Addressee::List collectAddressBookContacts() const; |
|
78 |
||
79 |
QItemSelectionModel *mSelectionModel; |
|
80 |
||
81 |
QLabel *mMessageLabel; |
|
82 |
QRadioButton *mAllContactsButton; |
|
83 |
QRadioButton *mSelectedContactsButton; |
|
84 |
QRadioButton *mAddressBookContactsButton; |
|
85 |
Akonadi::CollectionComboBox *mAddressBookSelection; |
|
86 |
QCheckBox *mAddressBookSelectionRecursive; |
|
87 |
};
|
|
88 |
||
89 |
#endif
|