aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-10 18:30:09 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-11 15:11:12 +0200
commite53b5bc9a106f961a79e2a9c94b5dd10f05845d4 (patch)
tree9cf0387ee6007cdf2b6147dbcb68c073cfdc80ad /src/plugins/texteditor
parentb8f7d44753dc70838ac74e2262b606b5f0b363a7 (diff)
Fixed completion settings to also apply to the QML code completion
By moving the completion settings into the TextEditor plugin, so that both the CppTools and the QmlJSEditor plugins can access the settings. The user-interface to edit the settings is still in the CppTools plugin, since we're in string freeze at the moment. It should be moved to the TextEditor plugin later. For now the QML completion only supports the case-sensitivity and partial completion options, since there is no automatic insertion of brackets. Task-number: QTCREATORBUG-1327 Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r--src/plugins/texteditor/completionsettings.cpp86
-rw-r--r--src/plugins/texteditor/completionsettings.h70
-rw-r--r--src/plugins/texteditor/icompletioncollector.cpp51
-rw-r--r--src/plugins/texteditor/icompletioncollector.h26
-rw-r--r--src/plugins/texteditor/texteditor.pro6
-rw-r--r--src/plugins/texteditor/texteditorsettings.cpp117
-rw-r--r--src/plugins/texteditor/texteditorsettings.h21
7 files changed, 318 insertions, 59 deletions
diff --git a/src/plugins/texteditor/completionsettings.cpp b/src/plugins/texteditor/completionsettings.cpp
new file mode 100644
index 00000000000..0d800da3b32
--- /dev/null
+++ b/src/plugins/texteditor/completionsettings.cpp
@@ -0,0 +1,86 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, 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.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#include "completionsettings.h"
+
+#include <QtCore/QSettings>
+
+static const char * const groupPostfix = "Completion";
+static const char * const caseSensitivityKey = "CaseSensitivity";
+static const char * const autoInsertBracesKey = "AutoInsertBraces";
+static const char * const partiallyCompleteKey = "PartiallyComplete";
+static const char * const spaceAfterFunctionNameKey = "SpaceAfterFunctionName";
+
+using namespace TextEditor;
+
+CompletionSettings::CompletionSettings()
+ : m_caseSensitivity(FirstLetterCaseSensitive)
+ , m_autoInsertBrackets(true)
+ , m_partiallyComplete(true)
+ , m_spaceAfterFunctionName(false)
+{
+}
+
+void CompletionSettings::toSettings(const QString &category, QSettings *s) const
+{
+ QString group = QLatin1String(groupPostfix);
+ if (!category.isEmpty())
+ group.insert(0, category);
+
+ s->beginGroup(group);
+ s->setValue(QLatin1String(caseSensitivityKey), (int) m_caseSensitivity);
+ s->setValue(QLatin1String(autoInsertBracesKey), m_autoInsertBrackets);
+ s->setValue(QLatin1String(partiallyCompleteKey), m_partiallyComplete);
+ s->setValue(QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName);
+ s->endGroup();
+}
+
+void CompletionSettings::fromSettings(const QString &category, const QSettings *s)
+{
+ QString group = QLatin1String(groupPostfix);
+ if (!category.isEmpty())
+ group.insert(0, category);
+ group += QLatin1Char('/');
+
+ *this = CompletionSettings(); // Assign defaults
+
+ m_caseSensitivity = (CaseSensitivity) s->value(group + QLatin1String(caseSensitivityKey), m_caseSensitivity).toInt();
+ m_autoInsertBrackets = s->value(group + QLatin1String(autoInsertBracesKey), m_autoInsertBrackets).toBool();
+ m_partiallyComplete = s->value(group + QLatin1String(partiallyCompleteKey), m_partiallyComplete).toBool();
+ m_spaceAfterFunctionName = s->value(group + QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName).toBool();
+}
+
+bool CompletionSettings::equals(const CompletionSettings &cs) const
+{
+ return m_caseSensitivity == cs.m_caseSensitivity
+ && m_autoInsertBrackets == cs.m_autoInsertBrackets
+ && m_partiallyComplete == cs.m_partiallyComplete
+ && m_spaceAfterFunctionName == cs.m_spaceAfterFunctionName
+ ;
+}
diff --git a/src/plugins/texteditor/completionsettings.h b/src/plugins/texteditor/completionsettings.h
new file mode 100644
index 00000000000..0d35abf9bb3
--- /dev/null
+++ b/src/plugins/texteditor/completionsettings.h
@@ -0,0 +1,70 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, 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.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#ifndef COMPLETIONSETTINGS_H
+#define COMPLETIONSETTINGS_H
+
+#include "texteditor_global.h"
+
+QT_BEGIN_NAMESPACE
+class QSettings;
+QT_END_NAMESPACE
+
+namespace TextEditor {
+
+enum CaseSensitivity {
+ CaseInsensitive,
+ CaseSensitive,
+ FirstLetterCaseSensitive
+};
+
+/**
+ * Settings that describe how the code completion behaves.
+ */
+struct TEXTEDITOR_EXPORT CompletionSettings
+{
+ CompletionSettings();
+
+ void toSettings(const QString &category, QSettings *s) const;
+ void fromSettings(const QString &category, const QSettings *s);
+
+ bool equals(const CompletionSettings &bs) const;
+
+ CaseSensitivity m_caseSensitivity;
+ bool m_autoInsertBrackets;
+ bool m_partiallyComplete;
+ bool m_spaceAfterFunctionName;
+};
+
+inline bool operator==(const CompletionSettings &t1, const CompletionSettings &t2) { return t1.equals(t2); }
+inline bool operator!=(const CompletionSettings &t1, const CompletionSettings &t2) { return !t1.equals(t2); }
+
+} // namespace TextEditor
+
+#endif // COMPLETIONSETTINGS_H
diff --git a/src/plugins/texteditor/icompletioncollector.cpp b/src/plugins/texteditor/icompletioncollector.cpp
index 9bf453e1b5a..0d4dd129667 100644
--- a/src/plugins/texteditor/icompletioncollector.cpp
+++ b/src/plugins/texteditor/icompletioncollector.cpp
@@ -28,11 +28,27 @@
**************************************************************************/
#include "icompletioncollector.h"
+
+#include "completionsettings.h"
#include "itexteditable.h"
+
#include <QtCore/QRegExp>
#include <algorithm>
using namespace TextEditor;
+using namespace TextEditor::Internal;
+
+namespace TextEditor {
+namespace Internal {
+
+struct ICompletionCollectorPrivate
+{
+public:
+ CompletionSettings m_completionSettings;
+};
+
+} // namespace Internal
+} // namespace TextEditor
bool ICompletionCollector::compareChar(const QChar &l, const QChar &r)
{
@@ -62,6 +78,27 @@ bool ICompletionCollector::completionItemLessThan(const CompletionItem &i1, cons
return lessThan(lower1, lower2);
}
+ICompletionCollector::ICompletionCollector(QObject *parent)
+ : QObject(parent)
+ , m_d(new Internal::ICompletionCollectorPrivate)
+{
+}
+
+ICompletionCollector::~ICompletionCollector()
+{
+ delete m_d;
+}
+
+void ICompletionCollector::setCompletionSettings(const CompletionSettings &settings)
+{
+ m_d->m_completionSettings = settings;
+}
+
+const CompletionSettings &ICompletionCollector::completionSettings() const
+{
+ return m_d->m_completionSettings;
+}
+
QList<CompletionItem> ICompletionCollector::getCompletions()
{
QList<CompletionItem> completionItems;
@@ -88,6 +125,9 @@ QList<CompletionItem> ICompletionCollector::getCompletions()
bool ICompletionCollector::partiallyComplete(const QList<TextEditor::CompletionItem> &completionItems)
{
+ if (! m_d->m_completionSettings.m_partiallyComplete)
+ return false;
+
// Compute common prefix
QString firstKey = completionItems.first().text;
QString lastKey = completionItems.last().text;
@@ -113,9 +153,10 @@ bool ICompletionCollector::partiallyComplete(const QList<TextEditor::CompletionI
void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items,
QList<TextEditor::CompletionItem> *filteredItems,
- const QString &key,
- ICompletionCollector::CaseSensitivity caseSensitivity)
+ const QString &key)
{
+ const TextEditor::CaseSensitivity caseSensitivity = m_d->m_completionSettings.m_caseSensitivity;
+
/*
* This code builds a regular expression in order to more intelligently match
* camel-case style. This means upper-case characters will be rewritten as follows:
@@ -132,8 +173,8 @@ void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items
bool first = true;
const QLatin1String wordContinuation("[a-z0-9_]*");
foreach (const QChar &c, key) {
- if (caseSensitivity == CaseInsensitive ||
- (caseSensitivity == FirstLetterCaseSensitive && !first)) {
+ if (caseSensitivity == TextEditor::CaseInsensitive ||
+ (caseSensitivity == TextEditor::FirstLetterCaseSensitive && !first)) {
keyRegExp += QLatin1String("(?:");
if (c.isUpper() && !first)
@@ -158,7 +199,7 @@ void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items
if (hasKey) {
if (item.text.startsWith(key, Qt::CaseSensitive)) {
item.relevance = 2;
- } else if (caseSensitivity != CaseSensitive
+ } else if (caseSensitivity != TextEditor::CaseSensitive
&& item.text.startsWith(key, Qt::CaseInsensitive)) {
item.relevance = 1;
}
diff --git a/src/plugins/texteditor/icompletioncollector.h b/src/plugins/texteditor/icompletioncollector.h
index e2cfdfacd81..e78ad83b829 100644
--- a/src/plugins/texteditor/icompletioncollector.h
+++ b/src/plugins/texteditor/icompletioncollector.h
@@ -38,8 +38,13 @@
namespace TextEditor {
+namespace Internal {
+class ICompletionCollectorPrivate;
+}
+
class ICompletionCollector;
class ITextEditable;
+struct CompletionSettings;
struct CompletionItem
{
@@ -73,8 +78,10 @@ class TEXTEDITOR_EXPORT ICompletionCollector : public QObject
{
Q_OBJECT
public:
- ICompletionCollector(QObject *parent = 0) : QObject(parent) {}
- virtual ~ICompletionCollector() {}
+ ICompletionCollector(QObject *parent = 0);
+ virtual ~ICompletionCollector();
+
+ const CompletionSettings &completionSettings() const;
virtual QList<CompletionItem> getCompletions();
virtual bool shouldRestartCompletion();
@@ -120,21 +127,20 @@ public:
// helpers
- enum CaseSensitivity {
- CaseInsensitive,
- CaseSensitive,
- FirstLetterCaseSensitive
- };
-
void filter(const QList<TextEditor::CompletionItem> &items,
QList<TextEditor::CompletionItem> *filteredItems,
- const QString &key,
- CaseSensitivity caseSensitivity);
+ const QString &key);
+
+public slots:
+ void setCompletionSettings(const TextEditor::CompletionSettings &);
protected:
static bool compareChar(const QChar &item, const QChar &other);
static bool lessThan(const QString &item, const QString &other);
static bool completionItemLessThan(const CompletionItem &item, const CompletionItem &other);
+
+private:
+ Internal::ICompletionCollectorPrivate *m_d;
};
class TEXTEDITOR_EXPORT IQuickFixCollector : public ICompletionCollector
diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro
index 26429c08586..a27f857809a 100644
--- a/src/plugins/texteditor/texteditor.pro
+++ b/src/plugins/texteditor/texteditor.pro
@@ -34,7 +34,8 @@ SOURCES += texteditorplugin.cpp \
itexteditor.cpp \
texteditoroverlay.cpp \
texteditoroptionspage.cpp \
- basetextdocumentlayout.cpp
+ basetextdocumentlayout.cpp \
+ completionsettings.cpp
HEADERS += texteditorplugin.h \
textfilewizard.h \
@@ -71,7 +72,8 @@ HEADERS += texteditorplugin.h \
colorschemeedit.h \
texteditoroverlay.h \
texteditoroptionspage.h \
- basetextdocumentlayout.h
+ basetextdocumentlayout.h \
+ completionsettings.h
FORMS += behaviorsettingspage.ui \
diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp
index de018d407fe..52b98abd9d9 100644
--- a/src/plugins/texteditor/texteditorsettings.cpp
+++ b/src/plugins/texteditor/texteditorsettings.cpp
@@ -33,6 +33,7 @@
#include "basetexteditor.h"
#include "behaviorsettings.h"
#include "behaviorsettingspage.h"
+#include "completionsettings.h"
#include "displaysettings.h"
#include "displaysettingspage.h"
#include "fontsettingspage.h"
@@ -41,17 +42,54 @@
#include "texteditorplugin.h"
#include <extensionsystem/pluginmanager.h>
+#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <QtGui/QApplication>
using namespace TextEditor;
using namespace TextEditor::Constants;
+using namespace TextEditor::Internal;
+
+namespace TextEditor {
+namespace Internal {
+
+class TextEditorSettingsPrivate
+{
+public:
+ FontSettingsPage *m_fontSettingsPage;
+ BehaviorSettingsPage *m_behaviorSettingsPage;
+ DisplaySettingsPage *m_displaySettingsPage;
+
+ CompletionSettings m_completionSettings;
+
+ void fontZoomRequested(int pointSize);
+ void zoomResetRequested();
+};
+
+void TextEditorSettingsPrivate::fontZoomRequested(int zoom)
+{
+ FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
+ fs.setFontZoom(qMax(10, fs.fontZoom() + zoom));
+ m_fontSettingsPage->saveSettings();
+}
+
+void TextEditorSettingsPrivate::zoomResetRequested()
+{
+ FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
+ fs.setFontZoom(100);
+ m_fontSettingsPage->saveSettings();
+}
+
+} // namespace Internal
+} // namespace TextEditor
+
TextEditorSettings *TextEditorSettings::m_instance = 0;
TextEditorSettings::TextEditorSettings(QObject *parent)
: QObject(parent)
+ , m_d(new Internal::TextEditorSettingsPrivate)
{
QTC_ASSERT(!m_instance, return);
m_instance = this;
@@ -102,44 +140,50 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_FILE), tr("Diff File"), Qt::darkBlue));
formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_LOCATION), tr("Diff Location"), Qt::blue));
- m_fontSettingsPage = new FontSettingsPage(formatDescriptions,
- QLatin1String("A.FontSettings"),
- this);
- pm->addObject(m_fontSettingsPage);
+ m_d->m_fontSettingsPage = new FontSettingsPage(formatDescriptions,
+ QLatin1String("A.FontSettings"),
+ this);
+ pm->addObject(m_d->m_fontSettingsPage);
// Add the GUI used to configure the tab, storage and interaction settings
TextEditor::BehaviorSettingsPageParameters behaviorSettingsPageParameters;
behaviorSettingsPageParameters.id = QLatin1String("B.BehaviourSettings");
behaviorSettingsPageParameters.displayName = tr("Behavior");
behaviorSettingsPageParameters.settingsPrefix = QLatin1String("text");
- m_behaviorSettingsPage = new BehaviorSettingsPage(behaviorSettingsPageParameters, this);
- pm->addObject(m_behaviorSettingsPage);
+ m_d->m_behaviorSettingsPage = new BehaviorSettingsPage(behaviorSettingsPageParameters, this);
+ pm->addObject(m_d->m_behaviorSettingsPage);
TextEditor::DisplaySettingsPageParameters displaySettingsPageParameters;
displaySettingsPageParameters.id = QLatin1String("D.DisplaySettings"),
displaySettingsPageParameters.displayName = tr("Display");
displaySettingsPageParameters.settingsPrefix = QLatin1String("text");
- m_displaySettingsPage = new DisplaySettingsPage(displaySettingsPageParameters, this);
- pm->addObject(m_displaySettingsPage);
+ m_d->m_displaySettingsPage = new DisplaySettingsPage(displaySettingsPageParameters, this);
+ pm->addObject(m_d->m_displaySettingsPage);
- connect(m_fontSettingsPage, SIGNAL(changed(TextEditor::FontSettings)),
+ connect(m_d->m_fontSettingsPage, SIGNAL(changed(TextEditor::FontSettings)),
this, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)));
- connect(m_behaviorSettingsPage, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)),
+ connect(m_d->m_behaviorSettingsPage, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)),
this, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)));
- connect(m_behaviorSettingsPage, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)),
+ connect(m_d->m_behaviorSettingsPage, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)),
this, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)));
- connect(m_behaviorSettingsPage, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)),
+ connect(m_d->m_behaviorSettingsPage, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)),
this, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)));
- connect(m_displaySettingsPage, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)),
+ connect(m_d->m_displaySettingsPage, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)),
this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)));
+
+ // TODO: Move these settings to TextEditor category
+ if (QSettings *s = Core::ICore::instance()->settings())
+ m_d->m_completionSettings.fromSettings(QLatin1String("CppTools/"), s);
}
TextEditorSettings::~TextEditorSettings()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
- pm->removeObject(m_fontSettingsPage);
- pm->removeObject(m_behaviorSettingsPage);
- pm->removeObject(m_displaySettingsPage);
+ pm->removeObject(m_d->m_fontSettingsPage);
+ pm->removeObject(m_d->m_behaviorSettingsPage);
+ pm->removeObject(m_d->m_displaySettingsPage);
+
+ delete m_d;
m_instance = 0;
}
@@ -181,41 +225,46 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
}
-void TextEditorSettings::fontZoomRequested(int zoom)
+const FontSettings &TextEditorSettings::fontSettings() const
{
- FontSettings &fs = const_cast<FontSettings&>(fontSettings());
- fs.setFontZoom(qMax(10, fs.fontZoom() + zoom));
- m_fontSettingsPage->saveSettings();
+ return m_d->m_fontSettingsPage->fontSettings();
}
-void TextEditorSettings::zoomResetRequested()
+const TabSettings &TextEditorSettings::tabSettings() const
{
- FontSettings &fs = const_cast<FontSettings&>(fontSettings());
- fs.setFontZoom(100);
- m_fontSettingsPage->saveSettings();
+ return m_d->m_behaviorSettingsPage->tabSettings();
}
-const FontSettings &TextEditorSettings::fontSettings() const
+const StorageSettings &TextEditorSettings::storageSettings() const
{
- return m_fontSettingsPage->fontSettings();
+ return m_d->m_behaviorSettingsPage->storageSettings();
}
-const TabSettings &TextEditorSettings::tabSettings() const
+const BehaviorSettings &TextEditorSettings::behaviorSettings() const
{
- return m_behaviorSettingsPage->tabSettings();
+ return m_d->m_behaviorSettingsPage->behaviorSettings();
}
-const StorageSettings &TextEditorSettings::storageSettings() const
+const DisplaySettings &TextEditorSettings::displaySettings() const
{
- return m_behaviorSettingsPage->storageSettings();
+ return m_d->m_displaySettingsPage->displaySettings();
}
-const BehaviorSettings &TextEditorSettings::behaviorSettings() const
+const CompletionSettings &TextEditorSettings::completionSettings() const
{
- return m_behaviorSettingsPage->behaviorSettings();
+ return m_d->m_completionSettings;
}
-const DisplaySettings &TextEditorSettings::displaySettings() const
+void TextEditorSettings::setCompletionSettings(const TextEditor::CompletionSettings &settings)
{
- return m_displaySettingsPage->displaySettings();
+ if (m_d->m_completionSettings == settings)
+ return;
+
+ m_d->m_completionSettings = settings;
+ if (QSettings *s = Core::ICore::instance()->settings())
+ m_d->m_completionSettings.toSettings(QLatin1String("CppTools/"), s);
+
+ emit completionSettingsChanged(m_d->m_completionSettings);
}
+
+#include "moc_texteditorsettings.cpp"
diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h
index a5836304bee..ff6c9b95862 100644
--- a/src/plugins/texteditor/texteditorsettings.h
+++ b/src/plugins/texteditor/texteditorsettings.h
@@ -45,11 +45,16 @@ struct TabSettings;
struct StorageSettings;
struct BehaviorSettings;
struct DisplaySettings;
+struct CompletionSettings;
+
+namespace Internal {
+class TextEditorSettingsPrivate;
+}
/**
* This class provides a central place for basic text editor settings. These
* settings include font settings, tab settings, storage settings, behavior
- * settings and display settings.
+ * settings, display settings and completion settings.
*/
class TEXTEDITOR_EXPORT TextEditorSettings : public QObject
{
@@ -68,6 +73,9 @@ public:
const StorageSettings &storageSettings() const;
const BehaviorSettings &behaviorSettings() const;
const DisplaySettings &displaySettings() const;
+ const CompletionSettings &completionSettings() const;
+
+ void setCompletionSettings(const TextEditor::CompletionSettings &);
signals:
void fontSettingsChanged(const TextEditor::FontSettings &);
@@ -75,15 +83,12 @@ signals:
void storageSettingsChanged(const TextEditor::StorageSettings &);
void behaviorSettingsChanged(const TextEditor::BehaviorSettings &);
void displaySettingsChanged(const TextEditor::DisplaySettings &);
-
-private slots:
- void fontZoomRequested(int pointSize);
- void zoomResetRequested();
+ void completionSettingsChanged(const TextEditor::CompletionSettings &);
private:
- FontSettingsPage *m_fontSettingsPage;
- BehaviorSettingsPage *m_behaviorSettingsPage;
- DisplaySettingsPage *m_displaySettingsPage;
+ Internal::TextEditorSettingsPrivate *m_d;
+ Q_PRIVATE_SLOT(m_d, void fontZoomRequested(int pointSize));
+ Q_PRIVATE_SLOT(m_d, void zoomResetRequested());
static TextEditorSettings *m_instance;
};