MessageList::Core::SortOrder

MessageList::Core::SortOrder Class Reference

#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 QVector< QPair< QString, int > > enumerateGroupSortDirectionOptions (Aggregation::Grouping g, GroupSorting groupSorting)
 
static QVector< QPair< QString, int > > enumerateGroupSortingOptions (Aggregation::Grouping g)
 
static QVector< QPair< QString, int > > enumerateMessageSortDirectionOptions (MessageSorting ms)
 
static QVector< 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 21 of file sortorder.h.

Member Enumeration Documentation

How to sort the groups If you add values here please look at the implementations of the enumerate* functions and add appropriate descriptors.

Enumerator
NoGroupSorting 

Don't sort the groups at all, add them as they come in.

SortGroupsByDateTime 

Sort groups by date/time of the group.

SortGroupsByDateTimeOfMostRecent 

Sort groups by date/time of the most recent message.

SortGroupsBySenderOrReceiver 

Sort groups by sender or receiver (makes sense only with GroupBySenderOrReceiver)

SortGroupsBySender 

Sort groups by sender (makes sense only with GroupBySender)

SortGroupsByReceiver 

Sort groups by receiver (makes sense only with GroupByReceiver)

Definition at line 35 of file sortorder.h.

The available message sorting options.

If you add values here please look at the implementations of the enumerate* functions and add appropriate descriptors.

Enumerator
NoMessageSorting 

Don't sort the messages at all.

SortMessagesByDateTime 

Sort the messages by date and time.

SortMessagesByDateTimeOfMostRecent 

Sort the messages by date and time of the most recent message in subtree.

SortMessagesBySenderOrReceiver 

Sort the messages by sender or receiver.

SortMessagesBySender 

Sort the messages by sender.

SortMessagesByReceiver 

Sort the messages by receiver.

SortMessagesBySubject 

Sort the messages by subject.

SortMessagesBySize 

Sort the messages by size.

SortMessagesByActionItemStatus 

Sort the messages by the "Action Item" flag of status.

SortMessagesByUnreadStatus 

Sort the messages by the "Unread" flags of status.

SortMessagesByAttachmentStatus 

Sort the messages By "Important" flags of status.

Sort the messages By "Attachment" flags of status

Definition at line 60 of file sortorder.h.

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

SortOrder SortOrder::defaultForAggregation ( const Aggregation aggregation,
SortOrder  oldSortOrder 
)
static

Returns the default sort order for the given aggregation.

Parameters
aggregationthe given aggregation.
oldSortOrderthe 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 185 of file sortorder.cpp.

QVector< QPair< QString, int > > SortOrder::enumerateGroupSortDirectionOptions ( Aggregation::Grouping  g,
GroupSorting  groupSorting 
)
static

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 132 of file sortorder.cpp.

QVector< QPair< QString, int > > SortOrder::enumerateGroupSortingOptions ( Aggregation::Grouping  g)
static

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 108 of file sortorder.cpp.

QVector< QPair< QString, int > > SortOrder::enumerateMessageSortDirectionOptions ( MessageSorting  ms)
static

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 87 of file sortorder.cpp.

QVector< QPair< QString, int > > SortOrder::enumerateMessageSortingOptions ( Aggregation::Threading  t)
static

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 67 of file sortorder.cpp.

SortOrder::SortDirection SortOrder::groupSortDirection ( ) const

Returns the current group SortDirection.

Definition at line 37 of file sortorder.cpp.

SortOrder::GroupSorting SortOrder::groupSorting ( ) const

Returns the GroupSorting.

Definition at line 27 of file sortorder.cpp.

bool SortOrder::isValidMessageSorting ( SortOrder::MessageSorting  ms)
static

Returns true if the ms parameter specifies a valid MessageSorting option.

Definition at line 298 of file sortorder.cpp.

SortOrder::SortDirection SortOrder::messageSortDirection ( ) const

Returns the current message SortDirection.

Definition at line 57 of file sortorder.cpp.

SortOrder::MessageSorting SortOrder::messageSorting ( ) const

Returns the current message sorting option.

Definition at line 47 of file sortorder.cpp.

void SortOrder::readConfig ( KConfigGroup conf,
const QString storageId,
bool *  storageUsesPrivateSortOrder 
)

Reads the sort order from a config group.

Parameters
confthe config group.
storageIdthe 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
storageUsesPrivateSortOrderthis 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 265 of file sortorder.cpp.

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 42 of file sortorder.cpp.

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 32 of file sortorder.cpp.

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 62 of file sortorder.cpp.

void SortOrder::setMessageSorting ( SortOrder::MessageSorting  ms)

Sets the current message sorting option.

Definition at line 52 of file sortorder.cpp.

bool SortOrder::validForAggregation ( const Aggregation aggregation) const

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 164 of file sortorder.cpp.

void SortOrder::writeConfig ( KConfigGroup conf,
const QString storageId,
bool  storageUsesPrivateSortOrder 
) const

Writes the sort order to a config group.

Parameters
confthe config group.
storageIdthe storage identifier.
storageUsesPrivateSortOrderif false, this sort order will be saved as the global sort order.
See also
readConfig

Definition at line 277 of file sortorder.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 23:13:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.