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

akonadi

  • 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 
23 #ifndef PHONEEDITWIDGET_H
24 #define PHONEEDITWIDGET_H
25 
26 #include <QtCore/QList>
27 
28 #include <kabc/addressee.h>
29 #include <kcombobox.h>
30 #include <kdialog.h>
31 
32 class KLineEdit;
33 
34 class QButtonGroup;
35 class QCheckBox;
36 class QScrollArea;
37 class QSignalMapper;
38 class QVBoxLayout;
39 
43 class PhoneTypeCombo : public KComboBox
44 {
45  Q_OBJECT
46 
47  public:
53  explicit PhoneTypeCombo( QWidget *parent = 0 );
54 
58  ~PhoneTypeCombo();
59 
63  void setType( KABC::PhoneNumber::Type type );
64 
68  KABC::PhoneNumber::Type type() const;
69 
70  private Q_SLOTS:
71  void selected( int );
72  void otherSelected();
73 
74  private:
75  void update();
76 
77  KABC::PhoneNumber::Type mType;
78  int mLastSelected;
79  QList<int> mTypeList;
80 };
81 
86 class PhoneNumberWidget : public QWidget
87 {
88  Q_OBJECT
89 
90  public:
96  explicit PhoneNumberWidget( QWidget *parent = 0 );
97 
101  void setNumber( const KABC::PhoneNumber &number );
102 
106  KABC::PhoneNumber number() const;
107 
111  void setReadOnly( bool readOnly );
112 
113  Q_SIGNALS:
114  void modified();
115 
116  private:
117  PhoneTypeCombo *mTypeCombo;
118  KLineEdit *mNumberEdit;
119  KABC::PhoneNumber mNumber;
120 };
121 
125 class PhoneNumberListWidget : public QWidget
126 {
127  Q_OBJECT
128 
129  public:
135  explicit PhoneNumberListWidget( QWidget *parent = 0 );
136 
140  ~PhoneNumberListWidget();
141 
145  void setPhoneNumbers( const KABC::PhoneNumber::List &list );
146 
150  KABC::PhoneNumber::List phoneNumbers() const;
151 
155  void setReadOnly( bool readOnly );
156 
160  int phoneNumberCount() const;
161 
162  public Q_SLOTS:
166  void add();
167 
171  void remove();
172 
173  private Q_SLOTS:
174  void changed( int );
175 
176  private:
177  void recreateNumberWidgets();
178 
179  KABC::PhoneNumber::List mPhoneNumberList;
180  QList<PhoneNumberWidget*> mWidgets;
181 
182  QVBoxLayout *mWidgetLayout;
183 
184  bool mReadOnly;
185  QSignalMapper *mMapper;
186 };
187 
191 class PhoneEditWidget : public QWidget
192 {
193  Q_OBJECT
194 
195  public:
201  explicit PhoneEditWidget( QWidget *parent = 0 );
202 
206  ~PhoneEditWidget();
207 
211  void loadContact( const KABC::Addressee &contact );
212 
216  void storeContact( KABC::Addressee &contact ) const;
217 
221  void setReadOnly( bool readOnly );
222 
223  private Q_SLOTS:
224  void changed();
225 
226  private:
227  QPushButton *mAddButton;
228  QPushButton *mRemoveButton;
229 
230  bool mReadOnly;
231 
232  QScrollArea *mListScrollArea;
233  PhoneNumberListWidget *mPhoneNumberListWidget;
234 };
235 
239 class PhoneTypeDialog : public KDialog
240 {
241  public:
248  explicit PhoneTypeDialog( KABC::PhoneNumber::Type type, QWidget *parent = 0 );
249 
253  KABC::PhoneNumber::Type type() const;
254 
255  private:
256  KABC::PhoneNumber::Type mType;
257  KABC::PhoneNumber::TypeList mTypeList;
258 
259  QButtonGroup *mGroup;
260  QCheckBox *mPreferredBox;
261 };
262 
263 #endif
PhoneTypeDialog::PhoneTypeDialog
PhoneTypeDialog(KABC::PhoneNumber::Type type, QWidget *parent=0)
Creates a new phone type dialog.
Definition: phoneeditwidget.cpp:344
PhoneNumberListWidget::~PhoneNumberListWidget
~PhoneNumberListWidget()
Destroys the phone number list widget.
Definition: phoneeditwidget.cpp:177
PhoneNumberWidget::number
KABC::PhoneNumber number() const
Returns the phone number of the widget.
Definition: phoneeditwidget.cpp:150
PhoneNumberWidget
A widget that provides selectors for the type and number of a phone number entry. ...
Definition: phoneeditwidget.h:86
PhoneNumberListWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:181
PhoneNumberWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:160
PhoneNumberListWidget::PhoneNumberListWidget
PhoneNumberListWidget(QWidget *parent=0)
Creates a new phone number list widget.
Definition: phoneeditwidget.cpp:166
PhoneEditWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:309
PhoneTypeDialog
A dialog for editing phone number types.
Definition: phoneeditwidget.h:239
PhoneEditWidget::storeContact
void storeContact(KABC::Addressee &contact) const
Stores the data from the widget to the contact.
Definition: phoneeditwidget.cpp:329
PhoneNumberListWidget::phoneNumberCount
int phoneNumberCount() const
Returns the number of phone numbers available.
Definition: phoneeditwidget.cpp:190
PhoneTypeCombo
A combobox to select a phone number type.
Definition: phoneeditwidget.h:43
PhoneTypeCombo::~PhoneTypeCombo
~PhoneTypeCombo()
Destroys the phone type combo.
Definition: phoneeditwidget.cpp:61
PhoneEditWidget
A widget for editing phone numbers of a contact.
Definition: phoneeditwidget.h:191
PhoneEditWidget::PhoneEditWidget
PhoneEditWidget(QWidget *parent=0)
Creates a new phone edit widget.
Definition: phoneeditwidget.cpp:274
PhoneEditWidget::loadContact
void loadContact(const KABC::Addressee &contact)
Loads the data from contact to the widget.
Definition: phoneeditwidget.cpp:323
PhoneNumberListWidget::phoneNumbers
KABC::PhoneNumber::List phoneNumbers() const
Returns the list of phone numbers.
Definition: phoneeditwidget.cpp:214
PhoneTypeDialog::type
KABC::PhoneNumber::Type type() const
Returns the selected type.
Definition: phoneeditwidget.cpp:393
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:139
PhoneNumberListWidget::add
void add()
Adds a new phone number widget to this widget.
Definition: phoneeditwidget.cpp:228
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:195
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:305
PhoneNumberListWidget
A widgets that groups together a list of PhoneNumberWidgets.
Definition: phoneeditwidget.h:125
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:18 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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
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