Messagelib

aggregationeditor.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 "utils/optionseteditor.h"
12
13class QComboBox;
14
15namespace MessageList
16{
17namespace Core
18{
19class Aggregation;
20} // namespace Core
21
22namespace Utils
23{
24/**
25 * A widget that allows editing a single MessageList::Aggregation.
26 *
27 * Used by ConfigureAggregationsDialog.
28 */
30{
32public:
34 ~AggregationEditor() override;
35
36private:
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
48public:
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
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
78private:
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 // Internal handlers for editing element interaction
89
90 void groupingComboActivated(int idx);
91 void threadingComboActivated(int idx);
92 void slotNameEditTextEdited(const QString &newName) override;
93};
94} // namespace Utils
95} // namespace MessageList
A set of aggregation options that can be applied to the MessageList::Model in a single shot.
Definition aggregation.h:29
A widget that allows editing a single MessageList::Aggregation.
void editAggregation(Core::Aggregation *set)
Sets the Aggregation to be edited.
Core::Aggregation * editedAggregation() const
Returns the Aggregation currently edited by this AggregationEditor.
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.
The base class for the OptionSet editors.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.