19#ifndef _KATE_DOCUMENT_INCLUDE_
20#define _KATE_DOCUMENT_INCLUDE_
22#include <tdetexteditor/document.h>
23#include <tdetexteditor/view.h>
24#include <tdetexteditor/editinterface.h>
25#include <tdetexteditor/undointerface.h>
26#include <tdetexteditor/cursorinterface.h>
27#include <tdetexteditor/documentinfo.h>
28#include <tdetexteditor/selectioninterface.h>
29#include <tdetexteditor/selectioninterfaceext.h>
30#include <tdetexteditor/blockselectioninterface.h>
31#include <tdetexteditor/searchinterface.h>
32#include <tdetexteditor/highlightinginterface.h>
33#include <tdetexteditor/configinterface.h>
34#include <tdetexteditor/configinterfaceextension.h>
35#include <tdetexteditor/markinterface.h>
36#include <tdetexteditor/markinterfaceextension.h>
37#include <tdetexteditor/wordwrapinterface.h>
38#include <tdetexteditor/printinterface.h>
39#include <tdetexteditor/variableinterface.h>
55class KATEPARTINTERFACES_EXPORT Cursor :
public KTextEditor::Cursor
59 virtual ~Cursor () { ; };
62class KATEPARTINTERFACES_EXPORT ConfigPage :
public KTextEditor::ConfigPage
67 ConfigPage ( TQWidget *parent=0,
const char *name=0 ) : KTextEditor::ConfigPage (parent, name) { ; };
68 virtual ~ConfigPage () { ; };
71 virtual void apply () { ; };
72 virtual void reload () { ; };
73 virtual void reset () {};
74 virtual void defaults () {};
80class KATEPARTINTERFACES_EXPORT ActionMenu :
public TDEActionMenu
85 ActionMenu (
const TQString& text, TQObject* parent = 0,
const char* name = 0 )
87 virtual ~ActionMenu () { ; };
90 virtual void updateMenu (
class Document *) = 0;
107 virtual TQStringList
cmds () = 0;
113 virtual bool exec (
View *view,
const TQString &cmd, TQString &msg) = 0;
119 virtual bool help (
View *view,
const TQString &cmd, TQString &msg) = 0;
182class KATEPARTINTERFACES_EXPORT
Document :
public KTextEditor::Document,
public KTextEditor::EditInterface,
183 public KTextEditor::UndoInterface,
public KTextEditor::CursorInterface,
184 public KTextEditor::SelectionInterface,
public KTextEditor::SearchInterface,
185 public KTextEditor::HighlightingInterface,
public KTextEditor::BlockSelectionInterface,
186 public KTextEditor::ConfigInterface,
public KTextEditor::MarkInterface,
187 public KTextEditor::PrintInterface,
public KTextEditor::WordWrapInterface,
188 public KTextEditor::MarkInterfaceExtension,
189 public KTextEditor::SelectionInterfaceExt
195 Document ( TQObject* parent,
const char* name );
202 static bool registerCommand (
Command *cmd);
203 static bool unregisterCommand (
Command *cmd);
204 static Command *queryCommand (
const TQString &cmd);
227 virtual ActionMenu *hlActionMenu (
const TQString& , TQObject* =0,
const char* = 0) = 0;
228 virtual ActionMenu *exportActionMenu (
const TQString& , TQObject* =0,
const char* = 0) = 0;
232 virtual void flush () { ; };
244 virtual void exportAs(
const TQString &) = 0;
246 virtual void applyWordWrap () = 0;
250 virtual void setWordWrap (
bool ) = 0;
251 virtual bool wordWrap () = 0;
253 virtual void setWordWrapAt (
unsigned int) = 0;
254 virtual uint wordWrapAt () = 0;
257 virtual void setEncoding (
const TQString &e) = 0;
258 virtual TQString encoding()
const = 0;
281 virtual uint configFlags () = 0;
282 virtual void setConfigFlags (uint flags) = 0;
288 cfBackspaceIndents= 0x2,
291 cfRemoveSpaces = 0x10,
293 cfAutoBrackets= 0x40,
295 cfKeepSelection= 0x100,
300 cfKeepIndentProfile= 0x8000,
301 cfKeepExtraSpaces= 0x10000,
302 cfTabIndents= 0x80000,
303 cfShowTabs= 0x200000,
304 cfSpaceIndent= 0x400000,
305 cfSmartHome = 0x800000
329 static void setOpenErrorDialogsActivated (
bool on);
332 static void setFileChangedDialogsActivated (
bool on);
334 static const TQString &defaultEncoding ();
337 static bool s_openErrorDialogsActivated;
338 static bool s_fileChangedDialogsActivated;
340 static TQString s_defaultEncoding;
348 :
public KTextEditor::DocumentInfoInterface,
349 public KTextEditor::VariableInterface
Extension to the Command interface, allowing to interact with commands during typing.
virtual void flagCompletions(TQStringList &)
Fill in a list of flags to complete from.
virtual bool wantsToProcessText(const TQString &cmdname)
virtual void processText(Kate::View *view, const TQString &text)
This is called by the commandline each time the argument text for the command changes,...
virtual TDECompletion * completionObject(const TQString &cmdname, Kate::View *)
virtual TQStringList cmds()=0
Pure text start part of the commands which can be handled by this object which means i....
virtual bool help(View *view, const TQString &cmd, TQString &msg)=0
Shows help for the given view and cmd string, return a bool about success, msg for status.
virtual bool exec(View *view, const TQString &cmd, TQString &msg)=0
Execute this command for the given view and cmd string, return a bool about success,...
Extensions to the Document Interface.
ModifiedOnDiskReason
Reasons why a document is modified on disk.
virtual void setModifiedOnDisk(int reason)=0
For client apps that want to deal with files modified on disk, it is nessecary to reset this property...
virtual void slotModifiedOnDisk(View *v=0)=0
These stuff is implemented as slots in the real document.
This interface provides access to the Kate Document class.
virtual TQString docName()
Returns the document name.
virtual void isModOnHD(bool=false)
deprecated for KDE 4.0, just does reloadFile, which will ask the normal "do you want it really" quest...
virtual ConfigPage * indentConfigPage(TQWidget *)=0
virtual void spellcheck()
Spellchecking.
virtual ConfigPage * fontConfigPage(TQWidget *)=0
virtual void setDocName(TQString)
Sets the document name.
virtual ConfigPage * keysConfigPage(TQWidget *)=0
void modifiedOnDisc(Kate::Document *doc, bool isModified, unsigned char reason)
Indicate this file is modified on disk.
virtual ConfigPage * kSpellConfigPage(TQWidget *)
virtual ConfigPage * editConfigPage(TQWidget *)=0
virtual void reloadFile()=0
Reloads the current document from disk if possible.
virtual ConfigPage * selectConfigPage(TQWidget *)=0
virtual ConfigPage * colorConfigPage(TQWidget *)=0
virtual ConfigPage * hlConfigPage(TQWidget *)=0
The Kate::View text editor interface.
kndbgstream & flush(kndbgstream &s)
Kate namespace All classes in this namespace must stay BC during one major release series (e....
KATEPARTINTERFACES_EXPORT Document * createDocument(TQObject *parent=0, const char *name=0)
Creates a new Kate::Document object.
KATEPARTINTERFACES_EXPORT DocumentExt * documentExt(KTextEditor::Document *doc)
Check if given document is a Kate::DocumentExt.
KATEPARTINTERFACES_EXPORT Document * document(KTextEditor::Document *doc)
Check if given document is a Kate::Document.