forked from qt-creator/qt-creator
Fix compilation of QmlJS code formatter test.
Done by moving ITextMark and ITextMarkable from itexteditor.h to itextmark.h. The test uses parts of the texteditor plugin by compiling some of its files. For that to work, the code has to be fairly stand-alone. The reference to EditorManager in itexteditor.cpp broke it. Long term, the test should become a plugin based test to avoid this kind of problem. Change-Id: Ibae3bcd7365eb4e2814cd07011cad0180507e82b Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "texteditor_global.h"
|
||||
|
||||
#include "itextmark.h"
|
||||
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
|
||||
#include <QObject>
|
||||
@@ -53,54 +55,6 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace TextEditor {
|
||||
|
||||
class ITextEditor;
|
||||
|
||||
class TEXTEDITOR_EXPORT ITextMark
|
||||
{
|
||||
public:
|
||||
ITextMark(int line) : m_lineNumber(line), m_priority(NormalPriority) {}
|
||||
virtual ~ITextMark();
|
||||
|
||||
// determine order on markers on the same line.
|
||||
enum Priority
|
||||
{
|
||||
LowPriority,
|
||||
NormalPriority,
|
||||
HighPriority // shown on top.
|
||||
};
|
||||
|
||||
int lineNumber() const;
|
||||
virtual void paint(QPainter *painter, const QRect &rect) const;
|
||||
virtual void updateLineNumber(int lineNumber);
|
||||
virtual void updateBlock(const QTextBlock &block);
|
||||
virtual void removedFromEditor();
|
||||
void setIcon(const QIcon &icon);
|
||||
Priority priority() const;
|
||||
void setPriority(Priority prioriy);
|
||||
virtual bool visible() const;
|
||||
virtual double widthFactor() const;
|
||||
|
||||
private:
|
||||
int m_lineNumber;
|
||||
QIcon m_icon;
|
||||
Priority m_priority;
|
||||
};
|
||||
|
||||
typedef QList<ITextMark *> TextMarks;
|
||||
|
||||
|
||||
class TEXTEDITOR_EXPORT ITextMarkable : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ITextMarkable(QObject *parent = 0) : QObject(parent) {}
|
||||
|
||||
virtual bool addMark(ITextMark *mark) = 0;
|
||||
virtual TextMarks marksAt(int line) const = 0;
|
||||
virtual void removeMark(ITextMark *mark) = 0;
|
||||
virtual void updateMark(ITextMark *mark) = 0;
|
||||
};
|
||||
|
||||
class TEXTEDITOR_EXPORT ITextEditor : public Core::IEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user