MessageList::Core::SortOrder

Search for usage in LXR

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 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.

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.

◆ MessageSorting

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.

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()

SortOrder SortOrder::defaultForAggregation ( const Aggregation * aggregation,
SortOrder oldSortOrder )
staticnodiscard

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

◆ enumerateGroupSortDirectionOptions()

QList< QPair< QString, int > > SortOrder::enumerateGroupSortDirectionOptions ( Aggregation::Grouping g,
GroupSorting groupSorting )
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()

QList< QPair< QString, int > > SortOrder::enumerateGroupSortingOptions ( Aggregation::Grouping g)
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()

QList< QPair< QString, int > > SortOrder::enumerateMessageSortDirectionOptions ( MessageSorting ms)
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()

QList< QPair< QString, int > > SortOrder::enumerateMessageSortingOptions ( Aggregation::Threading t)
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()

SortOrder::SortDirection SortOrder::groupSortDirection ( ) const
nodiscard

Returns the current group SortDirection.

Definition at line 30 of file sortorder.cpp.

◆ groupSorting()

SortOrder::GroupSorting SortOrder::groupSorting ( ) const
nodiscard

Returns the GroupSorting.

Definition at line 20 of file sortorder.cpp.

◆ isValidMessageSorting()

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

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

Definition at line 263 of file sortorder.cpp.

◆ messageSortDirection()

SortOrder::SortDirection SortOrder::messageSortDirection ( ) const
nodiscard

Returns the current message SortDirection.

Definition at line 50 of file sortorder.cpp.

◆ messageSorting()

SortOrder::MessageSorting SortOrder::messageSorting ( ) const
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
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 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()

bool SortOrder::validForAggregation ( const Aggregation * aggregation) const
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
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 246 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-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.