Astyle kdelibs
[kdepim.git] / kmail / collectionpage / collectionmailinglistpage.h
blob7171082c49beccde887b12b3b3e12bd56ff8e401
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 This file is part of KMail, the KDE mail client.
3 Copyright (c) 2005 Till Adam <adam@kde.org>
4 Copyright (c) 2011 Montel Laurent <montel@kde.org>
5 Copyright (c) 2012 Jonathan Marten <jjm@keelhaul.me.uk>
7 KMail is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License, version 2, as
9 published by the Free Software Foundation.
11 KMail is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef COLLECTIONMAILINGLISTPAGE_H
22 #define COLLECTIONMAILINGLISTPAGE_H
24 #include "messagecore/misc/mailinglist.h"
25 #include "foldercollection.h"
27 #include <AkonadiWidgets/collectionpropertiespage.h>
28 #include <AkonadiCore/collection.h>
30 class QCheckBox;
31 class QPushButton;
33 template <typename T> class QSharedPointer;
35 class KComboBox;
36 class KJob;
37 class KEditListWidget;
38 class KSqueezedTextLabel;
40 class CollectionMailingListPage : public Akonadi::CollectionPropertiesPage
42 Q_OBJECT
43 public:
44 explicit CollectionMailingListPage(QWidget *parent = 0);
45 ~CollectionMailingListPage();
47 void load(const Akonadi::Collection &col);
48 void save(Akonadi::Collection &col);
50 bool canHandle(const Akonadi::Collection &col) const;
52 protected:
53 void init(const Akonadi::Collection &);
55 protected slots:
56 void slotFetchDone(KJob *job);
58 private slots:
60 * Detects mailing-list related stuff
62 void slotDetectMailingList();
63 void slotInvokeHandler();
64 void slotMLHandling(int element);
65 void slotHoldsML(bool holdsML);
66 void slotAddressChanged(int addr);
67 void slotConfigChanged();
69 private:
70 void fillMLFromWidgets();
71 void fillEditBox();
73 Akonadi::Collection mCurrentCollection;
74 QSharedPointer<MailCommon::FolderCollection> mFolder;
76 int mLastItem;
77 MailingList mMailingList;
78 QCheckBox *mHoldsMailingList;
79 KComboBox *mMLHandlerCombo;
80 QPushButton *mDetectButton;
81 KComboBox *mAddressCombo;
82 KEditListWidget *mEditList;
83 KSqueezedTextLabel *mMLId;
84 QWidget *mGroupWidget;
85 bool changed;
88 AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionMailingListPageFactory, CollectionMailingListPage)
90 #endif /* COLLECTIONMAILINGLISTPAGE_H */