Kate
view.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _KATE_VIEW_INCLUDE_
00020 #define _KATE_VIEW_INCLUDE_
00021
00022 #include <ktexteditor/document.h>
00023 #include <ktexteditor/view.h>
00024 #include <ktexteditor/clipboardinterface.h>
00025 #include <ktexteditor/popupmenuinterface.h>
00026 #include <ktexteditor/markinterface.h>
00027 #include <ktexteditor/viewcursorinterface.h>
00028 #include <ktexteditor/codecompletioninterface.h>
00029 #include <ktexteditor/dynwordwrapinterface.h>
00030
00031 class KConfig;
00032
00033 namespace Kate
00034 {
00035
00036 class Document;
00037
00042 class KATEPARTINTERFACES_EXPORT View : public KTextEditor::View, public KTextEditor::ClipboardInterface,
00043 public KTextEditor::PopupMenuInterface, public KTextEditor::ViewCursorInterface,
00044 public KTextEditor::CodeCompletionInterface, public KTextEditor::DynWordWrapInterface
00045 {
00046 Q_OBJECT
00047
00048 public:
00052 enum saveResult { SAVE_OK, SAVE_CANCEL, SAVE_RETRY, SAVE_ERROR };
00056 View ( KTextEditor::Document *, QWidget *, const char *name = 0 );
00060 virtual ~View ();
00064 virtual bool isOverwriteMode() const { return false; }
00068 virtual void setOverwriteMode( bool ) { }
00072 virtual QString currentTextLine() { return 0L; }
00076 virtual QString currentWord() { return 0L; }
00081 virtual QString word(int , int ) { return 0L; }
00086 virtual void insertText(const QString &mark ) { Q_UNUSED(mark); }
00090 virtual bool canDiscard() { return false; }
00091
00092 public:
00093 virtual int tabWidth() = 0;
00094 virtual void setTabWidth(int) = 0;
00095 virtual void setEncoding (QString e) = 0;
00096
00100 virtual bool isLastView() = 0;
00101
00102 public slots:
00108 virtual void flush () { ; };
00114 virtual saveResult save() { return SAVE_CANCEL; };
00118 virtual saveResult saveAs() { return SAVE_CANCEL; };
00122 virtual void indent() { ; };
00126 virtual void unIndent() { ; };
00130 virtual void cleanIndent() { ; };
00134 virtual void comment() { ; };
00138 virtual void uncomment() { ; };
00142 virtual void keyReturn () { ; };
00143 virtual void keyDelete () { ; };
00144 virtual void backspace () { ; };
00145 virtual void killLine () { ; };
00149 virtual void cursorLeft () { ; };
00150 virtual void shiftCursorLeft () { ; };
00151 virtual void cursorRight () { ; };
00152 virtual void shiftCursorRight () { ; };
00153 virtual void wordLeft () { ; };
00154 virtual void shiftWordLeft () { ; };
00155 virtual void wordRight () { ; };
00156 virtual void shiftWordRight () { ; };
00157 virtual void home () { ; };
00158 virtual void shiftHome () { ; };
00159 virtual void end () { ; };
00160 virtual void shiftEnd () { ; };
00161 virtual void up () { ; };
00162 virtual void shiftUp () { ; };
00163 virtual void down () { ; };
00164 virtual void shiftDown () { ; };
00165 virtual void scrollUp () { ; };
00166 virtual void scrollDown () { ; };
00167 virtual void topOfView () { ; };
00168 virtual void bottomOfView () { ; };
00169 virtual void pageUp () { ; };
00170 virtual void shiftPageUp () { ; };
00171 virtual void pageDown () { ; };
00172 virtual void shiftPageDown () { ; };
00173 virtual void top () { ; };
00174 virtual void shiftTop () { ; };
00175 virtual void bottom () { ; };
00176 virtual void shiftBottom () { ; };
00180 virtual void find() { ; };
00184 virtual void replace() { ; };
00188 virtual void gotoLine() { ; };
00189
00190 public:
00195 virtual void readSessionConfig(KConfig *) { ; };
00199 virtual void writeSessionConfig(KConfig *) { ; };
00200
00201 public slots:
00205 virtual int getEol() { return 0L; }
00209 virtual void setEol(int) { }
00213
00214 virtual void setFocus () { QWidget::setFocus(); }
00219 virtual void findAgain(bool forward ) { Q_UNUSED(forward); }
00224 virtual void findAgain () { };
00229 virtual void findPrev () { }
00234 virtual void slotEditCommand () { }
00235
00240 virtual void setIconBorder (bool enable ) { Q_UNUSED(enable); }
00244 virtual void toggleIconBorder () { }
00249 virtual void setLineNumbersOn (bool enable) { Q_UNUSED(enable); }
00253 virtual void toggleLineNumbersOn () {}
00254
00255 public:
00259 virtual bool iconBorder() { return false; }
00263 virtual bool lineNumbersOn() { return false; }
00267 virtual Document *getDoc () { return 0L; }
00268
00269 public slots:
00273 virtual void slotIncFontSizes () { }
00277 virtual void slotDecFontSizes () { }
00278
00279 virtual void gotoMark (KTextEditor::Mark *mark) = 0;
00280
00285
00286 virtual void toggleBookmark () {}
00287
00288 virtual void gotoLineNumber( int ) = 0;
00289
00290 signals:
00291 void gotFocus (View *);
00292
00293
00294 public:
00295 virtual void setActive (bool b) = 0;
00296 virtual bool isActive () = 0;
00297 };
00298
00299 KATEPARTINTERFACES_EXPORT View *view (KTextEditor::View *view);
00300
00301 }
00302
00303 #endif