summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodestylepreferences.h
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-02-03 15:48:14 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2011-05-24 12:45:07 +0200
commit779fafcbfe6f92dd1288664fae512f69bc12418b (patch)
tree38a3b75cc3a18f386ab72102e97f06ffa24d4d29 /src/plugins/cpptools/cppcodestylepreferences.h
parentf69eb52944a7fc8306cbb72b7325a610045dea7a (diff)
downloadqt-creator-779fafcbfe6f92dd1288664fae512f69bc12418b.tar.gz
Make C++ code style configurable.
Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b Done-with: Jarek Kobus Task-number: QTCREATORBUG-2670 Task-number: QTCREATORBUG-4310 Task-number: QTCREATORBUG-2763 Task-number: QTCREATORBUG-3623 Task-number: QTCREATORBUG-567 Reviewed-on: http://codereview.qt.nokia.com/74 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodestylepreferences.h')
-rw-r--r--src/plugins/cpptools/cppcodestylepreferences.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodestylepreferences.h b/src/plugins/cpptools/cppcodestylepreferences.h
new file mode 100644
index 0000000000..991e15f017
--- /dev/null
+++ b/src/plugins/cpptools/cppcodestylepreferences.h
@@ -0,0 +1,48 @@
+#ifndef CPPCODESTYLEPREFERENCES_H
+#define CPPCODESTYLEPREFERENCES_H
+
+#include "cpptools_global.h"
+#include "cppcodestylesettings.h"
+#include <texteditor/ifallbackpreferences.h>
+
+namespace CppTools {
+
+class CPPTOOLS_EXPORT CppCodeStylePreferences : public TextEditor::IFallbackPreferences
+{
+ Q_OBJECT
+public:
+ explicit CppCodeStylePreferences(
+ const QList<TextEditor::IFallbackPreferences *> &fallbacks,
+ QObject *parent = 0);
+
+ virtual QVariant value() const;
+ virtual void setValue(const QVariant &);
+
+ CppCodeStyleSettings settings() const;
+
+ // tracks parent hierarchy until currentParentSettings is null
+ CppCodeStyleSettings currentSettings() const;
+
+ virtual void toMap(const QString &prefix, QVariantMap *map) const;
+ virtual void fromMap(const QString &prefix, const QVariantMap &map);
+
+public slots:
+ void setSettings(const CppTools::CppCodeStyleSettings &data);
+
+signals:
+ void settingsChanged(const CppTools::CppCodeStyleSettings &);
+ void currentSettingsChanged(const CppTools::CppCodeStyleSettings &);
+
+protected:
+ virtual QString settingsSuffix() const;
+
+private slots:
+ void slotCurrentValueChanged(const QVariant &);
+
+private:
+ CppCodeStyleSettings m_data;
+};
+
+} // namespace CppTools
+
+#endif // CPPCODESTYLEPREFERENCES_H