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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
  • contact
emailaddressselectiondialog.cpp
1 /*
2  This file is part of Akonadi Contact.
3 
4  Copyright (c) 2010 KDAB
5  Author: Tobias Koenig <tokoe@kde.org>
6 
7  This library is free software; you can redistribute it and/or modify it
8  under the terms of the GNU Library General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version.
11 
12  This library is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15  License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to the
19  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  02110-1301, USA.
21 */
22 
23 #include "emailaddressselectiondialog.h"
24 
25 #include <KConfigGroup>
26 #include <KGlobal>
27 #include <KSharedConfig>
28 
29 using namespace Akonadi;
30 
31 class EmailAddressSelectionDialog::Private
32 {
33  public:
34  Private( EmailAddressSelectionDialog *qq, QAbstractItemModel *model )
35  : q( qq )
36  {
37  if ( model ) {
38  mView = new EmailAddressSelectionWidget( model, q );
39  } else {
40  mView = new EmailAddressSelectionWidget( q );
41  }
42  q->connect( mView, SIGNAL(doubleClicked()), q, SLOT(accept()));
43  q->setButtons( Ok | Cancel );
44  q->setMainWidget( mView );
45  readConfig();
46  }
47 
48  void readConfig()
49  {
50  KConfigGroup group( KGlobal::config(), QLatin1String( "EmailAddressSelectionDialog" ) );
51  const QSize size = group.readEntry( "Size", QSize() );
52  if ( size.isValid() ) {
53  q->resize( size );
54  } else {
55  q->resize( q->sizeHint().width(), q->sizeHint().height() );
56  }
57  }
58 
59  void writeConfig()
60  {
61  KConfigGroup group( KGlobal::config(), QLatin1String( "EmailAddressSelectionDialog" ) );
62  group.writeEntry( "Size", q->size() );
63  }
64 
65  EmailAddressSelectionDialog *q;
66  EmailAddressSelectionWidget *mView;
67 };
68 
69 EmailAddressSelectionDialog::EmailAddressSelectionDialog( QWidget *parent )
70  : KDialog( parent ), d( new Private( this, 0 ) )
71 {
72 }
73 
74 EmailAddressSelectionDialog::EmailAddressSelectionDialog( QAbstractItemModel *model, QWidget *parent )
75  : KDialog( parent ), d( new Private( this, model ) )
76 {
77 }
78 
79 EmailAddressSelectionDialog::~EmailAddressSelectionDialog()
80 {
81  d->writeConfig();
82  delete d;
83 }
84 
85 EmailAddressSelection::List EmailAddressSelectionDialog::selectedAddresses() const
86 {
87  return d->mView->selectedAddresses();
88 }
89 
90 EmailAddressSelectionWidget* EmailAddressSelectionDialog::view() const
91 {
92  return d->mView;
93 }
94 
Akonadi::EmailAddressSelection::List
QList< EmailAddressSelection > List
A list of email address selection objects.
Definition: emailaddressselection.h:55
Akonadi::EmailAddressSelectionDialog::view
EmailAddressSelectionWidget * view() const
Returns the email address selection view that is used.
Definition: emailaddressselectiondialog.cpp:90
Akonadi::EmailAddressSelectionDialog
A dialog to select email addresses from Akonadi.
Definition: emailaddressselectiondialog.h:59
Akonadi::EmailAddressSelectionDialog::EmailAddressSelectionDialog
EmailAddressSelectionDialog(QWidget *parent=0)
Creates a new email address selection dialog.
Definition: emailaddressselectiondialog.cpp:69
Akonadi::EmailAddressSelectionWidget
A widget to select email addresses from Akonadi.
Definition: emailaddressselectionwidget.h:66
Akonadi::EmailAddressSelectionDialog::selectedAddresses
EmailAddressSelection::List selectedAddresses() const
Returns the list of selected email addresses.
Definition: emailaddressselectiondialog.cpp:85
Akonadi::EmailAddressSelectionDialog::~EmailAddressSelectionDialog
~EmailAddressSelectionDialog()
Destroys the email address selection dialog.
Definition: emailaddressselectiondialog.cpp:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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