File indexing completed on 2024-12-15 04:54:36

0001 /******************************************************************************
0002  *
0003  *  SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  *
0007  *******************************************************************************/
0008 
0009 #pragma once
0010 
0011 namespace MessageList
0012 {
0013 namespace Core
0014 {
0015 /**
0016  * Pre-selection is the action of automatically selecting a message just after the folder
0017  * has finished loading. We may want to select the message that was selected the last
0018  * time this folder has been open, or we may want to select the first unread message.
0019  * We also may want to do no pre-selection at all (for example, when the user
0020  * starts navigating the view before the pre-selection could actually be made
0021  * and pre-selecting would confuse him). This member holds the option.
0022  *
0023  * All the modes except PreSelectNone try to fallback to "PreSelectLastSelected" when the
0024  * specified item isn't found.
0025  *
0026  * See Model::setStorageModel() for more information.
0027  */
0028 enum PreSelectionMode {
0029     PreSelectNone, //< no pre-selection at all
0030     PreSelectLastSelected, //< pre-select the last message that was selected in this folder (default)
0031     PreSelectFirstUnreadCentered, //< pre-select the first unread message and center it
0032     PreSelectNewestCentered, //< pre-select the newest message, by date
0033     PreSelectOldestCentered, //< pre-select the oldest message, by date
0034 };
0035 
0036 /**
0037  * This enum is used in the view message selection functions (for instance View::nextMessageItem()).
0038  */
0039 enum MessageTypeFilter {
0040     MessageTypeAny, //< Select any message
0041     MessageTypeUnreadOnly, //< Select only unread messages
0042 };
0043 
0044 /**
0045  * This enum is used in the view message selection functions (for instance View::selectNextMessage())
0046  */
0047 enum ExistingSelectionBehaviour {
0048     ClearExistingSelection, //< Clear the existing selection before selecting the new item
0049     ExpandExistingSelection, //< Preserve the existing selection (grow only)
0050     GrowOrShrinkExistingSelection //< Grow or shrink the existing selection depending on what item is actually being selected
0051 };
0052 }
0053 }