• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 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#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
31class KLineEdit;
32
33class QButtonGroup;
34class QCheckBox;
35class QScrollArea;
36class QSignalMapper;
37class QVBoxLayout;
38
42class PhoneTypeCombo : public KComboBox
43{
44 Q_OBJECT
45
46public:
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
69private Q_SLOTS:
70 void selected(int);
71 void otherSelected();
72
73private:
74 void update();
75
76 KABC::PhoneNumber::Type mType;
77 int mLastSelected;
78 QList<int> mTypeList;
79};
80
85class PhoneNumberWidget : public QWidget
86{
87 Q_OBJECT
88
89public:
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
112Q_SIGNALS:
113 void modified();
114
115private:
116 PhoneTypeCombo *mTypeCombo;
117 KLineEdit *mNumberEdit;
118 KABC::PhoneNumber mNumber;
119};
120
124class PhoneNumberListWidget : public QWidget
125{
126 Q_OBJECT
127
128public:
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
161public Q_SLOTS:
165 void add();
166
170 void remove();
171
172private Q_SLOTS:
173 void changed(int);
174
175private:
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
190class PhoneEditWidget : public QWidget
191{
192 Q_OBJECT
193
194public:
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
222private Q_SLOTS:
223 void changed();
224
225private:
226 QPushButton *mAddButton;
227 QPushButton *mRemoveButton;
228
229 bool mReadOnly;
230
231 QScrollArea *mListScrollArea;
232 PhoneNumberListWidget *mPhoneNumberListWidget;
233};
234
238class PhoneTypeDialog : public KDialog
239{
240public:
247 explicit PhoneTypeDialog(KABC::PhoneNumber::Type type, QWidget *parent = 0);
248
252 KABC::PhoneNumber::Type type() const;
253
254private:
255 KABC::PhoneNumber::Type mType;
256 KABC::PhoneNumber::TypeList mTypeList;
257
258 QButtonGroup *mGroup;
259 QCheckBox *mPreferredBox;
260};
261
262#endif
PhoneEditWidget
A widget for editing phone numbers of a contact.
Definition: phoneeditwidget.h:191
PhoneEditWidget::~PhoneEditWidget
~PhoneEditWidget()
Destroys the phone edit widget.
Definition: phoneeditwidget.cpp:308
PhoneEditWidget::loadContact
void loadContact(const KABC::Addressee &contact)
Loads the data from contact to the widget.
Definition: phoneeditwidget.cpp:326
PhoneEditWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:312
PhoneEditWidget::storeContact
void storeContact(KABC::Addressee &contact) const
Stores the data from the widget to the contact.
Definition: phoneeditwidget.cpp:332
PhoneNumberListWidget
A widgets that groups together a list of PhoneNumberWidgets.
Definition: phoneeditwidget.h:125
PhoneNumberListWidget::add
void add()
Adds a new phone number widget to this widget.
Definition: phoneeditwidget.cpp:230
PhoneNumberListWidget::phoneNumbers
KABC::PhoneNumber::List phoneNumbers() const
Returns the list of phone numbers.
Definition: phoneeditwidget.cpp:216
PhoneNumberListWidget::~PhoneNumberListWidget
~PhoneNumberListWidget()
Destroys the phone number list widget.
Definition: phoneeditwidget.cpp:179
PhoneNumberListWidget::setPhoneNumbers
void setPhoneNumbers(const KABC::PhoneNumber::List &list)
Sets the list of phone numbers the widget shall show.
Definition: phoneeditwidget.cpp:197
PhoneNumberListWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:183
PhoneNumberListWidget::remove
void remove()
Removes the last phone number widget from this widget.
Definition: phoneeditwidget.cpp:237
PhoneNumberListWidget::phoneNumberCount
int phoneNumberCount() const
Returns the number of phone numbers available.
Definition: phoneeditwidget.cpp:192
PhoneNumberWidget
A widget that provides selectors for the type and number of a phone number entry.
Definition: phoneeditwidget.h:86
PhoneNumberWidget::number
KABC::PhoneNumber number() const
Returns the phone number of the widget.
Definition: phoneeditwidget.cpp:151
PhoneNumberWidget::setReadOnly
void setReadOnly(bool readOnly)
Sets the widget to readOnly mode.
Definition: phoneeditwidget.cpp:161
PhoneNumberWidget::setNumber
void setNumber(const KABC::PhoneNumber &number)
Sets the phone number of the widget.
Definition: phoneeditwidget.cpp:140
PhoneTypeCombo
A combobox to select a phone number type.
Definition: phoneeditwidget.h:43
PhoneTypeCombo::setType
void setType(KABC::PhoneNumber::Type type)
Sets the phone number type that shall be selected.
Definition: phoneeditwidget.cpp:65
PhoneTypeCombo::type
KABC::PhoneNumber::Type type() const
Returns the selected phone number type.
Definition: phoneeditwidget.cpp:75
PhoneTypeCombo::~PhoneTypeCombo
~PhoneTypeCombo()
Destroys the phone type combo.
Definition: phoneeditwidget.cpp:61
PhoneTypeDialog
A dialog for editing phone number types.
Definition: phoneeditwidget.h:239
PhoneTypeDialog::type
KABC::PhoneNumber::Type type() const
Returns the selected type.
Definition: phoneeditwidget.cpp:396
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.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.14.10 API Reference

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