Messagelib

view.h
1 /******************************************************************************
2  *
3  * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <[email protected]>
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 
18 class QMenu;
19 
20 namespace Akonadi
21 {
22 class MessageStatus;
23 }
24 
25 namespace MessageList
26 {
27 namespace Core
28 {
29 using MessageItemSetReference = long;
30 
31 class Aggregation;
32 class Delegate;
33 class Item;
34 class MessageItem;
35 class Model;
36 class Theme;
37 class SortOrder;
38 class StorageModel;
39 class 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  */
46 class View : public QTreeView
47 {
48  friend class Model;
49  friend class ModelPrivate;
50  Q_OBJECT
51 public:
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  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  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  */
75  void setStorageModel(StorageModel *storageModel, PreSelectionMode preSelectionMode = PreSelectLastSelected);
76 
77  /**
78  * Returns the currently displayed StorageModel. May be 0.
79  */
80  StorageModel *storageModel() const;
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  */
112  MessageItem *currentMessageItem(bool selectIfNeeded = true) const;
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  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  */
132  bool isDisplayedWithParentsExpanded(Item *it) const;
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  */
151  QList<MessageItem *> selectionAsMessageItemList(bool includeCollapsedChildren = true) const;
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  bool selectionEmpty() const;
169 
170  /**
171  * Selects the specified MessageItems. The current selection is NOT removed.
172  * Use clearSelection() for that purpose.
173  */
174  void selectMessageItems(const QList<MessageItem *> &list);
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  */
195  [[nodiscard]] QList<MessageItem *> persistentSetCurrentMessageItemList(MessageItemSetReference ref);
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  */
209  void markMessageItemsAsAboutToBeRemoved(const QList<MessageItem *> &items, bool bMark);
210 
211  /**
212  * Returns true if the current Aggregation is threaded, false otherwise
213  * (or if there is no current Aggregation).
214  */
215  bool isThreaded() const;
216 
217  /**
218  * If expand is true then it expands the current thread, otherwise
219  * collapses it.
220  */
221  void setCurrentThreadExpanded(bool expand);
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  */
254  bool selectNextMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop);
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  */
273  bool selectPreviousMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop);
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  */
286  bool focusNextMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop);
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  */
296  bool focusPreviousMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop);
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  */
304  void selectFocusedMessageItem(bool centerItem);
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  */
311  bool selectFirstMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem);
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  */
318  bool selectLastMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem);
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 
354 protected:
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  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  */
448  Item *nextMessageItem(MessageTypeFilter messageTypeFilter, bool loop);
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  */
460  Item *messageItemAfter(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop);
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  */
470  Item *firstMessageItem(MessageTypeFilter messageTypeFilter);
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  */
482  Item *previousMessageItem(MessageTypeFilter messageTypeFilter, bool loop);
483 
484  /**
485  * Returns the deepest child that is visible (i.e. not in a collapsed tree) of
486  * the specified reference item.
487  */
488  Item *deepestExpandedChild(Item *referenceItem) const;
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  */
500  Item *messageItemBefore(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop);
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  */
510  Item *lastMessageItem(MessageTypeFilter messageTypeFilter);
511 
512  /**
513  * This is called by Model to signal that the initial loading stage of a newly
514  * attached StorageModel is terminated.
515  */
516  void modelFinishedLoading();
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  */
548  void growOrShrinkExistingSelection(const QModelIndex &newSelectedIndex, bool movingUp);
549 
550 public Q_SLOTS:
551  /**
552  * Collapses all the group headers (if present in the current Aggregation)
553  */
554  void slotCollapseAllGroups();
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  */
565  void slotExpandCurrentItem();
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 
577 protected Q_SLOTS:
578 
579  /**
580  * Handles context menu requests for the header.
581  */
582  void slotHeaderContextMenuRequested(const QPoint &pnt);
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  */
592  void slotAdjustColumnSizes();
593 
594  /**
595  * Handles the Show Default Columns action of the header context menu.
596  */
597  void slotShowDefaultColumns();
598 
599  /**
600  * Handles the Display Tooltips action of the header context menu.
601  */
602  void slotDisplayTooltips(bool showTooltips);
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  */
617  void saveThemeColumnState();
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 
626 private:
627  class ViewPrivate;
628  std::unique_ptr<ViewPrivate> const d;
629 }; // class View
630 } // namespace Core
631 } // namespace MessageList
Q_OBJECTQ_OBJECT
void mouseDoubleClickEvent(QMouseEvent *e) override
Reimplemented in order to handle double clicks with sub-item precision.
Definition: view.cpp:1931
bool selectionEmpty() const
Fast function that determines if the selection is empty.
Definition: view.cpp:884
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 slotCollapseAllGroups()
Collapses all the group headers (if present in the current Aggregation)
Definition: view.cpp:2497
QList< Akonadi::MessageStatus > currentFilterStatus() const
Returns the Akonadi::MessageStatus in the current quicksearch field.
Definition: view.cpp:2522
void dropEvent(QDropEvent *e) override
Reimplemented in order to handle message DnD.
Definition: view.cpp:2116
The MessageItem class.
Definition: messageitem.h:34
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 setAggregation(const Aggregation *aggregation)
Sets the aggregation for this view.
Definition: view.cpp:251
Q_SLOTSQ_SLOTS
The MessageList::View is the real display of the message list.
Definition: view.h:46
Item * lastMessageItem(MessageTypeFilter messageTypeFilter)
Finds the last message item in the view.
Definition: view.cpp:1339
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
void ignoreUpdateGeometries(bool ignore)
Used to enable/disable the ignoring of updateGeometries() calls.
Definition: view.cpp:183
void setSortOrder(const SortOrder *sortOrder)
Sets the specified sort order.
Definition: view.cpp:268
Item * messageItemAfter(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop)
Finds message item that comes "after" the reference item.
Definition: view.cpp:1122
void slotSelectionChanged(const QItemSelection &current, const QItemSelection &)
Handles selection item management.
Definition: view.cpp:1878
void ref()
bool focusPreviousMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the previous message item in the view without actually selecting it.
Definition: view.cpp:1526
QString currentFilterSearchString() const
Returns the search term in the current quicksearch field.
Definition: view.cpp:2532
void deletePersistentSet(MessageItemSetReference ref)
Deletes the persistent set pointed by the specified reference.
Definition: view.cpp:1642
bool focusNextMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the next message item in the view without actually selecting it.
Definition: view.cpp:1502
Provides a widget which has the messagelist and the most important helper widgets,...
Definition: widgetbase.h:40
void selectMessageItems(const QList< MessageItem * > &list)
Selects the specified MessageItems.
Definition: view.cpp:1085
void dragEnterEvent(QDragEnterEvent *e) override
Reimplemented in order to handle message DnD.
Definition: view.cpp:2106
Model
Definition: item.h:49
void mouseMoveEvent(QMouseEvent *e) override
Reimplemented in order to handle DnD.
Definition: view.cpp:2046
Model * model() const
Returns the Model attached to this View.
Definition: view.cpp:162
bool selectFirstMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the first message item in the view that matches messageTypeFilter.
Definition: view.cpp:1568
void setCurrentThreadExpanded(bool expand)
If expand is true then it expands the current thread, otherwise collapses it.
Definition: view.cpp:1005
StorageModel * storageModel() const
Returns the currently displayed StorageModel.
Definition: view.cpp:246
void dragMoveEvent(QDragMoveEvent *e) override
Reimplemented in order to handle message DnD.
Definition: view.cpp:2111
Item * nextMessageItem(MessageTypeFilter messageTypeFilter, bool loop)
Finds the next message item with respect to the current item.
Definition: view.cpp:1223
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 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 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 hide()
void slotExpandCurrentItem()
Expands the current item.
Definition: view.cpp:2512
void setTheme(Theme *theme)
Sets the specified theme for this view.
Definition: view.cpp:260
void slotHeaderSectionResized(int logicalIndex, int oldWidth, int newWidth)
Handles section resizes in order to save the column widths.
Definition: view.cpp:704
void setAllThreadsExpanded(bool expand)
If expand is true then it expands all the threads, otherwise collapses them.
Definition: view.cpp:1033
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
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
bool selectNextMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the next message item in the view.
Definition: view.cpp:1428
void slotDisplayTooltips(bool showTooltips)
Handles the Display Tooltips action of the header context menu.
Definition: view.cpp:802
void slotShowHideColumn(int columnIndex)
Handles the actions of the header context menu for showing/hiding a column.
Definition: view.cpp:807
Delegate * delegate() const
Returns the Delegate attached to this View.
Definition: view.cpp:167
void ensureDisplayedWithParentsExpanded(Item *it)
Makes sure that the specified is currently viewable by the user.
Definition: view.cpp:1794
void changeMessageStatus(MessageItem *it, Akonadi::MessageStatus set, Akonadi::MessageStatus unset)
Performs a change in the specified MessageItem status.
Definition: view.cpp:2007
bool selectPreviousMessageItem(MessageTypeFilter messageTypeFilter, ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the previous message item in the view.
Definition: view.cpp:1465
int sizeHintForColumn(int logicalColumnIndex) const override
Reimplemented in order to kill the QTreeView column auto-resizing.
Definition: view.cpp:715
MessageItemSetReference createPersistentSet(const QList< MessageItem * > &items)
Creates a persistent set for the specified MessageItems and returns its reference.
Definition: view.cpp:1632
QList< MessageItem * > currentThreadAsMessageItemList() const
Returns the MessageItems bound to the current StorageModel that are part of the current thread.
Definition: view.cpp:932
PreSelectionMode
Pre-selection is the action of automatically selecting a message just after the folder has finished l...
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
A class which holds information about sorting, e.g.
Definition: sortorder.h:34
void triggerDelayedApplyThemeColumns()
Starts a short-delay timer connected to applyThemeColumns().
Definition: view.cpp:569
void slotExpandAllGroups()
Expands all the group headers (if present in the current Aggregation)
Definition: view.cpp:2502
void applyThemeColumns()
Applies the theme columns to this view.
Definition: view.cpp:313
Item * currentItem() const
Returns the current Item (that is bound to current StorageModel).
Definition: view.cpp:840
void slotAdjustColumnSizes()
Handles the Adjust Column Sizes action of the header context menu.
Definition: view.cpp:782
void triggerDelayedSaveThemeColumnState()
Starts a short-delay timer connected to saveThemeColumnState().
Definition: view.cpp:616
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:47
QList< MessageItem * > selectionAsMessageItemList(bool includeCollapsedChildren=true) const
Returns the currently selected MessageItems (bound to current StorageModel).
Definition: view.cpp:889
void selectFocusedMessageItem(bool centerItem)
Selects the currently focused message item.
Definition: view.cpp:1550
Item * messageItemBefore(Item *referenceItem, MessageTypeFilter messageTypeFilter, bool loop)
Finds message item that comes "before" the reference item.
Definition: view.cpp:1238
void setCurrentMessageItem(MessageItem *it, bool center=false)
Sets the current message item.
Definition: view.cpp:869
void changeEvent(QEvent *e) override
Reimplemented in order to catch palette, font and style changes.
Definition: view.cpp:2121
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 * previousMessageItem(MessageTypeFilter messageTypeFilter, bool loop)
Finds the previous message item with respect to the current item.
Definition: view.cpp:1344
Item * firstMessageItem(MessageTypeFilter messageTypeFilter)
Finds the first message item in the view.
Definition: view.cpp:1218
ExistingSelectionBehaviour
This enum is used in the view message selection functions (for instance View::selectNextMessage())
void resizeEvent(QResizeEvent *e) override
Reimplemented in order to resize columns when header is not visible.
Definition: view.cpp:625
The QAbstractItemModel based interface that you need to provide for your storage to work with Message...
void saveThemeColumnState()
Saves the state of the columns (width and visibility) to the currently selected theme object.
Definition: view.cpp:578
bool selectLastMessageItem(MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the last message item in the view that matches messageTypeFilter.
Definition: view.cpp:1596
void expand(const QModelIndex &index)
void setStorageModel(StorageModel *storageModel, PreSelectionMode preSelectionMode=PreSelectLastSelected)
Sets the StorageModel to be displayed in this view.
Definition: view.cpp:278
MessageTypeFilter
This enum is used in the view message selection functions (for instance View::nextMessageItem()).
void reload()
Triggers a reload of the view in order to re-display the current folder.
Definition: view.cpp:273
MessageItem * currentMessageItem(bool selectIfNeeded=true) const
Returns the current MessageItem (that is bound to current StorageModel).
Definition: view.cpp:851
void mousePressEvent(QMouseEvent *e) override
Reimplemented in order to handle clicks with sub-item precision.
Definition: view.cpp:2034
This class manages the huge tree of displayable objects: GroupHeaderItems and MessageItems.
Definition: model.h:65
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:47
void slotHeaderContextMenuRequested(const QPoint &pnt)
Handles context menu requests for the header.
Definition: view.cpp:729
void setChildrenExpanded(const Item *parent, bool expand)
Expands or collapses the children of the specified item, recursively.
Definition: view.cpp:953
bool event(QEvent *e) override
Reimplemented in order to catch QHelpEvent.
Definition: view.cpp:2146
Item * deepestExpandedChild(Item *referenceItem) const
Returns the deepest child that is visible (i.e.
Definition: view.cpp:1228
A set of aggregation options that can be applied to the MessageList::Model in a single shot.
Definition: aggregation.h:28
QObject * parent() const const
bool isScrollingLocked() const
Returns true if the vertical scrollbar should keep to the top or bottom while inserting items.
Definition: view.cpp:188
void slotShowDefaultColumns()
Handles the Show Default Columns action of the header context menu.
Definition: view.cpp:792
void slotCollapseCurrentItem()
Collapses the current item.
Definition: view.cpp:2507
void focusQuickSearch(const QString &selectedText)
Sets the focus on the quick search line of the currently active tab.
Definition: view.cpp:2517
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:03:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.