Debian Codegraph @

Dekko/api/public/Messaging/MessageActions.qml

raw
1 /* Copyright (C) 2016 - 2017 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
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, see <http://www.gnu.org/licenses/>.
17 */
18 pragma Singleton
19 import QtQuick 2.4
20 import QuickFlux 1.0
21
22 /*!
23 * @ingroup qml_actions
24 */
25 ActionCreator {
26
27 /* Displays a message given it's message id
28
29 This will display the messageview in the correct column based on formfactor
30 so you don't need to care about where or what you should load when calling
31 this action
32 */
33 signal openMessage(int msgId)
34
35 signal setCurrentMessage(int msgId)
36
37 /* Opens the folder in the messagelist
38
39 folderName: Readable description of the folder which will be used as the page title
40 folderKey: is the key used to generate the messagelist
41 */
42 signal openFolder(string folderName, var folderKey)
43
44 /* Displays folderlist view for accountId.
45
46 accountName: Readable description of the account. used in the page title
47 accountId: QMailAccountId
48
49 This will display the folder list view either as a new page when in small/medium form factors
50 or in the left column on large form factors.
51 */
52 signal openAccountFolder(string accountName, var accountId)
53
54 /* Change the sort order of the message list view
55
56 order: Can be either Qt.DescendingOrder or Qt.AscendingOrder
57
58 Errors: will log an invalid sort order error and default to DescendingOrder
59 */
60 signal changeMessageListSortOrder(int order)
61
62 /* Reset the message list as if it's being loaded for the first time.
63
64 It does some clean up like reset selected indexes, repositions the listview etc
65 */
66 signal resetMessageList()// TODO
67
68 /* Deletes a message with msgId
69
70 Delete actions are not sent to the server immediately and are undoable.
71 The delete action is queued and a timer is started for 5 seconds. Which during that time you
72 can call undoRecentActions to restore the deleted message to previous state.
73
74 Once the timer finishes the delete action is committed and sent to the server
75 */
76 signal deleteMessage(int msgId)
77
78 /* Deletes the selected messages set using setMessageCheck when in multiselection state
79
80 No messages will be deleted unless the msg list model is in selection mode
81 */
82 signal deleteSelectedMessages()
83
84 /* Undo any recent message actions that are marked as undoable.
85
86 You can check for undoable actions via MailStore.hasUndoableActions and MailboxStore.hasUndoableActions
87 */
88 signal undoRecentActions()
89
90 /* Mark message with ID as read/unread */
91 signal markMessageRead(int msgId, bool read)
92
93 /* Marks any selected messages set using setMessageCheck when in multiselection state
94
95 No message will be marked as read/unread unless the msg list model in in selection mode
96 */
97 signal markSelectedMessagesRead()
98
99 /* Mark message with ID as as important/not-important */
100 signal markMessageImportant(int msgId, bool important)
101
102 /* Marks any selected messages set using setMessageCheck when in multiselection state
103
104 No message will be marked as important/not-important unless the msg list model in in selection mode
105 */
106 signal markSelectedMessagesImportant()
107
108 signal markMessageAsTodo(int msgId, bool todo)
109 signal markMessageAsDone(int msgId, bool done)
110 signal restoreMessage(int msgId)
111
112 /* Select a ll messages when in multiselect */
113 signal selectAllMessages()
114
115 /* Unselect all messages when in multiselect */
116 signal unselectAllMessages()
117
118 // checked options are Qt.Checked/Unchecked
119 signal setMessageCheck(int msgIndex, var checked)
120
121 /* Add more messages to the MessageListModel */
122 signal showMoreMessages()
123
124 signal setMessageListFilter(int filter)
125
126 signal rewindMessageListStack()
127
128 signal startMultiSelection()
129
130 signal endMultiSelection()
131
132 signal resetFolderLists()
133
134 signal stackRewound()
135
136 signal sendPendingMessages()
137 }