2011-07-06 10:38:53 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-07-06 10:38:53 +02:00
|
|
|
**
|
2011-11-02 15:59:12 +01:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2011-07-06 10:38:53 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-11-02 15:59:12 +01:00
|
|
|
** Nokia at qt-info@nokia.com.
|
2011-07-06 10:38:53 +02:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2011-02-03 15:48:14 +01:00
|
|
|
#ifndef QMLJSCODESTYLESETTINGSPAGE_H
|
|
|
|
|
#define QMLJSCODESTYLESETTINGSPAGE_H
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QPointer>
|
2011-02-03 15:48:14 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QSettings;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace TextEditor {
|
|
|
|
|
class FontSettings;
|
|
|
|
|
class TabSettings;
|
2011-08-16 10:45:23 +02:00
|
|
|
class CodeStyleEditor;
|
|
|
|
|
class ICodeStylePreferences;
|
2011-02-03 15:48:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace QmlJSTools {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-05-25 09:31:03 +02:00
|
|
|
namespace Ui {
|
|
|
|
|
class QmlJSCodeStyleSettingsPage;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-25 08:50:01 +02:00
|
|
|
class QmlJSCodeStylePreferencesWidget : public QWidget
|
2011-02-03 15:48:14 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2011-05-25 08:50:01 +02:00
|
|
|
explicit QmlJSCodeStylePreferencesWidget(QWidget *parent = 0);
|
|
|
|
|
virtual ~QmlJSCodeStylePreferencesWidget();
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2011-08-16 10:45:23 +02:00
|
|
|
void setPreferences(TextEditor::ICodeStylePreferences *preferences);
|
2011-02-03 15:48:14 +01:00
|
|
|
|
|
|
|
|
QString searchKeywords() const;
|
|
|
|
|
|
|
|
|
|
private slots:
|
2011-08-16 10:45:23 +02:00
|
|
|
void decorateEditor(const TextEditor::FontSettings &fontSettings);
|
2011-02-03 15:48:14 +01:00
|
|
|
void setVisualizeWhitespace(bool on);
|
2011-05-25 08:50:01 +02:00
|
|
|
void slotSettingsChanged();
|
2011-02-03 15:48:14 +01:00
|
|
|
void updatePreview();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
2011-08-16 10:45:23 +02:00
|
|
|
TextEditor::ICodeStylePreferences *m_preferences;
|
2011-02-03 15:48:14 +01:00
|
|
|
Ui::QmlJSCodeStyleSettingsPage *m_ui;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QmlJSCodeStyleSettingsPage : public Core::IOptionsPage
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit QmlJSCodeStyleSettingsPage(QWidget *parent = 0);
|
|
|
|
|
~QmlJSCodeStyleSettingsPage();
|
|
|
|
|
|
|
|
|
|
virtual QString id() const;
|
|
|
|
|
virtual QString displayName() const;
|
|
|
|
|
virtual QString category() const;
|
|
|
|
|
virtual QString displayCategory() const;
|
|
|
|
|
virtual QIcon categoryIcon() const;
|
|
|
|
|
|
|
|
|
|
virtual QWidget *createPage(QWidget *parent);
|
|
|
|
|
virtual void apply();
|
|
|
|
|
virtual void finish() { }
|
|
|
|
|
virtual bool matches(const QString &) const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_searchKeywords;
|
2011-08-16 10:45:23 +02:00
|
|
|
TextEditor::ICodeStylePreferences *m_pageTabPreferences;
|
|
|
|
|
QPointer<TextEditor::CodeStyleEditor> m_widget;
|
2011-02-03 15:48:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CppTools
|
|
|
|
|
|
|
|
|
|
#endif // QMLJSCODESTYLESETTINGSPAGE_H
|