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

mailcommon

  • sources
  • kde-4.14
  • kdepim
  • mailcommon
  • collectionpage
contenttypewidget.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 
19 */
20 
21 #include "contenttypewidget.h"
22 #include "collectiontypeutil.h"
23 #include <KLocalizedString>
24 #include <KComboBox>
25 #include <QHBoxLayout>
26 #include <QLabel>
27 
28 
29 using namespace MailCommon;
30 ContentTypeWidget::ContentTypeWidget(QWidget *parent)
31  : QWidget(parent)
32 {
33  QHBoxLayout *hbox = new QHBoxLayout(this);
34  hbox->setMargin(0);
35 
36  QLabel *label = new QLabel( i18n( "&Folder contents:" ), this );
37  label->setObjectName(QLatin1String("contenttypewidgetlabel"));
38  hbox->addWidget(label);
39  mContentsComboBox = new KComboBox( this );
40  mContentsComboBox->setObjectName(QLatin1String("contentcombobox"));
41  label->setBuddy( mContentsComboBox );
42  hbox->addWidget(mContentsComboBox);
43  MailCommon::CollectionTypeUtil collectionUtil;
44  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeMail ) );
45  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeCalendar ) );
46  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeContact ) );
47  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeNote ) );
48  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeTask ) );
49  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeJournal ) );
50  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeConfiguration ) );
51  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeFreebusy ) );
52  mContentsComboBox->addItem( collectionUtil.folderContentDescription( CollectionTypeUtil::ContentsTypeFile ) );
53 
54  connect(mContentsComboBox, SIGNAL(activated(int)), SIGNAL(activated(int)));
55 }
56 
57 ContentTypeWidget::~ContentTypeWidget()
58 {
59 
60 }
61 
62 int ContentTypeWidget::currentIndex() const
63 {
64  return mContentsComboBox->currentIndex();
65 }
66 
67 void ContentTypeWidget::setCurrentIndex(int index)
68 {
69  mContentsComboBox->setCurrentIndex(index);
70 }
71 
72 void ContentTypeWidget::setCurrentItem(const QString &name)
73 {
74  mContentsComboBox->setCurrentItem(name);
75 }
76 
77 QString ContentTypeWidget::currentText() const
78 {
79  return mContentsComboBox->currentText();
80 }
QWidget
contenttypewidget.h
MailCommon::ContentTypeWidget::ContentTypeWidget
ContentTypeWidget(QWidget *parent=0)
Definition: contenttypewidget.cpp:30
QHBoxLayout
MailCommon::CollectionTypeUtil::ContentsTypeJournal
Definition: collectiontypeutil.h:46
QLabel::setBuddy
void setBuddy(QWidget *buddy)
MailCommon::ContentTypeWidget::setCurrentItem
void setCurrentItem(const QString &name)
Definition: contenttypewidget.cpp:72
MailCommon::CollectionTypeUtil::ContentsTypeNote
Definition: collectiontypeutil.h:44
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
MailCommon::ContentTypeWidget::~ContentTypeWidget
~ContentTypeWidget()
Definition: contenttypewidget.cpp:57
collectiontypeutil.h
MailCommon::CollectionTypeUtil::ContentsTypeContact
Definition: collectiontypeutil.h:43
QObject::setObjectName
void setObjectName(const QString &name)
MailCommon::CollectionTypeUtil::ContentsTypeFreebusy
Definition: collectiontypeutil.h:48
MailCommon::ContentTypeWidget::activated
void activated(int index)
MailCommon::ContentTypeWidget::currentIndex
int currentIndex() const
Definition: contenttypewidget.cpp:62
QString
MailCommon::CollectionTypeUtil::ContentsTypeFile
Definition: collectiontypeutil.h:49
QLayout::setMargin
void setMargin(int margin)
MailCommon::CollectionTypeUtil::ContentsTypeTask
Definition: collectiontypeutil.h:45
MailCommon::CollectionTypeUtil
Definition: collectiontypeutil.h:29
QLatin1String
MailCommon::CollectionTypeUtil::ContentsTypeConfiguration
Definition: collectiontypeutil.h:47
MailCommon::ContentTypeWidget::currentText
QString currentText() const
Definition: contenttypewidget.cpp:77
MailCommon::CollectionTypeUtil::folderContentDescription
QString folderContentDescription(CollectionTypeUtil::FolderContentsType type)
Definition: collectiontypeutil.cpp:51
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
MailCommon::CollectionTypeUtil::ContentsTypeCalendar
Definition: collectiontypeutil.h:42
MailCommon::ContentTypeWidget::setCurrentIndex
void setCurrentIndex(int index)
Definition: contenttypewidget.cpp:67
MailCommon::CollectionTypeUtil::ContentsTypeMail
Definition: collectiontypeutil.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:40 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
  • pimprint

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