# class Document |
Contains pure virtuals
Full name | `KTextEditor::Document`
Definition | `#include <ktexteditor.h>`
Inherits | KParts::ReadWritePart (kparts) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- Document ( QObject *parent = 0, const char *name = 0 )
- virtual ~Document ()
- virtual View * createView ( QWidget *parent, const char *name = 0 )
- virtual QList<View> views () const
- virtual QString textLine ( int line ) const
- virtual void setSelection ( int row_from, int col_from, int row_to, int col_t )
- virtual bool hasSelection () const
- virtual QString selection () const
- virtual int numLines () const
- virtual void insertLine ( const QString &s, int line = -1 )
- virtual void insertAt ( const QString &s, int line, int col, bool mark = FALSE )
- virtual void removeLine ( int line )
- virtual QString text () const
- virtual int length () const

#### Public Slots

- virtual void setText ( const QString &t )

#### Signals

- void textChanged ()
- void deleted ( int startLine, int endLine )
- void inserted ( int startLine, int endLine )

#### Protected Methods

- virtual void addView ( View *view )
- virtual void removeView ( View *view )

#### Protected Members

- QList<View> m_views

## Detailed Description

Document ( QObject *parent = 0, const char *name = 0 ) | ### Document

~Document () | ### ~Document

[virtual]

View * createView ( QWidget *parent, const char *name = 0 ) | ### createView

[pure virtual]

Create a view that will display the document data. You can create as many views as you like. When the user modifies data in one view then all other views will be updated as well.

QList<View> views () | ### views

[const virtual]

QString textLine ( int line ) | ### textLine

[const pure virtual]

Returns: All the text from the requested line.

void setSelection ( int row_from, int col_from, int row_to, int col_t ) | ### setSelection

[pure virtual]

bool hasSelection () | ### hasSelection

[const pure virtual]

QString selection () | ### selection

[const pure virtual]

int numLines () | ### numLines

[const pure virtual]

Returns: The current number of lines in the document

void insertLine ( const QString &s, int line = -1 ) | ### insertLine

[pure virtual]

Insert line(s) at the given line number. If the line number is -1 (the default) then the line is added to end of the document

void insertAt ( const QString &s, int line, int col, bool mark = FALSE ) | ### insertAt

[pure virtual]

Add the line(s) into the document at the given line and column.

void removeLine ( int line ) | ### removeLine

[pure virtual]

QString text () | ### text

[const pure virtual]

Returns: the complete document as a single QString

int length () | ### length

[const pure virtual]

Returns: the number of characters in the document

void setText ( const QString &t ) | ### setText

[pure virtual slot]

Set the given text into the view. Warning: This will overwrite any data currently held in this view.

void textChanged () | ### textChanged

[signal]

When the user changes the text then this signal is emitted TODO: - explain why and what type of change trigger this?

void deleted ( int startLine, int endLine ) | ### deleted

[signal]

void inserted ( int startLine, int endLine ) | ### inserted

[signal]

void addView ( View *view ) | ### addView

[protected virtual]

Call this method in your document implementation whenever you created a new view. (like in createView )

void removeView ( View *view ) | ### removeView

[protected virtual]

Call this method in your document implementation whenever you delete a view.

QList<View> m_views | ### m_views

[protected]

Generated by: root@i386.ports.openbsd.org on Wed Apr 25 13:59:18 2001, using kdoc 2.0a53.