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

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • util
mailutil_p.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net,
3  Author Tobias Koenig <tokoe@kdab.com>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef MAILCOMMON_MAILUTIL_P_H
22 #define MAILCOMMON_MAILUTIL_P_H
23 
24 #include <KDialog>
25 #include <KLocale>
26 #include <KSeparator>
27 
28 #include <QLabel>
29 #include <QVBoxLayout>
30 
31 namespace MailCommon {
32 
33 class AttachmentSelectionDialog : public KDialog
34 {
35  Q_OBJECT
36 
37 public:
38  enum Type {
39  AttachAsLink,
40  AttachInline,
41  AttachWithoutAttachments
42  };
43 
44  explicit AttachmentSelectionDialog( QWidget *parent = 0 )
45  : KDialog( parent ),
46  mButtonCode( KDialog::Cancel )
47  {
48  setButtons( User1 | User2 | User3 | Cancel );
49  setWindowTitle( i18n( "Create Todo/Reminder" ) );
50  setButtonText( User1, i18n( "Attach inline without attachments" ) );
51  setButtonText( User2, i18n( "Attach &inline" ) );
52  setButtonText( User3, i18n( "Attach as &link" ) );
53  QVBoxLayout *lay = new QVBoxLayout;
54  QWidget *w = new QWidget;
55  w->setLayout(lay);
56  lay->addWidget(new QLabel( i18n( "How should the email be attached?" ) ));
57  lay->addWidget(new KSeparator);
58  setMainWidget( w );
59  }
60 
61  Type attachmentType() const
62  {
63  switch ( mButtonCode ) {
64  case User1:
65  return AttachWithoutAttachments;
66  case User2:
67  return AttachInline;
68  case User3:
69  default:
70  return AttachAsLink;
71  }
72  }
73 
74 protected Q_SLOTS:
75  void slotButtonClicked( int button )
76  {
77  mButtonCode = static_cast<KDialog::ButtonCode>( button );
78 
79  if ( mButtonCode == User1 || mButtonCode == User2 || mButtonCode == User3 ) {
80  accept();
81  }
82 
83  KDialog::slotButtonClicked( button );
84  }
85 
86 private:
87  KDialog::ButtonCode mButtonCode;
88 };
89 
90 }
91 
92 #endif
QWidget
MailCommon::AttachmentSelectionDialog::AttachInline
Definition: mailutil_p.h:40
KDialog
MailCommon::AttachmentSelectionDialog::AttachmentSelectionDialog
AttachmentSelectionDialog(QWidget *parent=0)
Definition: mailutil_p.h:44
MailCommon::AttachmentSelectionDialog
Definition: mailutil_p.h:33
MailCommon::AttachmentSelectionDialog::attachmentType
Type attachmentType() const
Definition: mailutil_p.h:61
MailCommon::AttachmentSelectionDialog::AttachWithoutAttachments
Definition: mailutil_p.h:41
MailCommon::AttachmentSelectionDialog::AttachAsLink
Definition: mailutil_p.h:39
MailCommon::AttachmentSelectionDialog::slotButtonClicked
void slotButtonClicked(int button)
Definition: mailutil_p.h:75
MailCommon::AttachmentSelectionDialog::Type
Type
Definition: mailutil_p.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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