Messagelib

aggregationeditor.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 <utils/optionseteditor.h>
12 
13 class QComboBox;
14 
15 namespace MessageList
16 {
17 namespace Core
18 {
19 class Aggregation;
20 } // namespace Core
21 
22 namespace Utils
23 {
24 /**
25  * A widget that allows editing a single MessageList::Aggregation.
26  *
27  * Used by ConfigureAggregationsDialog.
28  */
30 {
31  Q_OBJECT
32 public:
33  explicit AggregationEditor(QWidget *parent);
34  ~AggregationEditor() override;
35 
36 private:
37  Core::Aggregation *mCurrentAggregation = nullptr; // shallow, may be null!
38 
39  // Grouping, Threading and Sorting tab
40  QComboBox *mGroupingCombo = nullptr;
41  QComboBox *mGroupExpandPolicyCombo = nullptr;
42  QComboBox *mThreadingCombo = nullptr;
43  QComboBox *mThreadLeaderCombo = nullptr;
44  QComboBox *mThreadExpandPolicyCombo = nullptr;
45  // Advanced tab
46  QComboBox *mFillViewStrategyCombo = nullptr;
47 
48 public:
49  /**
50  * Sets the Aggregation to be edited.
51  * Saves and forgets any previously Aggregation that was being edited.
52  * The set parameter may be 0: in this case the editor is simply disabled.
53  */
55 
56  /**
57  * Returns the Aggregation currently edited by this AggregationEditor.
58  * May be 0.
59  */
61  {
62  return mCurrentAggregation;
63  }
64 
65  /**
66  * Explicitly commits the changes in the editor to the edited Aggregation, if any.
67  */
68  void commit();
69 
70 Q_SIGNALS:
71  /**
72  * This is triggered when the aggregation name changes in the editor text field.
73  * It's connected to the Aggregation configuration dialog which updates
74  * the list of aggregations with the new name.
75  */
77 
78 private:
79  // Helpers for filling the various editing elements
80 
81  void fillGroupingCombo();
82  void fillGroupExpandPolicyCombo();
83  void fillThreadingCombo();
84  void fillThreadLeaderCombo();
85  void fillThreadExpandPolicyCombo();
86  void fillFillViewStrategyCombo();
87  void setReadOnly(bool readOnly);
88 
89 private Q_SLOTS:
90 
91  // Internal handlers for editing element interaction
92 
93  void groupingComboActivated(int idx);
94  void threadingComboActivated(int idx);
95  void slotNameEditTextEdited(const QString &newName) override;
96 };
97 } // namespace Utils
98 } // namespace MessageList
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
void aggregationNameChanged()
This is triggered when the aggregation name changes in the editor text field.
void commit()
Explicitly commits the changes in the editor to the edited Aggregation, if any.
Core::Aggregation * editedAggregation() const
Returns the Aggregation currently edited by this AggregationEditor.
A widget that allows editing a single MessageList::Aggregation.
Q_SIGNALSQ_SIGNALS
void editAggregation(Core::Aggregation *set)
Sets the Aggregation to be edited.
The base class for the OptionSet editors.
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:52:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.