• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
32 class QCheckBox;
33 class QLabel;
34 
35 class KLineEdit;
36 class KTextEdit;
37 
41 class AddressSelectionWidget : public KComboBox
42 {
43  Q_OBJECT
44 
45  public:
51  AddressSelectionWidget( QWidget *parent = 0 );
52 
56  virtual ~AddressSelectionWidget();
57 
61  void setAddresses( const KABC::Address::List &addresses );
62 
66  void setCurrentAddress( const KABC::Address &address );
67 
71  KABC::Address currentAddress() const;
72 
73  Q_SIGNALS:
80  void selectionChanged( const KABC::Address &address );
81 
82  private Q_SLOTS:
83  void selected( int );
84 
85  private:
86  void updateView();
87 
88  KABC::Address::List mAddresses;
89 };
90 
94 class AddressTypeCombo : public KComboBox
95 {
96  Q_OBJECT
97 
98  public:
104  AddressTypeCombo( QWidget *parent = 0 );
105 
109  ~AddressTypeCombo();
110 
114  void setType( KABC::Address::Type type );
115 
119  KABC::Address::Type type() const;
120 
121  private Q_SLOTS:
122  void selected( int );
123  void otherSelected();
124 
125  private:
126  void update();
127 
128  KABC::Address::Type mType;
129  int mLastSelected;
130  QList<int> mTypeList;
131 };
132 
136 class AddressEditWidget : public QWidget
137 {
138  Q_OBJECT
139 
140  public:
141  explicit AddressEditWidget( QWidget *parent = 0 );
142  ~AddressEditWidget();
143 
144  void loadContact( const KABC::Addressee &contact );
145  void storeContact( KABC::Addressee &contact ) const;
146 
147  void setReadOnly( bool readOnly );
148 
149  public Q_SLOTS:
150  void updateName( const QString &name );
151 
152  private Q_SLOTS:
153  void updateAddressView();
154  void createAddress();
155  void editAddress();
156  void deleteAddress();
157 
158  private:
159  void updateButtons();
160  void fixPreferredAddress( const KABC::Address &preferredAddress );
161 
162  AddressSelectionWidget *mAddressSelectionWidget;
163 
164  QLabel *mAddressView;
165  QPushButton *mCreateButton;
166  QPushButton *mEditButton;
167  QPushButton *mDeleteButton;
168 
169  KABC::Address::List mAddressList;
170  QString mName;
171  bool mReadOnly;
172 };
173 
177 class AddressEditDialog : public KDialog
178 {
179  Q_OBJECT
180 
181  public:
182  AddressEditDialog( QWidget *parent = 0 );
183  ~AddressEditDialog();
184 
185  void setAddress( const KABC::Address &address );
186  KABC::Address address() const;
187 
188  private Q_SLOTS:
189  void editLabel();
190 
191  private:
192  void fillCountryCombo();
193 
194  AddressTypeCombo *mTypeCombo;
195  KTextEdit *mStreetTextEdit;
196  KComboBox *mCountryCombo;
197  KLineEdit *mRegionEdit;
198  KLineEdit *mLocalityEdit;
199  KLineEdit *mPostalCodeEdit;
200  KLineEdit *mPOBoxEdit;
201  QCheckBox *mPreferredCheckBox;
202 
203  KABC::Address mAddress;
204  QString mLabel;
205 };
206 
207 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:31 by doxygen 1.8.3.1 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.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