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

0001 /* SPDX-FileCopyrightText: 2009 James Bendig <james@imptalk.com>
0002 
0003    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 #pragma once
0006 
0007 #include "messagelist_export.h"
0008 #include <Akonadi/Collection>
0009 #include <QComboBox>
0010 #include <memory>
0011 namespace MessageList
0012 {
0013 namespace Core
0014 {
0015 class StorageModel;
0016 class Theme;
0017 } // namespace Core
0018 
0019 namespace Utils
0020 {
0021 class ThemeComboBoxPrivate;
0022 
0023 /**
0024  * A specialized QComboBox that lists all message list themes.
0025  */
0026 class MESSAGELIST_EXPORT ThemeComboBox : public QComboBox
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     explicit ThemeComboBox(QWidget *parent);
0032     ~ThemeComboBox() override;
0033 
0034     QString currentTheme() const;
0035 
0036     void writeDefaultConfig() const;
0037 
0038     void writeStorageModelConfig(MessageList::Core::StorageModel *storageModel, bool isPrivateSetting) const;
0039     void writeStorageModelConfig(const QString &id, bool isPrivateSetting) const;
0040 
0041     void readStorageModelConfig(const Akonadi::Collection &col, bool &isPrivateSetting);
0042     void readStorageModelConfig(MessageList::Core::StorageModel *storageModel, bool &isPrivateSetting);
0043 
0044 public Q_SLOTS:
0045     void slotLoadThemes();
0046     void selectDefault();
0047 
0048 private:
0049     std::unique_ptr<ThemeComboBoxPrivate> const d;
0050 };
0051 } // namespace Utils
0052 } // namespace MessageList