SVN_SILENT made messages (.desktop file) - always resolve ours
[kdepim.git] / akonadiconsole / browserwidget.h
blobb78038f24b4f971ad3d3865ec141b567ca673dcf
1 /*
2 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
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.
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.
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.
20 #ifndef AKONADICONSOLE_BROWSERWIDGET_H
21 #define AKONADICONSOLE_BROWSERWIDGET_H
23 #include <ui_browserwidget_itemview.h>
24 #include <ui_browserwidget_contentview.h>
26 #include <AkonadiCore/collection.h>
27 #include <AkonadiCore/item.h>
28 #include <AkonadiWidgets/etmviewstatesaver.h>
30 #include <QWidget>
32 class QModelIndex;
33 class QStandardItemModel;
35 class KJob;
36 class KToggleAction;
37 class KXmlGuiWindow;
39 class AkonadiBrowserModel;
41 template <typename T> class KViewStateMaintainer;
43 namespace Akonadi
45 class ChangeRecorder;
46 class EntityTreeView;
47 class Job;
48 class StandardActionManager;
49 class Monitor;
50 class TagModel;
51 class StatisticsProxyModel;
54 class BrowserWidget: public QWidget
56 Q_OBJECT
58 public:
59 explicit BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget *parent = Q_NULLPTR);
60 ~BrowserWidget();
62 public Q_SLOTS:
63 void dumpToXml();
64 void clearCache();
66 private Q_SLOTS:
67 void itemActivated(const QModelIndex &index);
68 void itemFetchDone(KJob *job);
69 void modelChanged();
70 void save();
71 void saveResult(KJob *job);
72 void addAttribute();
73 void delAttribute();
74 void setItem(const Akonadi::Item &item);
75 void dumpToXmlResult(KJob *job);
76 void clear();
77 void updateItemFetchScope();
79 void contentViewChanged();
81 void tagViewContextMenuRequested(const QPoint &pos);
82 void tagViewDoubleClicked(const QModelIndex &index);
83 void addSubTagRequested();
84 void addTagRequested();
85 void editTagRequested();
86 void removeTagRequested();
87 void createTag();
88 void modifyTag();
89 private:
90 Akonadi::Collection currentCollection() const;
92 Akonadi::ChangeRecorder *mBrowserMonitor;
93 AkonadiBrowserModel *mBrowserModel;
94 Akonadi::EntityTreeView *mCollectionView;
95 Akonadi::StatisticsProxyModel *statisticsProxyModel;
96 Ui::ItemViewWidget itemUi;
97 Ui::ContentViewWidget contentUi;
98 Akonadi::Item mCurrentItem;
99 QStandardItemModel *mAttrModel;
100 Akonadi::StandardActionManager *mStdActionManager;
101 Akonadi::Monitor *mMonitor;
102 KViewStateMaintainer<Akonadi::ETMViewStateSaver> *m_stateMaintainer;
103 KToggleAction *mCacheOnlyAction;
104 QTreeView *mTagView;
105 Akonadi::TagModel *mTagModel;
108 #endif