Messagelib

view.h
1/******************************************************************************
2 *
3 * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 *
7 *******************************************************************************/
8
9#pragma once
10
11#include <QList>
12#include <QPoint>
13#include <QTreeView>
14
15#include "messagelist/enums.h"
16#include "messagelist/quicksearchline.h"
17
18class QMenu;
19
20namespace Akonadi
21{
22class MessageStatus;
23}
24
25namespace MessageList
26{
27namespace Core
28{
29using MessageItemSetReference = long;
30
31class Aggregation;
32class Delegate;
33class Item;
34class MessageItem;
35class Model;
36class Theme;
37class SortOrder;
38class StorageModel;
39class Widget;
40
41/**
42 * The MessageList::View is the real display of the message list. It is
43 * based on QTreeView, has a Model that manipulates the underlying message storage
44 * and a Delegate that is responsible of painting the items.
45 */
46class View : public QTreeView
47{
48 friend class Model;
49 friend class ModelPrivate;
51public:
52 explicit View(Widget *parent);
53 ~View() override;
54
55 /**
56 * Returns the Model attached to this View. You probably never need to manipulate
57 * it directly.
58 */
59 [[nodiscard]] Model *model() const;
60
61 /**
62 * Returns the Delegate attached to this View. You probably never need to manipulate
63 * it directly. Model uses it to obtain size hints.
64 */
65 [[nodiscard]] Delegate *delegate() const;
66
67 /**
68 * Sets the StorageModel to be displayed in this view. The StorageModel may be 0 (so no content is displayed).
69 * Setting the StorageModel will obviously trigger a view reload.
70 * Be sure to set the Aggregation and the Theme BEFORE calling this function.
71 *
72 * Pre-selection is the action of automatically selecting a message just after the folder
73 * has finished loading. See Model::setStorageModel() for more information.
74 */
76
77 /**
78 * Returns the currently displayed StorageModel. May be 0.
79 */
81
82 /**
83 * Sets the aggregation for this view.
84 * Does not trigger a reload of the view: you *MUST* trigger it manually.
85 */
86 void setAggregation(const Aggregation *aggregation);
87
88 /**
89 * Sets the specified theme for this view.
90 * Does not trigger a reload of the view: you *MUST* trigger it manually.
91 */
92 void setTheme(Theme *theme);
93
94 /**
95 * Sets the specified sort order.
96 * Does not trigger a reload of the view: you *MUST* trigger it manually.
97 */
98 void setSortOrder(const SortOrder *sortOrder);
99
100 /**
101 * Triggers a reload of the view in order to re-display the current folder.
102 * Call this function after changing the Aggregation or the Theme.
103 */
104 void reload();
105
106 /**
107 * Returns the current MessageItem (that is bound to current StorageModel).
108 * May return 0 if there is no current message or no current StorageModel.
109 * If the current message item isn't currently selected (so is only focused)
110 * then it's selected when this function is called, unless selectIfNeeded is false.
111 */
113
114 /**
115 * Returns the current Item (that is bound to current StorageModel).
116 * May return 0 if there is no current item or no current StorageModel.
117 * If the current item isn't currently selected (so is only focused)
118 * then it's selected when this function is called.
119 */
120 [[nodiscard]] Item *currentItem() const;
121
122 /**
123 * Sets the current message item.
124 */
125 void setCurrentMessageItem(MessageItem *it, bool center = false);
126
127 /**
128 * Returns true if the specified item is currently displayed in the tree
129 * and has all the parents expanded. This means that the user can
130 * see the message (by eventually scrolling the view).
131 */
133
134 /**
135 * Makes sure that the specified is currently viewable by the user.
136 * This means that the user can see the message (by eventually scrolling the view).
137 */
139
140 /**
141 * Returns the currently selected MessageItems (bound to current StorageModel).
142 * The list may be empty if there are no selected messages or no StorageModel.
143 *
144 * If includeCollapsedChildren is true then the children of the selected but
145 * collapsed items are also added to the list.
146 *
147 * The returned list is guaranteed to be valid only until you return control
148 * to the main even loop. Don't store it for any longer. If you need to reference
149 * this set of messages at a later stage then take a look at createPersistentSet().
150 */
152
153 /**
154 * Returns the MessageItems bound to the current StorageModel that
155 * are part of the current thread. The current thread is the thread
156 * that contains currentMessageItem().
157 * The list may be empty if there is no currentMessageItem() or no StorageModel.
158 *
159 * The returned list is guaranteed to be valid only until you return control
160 * to the main even loop. Don't store it for any longer. If you need to reference
161 * this set of messages at a later stage then take a look at createPersistentSet().
162 */
164
165 /**
166 * Fast function that determines if the selection is empty
167 */
168 [[nodiscard]] bool selectionEmpty() const;
169
170 /**
171 * Selects the specified MessageItems. The current selection is NOT removed.
172 * Use clearSelection() for that purpose.
173 */
175
176 /**
177 * Creates a persistent set for the specified MessageItems and
178 * returns its reference. Later you can use this reference
179 * to retrieve the list of MessageItems that are still valid.
180 * See persistentSetCurrentMessageList() for that.
181 *
182 * Persistent sets consume resources (both memory and CPU time
183 * while manipulating the view) so be sure to call deletePersistentSet()
184 * when you no longer need it.
185 */
186 MessageItemSetReference createPersistentSet(const QList<MessageItem *> &items);
187
188 /**
189 * Returns the list of MessageItems that are still existing in the
190 * set pointed by the specified reference. This list will contain
191 * at most the messages that you have passed to createPersistentSet()
192 * but may contain less (even 0) if these MessageItem object were removed
193 * from the view for some reason.
194 */
196
197 /**
198 * Deletes the persistent set pointed by the specified reference.
199 * If the set does not exist anymore, nothing happens.
200 */
201 void deletePersistentSet(MessageItemSetReference ref);
202
203 /**
204 * If bMark is true this function marks the messages as "about to be removed"
205 * so they appear dimmer and aren't selectable in the view.
206 * If bMark is false then this function clears the "about to be removed" state
207 * for the specified MessageItems.
208 */
210
211 /**
212 * Returns true if the current Aggregation is threaded, false otherwise
213 * (or if there is no current Aggregation).
214 */
215 [[nodiscard]] bool isThreaded() const;
216
217 /**
218 * If expand is true then it expands the current thread, otherwise
219 * collapses it.
220 */
222
223 /**
224 * If expand is true then it expands all the threads, otherwise
225 * collapses them.
226 */
227 void setAllThreadsExpanded(bool expand);
228
229 /**
230 * If expand is true then it expands all the groups (only the toplevel
231 * group item: inner threads are NOT expanded). If expand is false
232 * then it collapses all the groups. If no grouping is in effect
233 * then this function does nothing.
234 */
235 void setAllGroupsExpanded(bool expand);
236
237 /**
238 * Selects the next message item in the view.
239 *
240 * messageTypeFilter can be used to limit the selection to
241 * a certain category of messages.
242 *
243 * existingSelectionBehaviour specifies how the existing selection
244 * is manipulated. It may be cleared, expanded or grown/shrunk.
245 *
246 * If centerItem is true then the specified item will be positioned
247 * at the center of the view, if possible.
248 * If loop is true then the "next" algorithm will restart from the beginning
249 * of the list if the end is reached, otherwise it will just stop returning false.
250 *
251 * \sa MessageList::Core::MessageTypeFilter
252 * \sa MessageList::Core::ExistingSelectionBehaviour
253 */
255
256 /**
257 * Selects the previous message item in the view.
258 *
259 * messageTypeFilter can be used to limit the selection to
260 * a certain category of messages.
261 *
262 * existingSelectionBehaviour specifies how the existing selection
263 * is manipulated. It may be cleared, expanded or grown/shrunk.
264 *
265 * If centerItem is true then the specified item will be positioned
266 * at the center of the view, if possible.
267 * If loop is true then the "previous" algorithm will restart from the end
268 * of the list if the beginning is reached, otherwise it will just stop returning false.
269 *
270 * \sa MessageList::Core::MessageTypeFilter
271 * \sa MessageList::Core::ExistingSelectionBehaviour
272 */
274
275 /**
276 * Focuses the next message item in the view without actually selecting it.
277 *
278 * messageTypeFilter can be used to limit the selection to
279 * a certain category of messages.
280 *
281 * If centerItem is true then the specified item will be positioned
282 * at the center of the view, if possible.
283 * If loop is true then the "next" algorithm will restart from the beginning
284 * of the list if the end is reached, otherwise it will just stop returning false.
285 */
287
288 /**
289 * Focuses the previous message item in the view without actually selecting it.
290 * If unread is true then focuses the previous unread message item.
291 * If centerItem is true then the specified item will be positioned
292 * at the center of the view, if possible.
293 * If loop is true then the "previous" algorithm will restart from the end
294 * of the list if the beginning is reached, otherwise it will just stop returning false.
295 */
297
298 /**
299 * Selects the currently focused message item. If the currently focused
300 * message is already selected (which is very likely) nothing happens.
301 * If centerItem is true then the specified item will be positioned
302 * at the center of the view, if possible.
303 */
305
306 /**
307 * Selects the first message item in the view that matches messageTypeFilter.
308 * If centerItem is true then the specified item will be positioned
309 * at the center of the view, if possible.
310 */
312
313 /**
314 * Selects the last message item in the view that matches messageTypeFilter.
315 * If centerItem is true then the specified item will be positioned
316 * at the center of the view, if possible.
317 */
319
320 /**
321 * Sets the focus on the quick search line of the currently active tab.
322 */
323 void focusQuickSearch(const QString &selectedText);
324
325 /**
326 * Returns the Akonadi::MessageStatus in the current quicksearch field.
327 */
329
330 /**
331 * Returns the search term in the current quicksearch field.
332 */
334
335 /**
336 * Called to hide or show the specified row from the view.
337 * @reimp
338 */
339 virtual void setRowHidden(int row, const QModelIndex &parent, bool hide);
340
341 void sortOrderMenuAboutToShow(QMenu *menu);
342
343 void aggregationMenuAboutToShow(QMenu *menu);
344
345 void themeMenuAboutToShow(QMenu *menu);
346
347 void setCollapseItem(const QModelIndex &index);
348 void setExpandItem(const QModelIndex &index);
349
350 void setQuickSearchClickMessage(const QString &msg);
351
353
354protected:
355 /**
356 * Reimplemented in order to catch QHelpEvent
357 */
358 bool event(QEvent *e) override;
359
360 /**
361 * Reimplemented in order to catch palette, font and style changes
362 */
363 void changeEvent(QEvent *e) override;
364
365 /**
366 * Reimplemented in order to handle clicks with sub-item precision.
367 */
368 void mousePressEvent(QMouseEvent *e) override;
369
370 /**
371 * Reimplemented in order to handle double clicks with sub-item precision.
372 */
373 void mouseDoubleClickEvent(QMouseEvent *e) override;
374
375 /**
376 * Reimplemented in order to handle DnD
377 */
378 void mouseMoveEvent(QMouseEvent *e) override;
379
380 /**
381 * Reimplemented in order to handle message DnD
382 */
383 void dragEnterEvent(QDragEnterEvent *e) override;
384
385 /**
386 * Reimplemented in order to handle message DnD
387 */
388 void dragMoveEvent(QDragMoveEvent *e) override;
389
390 /**
391 * Reimplemented in order to handle message DnD
392 */
393 void dropEvent(QDropEvent *e) override;
394
395 /**
396 * Reimplemented in order to resize columns when header is not visible
397 */
398 void resizeEvent(QResizeEvent *e) override;
399
400 void paintEvent(QPaintEvent *event) override;
401 /**
402 * Reimplemented in order to kill the QTreeView column auto-resizing
403 */
404 [[nodiscard]] int sizeHintForColumn(int logicalColumnIndex) const override;
405
406 /**
407 * Reimplemented in order to disable update of the geometries
408 * while a job step is running (as it takes a very long time and it's called for every item insertion...)
409 * TODO: not true anymore, it's called after a delay.
410 */
411 void updateGeometries() override;
412
413 /**
414 * Returns true if the vertical scrollbar should keep to the top or bottom
415 * while inserting items.
416 */
417 bool isScrollingLocked() const;
418
419 /**
420 * Used to enable/disable the ignoring of updateGeometries() calls.
421 */
422 void ignoreUpdateGeometries(bool ignore);
423
424 void modelAboutToEmitLayoutChanged();
425 void modelEmittedLayoutChanged();
426
427 /**
428 * This is called by the model to insulate us from certain QTreeView signals
429 * This is because they may be spurious (caused by Model item rearrangements).
430 */
431 void ignoreCurrentChanges(bool ignore);
432
433 /**
434 * Expands or collapses the children of the specified item, recursively.
435 */
436 void setChildrenExpanded(const Item *parent, bool expand);
437
438 /**
439 * Finds the next message item with respect to the current item.
440 * If there is no current item then the search starts from the beginning.
441 * Returns 0 if no next message could be found.
442 *
443 * messageTypeFilter can be used to limit the selection to
444 * a certain category of messages.
445 * If loop is true then restarts from the beginning if end is
446 * reached, otherwise it just returns 0 in this case.
447 */
449
450 /**
451 * Finds message item that comes "after" the reference item.
452 * If reference item is 0 then the search starts from the beginning.
453 * Returns 0 if no next message could be found.
454 *
455 * messageTypeFilter can be used to limit the selection to
456 * a certain category of messages.
457 * If loop is true then restarts from the beginning if end is
458 * reached, otherwise it just returns 0 in this case.
459 */
461
462 /**
463 * Finds the first message item in the view.
464 *
465 * messageTypeFilter can be used to limit the selection to
466 * a certain category of messages.
467 *
468 * Returns 0 if the view is empty.
469 */
471
472 /**
473 * Finds the previous message item with respect to the current item.
474 * If there is no current item then the search starts from the end.
475 * Returns 0 if no previous message could be found.
476 *
477 * messageTypeFilter can be used to limit the selection to
478 * a certain category of messages.
479 * If loop is true then restarts from the end if beginning is
480 * reached, otherwise it just return 0 in this case.
481 */
483
484 /**
485 * Returns the deepest child that is visible (i.e. not in a collapsed tree) of
486 * the specified reference item.
487 */
489
490 /**
491 * Finds message item that comes "before" the reference item.
492 * If reference item is 0 then the search starts from the end.
493 * Returns 0 if no next message could be found.
494 *
495 * messageTypeFilter can be used to limit the selection to
496 * a certain category of messages.
497 * If loop is true then restarts from the beginning if end is
498 * reached, otherwise it just returns 0 in this case.
499 */
501
502 /**
503 * Finds the last message item in the view.
504 *
505 * messageTypeFilter can be used to limit the selection to
506 * a certain category of messages.
507 *
508 * Returns nullptr if the view is empty.
509 */
511
512 /**
513 * This is called by Model to signal that the initial loading stage of a newly
514 * attached StorageModel is terminated.
515 */
517
518 /**
519 * Performs a change in the specified MessageItem status.
520 * It first applies the change to the cached state in MessageItem and
521 * then requests our parent widget to act on the storage.
522 */
524 void changeMessageStatusRead(MessageItem *it, bool read);
525
526 /**
527 * Starts a short-delay timer connected to saveThemeColumnState().
528 * Used to accumulate consecutive changes and break out of the call stack
529 * up to the main event loop (since in the call stack the column state might be left undefined).
530 */
532
533 /**
534 * Starts a short-delay timer connected to applyThemeColumns().
535 * Used to accumulate consecutive changes and break out of the call stack
536 * up to the main event loop (since multiple resize events tend to be sent by Qt at startup).
537 */
539
540 /**
541 * This is used by the selection functions to grow/shrink the existing selection
542 * according to the newly selected item passed as parameter.
543 * If movingUp is true then: if the newly selected item is above the current selection top
544 * then the selection is expanded, otherwise it's shrunk. If movingUp is false then: if the
545 * newly selected item is below the current selection bottom then the selection is expanded
546 * otherwise it's shrunk.
547 */
549
550public Q_SLOTS:
551 /**
552 * Collapses all the group headers (if present in the current Aggregation)
553 */
555
556 /**
557 * Expands all the group headers (if present in the current Aggregation)
558 */
559 void slotExpandAllGroups();
560
561 /**
562 * Expands the current item.
563 * If it's a Message, it expands its thread, if its a group header it expands the group
564 */
566
567 /**
568 * Collapses the current item.
569 * If it's a Message, it collapses its thread, if its a group header it collapses the group
570 */
572
573 void slotExpandAllThreads();
574
575 void slotCollapseAllThreads();
576
577protected Q_SLOTS:
578
579 /**
580 * Handles context menu requests for the header.
581 */
583
584 /**
585 * Handles the actions of the header context menu for showing/hiding a column.
586 */
587 void slotShowHideColumn(int columnIndex);
588
589 /**
590 * Handles the Adjust Column Sizes action of the header context menu.
591 */
593
594 /**
595 * Handles the Show Default Columns action of the header context menu.
596 */
598
599 /**
600 * Handles the Display Tooltips action of the header context menu.
601 */
603
604 /**
605 * Handles section resizes in order to save the column widths
606 */
607 void slotHeaderSectionResized(int logicalIndex, int oldWidth, int newWidth);
608
609 /**
610 * Handles selection item management
611 */
612 void slotSelectionChanged(const QItemSelection &current, const QItemSelection &);
613
614 /**
615 * Saves the state of the columns (width and visibility) to the currently selected theme object.
616 */
618
619 /**
620 * Applies the theme columns to this view.
621 * Columns visible by default are shown, the other are hidden.
622 * Visible columns are assigned space inside the view by using the size hints and some heuristics.
623 */
624 void applyThemeColumns();
625
626private:
627 class ViewPrivate;
628 std::unique_ptr<ViewPrivate> const d;
629}; // class View
630} // namespace Core
631} // namespace MessageList
A set of aggregation options that can be applied to the MessageList::Model in a single shot.
Definition aggregation.h:29
A single item of the MessageList tree managed by MessageList::Model.
Definition item.h:36
The MessageItem class.
Definition messageitem.h:35
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition model.h:54
A class which holds information about sorting, e.g.
Definition sortorder.h:23
The QAbstractItemModel based interface that you need to provide for your storage to work with Message...
The Theme class defines the visual appearance of the MessageList.
Definition theme.h:48
The MessageList::View is the real display of the message list.
Definition view.h:47
void triggerDelayedApplyThemeColumns()
Starts a short-delay timer connected to applyThemeColumns().
Definition view.cpp:569
QList< MessageItem * > selectionAsMessageItemList(bool includeCollapsedChildren=true) const
Returns the currently selected MessageItems (bound to current StorageModel).
Definition view.cpp:889
void markMessageItemsAsAboutToBeRemoved(const QList< MessageItem * > &items, bool bMark)
If bMark is true this function marks the messages as "about to be removed" so they appear dimmer and ...
Definition view.cpp:1647
void slotCollapseCurrentItem()
Collapses the current item.
Definition view.cpp:2507
QString currentFilterSearchString() const
Returns the search term in the current quicksearch field.
Definition view.cpp:2532
void setTheme(Theme *theme)
Sets the specified theme for this view.
Definition view.cpp:260
void changeEvent(QEvent *e) override
Reimplemented in order to catch palette, font and style changes.
Definition view.cpp:2121
void setCurrentThreadExpanded(bool expand)
If expand is true then it expands the current thread, otherwise collapses it.
Definition view.cpp:1005
void setSortOrder(const SortOrder *sortOrder)
Sets the specified sort order.
Definition view.cpp:268
MessageItemSetReference createPersistentSet(const QList< MessageItem * > &items)
Creates a persistent set for the specified MessageItems and returns its reference.
Definition view.cpp:1632
Item * currentItem() const
Returns the current Item (that is bound to current StorageModel).
Definition view.cpp:840
MessageItem * currentMessageItem(bool selectIfNeeded=true) const
Returns the current MessageItem (that is bound to current StorageModel).
Definition view.cpp:851
bool selectionEmpty() const
Fast function that determines if the selection is empty.
Definition view.cpp:884
void slotShowDefaultColumns()
Handles the Show Default Columns action of the header context menu.
Definition view.cpp:792
bool selectPreviousMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the previous message item in the view.
Definition view.cpp:1465
void triggerDelayedSaveThemeColumnState()
Starts a short-delay timer connected to saveThemeColumnState().
Definition view.cpp:616
QList< MessageItem * > persistentSetCurrentMessageItemList(MessageItemSetReference ref)
Returns the list of MessageItems that are still existing in the set pointed by the specified referenc...
Definition view.cpp:1637
void setAggregation(const Aggregation *aggregation)
Sets the aggregation for this view.
Definition view.cpp:251
void mouseDoubleClickEvent(QMouseEvent *e) override
Reimplemented in order to handle double clicks with sub-item precision.
Definition view.cpp:1931
void deletePersistentSet(MessageItemSetReference ref)
Deletes the persistent set pointed by the specified reference.
Definition view.cpp:1642
bool event(QEvent *e) override
Reimplemented in order to catch QHelpEvent.
Definition view.cpp:2146
Item * firstMessageItem(MessageTypeFilter messageTypeFilter)
Finds the first message item in the view.
Definition view.cpp:1218
bool selectFirstMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the first message item in the view that matches messageTypeFilter.
Definition view.cpp:1568
QList< Akonadi::MessageStatus > currentFilterStatus() const
Returns the Akonadi::MessageStatus in the current quicksearch field.
Definition view.cpp:2522
QList< MessageItem * > currentThreadAsMessageItemList() const
Returns the MessageItems bound to the current StorageModel that are part of the current thread.
Definition view.cpp:932
void mouseMoveEvent(QMouseEvent *e) override
Reimplemented in order to handle DnD.
Definition view.cpp:2046
void setStorageModel(StorageModel *storageModel, PreSelectionMode preSelectionMode=PreSelectLastSelected)
Sets the StorageModel to be displayed in this view.
Definition view.cpp:278
Delegate * delegate() const
Returns the Delegate attached to this View.
Definition view.cpp:167
void resizeEvent(QResizeEvent *e) override
Reimplemented in order to resize columns when header is not visible.
Definition view.cpp:625
bool isScrollingLocked() const
Returns true if the vertical scrollbar should keep to the top or bottom while inserting items.
Definition view.cpp:188
Item * messageItemBefore(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop)
Finds message item that comes "before" the reference item.
Definition view.cpp:1238
int sizeHintForColumn(int logicalColumnIndex) const override
Reimplemented in order to kill the QTreeView column auto-resizing.
Definition view.cpp:715
StorageModel * storageModel() const
Returns the currently displayed StorageModel.
Definition view.cpp:246
void slotExpandAllGroups()
Expands all the group headers (if present in the current Aggregation)
Definition view.cpp:2502
void ensureDisplayedWithParentsExpanded(Item *it)
Makes sure that the specified is currently viewable by the user.
Definition view.cpp:1794
void slotCollapseAllGroups()
Collapses all the group headers (if present in the current Aggregation)
Definition view.cpp:2497
void slotHeaderContextMenuRequested(const QPoint &pnt)
Handles context menu requests for the header.
Definition view.cpp:729
void applyThemeColumns()
Applies the theme columns to this view.
Definition view.cpp:313
Item * lastMessageItem(MessageTypeFilter messageTypeFilter)
Finds the last message item in the view.
Definition view.cpp:1339
void saveThemeColumnState()
Saves the state of the columns (width and visibility) to the currently selected theme object.
Definition view.cpp:578
virtual void setRowHidden(int row, const QModelIndex &parent, bool hide)
Called to hide or show the specified row from the view.
Definition view.cpp:2537
void selectFocusedMessageItem(bool centerItem)
Selects the currently focused message item.
Definition view.cpp:1550
Item * nextMessageItem(MessageTypeFilter messageTypeFilter, bool loop)
Finds the next message item with respect to the current item.
Definition view.cpp:1223
void modelFinishedLoading()
This is called by Model to signal that the initial loading stage of a newly attached StorageModel is ...
Definition view.cpp:1624
void slotAdjustColumnSizes()
Handles the Adjust Column Sizes action of the header context menu.
Definition view.cpp:782
bool selectNextMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the next message item in the view.
Definition view.cpp:1428
bool isDisplayedWithParentsExpanded(Item *it) const
Returns true if the specified item is currently displayed in the tree and has all the parents expande...
Definition view.cpp:1824
Item * messageItemAfter(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop)
Finds message item that comes "after" the reference item.
Definition view.cpp:1122
void setAllGroupsExpanded(bool expand)
If expand is true then it expands all the groups (only the toplevel group item: inner threads are NOT...
Definition view.cpp:1054
void slotSelectionChanged(const QItemSelection &current, const QItemSelection &)
Handles selection item management.
Definition view.cpp:1878
void dragMoveEvent(QDragMoveEvent *e) override
Reimplemented in order to handle message DnD.
Definition view.cpp:2111
void dropEvent(QDropEvent *e) override
Reimplemented in order to handle message DnD.
Definition view.cpp:2116
void setChildrenExpanded(const Item *parent, bool expand)
Expands or collapses the children of the specified item, recursively.
Definition view.cpp:953
void reload()
Triggers a reload of the view in order to re-display the current folder.
Definition view.cpp:273
bool focusPreviousMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the previous message item in the view without actually selecting it.
Definition view.cpp:1526
bool focusNextMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the next message item in the view without actually selecting it.
Definition view.cpp:1502
void focusQuickSearch(const QString &selectedText)
Sets the focus on the quick search line of the currently active tab.
Definition view.cpp:2517
void growOrShrinkExistingSelection(const QModelIndex &newSelectedIndex, bool movingUp)
This is used by the selection functions to grow/shrink the existing selection according to the newly ...
Definition view.cpp:1349
void setCurrentMessageItem(MessageItem *it, bool center=false)
Sets the current message item.
Definition view.cpp:869
void mousePressEvent(QMouseEvent *e) override
Reimplemented in order to handle clicks with sub-item precision.
Definition view.cpp:2034
Model * model() const
Returns the Model attached to this View.
Definition view.cpp:162
void ignoreUpdateGeometries(bool ignore)
Used to enable/disable the ignoring of updateGeometries() calls.
Definition view.cpp:183
void setAllThreadsExpanded(bool expand)
If expand is true then it expands all the threads, otherwise collapses them.
Definition view.cpp:1033
Item * previousMessageItem(MessageTypeFilter messageTypeFilter, bool loop)
Finds the previous message item with respect to the current item.
Definition view.cpp:1344
void slotExpandCurrentItem()
Expands the current item.
Definition view.cpp:2512
void slotShowHideColumn(int columnIndex)
Handles the actions of the header context menu for showing/hiding a column.
Definition view.cpp:807
Item * deepestExpandedChild(Item *referenceItem) const
Returns the deepest child that is visible (i.e.
Definition view.cpp:1228
bool selectLastMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the last message item in the view that matches messageTypeFilter.
Definition view.cpp:1596
void selectMessageItems(const QList< MessageItem * > &list)
Selects the specified MessageItems.
Definition view.cpp:1085
void slotHeaderSectionResized(int logicalIndex, int oldWidth, int newWidth)
Handles section resizes in order to save the column widths.
Definition view.cpp:704
void ignoreCurrentChanges(bool ignore)
This is called by the model to insulate us from certain QTreeView signals This is because they may be...
Definition view.cpp:172
void dragEnterEvent(QDragEnterEvent *e) override
Reimplemented in order to handle message DnD.
Definition view.cpp:2106
void slotDisplayTooltips(bool showTooltips)
Handles the Display Tooltips action of the header context menu.
Definition view.cpp:802
void changeMessageStatus(MessageItem *it, Akonadi::MessageStatus set, Akonadi::MessageStatus unset)
Performs a change in the specified MessageItem status.
Definition view.cpp:2007
bool isThreaded() const
Returns true if the current Aggregation is threaded, false otherwise (or if there is no current Aggre...
Definition view.cpp:1870
void updateGeometries() override
Reimplemented in order to disable update of the geometries while a job step is running (as it takes a...
Definition view.cpp:224
Provides a widget which has the messagelist and the most important helper widgets,...
Definition widgetbase.h:41
ExistingSelectionBehaviour
This enum is used in the view message selection functions (for instance View::selectNextMessage())
PreSelectionMode
Pre-selection is the action of automatically selecting a message just after the folder has finished l...
MessageTypeFilter
This enum is used in the view message selection functions (for instance View::nextMessageItem()).
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
T qobject_cast(QObject *object)
void expand(const QModelIndex &index)
void hide()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.