File indexing completed on 2024-12-15 04:54:44

0001 /******************************************************************************
0002  *
0003  *  SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  *
0007  *******************************************************************************/
0008 
0009 #pragma once
0010 
0011 #include "utils/configureaggregationsdialog.h"
0012 #include <QListWidgetItem>
0013 namespace MessageList
0014 {
0015 namespace Core
0016 {
0017 class Aggregation;
0018 } // namespace Core
0019 
0020 namespace Utils
0021 {
0022 class AggregationEditor;
0023 class AggregationListWidget;
0024 class AggregationListWidgetItem;
0025 
0026 /**
0027  * The dialog used for configuring MessageList::Aggregation sets.
0028  *
0029  * This is managed by MessageList::Manager. Take a look at it first
0030  * if you want to display this dialog.
0031  */
0032 class Q_DECL_HIDDEN ConfigureAggregationsDialog::ConfigureAggregationsDialogPrivate
0033 {
0034 public:
0035     ConfigureAggregationsDialogPrivate(ConfigureAggregationsDialog *owner)
0036         : q(owner)
0037     {
0038     }
0039 
0040     // Private implementation
0041 
0042     void fillAggregationList();
0043     QString uniqueNameForAggregation(const QString &baseName, Core::Aggregation *skipAggregation = nullptr);
0044     AggregationListWidgetItem *findAggregationItemByName(const QString &name, Core::Aggregation *skipAggregation = nullptr);
0045     AggregationListWidgetItem *findAggregationItemByAggregation(Core::Aggregation *set);
0046     AggregationListWidgetItem *findAggregationItemById(const QString &aggregationId);
0047     void commitEditor();
0048 
0049     // Private slots
0050 
0051     void aggregationListItemClicked(QListWidgetItem *cur);
0052     void newAggregationButtonClicked();
0053     void cloneAggregationButtonClicked();
0054     void deleteAggregationButtonClicked();
0055     void editedAggregationNameChanged();
0056     void okButtonClicked();
0057     void exportAggregationButtonClicked();
0058     void importAggregationButtonClicked();
0059     void updateButton(QListWidgetItem *cur);
0060 
0061     ConfigureAggregationsDialog *const q;
0062 
0063     AggregationListWidget *mAggregationList = nullptr;
0064     AggregationEditor *mEditor = nullptr;
0065     QPushButton *mNewAggregationButton = nullptr;
0066     QPushButton *mCloneAggregationButton = nullptr;
0067     QPushButton *mDeleteAggregationButton = nullptr;
0068     QPushButton *mExportAggregationButton = nullptr;
0069     QPushButton *mImportAggregationButton = nullptr;
0070 };
0071 } // namespace Utils
0072 } // namespace MessageList