Files
sqlitebrowser/src/docktextedit.h
T
mgrojo a0e0fc98ae XML mode for the cell editor
The new editor mode shares the same Scintilla widget as the JSON mode.
The JsonTextEdit class has been generalised. Future modes supported by
Scintilla could be added with the current pattern. As a consequence, the
EditMode is not always equal to the current stacked widget.

Some code in EditDialog has been refactored, so it is easier to understand
and modified with so many modes. textNullSet has been replaced by the use
of dataType as Null.

SVG is promoted to a new recognised data type, so it can be edited in the
XML mode.

The XML data is formatted and validated following the pattern established
by the JSON mode.

New modules are needed by the XML mode: the Qt XML module and some new
Scintilla files required by the HTML/XML lexer.

The indent_compact was incorrectly named in Setting::getDefaultValue.

See issue #1253.
2017-12-23 22:19:17 +01:00

41 lines
754 B
C++

#ifndef DOCKTEXTEDIT_H
#define DOCKTEXTEDIT_H
#include "ExtendedScintilla.h"
#include <Qsci/qscilexerjson.h>
#include <Qsci/qscilexerxml.h>
/**
* @brief The DockTextEdit class
* This class is based on our Extended QScintilla widget
*/
class DockTextEdit : public ExtendedScintilla
{
Q_OBJECT
public:
explicit DockTextEdit(QWidget *parent = nullptr);
virtual ~DockTextEdit();
// Enumeration of supported languages
enum Language
{
JSON,
XML
};
void setLanguage(Language lang);
Language language() { return m_language; };
public slots:
void reloadSettings();
protected:
static QsciLexerJSON* jsonLexer;
static QsciLexerXML* xmlLexer;
private:
Language m_language;
};
#endif