TextEditors: Separate away methods that actually work on a document

Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().

Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
Eike Ziller
2013-04-18 18:21:17 +02:00
parent e31575a493
commit b450b3071e
20 changed files with 96 additions and 79 deletions

View File

@@ -158,8 +158,6 @@ public:
BaseTextEditor *editor() const;
ITextMarkable *markableInterface() const;
QChar characterAt(int pos) const;
void print(QPrinter *);
void setSuggestedFileName(const QString &suggestedFileName);
@@ -621,8 +619,7 @@ public:
friend class BaseTextEditorWidget;
BaseTextEditorWidget *editorWidget() const { return e; }
// EditorInterface
//QWidget *widget() { return e; }
// IEditor
Core::IDocument * document() { return e->editorDocument(); }
bool createNew(const QString &contents) { return e->createNew(contents); }
bool open(QString *errorString, const QString &fileName, const QString &realFileName) { return e->open(errorString, fileName, realFileName); }
@@ -637,7 +634,6 @@ public:
void insertExtraToolBarWidget(Side side, QWidget *widget);
// ITextEditor
int find(const QString &string) const;
int currentLine() const;
int currentColumn() const;
void gotoLine(int line, int column = 0) { e->gotoLine(line, column); }
@@ -650,10 +646,7 @@ public:
{ e->convertPosition(pos, line, column); }
QRect cursorRect(int pos = -1) const;
QString contents() const;
QString selectedText() const;
QString textAt(int pos, int length) const;
inline QChar characterAt(int pos) const { return e->characterAt(pos); }
inline ITextMarkable *markableInterface() { return e->markableInterface(); }