• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • interfaces
view.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef _KATE_VIEW_INCLUDE_
20 #define _KATE_VIEW_INCLUDE_
21 
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>
30 
31 class TDEConfig;
32 
33 namespace Kate
34 {
35 
36 class Document;
37 
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
45 {
46  TQ_OBJECT
47 
48  public:
52  enum saveResult { SAVE_OK, SAVE_CANCEL, SAVE_RETRY, SAVE_ERROR };
56  View ( KTextEditor::Document *, TQWidget *, const char *name = 0 );
60  virtual ~View ();
64  virtual bool isOverwriteMode() const { return false; }
68  virtual void setOverwriteMode( bool ) { }
72  virtual TQString currentTextLine() { return 0L; }
76  virtual TQString currentWord() { return 0L; }
81  virtual TQString word(int , int ) { return 0L; }
86  virtual void insertText(const TQString &mark ) { Q_UNUSED(mark); }
90  virtual bool canDiscard() { return false; }
91 
92  public:
93  virtual int tabWidth() = 0;
94  virtual void setTabWidth(int) = 0;
95  virtual void setEncoding (TQString e) = 0;
96 
100  virtual bool isLastView() = 0;
101 
102  public slots:
108  virtual void flush () { ; };
114  virtual saveResult save() { return SAVE_CANCEL; };
118  virtual saveResult saveAs() { return SAVE_CANCEL; };
122  virtual void indent() { ; };
126  virtual void unIndent() { ; };
130  virtual void cleanIndent() { ; };
134  virtual void comment() { ; };
138  virtual void uncomment() { ; };
142  virtual void keyReturn () { ; };
143  virtual void keyDelete () { ; };
144  virtual void backspace () { ; };
145  virtual void killLine () { ; };
149  virtual void cursorLeft () { ; };
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 () { ; };
180  virtual void find() { ; };
184  virtual void replace() { ; };
188  virtual void gotoLine() { ; };
189 
190  public:
195  virtual void readSessionConfig(TDEConfig *) { ; };
199  virtual void writeSessionConfig(TDEConfig *) { ; };
200 
201  public slots:
205  virtual int getEol() { return 0L; }
209  virtual void setEol(int) { }
213  // Should remove this, it's redundant.
214  virtual void setFocus () { TQWidget::setFocus(); }
219  virtual void findAgain(bool forward ) { Q_UNUSED(forward); }
224  virtual void findAgain () { };
229  virtual void findPrev () { }
234  virtual void slotEditCommand () { }
235 
240  virtual void setIconBorder (bool enable ) { Q_UNUSED(enable); }
244  virtual void toggleIconBorder () { }
249  virtual void setLineNumbersOn (bool enable) { Q_UNUSED(enable); }
253  virtual void toggleLineNumbersOn () {}
254 
255  public:
259  virtual bool iconBorder() { return false; }
263  virtual bool lineNumbersOn() { return false; }
267  virtual Document *getDoc () { return 0L; }
268 
269  public slots:
273  virtual void slotIncFontSizes () { }
277  virtual void slotDecFontSizes () { }
278 
279  virtual void gotoMark (KTextEditor::Mark *mark) = 0;
280 
285  // TODO: Remove when BIC is allowed
286  virtual void toggleBookmark () {}
287 
288  virtual void gotoLineNumber( int ) = 0;
289 
290  signals:
291  void gotFocus (View *);
292 // void newStatus(); // Kate app connects to this signal, should be in the interface
293 
294  public:
295  virtual void setActive (bool b) = 0;
296  virtual bool isActive () = 0;
297 };
298 
299 KATEPARTINTERFACES_EXPORT View *view (KTextEditor::View *view);
300 
301 }
302 
303 #endif
Kate::Document
This interface provides access to the Kate Document class.
Definition: document.h:190
Kate::View
The Kate::View text editor interface.
Definition: view.h:45
Kate::View::saveAs
virtual saveResult saveAs()
Allows the user to save the file under a new name.
Definition: view.h:118
Kate::View::canDiscard
virtual bool canDiscard()
Works exactly like closeURL() of KParts::ReadWritePart.
Definition: view.h:90
Kate::View::gotoLine
virtual void gotoLine()
Presents a "Goto Line" dialog to the user.
Definition: view.h:188
Kate::View::setEol
virtual void setEol(int)
Set the end of line mode (Unix, Macintosh or Dos).
Definition: view.h:209
Kate::View::getDoc
virtual Document * getDoc()
Returns a pointer to the document of the view.
Definition: view.h:267
Kate::View::currentTextLine
virtual TQString currentTextLine()
Gets the text line where the cursor is on.
Definition: view.h:72
Kate::View::toggleLineNumbersOn
virtual void toggleLineNumbersOn()
Toggles display of lineNumbers.
Definition: view.h:253
Kate::View::flush
virtual void flush()
Flushes the document of the text widget.
Definition: view.h:108
Kate::View::cleanIndent
virtual void cleanIndent()
Optimizes the selected indentation, replacing tabs and spaces as needed.
Definition: view.h:130
Kate::View::cursorLeft
virtual void cursorLeft()
Move cursor in the view.
Definition: view.h:149
Kate::View::word
virtual TQString word(int, int)
Gets the word at position x, y.
Definition: view.h:81
Kate::View::slotDecFontSizes
virtual void slotDecFontSizes()
Decrease font size.
Definition: view.h:277
Kate::View::setIconBorder
virtual void setIconBorder(bool enable)
Sets icon border on or off depending on.
Definition: view.h:240
Kate::View::findAgain
virtual void findAgain(bool forward)
Searches for the last searched text forward from cursor position.
Definition: view.h:219
Kate::View::slotEditCommand
virtual void slotEditCommand()
Presents an edit command popup window, where the user can apply a shell command to the contents of th...
Definition: view.h:234
Kate::View::uncomment
virtual void uncomment()
Removes comment signs in the current line.
Definition: view.h:138
Kate::View::toggleBookmark
virtual void toggleBookmark()
Definition: view.h:286
Kate::View::setFocus
virtual void setFocus()
Set focus to the current window.
Definition: view.h:214
Kate::View::insertText
virtual void insertText(const TQString &mark)
Insert text at the current cursor position.
Definition: view.h:86
Kate::View::currentWord
virtual TQString currentWord()
Gets the word where the cursor is on.
Definition: view.h:76
Kate::View::readSessionConfig
virtual void readSessionConfig(TDEConfig *)
Reads session config out of the TDEConfig object.
Definition: view.h:195
Kate::View::setLineNumbersOn
virtual void setLineNumbersOn(bool enable)
Sets display of line numbers on/off depending on enable.
Definition: view.h:249
Kate::View::isOverwriteMode
virtual bool isOverwriteMode() const
Set editor mode.
Definition: view.h:64
Kate::View::iconBorder
virtual bool iconBorder()
Returns whether iconborder is visible.
Definition: view.h:259
Kate::View::find
virtual void find()
Presents a search dialog to the user.
Definition: view.h:180
Kate::View::getEol
virtual int getEol()
Get the end of line mode (Unix, Macintosh or Dos).
Definition: view.h:205
Kate::View::unIndent
virtual void unIndent()
Moves the current line or the selection one position to the left.
Definition: view.h:126
Kate::View::lineNumbersOn
virtual bool lineNumbersOn()
Definition: view.h:263
Kate::View::findAgain
virtual void findAgain()
Searches for the last searched text forward from cursor position.
Definition: view.h:224
Kate::View::isLastView
virtual bool isLastView()=0
Returns true if this editor is the only owner of its document.
Kate::View::replace
virtual void replace()
Presents a replace dialog to the user.
Definition: view.h:184
Kate::View::indent
virtual void indent()
Moves the current line or the selection one position to the right.
Definition: view.h:122
Kate::View::comment
virtual void comment()
Comments out current line.
Definition: view.h:134
Kate::View::writeSessionConfig
virtual void writeSessionConfig(TDEConfig *)
Writes session config into the TDEConfig object.
Definition: view.h:199
Kate::View::findPrev
virtual void findPrev()
Searches for the last searched text forward from cursor position.
Definition: view.h:229
Kate::View::saveResult
saveResult
Return values for "save" related commands.
Definition: view.h:52
Kate::View::toggleIconBorder
virtual void toggleIconBorder()
Toggles icon border.
Definition: view.h:244
Kate::View::slotIncFontSizes
virtual void slotIncFontSizes()
Increase font size.
Definition: view.h:273
Kate::View::keyReturn
virtual void keyReturn()
Some simply key commands.
Definition: view.h:142
Kate::View::save
virtual saveResult save()
Saves the file under the current file name.
Definition: view.h:114
Kate::View::setOverwriteMode
virtual void setOverwriteMode(bool)
Get editor mode.
Definition: view.h:68
TDEConfig
Kate
Kate namespace All classes in this namespace must stay BC during one major release series (e....
Definition: document.h:51
TDEStdAccel::end
const TDEShortcut & end()
TDEStdAccel::home
const TDEShortcut & home()
TDEStdAccel::up
const TDEShortcut & up()

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.9.1
This website is maintained by Timothy Pearson.