19 #ifndef _KATE_VIEW_INCLUDE_
20 #define _KATE_VIEW_INCLUDE_
22 #include <tdetexteditor/document.h>
23 #include <tdetexteditor/view.h>
24 #include <tdetexteditor/clipboardinterface.h>
25 #include <tdetexteditor/popupmenuinterface.h>
26 #include <tdetexteditor/markinterface.h>
27 #include <tdetexteditor/viewcursorinterface.h>
28 #include <tdetexteditor/codecompletioninterface.h>
29 #include <tdetexteditor/dynwordwrapinterface.h>
42 class KATEPARTINTERFACES_EXPORT
View :
public KTextEditor::View,
public KTextEditor::ClipboardInterface,
43 public KTextEditor::PopupMenuInterface,
public KTextEditor::ViewCursorInterface,
44 public KTextEditor::CodeCompletionInterface,
public KTextEditor::DynWordWrapInterface
52 enum saveResult { SAVE_OK, SAVE_CANCEL, SAVE_RETRY, SAVE_ERROR };
56 View ( KTextEditor::Document *, TQWidget *,
const char *name = 0 );
81 virtual TQString
word(
int ,
int ) {
return 0L; }
86 virtual void insertText(
const TQString &mark ) { Q_UNUSED(mark); }
93 virtual int tabWidth() = 0;
94 virtual void setTabWidth(
int) = 0;
95 virtual void setEncoding (TQString e) = 0;
100 virtual bool isLastView() = 0;
143 virtual void keyDelete () { ; };
144 virtual void backspace () { ; };
145 virtual void killLine () { ; };
150 virtual void shiftCursorLeft () { ; };
151 virtual void cursorRight () { ; };
152 virtual void shiftCursorRight () { ; };
153 virtual void wordLeft () { ; };
154 virtual void shiftWordLeft () { ; };
155 virtual void wordRight () { ; };
156 virtual void shiftWordRight () { ; };
157 virtual void home () { ; };
158 virtual void shiftHome () { ; };
159 virtual void end () { ; };
160 virtual void shiftEnd () { ; };
161 virtual void up () { ; };
162 virtual void shiftUp () { ; };
163 virtual void down () { ; };
164 virtual void shiftDown () { ; };
165 virtual void scrollUp () { ; };
166 virtual void scrollDown () { ; };
167 virtual void topOfView () { ; };
168 virtual void bottomOfView () { ; };
169 virtual void pageUp () { ; };
170 virtual void shiftPageUp () { ; };
171 virtual void pageDown () { ; };
172 virtual void shiftPageDown () { ; };
173 virtual void top () { ; };
174 virtual void shiftTop () { ; };
175 virtual void bottom () { ; };
176 virtual void shiftBottom () { ; };
219 virtual void findAgain(
bool forward ) { Q_UNUSED(forward); }
279 virtual void gotoMark (KTextEditor::Mark *mark) = 0;
288 virtual void gotoLineNumber(
int ) = 0;
291 void gotFocus (
View *);
295 virtual void setActive (
bool b) = 0;
296 virtual bool isActive () = 0;
299 KATEPARTINTERFACES_EXPORT View *view (KTextEditor::View *view);
virtual void insertText(const TQString &mark)
Insert text at the current cursor position.
virtual Document * getDoc()
Returns a pointer to the document of the view.
virtual TQString word(int, int)
Gets the word at position x, y.
virtual void readSessionConfig(TDEConfig *)
Reads session config out of the TDEConfig object.
virtual void setFocus()
Set focus to the current window.
virtual void findAgain()
Searches for the last searched text forward from cursor position.
virtual void setOverwriteMode(bool)
Get editor mode.
This interface provides access to the Kate Document class.
virtual saveResult saveAs()
Allows the user to save the file under a new name.
virtual bool iconBorder()
Returns whether iconborder is visible.
virtual void findAgain(bool forward)
Searches for the last searched text forward from cursor position.
The Kate::View text editor interface.
saveResult
Return values for "save" related commands.
virtual void setLineNumbersOn(bool enable)
Sets display of line numbers on/off depending on enable.
virtual int getEol()
Get the end of line mode (Unix, Macintosh or Dos).
virtual void toggleBookmark()
virtual void setIconBorder(bool enable)
Sets icon border on or off depending on.
virtual void slotIncFontSizes()
Increase font size.
virtual void replace()
Presents a replace dialog to the user.
virtual void toggleIconBorder()
Toggles icon border.
virtual void writeSessionConfig(TDEConfig *)
Writes session config into the TDEConfig object.
const TDEShortcut & end()
virtual void gotoLine()
Presents a "Goto Line" dialog to the user.
virtual void cleanIndent()
Optimizes the selected indentation, replacing tabs and spaces as needed.
virtual void cursorLeft()
Move cursor in the view.
virtual void slotEditCommand()
Presents an edit command popup window, where the user can apply a shell command to the contents of th...
virtual TQString currentTextLine()
Gets the text line where the cursor is on.
const TDEShortcut & home()
virtual void keyReturn()
Some simply key commands.
virtual void setEol(int)
Set the end of line mode (Unix, Macintosh or Dos).
virtual void uncomment()
Removes comment signs in the current line.
virtual void comment()
Comments out current line.
virtual bool canDiscard()
Works exactly like closeURL() of KParts::ReadWritePart.
virtual void findPrev()
Searches for the last searched text forward from cursor position.
virtual saveResult save()
Saves the file under the current file name.
virtual bool isOverwriteMode() const
Set editor mode.
virtual void flush()
Flushes the document of the text widget.
virtual void find()
Presents a search dialog to the user.
virtual TQString currentWord()
Gets the word where the cursor is on.
virtual bool lineNumbersOn()
Kate namespace All classes in this namespace must stay BC during one major release series (e...
virtual void indent()
Moves the current line or the selection one position to the right.
virtual void toggleLineNumbersOn()
Toggles display of lineNumbers.
virtual void slotDecFontSizes()
Decrease font size.
virtual void unIndent()
Moves the current line or the selection one position to the left.