MessageList::Core::SortOrder
#include <sortorder.h>
Public Types | |
enum | GroupSorting { NoGroupSorting , SortGroupsByDateTime , SortGroupsByDateTimeOfMostRecent , SortGroupsBySenderOrReceiver , SortGroupsBySender , SortGroupsByReceiver } |
enum | MessageSorting { NoMessageSorting , SortMessagesByDateTime , SortMessagesByDateTimeOfMostRecent , SortMessagesBySenderOrReceiver , SortMessagesBySender , SortMessagesByReceiver , SortMessagesBySubject , SortMessagesBySize , SortMessagesByActionItemStatus , SortMessagesByUnreadStatus , SortMessagesByImportantStatus , SortMessagesByAttachmentStatus } |
enum | SortDirection { Ascending , Descending } |
Public Member Functions | |
SortDirection | groupSortDirection () const |
GroupSorting | groupSorting () const |
SortDirection | messageSortDirection () const |
MessageSorting | messageSorting () const |
void | readConfig (KConfigGroup &conf, const QString &storageId, bool *storageUsesPrivateSortOrder) |
void | setGroupSortDirection (SortDirection groupSortDirection) |
void | setGroupSorting (GroupSorting gs) |
void | setMessageSortDirection (SortDirection messageSortDirection) |
void | setMessageSorting (MessageSorting ms) |
bool | validForAggregation (const Aggregation *aggregation) const |
void | writeConfig (KConfigGroup &conf, const QString &storageId, bool storageUsesPrivateSortOrder) const |
Static Public Member Functions | |
static SortOrder | defaultForAggregation (const Aggregation *aggregation, SortOrder oldSortOrder) |
static QList< QPair< QString, int > > | enumerateGroupSortDirectionOptions (Aggregation::Grouping g, GroupSorting groupSorting) |
static QList< QPair< QString, int > > | enumerateGroupSortingOptions (Aggregation::Grouping g) |
static QList< QPair< QString, int > > | enumerateMessageSortDirectionOptions (MessageSorting ms) |
static QList< QPair< QString, int > > | enumerateMessageSortingOptions (Aggregation::Threading t) |
static bool | isValidMessageSorting (SortOrder::MessageSorting ms) |
Detailed Description
A class which holds information about sorting, e.g.
the sorting and sort direction of messages and groups.
Definition at line 22 of file sortorder.h.
Member Enumeration Documentation
◆ GroupSorting
How to sort the groups If you add values here please look at the implementations of the enumerate* functions and add appropriate descriptors.
Definition at line 35 of file sortorder.h.
◆ MessageSorting
The available message sorting options.
If you add values here please look at the implementations of the enumerate* functions and add appropriate descriptors.
Definition at line 60 of file sortorder.h.
◆ SortDirection
The "generic" sort direction: used for groups and for messages If you add values here please look at the implementations of the enumerate* functions and add appropriate descriptors.
Definition at line 50 of file sortorder.h.
Member Function Documentation
◆ defaultForAggregation()
|
staticnodiscard |
Returns the default sort order for the given aggregation.
- Parameters
-
aggregation the given aggregation. oldSortOrder the previously used sort order. If possible, the new sort order will be based on that old sort order, i.e. the message sorting and message sort direction is adopted.
Definition at line 169 of file sortorder.cpp.
◆ enumerateGroupSortDirectionOptions()
|
staticnodiscard |
Enumerates the group sort direction options compatible with the specified Grouping and GroupSorting.
The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself. If the returned list is empty then the value of the option is meaningless in the current context.
Definition at line 122 of file sortorder.cpp.
◆ enumerateGroupSortingOptions()
|
staticnodiscard |
Enumerates the group sorting options compatible with the specified Grouping.
The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself. If the returned list is empty then the value of the option is meaningless in the current context.
Definition at line 98 of file sortorder.cpp.
◆ enumerateMessageSortDirectionOptions()
|
staticnodiscard |
Enumerates the available message sorting directions for the specified MessageSorting option.
The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself. If the returned list is empty then the value of the option is meaningless in the current context.
Definition at line 80 of file sortorder.cpp.
◆ enumerateMessageSortingOptions()
|
staticnodiscard |
Enumerates the message sorting options compatible with the specified Threading setting.
The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself.
Definition at line 60 of file sortorder.cpp.
◆ groupSortDirection()
|
nodiscard |
Returns the current group SortDirection.
Definition at line 30 of file sortorder.cpp.
◆ groupSorting()
|
nodiscard |
Returns the GroupSorting.
Definition at line 20 of file sortorder.cpp.
◆ isValidMessageSorting()
|
staticnodiscard |
Returns true if the ms parameter specifies a valid MessageSorting option.
Definition at line 263 of file sortorder.cpp.
◆ messageSortDirection()
|
nodiscard |
Returns the current message SortDirection.
Definition at line 50 of file sortorder.cpp.
◆ messageSorting()
|
nodiscard |
Returns the current message sorting option.
Definition at line 40 of file sortorder.cpp.
◆ readConfig()
void SortOrder::readConfig | ( | KConfigGroup & | conf, |
const QString & | storageId, | ||
bool * | storageUsesPrivateSortOrder ) |
Reads the sort order from a config group.
- Parameters
-
conf the config group. storageId the id of the folder, which is prepended to each key. This way, more than one sort order can be saved in the same config group storageUsesPrivateSortOrder this boolean will be true if the sort order is private for that folder, and false if the sort order is the global sort order.
Definition at line 233 of file sortorder.cpp.
◆ setGroupSortDirection()
void SortOrder::setGroupSortDirection | ( | SortOrder::SortDirection | groupSortDirection | ) |
Sets the SortDirection for the groups.
Note that this option has no meaning if group sorting is set to NoGroupSorting.
Definition at line 35 of file sortorder.cpp.
◆ setGroupSorting()
void SortOrder::setGroupSorting | ( | SortOrder::GroupSorting | gs | ) |
Sets the GroupSorting option.
This may not have any effect, depending on the Aggregation this sort order is used in.
Definition at line 25 of file sortorder.cpp.
◆ setMessageSortDirection()
void SortOrder::setMessageSortDirection | ( | SortOrder::SortDirection | messageSortDirection | ) |
Sets the SortDirection for the message.
Note that this option has no meaning if message sorting is set to NoMessageSorting.
Definition at line 55 of file sortorder.cpp.
◆ setMessageSorting()
void SortOrder::setMessageSorting | ( | SortOrder::MessageSorting | ms | ) |
Sets the current message sorting option.
Definition at line 45 of file sortorder.cpp.
◆ validForAggregation()
|
nodiscard |
Checks if this sort order can be used in combination with the given aggregation.
Some combinations are not valid, for example the message sorting "most recent in subtree" with a non-threaded aggregation.
Definition at line 154 of file sortorder.cpp.
◆ writeConfig()
void SortOrder::writeConfig | ( | KConfigGroup & | conf, |
const QString & | storageId, | ||
bool | storageUsesPrivateSortOrder ) const |
Writes the sort order to a config group.
- Parameters
-
conf the config group. storageId the storage identifier. storageUsesPrivateSortOrder if false, this sort order will be saved as the global sort order.
- See also
- readConfig
Definition at line 246 of file sortorder.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:53:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.