• 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
aggregation.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_AGGREGATION_H__
22 #define __MESSAGELIST_CORE_AGGREGATION_H__
23 
24 class QDataStream;
25 
26 #include <QList>
27 #include <QPair>
28 #include <QString>
29 
30 #include <messagelist/core/optionset.h>
31 
32 namespace MessageList
33 {
34 
35 namespace Core
36 {
37 
43 class Aggregation : public OptionSet
44 {
45 public:
46 
52  enum Grouping
53  {
54  NoGrouping,
55  GroupByDate,
56  GroupByDateRange,
57  GroupBySenderOrReceiver,
58  GroupBySender,
59  GroupByReceiver
60  // Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
61  // TODO: Group by message status: "Important messages", "Urgent messages", "To reply", "To do" etc...
62  // TODO: Group by message unread status: "Unread messages", "Read messages" (maybe "New" ?)
63  };
64 
70  enum GroupExpandPolicy
71  {
72  NeverExpandGroups,
73  ExpandRecentGroups,
74  AlwaysExpandGroups
75  // Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
76  };
77 
83  enum Threading
84  {
85  NoThreading,
86  PerfectOnly,
87  PerfectAndReferences,
88  PerfectReferencesAndSubject
89  // Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
90  };
91 
97  enum ThreadLeader
98  {
99  TopmostMessage,
100  MostRecentMessage
101  // Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
102  };
103 
109  enum ThreadExpandPolicy
110  {
111  NeverExpandThreads,
112  ExpandThreadsWithNewMessages,
113  ExpandThreadsWithUnreadMessages,
114  AlwaysExpandThreads,
115  ExpandThreadsWithUnreadOrImportantMessages
116  // Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
117  };
118 
124  enum FillViewStrategy
125  {
126  FavorInteractivity,
127  FavorSpeed,
128  BatchNoInteractivity
129  // Warning: Never add enum entries in the middle: always add them at the end (numeric values are stored in configuration)
130  };
131 
132 private:
133  Grouping mGrouping;
134  GroupExpandPolicy mGroupExpandPolicy;
135  Threading mThreading;
136  ThreadLeader mThreadLeader;
137  ThreadExpandPolicy mThreadExpandPolicy;
138  FillViewStrategy mFillViewStrategy;
139 
140 public:
141  explicit Aggregation();
142  explicit Aggregation( const Aggregation &opt );
143  explicit Aggregation(
144  const QString &name,
145  const QString &description,
146  Grouping grouping,
147  GroupExpandPolicy groupExpandPolicy,
148  Threading threading,
149  ThreadLeader threadLeader,
150  ThreadExpandPolicy threadExpandPolicy,
151  FillViewStrategy fillViewStrategy,
152  bool readOnly );
153  static bool compareName( Aggregation *agg1, Aggregation *agg2 )
154  {
155  return ( agg1->name() < agg2->name() );
156  }
157 
158 public:
162  Grouping grouping() const
163  { return mGrouping; }
164 
168  void setGrouping( Grouping g )
169  { mGrouping = g; }
170 
176  static QList< QPair< QString, int > > enumerateGroupingOptions();
177 
181  GroupExpandPolicy groupExpandPolicy() const
182  { return mGroupExpandPolicy; }
183 
188  void setGroupExpandPolicy( GroupExpandPolicy groupExpandPolicy )
189  { mGroupExpandPolicy = groupExpandPolicy; }
190 
197  static QList< QPair< QString, int > > enumerateGroupExpandPolicyOptions( Grouping g );
198 
202  Threading threading() const
203  { return mThreading; }
204 
208  void setThreading( Threading t )
209  { mThreading = t; }
210 
216  static QList< QPair< QString, int > > enumerateThreadingOptions();
217 
221  ThreadLeader threadLeader() const
222  { return mThreadLeader; }
223 
229  void setThreadLeader( ThreadLeader tl )
230  { mThreadLeader = tl; }
231 
239  static QList< QPair< QString, int > > enumerateThreadLeaderOptions( Grouping g, Threading t );
240 
244  ThreadExpandPolicy threadExpandPolicy() const
245  { return mThreadExpandPolicy; }
246 
252  void setThreadExpandPolicy( ThreadExpandPolicy threadExpandPolicy )
253  { mThreadExpandPolicy = threadExpandPolicy; }
254 
261  static QList< QPair< QString, int > > enumerateThreadExpandPolicyOptions( Threading t );
262 
266  FillViewStrategy fillViewStrategy() const
267  { return mFillViewStrategy; }
268 
272  void setFillViewStrategy( FillViewStrategy fillViewStrategy )
273  { mFillViewStrategy = fillViewStrategy; }
274 
280  static QList< QPair< QString, int > > enumerateFillViewStrategyOptions();
281 
285  virtual void save( QDataStream &stream ) const;
286 
290  virtual bool load( QDataStream &stream );
291 };
292 
293 } // namespace Core
294 
295 } // namespace MessageList
296 
297 #endif
MessageList::Core::Aggregation::PerfectAndReferences
Thread by "In-Reply-To" and "References" fields.
Definition: aggregation.h:87
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::Aggregation::setFillViewStrategy
void setFillViewStrategy(FillViewStrategy fillViewStrategy)
Sets the current fill view strategy.
Definition: aggregation.h:272
MessageList::Core::Aggregation::setGroupExpandPolicy
void setGroupExpandPolicy(GroupExpandPolicy groupExpandPolicy)
Sets the GroupExpandPolicy for the groups.
Definition: aggregation.h:188
MessageList::Core::Aggregation::compareName
static bool compareName(Aggregation *agg1, Aggregation *agg2)
Definition: aggregation.h:153
MessageList::Core::OptionSet
A set of options that can be applied to the MessageList in one shot.
Definition: optionset.h:47
MessageList::Core::Aggregation::ThreadExpandPolicy
ThreadExpandPolicy
The available thread expand policies.
Definition: aggregation.h:109
MessageList::Core::Aggregation::save
virtual void save(QDataStream &stream) const
Pure virtual reimplemented from OptionSet.
Definition: aggregation.cpp:189
MessageList::Core::Aggregation::threadLeader
ThreadLeader threadLeader() const
Returns the current thread leader determination method.
Definition: aggregation.h:221
MessageList::Core::Aggregation::PerfectReferencesAndSubject
Thread by all of the above and try to match subjects too.
Definition: aggregation.h:88
MessageList::Core::Aggregation::enumerateFillViewStrategyOptions
static QList< QPair< QString, int > > enumerateFillViewStrategyOptions()
Enumerates the fill view strategies.
Definition: aggregation.cpp:263
MessageList::Core::Aggregation::NoThreading
Perform no threading at all.
Definition: aggregation.h:85
MessageList::Core::Aggregation::Aggregation
Aggregation()
Definition: aggregation.cpp:65
MessageList::Core::Aggregation::grouping
Grouping grouping() const
Returns the currently set Grouping option.
Definition: aggregation.h:162
MessageList::Core::Aggregation::Threading
Threading
The available threading methods.
Definition: aggregation.h:83
MessageList::Core::Aggregation::GroupBySender
Group by sender, always.
Definition: aggregation.h:58
MessageList::Core::Aggregation::ExpandRecentGroups
Makes sense only with GroupByDate or GroupByDateRange.
Definition: aggregation.h:73
MessageList::Core::Aggregation::threading
Threading threading() const
Returns the current threading method.
Definition: aggregation.h:202
MessageList::Core::Aggregation::FillViewStrategy
FillViewStrategy
The available fill view strategies.
Definition: aggregation.h:124
MessageList::Core::OptionSet::description
const QString & description() const
Returns a description of this option set.
Definition: optionset.h:88
MessageList::Core::Aggregation::GroupByDate
Group the messages by the date of the thread leader.
Definition: aggregation.h:55
MessageList::Core::Aggregation::PerfectOnly
Thread by "In-Reply-To" field only.
Definition: aggregation.h:86
MessageList::Core::Aggregation::load
virtual bool load(QDataStream &stream)
Pure virtual reimplemented from OptionSet.
Definition: aggregation.cpp:76
MessageList::Core::Aggregation::NeverExpandGroups
Never expand groups during a view fill algorithm.
Definition: aggregation.h:72
MessageList::Core::Aggregation::GroupByDateRange
Use smart (thread leader) date ranges ("Today","Yesterday","Last Week"...)
Definition: aggregation.h:56
MessageList::Core::Aggregation::enumerateThreadLeaderOptions
static QList< QPair< QString, int > > enumerateThreadLeaderOptions(Grouping g, Threading t)
Enumerates the thread leader determination methods compatible with the specified Threading and the sp...
Definition: aggregation.cpp:239
MessageList::Core::Aggregation::NoGrouping
Don't group messages at all.
Definition: aggregation.h:54
MessageList::Core::Aggregation::GroupExpandPolicy
GroupExpandPolicy
The available group expand policies.
Definition: aggregation.h:70
optionset.h
MessageList::Core::Aggregation::TopmostMessage
The thread grouping is computed from the topmost message (very similar to least recent, but might be different if timezones or machine clocks are screwed)
Definition: aggregation.h:99
MessageList::Core::Aggregation::setThreadExpandPolicy
void setThreadExpandPolicy(ThreadExpandPolicy threadExpandPolicy)
Sets the current thread expand policy.
Definition: aggregation.h:252
MessageList::Core::OptionSet::name
const QString & name() const
Returns the name of this OptionSet.
Definition: optionset.h:72
MessageList::Core::Aggregation::AlwaysExpandThreads
Expand all threads (this might be very slow)
Definition: aggregation.h:114
MessageList::Core::Aggregation::ThreadLeader
ThreadLeader
The available thread leading options.
Definition: aggregation.h:97
MessageList::Core::Aggregation::ExpandThreadsWithUnreadMessages
Expand threads with unread messages (this includes new)
Definition: aggregation.h:113
MessageList::Core::Aggregation::GroupByReceiver
Group by receiver, always.
Definition: aggregation.h:59
MessageList::Core::Aggregation::setThreadLeader
void setThreadLeader(ThreadLeader tl)
Sets the current thread leader determination method.
Definition: aggregation.h:229
MessageList::Core::Aggregation::AlwaysExpandGroups
All groups are expanded as they are inserted.
Definition: aggregation.h:74
MessageList::Core::Aggregation::enumerateThreadExpandPolicyOptions
static QList< QPair< QString, int > > enumerateThreadExpandPolicyOptions(Threading t)
Enumerates the thread expand policies compatible with the specified Threading option.
Definition: aggregation.cpp:251
MessageList::Core::Aggregation::FavorSpeed
Do larger chunks of work, zero intervals between chunks.
Definition: aggregation.h:127
MessageList::Core::Aggregation::groupExpandPolicy
GroupExpandPolicy groupExpandPolicy() const
Returns the current GroupExpandPolicy.
Definition: aggregation.h:181
MessageList::Core::Aggregation::setGrouping
void setGrouping(Grouping g)
Sets the Grouping option.
Definition: aggregation.h:168
MessageList::Core::Aggregation::ExpandThreadsWithUnreadOrImportantMessages
Expand threads with "hot" messages (this includes new, unread, important, todo)
Definition: aggregation.h:115
MessageList::Core::Aggregation::NeverExpandThreads
Never expand any thread, this is fast.
Definition: aggregation.h:111
MessageList::Core::Aggregation::Grouping
Grouping
Message grouping.
Definition: aggregation.h:52
MessageList::Core::Aggregation::enumerateThreadingOptions
static QList< QPair< QString, int > > enumerateThreadingOptions()
Enumerates the available threading method options.
Definition: aggregation.cpp:229
MessageList::Core::Aggregation::MostRecentMessage
The thread grouping is computed from the most recent message.
Definition: aggregation.h:100
MessageList::Core::Aggregation::FavorInteractivity
Do small chunks of work, small intervals between chunks to allow for UI event processing.
Definition: aggregation.h:126
MessageList::Core::Aggregation::setThreading
void setThreading(Threading t)
Sets the threading method option.
Definition: aggregation.h:208
MessageList::Core::Aggregation::ExpandThreadsWithNewMessages
DEPRECATED. New message status no longer exists.
Definition: aggregation.h:112
MessageList::Core::Aggregation::fillViewStrategy
FillViewStrategy fillViewStrategy() const
Returns the current fill view strategy.
Definition: aggregation.h:266
MessageList::Core::Aggregation::enumerateGroupExpandPolicyOptions
static QList< QPair< QString, int > > enumerateGroupExpandPolicyOptions(Grouping g)
Enumerates the group sort direction options compatible with the specified Grouping.
Definition: aggregation.cpp:217
MessageList::Core::OptionSet::readOnly
bool readOnly() const
Definition: optionset.h:118
MessageList::Core::Aggregation::BatchNoInteractivity
Do one large chunk, no interactivity at all.
Definition: aggregation.h:128
MessageList::Core::Aggregation::GroupBySenderOrReceiver
Group by sender (incoming) or receiver (outgoing) field.
Definition: aggregation.h:57
MessageList::Core::Aggregation::threadExpandPolicy
ThreadExpandPolicy threadExpandPolicy() const
Returns the current thread expand policy.
Definition: aggregation.h:244
MessageList::Core::Aggregation::enumerateGroupingOptions
static QList< QPair< QString, int > > enumerateGroupingOptions()
Enumerates the available grouping options as a QList of pairs in that the first item is the localized...
Definition: aggregation.cpp:204
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