Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/sourceformatterselectionedit.h
Show All 26 Lines | |||||
27 | #include "shellexport.h" | 27 | #include "shellexport.h" | ||
28 | 28 | | |||
29 | class KConfigGroup; | 29 | class KConfigGroup; | ||
30 | class QListWidgetItem; | 30 | class QListWidgetItem; | ||
31 | 31 | | |||
32 | namespace KDevelop | 32 | namespace KDevelop | ||
33 | { | 33 | { | ||
34 | class SourceFormatterStyle; | 34 | class SourceFormatterStyle; | ||
35 | class ISourceFormatter; | ||||
35 | 36 | | |||
36 | class KDEVPLATFORMSHELL_EXPORT SourceFormatterSelectionEdit : public QWidget | 37 | class KDEVPLATFORMSHELL_EXPORT SourceFormatterSelectionEdit : public QWidget | ||
37 | { | 38 | { | ||
38 | Q_OBJECT | 39 | Q_OBJECT | ||
39 | 40 | | |||
40 | public: | 41 | public: | ||
41 | explicit SourceFormatterSelectionEdit(QWidget* parent = nullptr); | 42 | explicit SourceFormatterSelectionEdit(QWidget* parent = nullptr); | ||
42 | ~SourceFormatterSelectionEdit() override; | 43 | ~SourceFormatterSelectionEdit() override; | ||
43 | 44 | | |||
44 | public: | 45 | public: | ||
45 | void loadSettings(const KConfigGroup& config); | 46 | void loadSettings(const KConfigGroup& config); | ||
46 | void saveSettings(KConfigGroup& config); | 47 | void saveSettings(KConfigGroup& config); | ||
47 | 48 | | |||
48 | Q_SIGNALS: | 49 | Q_SIGNALS: | ||
49 | void changed(); | 50 | void changed(); | ||
50 | 51 | | |||
51 | private Q_SLOTS: | 52 | private Q_SLOTS: | ||
53 | void addSourceFormatter(KDevelop::ISourceFormatter* ifmt); | ||||
54 | void removeSourceFormatter(KDevelop::ISourceFormatter* ifmt); | ||||
55 | | ||||
52 | void deleteStyle(); | 56 | void deleteStyle(); | ||
53 | void editStyle(); | 57 | void editStyle(); | ||
54 | void newStyle(); | 58 | void newStyle(); | ||
55 | void selectLanguage(int ); | 59 | void selectLanguage(int ); | ||
56 | void selectFormatter(int ); | 60 | void selectFormatter(int ); | ||
57 | void selectStyle(int ); | 61 | void selectStyle(int ); | ||
58 | void styleNameChanged(QListWidgetItem* ); | 62 | void styleNameChanged(QListWidgetItem* ); | ||
59 | 63 | | |||
60 | private: | 64 | private: | ||
65 | void resetUi(); | ||||
61 | void updatePreview(); | 66 | void updatePreview(); | ||
62 | QListWidgetItem* addStyle(const KDevelop::SourceFormatterStyle& s); | 67 | QListWidgetItem* addStyle(const KDevelop::SourceFormatterStyle& s); | ||
63 | void enableStyleButtons(); | 68 | void enableStyleButtons(); | ||
64 | 69 | | |||
65 | private: | 70 | private: | ||
66 | const QScopedPointer<class SourceFormatterSelectionEditPrivate> d; | 71 | const QScopedPointer<class SourceFormatterSelectionEditPrivate> d; | ||
67 | }; | 72 | }; | ||
68 | 73 | | |||
69 | } | 74 | } | ||
70 | 75 | | |||
71 | #endif | 76 | #endif | ||
72 | 77 | |