summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodestylepreferences.h
blob: 991e15f0171b31c6877587025a294940dde06282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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