summaryrefslogtreecommitdiffabout
path: root/kabc/distributionlistdialog.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kabc/distributionlistdialog.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kabc/distributionlistdialog.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/distributionlistdialog.h140
1 files changed, 140 insertions, 0 deletions
diff --git a/kabc/distributionlistdialog.h b/kabc/distributionlistdialog.h
new file mode 100644
index 0000000..b6d3c80
--- a/dev/null
+++ b/kabc/distributionlistdialog.h
@@ -0,0 +1,140 @@
1/*
2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef KABC_DISTRIBUTIONLISTDIALOG_H
22#define KABC_DISTRIBUTIONLISTDIALOG_H
23
24#include <qwidget.h>
25
26#include <kdialogbase.h>
27
28class QListView;
29class QLabel;
30class QComboBox;
31class QButtonGroup;
32
33namespace KABC {
34
35class AddressBook;
36class DistributionListEditorWidget;
37class DistributionListManager;
38
39/**
40 @short Frontend to create distribution lists
41
42 Creating a new DistributionListDialog does automatically
43 load all addressees and distribution lists from the config
44 files. The changes will be saved when clicking the 'OK'
45 button.
46
47 Example:
48
49 <pre>
50 KABC::DistributionListDialog *dlg = new
51 KABC::DistributionListDialog( KABC::StdAddressBook::self(), this );
52
53 dlg->exec();
54 </pre>
55*/
56class DistributionListDialog : public KDialogBase
57{
58 Q_OBJECT
59
60 public:
61 /**
62 Constructor.
63
64 @param ab The addressbook, the addressees should be used from
65 @param parent The parent widget
66 */
67 DistributionListDialog( AddressBook *ab, QWidget *parent );
68
69 /**
70 Destructor.
71 */
72 virtual ~DistributionListDialog();
73
74 private:
75 DistributionListEditorWidget *mEditor;
76
77 struct Data;
78 Data *d;
79};
80
81/**
82 @short Helper class
83*/
84class EmailSelector : public KDialogBase
85{
86 public:
87 EmailSelector( const QStringList &emails, const QString &current,
88 QWidget *parent );
89
90 QString selected();
91
92 static QString getEmail( const QStringList &emails, const QString &current,
93 QWidget *parent );
94
95 private:
96 QButtonGroup *mButtonGroup;
97};
98
99/**
100 @short Helper class
101*/
102class DistributionListEditorWidget : public QWidget
103{
104 Q_OBJECT
105
106 public:
107 DistributionListEditorWidget( AddressBook *, QWidget *parent );
108 virtual ~DistributionListEditorWidget();
109
110 private slots:
111 void newList();
112 void editList();
113 void removeList();
114 void addEntry();
115 void removeEntry();
116 void changeEmail();
117 void updateEntryView();
118 void updateAddresseeView();
119 void updateNameCombo();
120 void slotSelectionEntryViewChanged();
121 void slotSelectionAddresseeViewChanged();
122 void save();
123
124 private:
125 QComboBox *mNameCombo;
126 QLabel *mListLabel;
127 QListView *mEntryView;
128 QListView *mAddresseeView;
129
130 AddressBook *mAddressBook;
131 DistributionListManager *mManager;
132 QPushButton *mNewButton, *mEditButton, *mRemoveButton;
133 QPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton;
134
135 struct Data;
136 Data *d;
137};
138
139}
140#endif