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

akonadi/contact

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
  • contact
  • editor
phoneeditwidget.h
1 /*
2  This file is part of Akonadi Contact.
3 
4  Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 #ifndef PHONEEDITWIDGET_H
23 #define PHONEEDITWIDGET_H
24 
25 #include <QtCore/QList>
26 
27 #include <kabc/addressee.h>
28 #include <kcombobox.h>
29 #include <kdialog.h>
30 
31 class KLineEdit;
32 
33 class QButtonGroup;
34 class QCheckBox;
35 class QScrollArea;
36 class QSignalMapper;
37 class QVBoxLayout;
38 
42 class PhoneTypeCombo : public KComboBox
43 {
44  Q_OBJECT
45 
46 public:
52  explicit PhoneTypeCombo(QWidget *parent = 0);
53 
57  ~PhoneTypeCombo();
58 
62  void setType(KABC::PhoneNumber::Type type);
63 
67  KABC::PhoneNumber::Type type() const;
68 
69 private Q_SLOTS:
70  void selected(int);
71  void otherSelected();
72 
73 private:
74  void update();
75 
76  KABC::PhoneNumber::Type mType;
77  int mLastSelected;
78  QList<int> mTypeList;
79 };
80 
85 class PhoneNumberWidget : public QWidget
86 {
87  Q_OBJECT
88 
89 public:
95  explicit PhoneNumberWidget(QWidget *parent = 0);
96 
100  void setNumber(const KABC::PhoneNumber &number);
101 
105  KABC::PhoneNumber number() const;
106 
110  void setReadOnly(bool readOnly);
111 
112 Q_SIGNALS:
113  void modified();
114 
115 private:
116  PhoneTypeCombo *mTypeCombo;
117  KLineEdit *mNumberEdit;
118  KABC::PhoneNumber mNumber;
119 };
120 
124 class PhoneNumberListWidget : public QWidget
125 {
126  Q_OBJECT
127 
128 public:
134  explicit PhoneNumberListWidget(QWidget *parent = 0);
135 
139  ~PhoneNumberListWidget();
140 
144  void setPhoneNumbers(const KABC::PhoneNumber::List &list);
145 
149  KABC::PhoneNumber::List phoneNumbers() const;
150 
154  void setReadOnly(bool readOnly);
155 
159  int phoneNumberCount() const;
160 
161 public Q_SLOTS:
165  void add();
166 
170  void remove();
171 
172 private Q_SLOTS:
173  void changed(int);
174 
175 private:
176  void recreateNumberWidgets();
177 
178  KABC::PhoneNumber::List mPhoneNumberList;
179  QList<PhoneNumberWidget *> mWidgets;
180 
181  QVBoxLayout *mWidgetLayout;
182 
183  bool mReadOnly;
184  QSignalMapper *mMapper;
185 };
186 
190 class PhoneEditWidget : public QWidget
191 {
192  Q_OBJECT
193 
194 public:
200  explicit PhoneEditWidget(QWidget *parent = 0);
201 
205  ~PhoneEditWidget();
206 
210  void loadContact(const KABC::Addressee &contact);
211 
215  void storeContact(KABC::Addressee &contact) const;
216 
220  void setReadOnly(bool readOnly);
221 
222 private Q_SLOTS:
223  void changed();
224 
225 private:
226  QPushButton *mAddButton;
227  QPushButton *mRemoveButton;
228 
229  bool mReadOnly;
230 
231  QScrollArea *mListScrollArea;
232  PhoneNumberListWidget *mPhoneNumberListWidget;
233 };
234 
238 class PhoneTypeDialog : public KDialog
239 {
240 public:
247  explicit PhoneTypeDialog(KABC::PhoneNumber::Type type, QWidget *parent = 0);
248 
252  KABC::PhoneNumber::Type type() const;
253 
254 private:
255  KABC::PhoneNumber::Type mType;
256  KABC::PhoneNumber::TypeList mTypeList;
257 
258  QButtonGroup *mGroup;
259  QCheckBox *mPreferredBox;
260 };
261 
262 #endif
PhoneTypeDialog::PhoneTypeDialog
PhoneTypeDialog(KABC::PhoneNumber::Type type, QWidget *parent=0)
Creates a new phone type dialog.
Definition: phoneeditwidget.cpp:347
QWidget
PhoneNumberListWidget::~PhoneNumberListWidget
~PhoneNumberListWidget()
Destroys the phone number list widget.
Definition: phoneeditwidget.cpp:179
PhoneNumberWidget::number
KABC::PhoneNumber number() const
Returns the phone number of the widget.
Definition: phoneeditwidget.cpp:151
PhoneNumberWidget
A widget that provides selectors for the type and number of a phone number entry. ...
Definition: phoneeditwidget.h:85
PhoneNumberListWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:183
PhoneNumberWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:161
PhoneNumberListWidget::PhoneNumberListWidget
PhoneNumberListWidget(QWidget *parent=0)
Creates a new phone number list widget.
Definition: phoneeditwidget.cpp:167
PhoneEditWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:312
PhoneTypeDialog
A dialog for editing phone number types.
Definition: phoneeditwidget.h:238
PhoneEditWidget::storeContact
void storeContact(KABC::Addressee &contact) const
Stores the data from the widget to the contact.
Definition: phoneeditwidget.cpp:332
QButtonGroup
PhoneNumberListWidget::phoneNumberCount
int phoneNumberCount() const
Returns the number of phone numbers available.
Definition: phoneeditwidget.cpp:192
PhoneTypeCombo
A combobox to select a phone number type.
Definition: phoneeditwidget.h:42
QCheckBox
PhoneTypeCombo::~PhoneTypeCombo
~PhoneTypeCombo()
Destroys the phone type combo.
Definition: phoneeditwidget.cpp:61
QVBoxLayout
PhoneEditWidget
A widget for editing phone numbers of a contact.
Definition: phoneeditwidget.h:190
QList< int >
PhoneEditWidget::PhoneEditWidget
PhoneEditWidget(QWidget *parent=0)
Creates a new phone edit widget.
Definition: phoneeditwidget.cpp:276
PhoneEditWidget::loadContact
void loadContact(const KABC::Addressee &contact)
Loads the data from contact to the widget.
Definition: phoneeditwidget.cpp:326
PhoneNumberListWidget::phoneNumbers
KABC::PhoneNumber::List phoneNumbers() const
Returns the list of phone numbers.
Definition: phoneeditwidget.cpp:216
PhoneTypeDialog::type
KABC::PhoneNumber::Type type() const
Returns the selected type.
Definition: phoneeditwidget.cpp:396
PhoneTypeCombo::PhoneTypeCombo
PhoneTypeCombo(QWidget *parent=0)
Creates a phone type combo.
Definition: phoneeditwidget.cpp:44
PhoneTypeCombo::setType
void setType(KABC::PhoneNumber::Type type)
Sets the phone number type that shall be selected.
Definition: phoneeditwidget.cpp:65
PhoneNumberWidget::setNumber
void setNumber(const KABC::PhoneNumber &number)
Sets the phone number of the widget.
Definition: phoneeditwidget.cpp:140
PhoneNumberListWidget::add
void add()
Adds a new phone number widget to this widget.
Definition: phoneeditwidget.cpp:230
PhoneNumberWidget::PhoneNumberWidget
PhoneNumberWidget(QWidget *parent=0)
Creates a new phone number widget.
Definition: phoneeditwidget.cpp:120
PhoneNumberListWidget::setPhoneNumbers
void setPhoneNumbers(const KABC::PhoneNumber::List &list)
Sets the list of phone numbers the widget shall show.
Definition: phoneeditwidget.cpp:197
PhoneTypeCombo::type
KABC::PhoneNumber::Type type() const
Returns the selected phone number type.
Definition: phoneeditwidget.cpp:75
PhoneEditWidget::~PhoneEditWidget
~PhoneEditWidget()
Destroys the phone edit widget.
Definition: phoneeditwidget.cpp:308
QPushButton
PhoneNumberListWidget
A widgets that groups together a list of PhoneNumberWidgets.
Definition: phoneeditwidget.h:124
QScrollArea
QObject::parent
QObject * parent() const
QSignalMapper
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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