File indexing completed on 2024-04-28 04:37:26
0001 /* 0002 SPDX-FileCopyrightText: 2008 Cédric Pasteur <cedric.pasteur@free.fr> 0003 SPDX-FileCopyrightText: 2017 Friedrich W. H. Kossebau <kossebau@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef KDEVPLATFORM_SOURCEFORMATTERSELECTIONEDIT_H 0009 #define KDEVPLATFORM_SOURCEFORMATTERSELECTIONEDIT_H 0010 0011 #include <QWidget> 0012 0013 #include "shellexport.h" 0014 0015 class KConfigGroup; 0016 class QListWidgetItem; 0017 0018 namespace KDevelop { 0019 class ISourceFormatter; 0020 class SourceFormatterSelectionEditPrivate; 0021 0022 class KDEVPLATFORMSHELL_EXPORT SourceFormatterSelectionEdit : public QWidget 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 explicit SourceFormatterSelectionEdit(QWidget* parent = nullptr); 0028 ~SourceFormatterSelectionEdit() override; 0029 0030 public: 0031 void loadSettings(const KConfigGroup& config); 0032 void saveSettings(KConfigGroup& config) const; 0033 0034 Q_SIGNALS: 0035 void changed(); 0036 0037 private Q_SLOTS: 0038 void addSourceFormatter(KDevelop::ISourceFormatter* ifmt); 0039 void removeSourceFormatter(KDevelop::ISourceFormatter* ifmt); 0040 0041 void deleteStyle(); 0042 void editStyle(); 0043 void newStyle(); 0044 void selectLanguage(int ); 0045 void selectFormatter(int ); 0046 void styleSelectionChanged(); 0047 void styleNameChanged(QListWidgetItem* ); 0048 0049 private: 0050 void addSourceFormatterNoUi(KDevelop::ISourceFormatter* ifmt); 0051 void resetUi(); 0052 0053 private: 0054 const QScopedPointer<class SourceFormatterSelectionEditPrivate> d_ptr; 0055 Q_DECLARE_PRIVATE(SourceFormatterSelectionEdit) 0056 }; 0057 0058 } 0059 0060 #endif 0061