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

akonadi/contact

  • 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  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  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  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
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:28:43 by doxygen 1.8.3.1 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-4.10.5 API Reference

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