2 This file is part of KAddressBook.
4 Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU 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.
24 #include "kaddressbook_export.h"
28 namespace GrantleeTheme
{
29 class GrantleeThemeManager
;
34 class ContactGroupViewer
;
36 class ContactsFilterProxyModel
;
37 class EntityMimeTypeFilterModel
;
41 class StandardContactActionManager
;
44 namespace KAddressBookGrantlee
{
45 class GrantleeContactFormatter
;
46 class GrantleeContactGroupFormatter
;
49 class ContactSwitcher
;
50 class KActionCollection
;
52 class ModelColumnManager
;
53 class QAbstractItemModel
;
54 class QItemSelectionModel
;
58 class QuickSearchWidget
;
62 class KADDRESSBOOK_EXPORT MainWidget
: public QWidget
67 explicit MainWidget( KXMLGUIClient
*guiClient
, QWidget
*parent
= 0 );
70 XXPortManager
*importManager() const;
79 void slotSearchDuplicateContacts();
81 bool handleCommandLine();
86 void itemSelected( const Akonadi::Item
&item
);
87 void itemSelectionChanged( const QModelIndex
&, const QModelIndex
& );
88 void selectFirstItem();
90 void setViewMode( QAction
*action
);
91 void setQRCodeShow( bool on
);
96 void slotGrantleeThemeSelected();
97 void slotGrantleeThemesUpdated();
98 void slotDebugNepomuk();
101 void initGrantleeThemeName();
103 void setupActions( KActionCollection
* );
105 void setViewMode( int mode
);
106 void saveSplitterStates() const;
107 void restoreSplitterStates();
109 QAbstractItemModel
*allContactsModel();
112 * Returns the address book collection that is currently
113 * selected by the user or an invalid collection if no
114 * address book is selected.
116 Akonadi::Collection
currentAddressBook() const;
118 Akonadi::EntityMimeTypeFilterModel
*mCollectionTree
;
119 Akonadi::EntityMimeTypeFilterModel
*mItemTree
;
120 Akonadi::EntityMimeTypeFilterModel
*mAllContactsModel
;
121 Akonadi::ContactsFilterProxyModel
*mContactsFilterModel
;
123 QuickSearchWidget
*mQuickSearchWidget
;
124 Akonadi::EntityTreeView
*mCollectionView
;
125 Akonadi::EntityTreeView
*mItemView
;
126 QWidget
*mDetailsPane
;
127 QStackedWidget
*mDetailsViewStack
;
128 ContactSwitcher
*mContactSwitcher
;
130 QSplitter
*mMainWidgetSplitter1
;
131 QSplitter
*mMainWidgetSplitter2
;
132 Akonadi::ContactViewer
*mContactDetails
;
133 Akonadi::ContactGroupViewer
*mContactGroupDetails
;
134 QWidget
*mEmptyDetails
;
135 Akonadi::StandardContactActionManager
*mActionManager
;
136 QItemSelectionModel
*mCollectionSelectionModel
;
138 QActionGroup
*mViewModeGroup
;
140 XXPortManager
*mXXPortManager
;
141 ModelColumnManager
*mModelColumnManager
;
142 KXMLGUIClient
*mXmlGuiClient
;
143 KAddressBookGrantlee::GrantleeContactFormatter
*mFormatter
;
144 KAddressBookGrantlee::GrantleeContactGroupFormatter
*mGroupFormatter
;
145 GrantleeTheme::GrantleeThemeManager
*mGrantleeThemeManager
;