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

KDE's Doxygen guidelines are available online.