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

akonadi

  • akonadi
  • contact
  • editor
addresseditwidget.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 ADDRESSEDITWIDGET_H
23#define ADDRESSEDITWIDGET_H
24
25#include <QWidget>
26
27#include <kabc/address.h>
28#include <kabc/addressee.h>
29#include <kcombobox.h>
30#include <kdialog.h>
31
32class QCheckBox;
33class QLabel;
34
35class KLineEdit;
36class KTextEdit;
37
41class AddressSelectionWidget : public KComboBox
42{
43 Q_OBJECT
44
45public:
51 explicit AddressSelectionWidget(QWidget *parent = 0);
52
56 virtual ~AddressSelectionWidget();
57
62 void setAddresses(const KABC::Address::List &addresses);
63
68 void setCurrentAddress(const KABC::Address &address);
69
73 KABC::Address currentAddress() const;
74
75Q_SIGNALS:
82 void selectionChanged(const KABC::Address &address);
83
84private Q_SLOTS:
85 void selected(int);
86
87private:
88 void updateView();
89
90 KABC::Address::List mAddresses;
91};
92
96class AddressTypeCombo : public KComboBox
97{
98 Q_OBJECT
99
100public:
106 explicit AddressTypeCombo(QWidget *parent = 0);
107
111 ~AddressTypeCombo();
112
117 void setType(KABC::Address::Type type);
118
122 KABC::Address::Type type() const;
123
124private Q_SLOTS:
125 void selected(int);
126 void otherSelected();
127
128private:
129 void update();
130
131 KABC::Address::Type mType;
132 int mLastSelected;
133 QList<int> mTypeList;
134};
135
139class AddressEditWidget : public QWidget
140{
141 Q_OBJECT
142
143public:
144 explicit AddressEditWidget(QWidget *parent = 0);
145 ~AddressEditWidget();
146
147 void loadContact(const KABC::Addressee &contact);
148 void storeContact(KABC::Addressee &contact) const;
149
150 void setReadOnly(bool readOnly);
151
152public Q_SLOTS:
153 void updateName(const QString &name);
154
155private Q_SLOTS:
156 void updateAddressView();
157 void createAddress();
158 void editAddress();
159 void deleteAddress();
160
161private:
162 void updateButtons();
163 void fixPreferredAddress(const KABC::Address &preferredAddress);
164
165 AddressSelectionWidget *mAddressSelectionWidget;
166
167 QLabel *mAddressView;
168 QPushButton *mCreateButton;
169 QPushButton *mEditButton;
170 QPushButton *mDeleteButton;
171
172 KABC::Address::List mAddressList;
173 QString mName;
174 bool mReadOnly;
175};
176
180class AddressEditDialog : public KDialog
181{
182 Q_OBJECT
183
184public:
185 explicit AddressEditDialog(QWidget *parent = 0);
186 ~AddressEditDialog();
187
188 void setAddress(const KABC::Address &address);
189 KABC::Address address() const;
190
191private Q_SLOTS:
192 void editLabel();
193
194private:
195 void fillCountryCombo();
196
197 AddressTypeCombo *mTypeCombo;
198 KTextEdit *mStreetTextEdit;
199 KComboBox *mCountryCombo;
200 KLineEdit *mRegionEdit;
201 KLineEdit *mLocalityEdit;
202 KLineEdit *mPostalCodeEdit;
203 KLineEdit *mPOBoxEdit;
204 QCheckBox *mPreferredCheckBox;
205
206 KABC::Address mAddress;
207 QString mLabel;
208};
209
210#endif
AddressEditDialog
Dialog for editing address details.
Definition: addresseditwidget.h:181
AddressEditWidget
An editor widget for addresses.
Definition: addresseditwidget.h:140
AddressSelectionWidget
A widget that shows a list of addresses for selection.
Definition: addresseditwidget.h:42
AddressSelectionWidget::setCurrentAddress
void setCurrentAddress(const KABC::Address &address)
Sets the current address.
Definition: addresseditwidget.cpp:121
AddressSelectionWidget::setAddresses
void setAddresses(const KABC::Address::List &addresses)
Sets the list of addresses that can be chosen from.
Definition: addresseditwidget.cpp:115
AddressSelectionWidget::selectionChanged
void selectionChanged(const KABC::Address &address)
This signal is emitted whenever the selection of the address has changed.
AddressSelectionWidget::~AddressSelectionWidget
virtual ~AddressSelectionWidget()
Destroys the address selection widget.
Definition: addresseditwidget.cpp:111
AddressSelectionWidget::currentAddress
KABC::Address currentAddress() const
Returns the current selected address.
Definition: addresseditwidget.cpp:129
AddressTypeCombo
A widget for selecting the type of an address.
Definition: addresseditwidget.h:97
AddressTypeCombo::type
KABC::Address::Type type() const
Returns the type that is currently selected.
Definition: addresseditwidget.cpp:183
AddressTypeCombo::setType
void setType(KABC::Address::Type type)
Sets the type that shall be selected in the combobox.
Definition: addresseditwidget.cpp:172
AddressTypeCombo::~AddressTypeCombo
~AddressTypeCombo()
Destroys the address type combo.
Definition: addresseditwidget.cpp:168
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