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

messagelist

  • sources
  • kde-4.12
  • kdepim
  • messagelist
  • core
manager.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef __MESSAGELIST_CORE_MANAGER_H__
22 #define __MESSAGELIST_CORE_MANAGER_H__
23 
24 #include <messagelist/core/sortorder.h>
25 #include <QList>
26 #include <QHash>
27 #include <QObject>
28 
29 #include <messagelist/messagelist_export.h>
30 #include <akonadi/collection.h>
31 class QPixmap;
32 
33 namespace KMime
34 {
35  class DateFormatter;
36 }
37 
38 namespace MessageList
39 {
40 
41 namespace Core
42 {
43 
44 class Aggregation;
45 class Theme;
46 class StorageModel;
47 class Widget;
48 
61 class Manager : public QObject
62 {
63  Q_OBJECT
64 protected:
65  explicit Manager();
66  ~Manager();
67 
68 private:
69  static Manager * mInstance;
70  QList< Widget * > mWidgetList;
71  QHash< QString, Aggregation * > mAggregations;
72  QHash< QString, Theme * > mThemes;
73  KMime::DateFormatter * mDateFormatter;
74  QString mCachedLocalizedUnknownText;
75 
76  // pixmaps, never null
77 
78  QPixmap * mPixmapMessageNew;
79  QPixmap * mPixmapMessageUnread;
80  QPixmap * mPixmapMessageRead;
81  QPixmap * mPixmapMessageDeleted;
82  QPixmap * mPixmapMessageReplied;
83  QPixmap * mPixmapMessageRepliedAndForwarded;
84  QPixmap * mPixmapMessageQueued;
85  QPixmap * mPixmapMessageActionItem;
86  QPixmap * mPixmapMessageSent;
87  QPixmap * mPixmapMessageForwarded;
88  QPixmap * mPixmapMessageImportant; // "flag"
89  QPixmap * mPixmapMessageWatched;
90  QPixmap * mPixmapMessageIgnored;
91  QPixmap * mPixmapMessageSpam;
92  QPixmap * mPixmapMessageHam;
93  QPixmap * mPixmapMessageFullySigned;
94  QPixmap * mPixmapMessagePartiallySigned;
95  QPixmap * mPixmapMessageUndefinedSigned;
96  QPixmap * mPixmapMessageNotSigned;
97  QPixmap * mPixmapMessageFullyEncrypted;
98  QPixmap * mPixmapMessagePartiallyEncrypted;
99  QPixmap * mPixmapMessageUndefinedEncrypted;
100  QPixmap * mPixmapMessageNotEncrypted;
101  QPixmap * mPixmapMessageAttachment;
102  QPixmap * mPixmapMessageAnnotation;
103  QPixmap * mPixmapMessageInvitation;
104  QPixmap * mPixmapShowMore;
105  QPixmap * mPixmapShowLess;
106  QPixmap * mPixmapVerticalLine;
107  QPixmap * mPixmapHorizontalSpacer;
108 
109 public:
110  // instance management
111  static Manager * instance()
112  { return mInstance; }
113 
114  // widget registration
115  static void registerWidget( Widget *pWidget );
116  static void unregisterWidget( Widget *pWidget );
117 
118  const KMime::DateFormatter * dateFormatter() const
119  { return mDateFormatter; }
120 
121  // global pixmaps
122  const QPixmap * pixmapMessageNew() const
123  { return mPixmapMessageNew; }
124  const QPixmap * pixmapMessageUnread() const
125  { return mPixmapMessageUnread; }
126  const QPixmap * pixmapMessageRead() const
127  { return mPixmapMessageRead; }
128  const QPixmap * pixmapMessageDeleted() const
129  { return mPixmapMessageDeleted; }
130  const QPixmap * pixmapMessageReplied() const
131  { return mPixmapMessageReplied; }
132  const QPixmap * pixmapMessageRepliedAndForwarded() const
133  { return mPixmapMessageRepliedAndForwarded; }
134  const QPixmap * pixmapMessageQueued() const
135  { return mPixmapMessageQueued; }
136  const QPixmap * pixmapMessageActionItem() const
137  { return mPixmapMessageActionItem; }
138  const QPixmap * pixmapMessageSent() const
139  { return mPixmapMessageSent; }
140  const QPixmap * pixmapMessageForwarded() const
141  { return mPixmapMessageForwarded; }
142  const QPixmap * pixmapMessageImportant() const
143  { return mPixmapMessageImportant; }
144  const QPixmap * pixmapMessageWatched() const
145  { return mPixmapMessageWatched; }
146  const QPixmap * pixmapMessageIgnored() const
147  { return mPixmapMessageIgnored; }
148  const QPixmap * pixmapMessageSpam() const
149  { return mPixmapMessageSpam; }
150  const QPixmap * pixmapMessageHam() const
151  { return mPixmapMessageHam; }
152  const QPixmap * pixmapMessageFullySigned() const
153  { return mPixmapMessageFullySigned; }
154  const QPixmap * pixmapMessagePartiallySigned() const
155  { return mPixmapMessagePartiallySigned; }
156  const QPixmap * pixmapMessageUndefinedSigned() const
157  { return mPixmapMessageUndefinedSigned; }
158  const QPixmap * pixmapMessageNotSigned() const
159  { return mPixmapMessageNotSigned; }
160  const QPixmap * pixmapMessageFullyEncrypted() const
161  { return mPixmapMessageFullyEncrypted; }
162  const QPixmap * pixmapMessagePartiallyEncrypted() const
163  { return mPixmapMessagePartiallyEncrypted; }
164  const QPixmap * pixmapMessageUndefinedEncrypted() const
165  { return mPixmapMessageUndefinedEncrypted; }
166  const QPixmap * pixmapMessageNotEncrypted() const
167  { return mPixmapMessageNotEncrypted; }
168  const QPixmap * pixmapMessageAttachment() const
169  { return mPixmapMessageAttachment; }
170  const QPixmap * pixmapMessageAnnotation() const
171  { return mPixmapMessageAnnotation; }
172  const QPixmap * pixmapMessageInvitation() const
173  { return mPixmapMessageInvitation; }
174  const QPixmap * pixmapShowMore() const
175  { return mPixmapShowMore; }
176  const QPixmap * pixmapShowLess() const
177  { return mPixmapShowLess; }
178  const QPixmap * pixmapVerticalLine() const
179  { return mPixmapVerticalLine; }
180  const QPixmap * pixmapHorizontalSpacer() const
181  { return mPixmapHorizontalSpacer; }
182 
183  const QString & cachedLocalizedUnknownText() const
184  { return mCachedLocalizedUnknownText; }
185 
186  // aggregation sets management
187  const Aggregation * aggregationForStorageModel( const StorageModel *storageModel, bool *storageUsesPrivateAggregation );
188  const Aggregation * aggregationForStorageModel( const QString &storageModel, bool *storageUsesPrivateAggregation );
189  const Aggregation * aggregationForStorageModel( const Akonadi::Collection &storageModel, bool *storageUsesPrivateAggregation );
190 
191 
192 
193  void saveAggregationForStorageModel( const StorageModel *storageModel, const QString &id, bool storageUsesPrivateAggregation );
194  void saveAggregationForStorageModel( const QString &index, const QString &id, bool storageUsesPrivateAggregation );
195  void saveAggregationForStorageModel( const Akonadi::Collection &col, const QString &id, bool storageUsesPrivateAggregation );
196 
197 
198  const Aggregation * defaultAggregation();
199  const Aggregation * aggregation( const QString &id );
200 
201  void addAggregation( Aggregation *set );
202  void removeAllAggregations();
203 
204  const QHash< QString, Aggregation * > & aggregations() const
205  { return mAggregations; }
206 
211  void aggregationsConfigurationCompleted();
212 
213  // sort order management
214  const SortOrder sortOrderForStorageModel( const StorageModel *storageModel, bool *storageUsesPrivateSortOrder );
215  void saveSortOrderForStorageModel( const StorageModel *storageModel,
216  const SortOrder& order, bool storageUsesPrivateSortOrder );
217 
218  // theme sets management
219  const Theme * themeForStorageModel( const Akonadi::Collection & col, bool * storageUsesPrivateTheme );
220  const Theme * themeForStorageModel( const StorageModel *storageModel, bool *storageUsesPrivateTheme );
221  const Theme * themeForStorageModel( const QString &id, bool * storageUsesPrivateTheme );
222 
223  void saveThemeForStorageModel( const StorageModel *storageModel, const QString &id, bool storageUsesPrivateTheme );
224  void saveThemeForStorageModel( int index, const QString &id, bool storageUsesPrivateTheme );
225  void saveThemeForStorageModel( const QString &storageModelIndex, const QString &id, bool storageUsesPrivateTheme );
226 
227 
228  const Theme * defaultTheme();
229  const Theme * theme( const QString &id );
230 
231  void addTheme( Theme *set );
232  void removeAllThemes();
233 
234  const QHash< QString, Theme * > & themes() const
235  { return mThemes; }
236 
241  void themesConfigurationCompleted();
242 
243 protected slots:
249  void reloadGlobalConfiguration();
250 
254  void reloadAllWidgets();
255 
256 signals:
257  void aggregationsChanged();
258  void themesChanged();
259 
260 private:
261  // internal configuration stuff
262  void loadConfiguration();
263  void saveConfiguration();
264  void loadGlobalConfiguration();
265  void saveGlobalConfiguration();
266 
267  // internal option set management
268  void createDefaultAggregations();
269  void createDefaultThemes();
270 };
271 
272 } // namespace Core
273 
274 } // namespace MessageList
275 
276 #endif
MessageList::Core::Manager::pixmapMessageIgnored
const QPixmap * pixmapMessageIgnored() const
Definition: manager.h:146
MessageList::Core::Manager::pixmapMessagePartiallyEncrypted
const QPixmap * pixmapMessagePartiallyEncrypted() const
Definition: manager.h:162
MessageList::Core::Manager::pixmapMessageSent
const QPixmap * pixmapMessageSent() const
Definition: manager.h:138
MessageList::Core::SortOrder
A class which holds information about sorting, e.g.
Definition: sortorder.h:37
MessageList::Core::Manager::aggregations
const QHash< QString, Aggregation * > & aggregations() const
Definition: manager.h:204
MessageList::Core::Manager::pixmapMessageUnread
const QPixmap * pixmapMessageUnread() const
Definition: manager.h:124
messagelist_export.h
MessageList::Core::Aggregation
A set of aggregation options that can be applied to the MessageList::Model in a single shot...
Definition: aggregation.h:43
MessageList::Core::Manager::dateFormatter
const KMime::DateFormatter * dateFormatter() const
Definition: manager.h:118
MessageList::Core::Manager::pixmapMessageForwarded
const QPixmap * pixmapMessageForwarded() const
Definition: manager.h:140
MessageList::Core::Manager::reloadGlobalConfiguration
void reloadGlobalConfiguration()
Reloads the global configuration from the config files (so we assume it has changed) The settings pri...
Definition: manager.cpp:905
MessageList::Core::Manager::pixmapMessageUndefinedEncrypted
const QPixmap * pixmapMessageUndefinedEncrypted() const
Definition: manager.h:164
MessageList::Core::Manager::theme
const Theme * theme(const QString &id)
Definition: manager.cpp:483
MessageList::Core::Manager::pixmapMessageSpam
const QPixmap * pixmapMessageSpam() const
Definition: manager.h:148
MessageList::Core::Manager::pixmapMessageNew
const QPixmap * pixmapMessageNew() const
Definition: manager.h:122
MessageList::Core::Manager::themesChanged
void themesChanged()
MessageList::Core::Widget
Provides a widget which has the messagelist and the most important helper widgets, like the search line and the comboboxes for changing status filtering, aggregation etc.
Definition: widgetbase.h:60
MessageList::Core::Manager::pixmapMessageNotEncrypted
const QPixmap * pixmapMessageNotEncrypted() const
Definition: manager.h:166
MessageList::Core::Manager::pixmapMessageHam
const QPixmap * pixmapMessageHam() const
Definition: manager.h:150
MessageList::Core::Manager::cachedLocalizedUnknownText
const QString & cachedLocalizedUnknownText() const
Definition: manager.h:183
MessageList::Core::Manager::removeAllThemes
void removeAllThemes()
Definition: manager.cpp:873
MessageList::Core::Manager::pixmapMessageAnnotation
const QPixmap * pixmapMessageAnnotation() const
Definition: manager.h:170
MessageList::Core::Manager::addTheme
void addTheme(Theme *set)
Definition: manager.cpp:595
QObject
MessageList::Core::Manager::pixmapMessageAttachment
const QPixmap * pixmapMessageAttachment() const
Definition: manager.h:168
MessageList::Core::Manager::pixmapVerticalLine
const QPixmap * pixmapVerticalLine() const
Definition: manager.h:178
MessageList::Core::Manager::reloadAllWidgets
void reloadAllWidgets()
Explicitly reloads the contents of all the widgets.
Definition: manager.cpp:893
MessageList::Core::Manager::saveAggregationForStorageModel
void saveAggregationForStorageModel(const StorageModel *storageModel, const QString &id, bool storageUsesPrivateAggregation)
Definition: manager.cpp:214
MessageList::Core::Manager::pixmapMessageFullySigned
const QPixmap * pixmapMessageFullySigned() const
Definition: manager.h:152
MessageList::Core::Manager::pixmapShowMore
const QPixmap * pixmapShowMore() const
Definition: manager.h:174
MessageList::Core::Manager::defaultAggregation
const Aggregation * defaultAggregation()
Definition: manager.cpp:181
MessageList::Core::Manager::themesConfigurationCompleted
void themesConfigurationCompleted()
This is called by the theme configuration dialog once the sets have been changed. ...
Definition: manager.cpp:882
MessageList::Core::Manager::pixmapMessageWatched
const QPixmap * pixmapMessageWatched() const
Definition: manager.h:144
MessageList::Core::Manager
: The manager for all the existing MessageList::Widget objects.
Definition: manager.h:61
MessageList::Core::Manager::defaultTheme
const Theme * defaultTheme()
Definition: manager.cpp:492
MessageList::Core::Manager::unregisterWidget
static void unregisterWidget(Widget *pWidget)
Definition: manager.cpp:155
MessageList::Core::Manager::pixmapMessageRepliedAndForwarded
const QPixmap * pixmapMessageRepliedAndForwarded() const
Definition: manager.h:132
MessageList::Core::Manager::addAggregation
void addAggregation(Aggregation *set)
Definition: manager.cpp:281
MessageList::Core::Manager::instance
static Manager * instance()
Definition: manager.h:111
MessageList::Core::Manager::pixmapMessageUndefinedSigned
const QPixmap * pixmapMessageUndefinedSigned() const
Definition: manager.h:156
MessageList::Core::Manager::pixmapMessageReplied
const QPixmap * pixmapMessageReplied() const
Definition: manager.h:130
MessageList::Core::Manager::pixmapShowLess
const QPixmap * pixmapShowLess() const
Definition: manager.h:176
MessageList::Core::Manager::registerWidget
static void registerWidget(Widget *pWidget)
Definition: manager.cpp:147
MessageList::Core::StorageModel
The QAbstractItemModel based interface that you need to provide for your storage to work with Message...
Definition: storagemodelbase.h:45
MessageList::Core::Manager::pixmapMessageQueued
const QPixmap * pixmapMessageQueued() const
Definition: manager.h:134
MessageList::Core::Manager::pixmapMessageNotSigned
const QPixmap * pixmapMessageNotSigned() const
Definition: manager.h:158
MessageList::Core::Manager::pixmapMessageImportant
const QPixmap * pixmapMessageImportant() const
Definition: manager.h:142
sortorder.h
MessageList::Core::Manager::aggregationsConfigurationCompleted
void aggregationsConfigurationCompleted()
This is called by the aggregation configuration dialog once the sets have been changed.
Definition: manager.cpp:450
MessageList::Core::Manager::pixmapMessageActionItem
const QPixmap * pixmapMessageActionItem() const
Definition: manager.h:136
MessageList::Core::Manager::themeForStorageModel
const Theme * themeForStorageModel(const Akonadi::Collection &col, bool *storageUsesPrivateTheme)
Definition: manager.cpp:545
MessageList::Core::Manager::aggregationsChanged
void aggregationsChanged()
MessageList::Core::Manager::saveThemeForStorageModel
void saveThemeForStorageModel(const StorageModel *storageModel, const QString &id, bool storageUsesPrivateTheme)
Definition: manager.cpp:526
MessageList::Core::Manager::sortOrderForStorageModel
const SortOrder sortOrderForStorageModel(const StorageModel *storageModel, bool *storageUsesPrivateSortOrder)
Definition: manager.cpp:461
MessageList::Core::Manager::pixmapMessageFullyEncrypted
const QPixmap * pixmapMessageFullyEncrypted() const
Definition: manager.h:160
MessageList::Core::Manager::~Manager
~Manager()
Definition: manager.cpp:105
MessageList::Core::Manager::removeAllAggregations
void removeAllAggregations()
Definition: manager.cpp:441
MessageList::Core::Theme
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
MessageList::Core::Manager::Manager
Manager()
Definition: manager.cpp:57
MessageList::Core::Manager::pixmapMessageRead
const QPixmap * pixmapMessageRead() const
Definition: manager.h:126
MessageList::Core::Manager::aggregationForStorageModel
const Aggregation * aggregationForStorageModel(const StorageModel *storageModel, bool *storageUsesPrivateAggregation)
Definition: manager.cpp:245
MessageList::Core::Manager::pixmapHorizontalSpacer
const QPixmap * pixmapHorizontalSpacer() const
Definition: manager.h:180
MessageList::Core::Manager::pixmapMessageDeleted
const QPixmap * pixmapMessageDeleted() const
Definition: manager.h:128
MessageList::Core::Manager::aggregation
const Aggregation * aggregation(const QString &id)
Definition: manager.cpp:172
MessageList::Core::Manager::saveSortOrderForStorageModel
void saveSortOrderForStorageModel(const StorageModel *storageModel, const SortOrder &order, bool storageUsesPrivateSortOrder)
Definition: manager.cpp:476
MessageList::Core::Manager::themes
const QHash< QString, Theme * > & themes() const
Definition: manager.h:234
MessageList::Core::Manager::pixmapMessageInvitation
const QPixmap * pixmapMessageInvitation() const
Definition: manager.h:172
MessageList::Core::Manager::pixmapMessagePartiallySigned
const QPixmap * pixmapMessagePartiallySigned() const
Definition: manager.h:154
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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