# kate Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# document.h

    00001 /* This file is part of the KDE libraries
    00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
    00003
    00004    This library is free software; you can redistribute it and/or
    00005    modify it under the terms of the GNU Library General Public
    00006    License version 2 as published by the Free Software Foundation.
    00007
    00008    This library is distributed in the hope that it will be useful,
    00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00011    Library General Public License for more details.
    00012
    00013    You should have received a copy of the GNU Library General Public License
    00014    along with this library; see the file COPYING.LIB.  If not, write to
    00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00016    Boston, MA 02111-1307, USA.
    00017 */
    00018
    00019 #ifndef _KATE_DOCUMENT_INCLUDE_
    00020 #define _KATE_DOCUMENT_INCLUDE_
    00021
    00022 #include <ktexteditor/document.h>
    00023 #include <ktexteditor/view.h>
    00024 #include <ktexteditor/editinterface.h>
    00025 #include <ktexteditor/undointerface.h>
    00026 #include <ktexteditor/cursorinterface.h>
    00027 #include <ktexteditor/documentinfo.h>
    00028 #include <ktexteditor/selectioninterface.h>
    00029 #include <ktexteditor/selectioninterfaceext.h>
    00030 #include <ktexteditor/blockselectioninterface.h>
    00031 #include <ktexteditor/searchinterface.h>
    00032 #include <ktexteditor/highlightinginterface.h>
    00033 #include <ktexteditor/configinterface.h>
    00034 #include <ktexteditor/configinterfaceextension.h>
    00035 #include <ktexteditor/markinterface.h>
    00036 #include <ktexteditor/markinterfaceextension.h>
    00037 #include <ktexteditor/wordwrapinterface.h>
    00038 #include <ktexteditor/printinterface.h>
    00039 #include <ktexteditor/variableinterface.h>
    00040
    00041 #include <kaction.h>
    00042
    00043 class KCompletion;
    00044
    00050 namespace Kate
    00051 {
    00052
    00053 class View;
    00054
    00055 class KATEPARTINTERFACES_EXPORT Cursor : public KTextEditor::Cursor
    00056 {
    00057   public:
    00058     Cursor () { ; };
    00059     virtual ~Cursor () { ; };
    00060 };
    00061
    00062 class KATEPARTINTERFACES_EXPORT ConfigPage : public KTextEditor::ConfigPage
    00063 {
    00064   Q_OBJECT
    00065
    00066   public:
    00067     ConfigPage ( QWidget *parent=0, const char *name=0 ) : KTextEditor::ConfigPage (parent, name) { ; };
    00068     virtual ~ConfigPage () { ; };
    00069
    00070   public slots:
    00071     virtual void apply () { ; };
    00072     virtual void reload () { ; };
    00073     virtual void reset () {};
    00074     virtual void defaults () {};
    00075
    00076   protected slots:
    00077     void slotChanged();
    00078 };
    00079
    00080 class KATEPARTINTERFACES_EXPORT ActionMenu : public KActionMenu
    00081 {
    00082   Q_OBJECT
    00083
    00084   public:
    00085     ActionMenu ( const QString& text, QObject* parent = 0, const char* name = 0 )
    00086       : KActionMenu(text, parent, name) { ; };
    00087     virtual ~ActionMenu () { ; };
    00088
    00089   public:
    00090     virtual void updateMenu (class Document *) = 0;
    00091 };
    00092
    00096 class KATEPARTINTERFACES_EXPORT Command
    00097 {
    00098   public:
    00099     Command () {};
    00100     virtual ~Command () {};
    00101
    00102   public:
    00107     virtual QStringList cmds () = 0;
    00108
    00113     virtual bool exec (View *view, const QString &cmd, QString &msg) = 0;
    00114
    00119     virtual bool help (View *view, const QString &cmd, QString &msg) = 0;
    00120 };
    00121
    00129 class CommandExtension
    00130 {
    00131   public:
    00132     CommandExtension() {;}
    00133     virtual ~CommandExtension() {;}
    00134  //### this is yet to be tried
    00146     virtual void flagCompletions( QStringList& /*list*/ ) {;}
    00147
    00157     virtual KCompletion *completionObject( const QString & cmdname, Kate::View */*view*/ ) { Q_UNUSED(cmdname); return 0L; }
    00158
    00169     virtual bool wantsToProcessText( const QString &cmdname ) { Q_UNUSED(cmdname); return false; }
    00170  // ### yet to be tested. The obvious candidate is isearch.
    00177     virtual void processText( Kate::View *view, const QString &text ) { Q_UNUSED(view); Q_UNUSED(text); }
    00178 };
    00179
    00182 class KATEPARTINTERFACES_EXPORT Document : public KTextEditor::Document, public KTextEditor::EditInterface,
    00183                      public KTextEditor::UndoInterface, public KTextEditor::CursorInterface,
    00184                      public KTextEditor::SelectionInterface, public KTextEditor::SearchInterface,
    00185                      public KTextEditor::HighlightingInterface, public KTextEditor::BlockSelectionInterface,
    00186                      public KTextEditor::ConfigInterface, public KTextEditor::MarkInterface,
    00187                      public KTextEditor::PrintInterface, public KTextEditor::WordWrapInterface,
    00188                      public KTextEditor::MarkInterfaceExtension,
    00189                      public KTextEditor::SelectionInterfaceExt
    00190 {
    00191   Q_OBJECT
    00192
    00193   public:
    00194     Document ();
    00195     Document ( QObject* parent, const char* name );
    00196     virtual ~Document ();
    00197
    00201   public:
    00202     static bool registerCommand (Command *cmd);
    00203     static bool unregisterCommand (Command *cmd);
    00204     static Command *queryCommand (const QString &cmd);
    00205
    00206   public:
    00212     virtual void isModOnHD(bool =false) { ; };
    00213
    00217     virtual QString docName () { return 0L; };
    00218
    00225     virtual void setDocName (QString ) { ; };
    00226
    00227     virtual ActionMenu *hlActionMenu (const QString& , QObject* =0, const char* = 0) = 0;
    00228     virtual ActionMenu *exportActionMenu (const QString& , QObject* =0, const char* = 0) = 0;
    00229
    00230   public slots:
    00231     // clear buffer/filename - update the views
    00232     virtual void flush () { ; };
    00233
    00237     virtual void reloadFile() = 0;
    00238
    00242     virtual void spellcheck() {};
    00243
    00244     virtual void exportAs(const QString &) = 0;
    00245
    00246     virtual void applyWordWrap () = 0;
    00247
    00248
    00249   public:
    00250     virtual void setWordWrap (bool ) = 0;
    00251     virtual bool wordWrap () = 0;
    00252
    00253     virtual void setWordWrapAt (unsigned int) = 0;
    00254     virtual uint wordWrapAt () = 0;
    00255
    00256
    00257     virtual void setEncoding (const QString &e) = 0;
    00258     virtual QString encoding() const = 0;
    00259
    00261   // FIXME: Remove when BIC allowed.
    00262   public:
    00264     virtual ConfigPage *colorConfigPage (QWidget *) = 0;
    00266     virtual ConfigPage *fontConfigPage (QWidget *) = 0;
    00268     virtual ConfigPage *indentConfigPage (QWidget *) = 0;
    00270     virtual ConfigPage *selectConfigPage (QWidget *) = 0;
    00272     virtual ConfigPage *editConfigPage (QWidget *) = 0;
    00274     virtual ConfigPage *keysConfigPage (QWidget *) = 0;
    00276     virtual ConfigPage *kSpellConfigPage (QWidget *) { return 0L; }
    00278     virtual ConfigPage *hlConfigPage (QWidget *) = 0;
    00279
    00280   public:
    00281     virtual uint configFlags () = 0;
    00282     virtual void setConfigFlags (uint flags) = 0;
    00283
    00284     // Flags for katedocument config !
    00285     enum ConfigFlags
    00286     {
    00287       cfAutoIndent= 0x1,
    00288       cfBackspaceIndents= 0x2,
    00289       cfWordWrap= 0x4,
    00290       cfReplaceTabs= 0x8,
    00291       cfRemoveSpaces = 0x10,
    00292       cfWrapCursor= 0x20,
    00293       cfAutoBrackets= 0x40,
    00294       cfPersistent= 0x80,
    00295       cfKeepSelection= 0x100,
    00296       cfDelOnInput= 0x400,
    00297       cfXorSelect= 0x800,
    00298       cfOvr= 0x1000,
    00299       cfMark= 0x2000,
    00300       cfKeepIndentProfile= 0x8000,
    00301       cfKeepExtraSpaces= 0x10000,
    00302       cfTabIndents= 0x80000,
    00303       cfShowTabs= 0x200000,
    00304       cfSpaceIndent= 0x400000,
    00305       cfSmartHome = 0x800000
    00306     };
    00307
    00308   signals:
    00319     void modifiedOnDisc (Kate::Document *doc, bool isModified, unsigned char reason);
    00320
    00321   /*
    00322    * there static methodes are usefull to turn on/off the dialogs
    00323    * kate part shows up on open file errors + file changed warnings
    00324    * open file errors default on, file changed warnings default off, better
    00325    * for other apps beside kate app using the part
    00326    */
    00327   public:
    00328     // default true
    00329     static void setOpenErrorDialogsActivated (bool on);
    00330
    00331     // default false
    00332     static void setFileChangedDialogsActivated (bool on);
    00333
    00334     static const QString &defaultEncoding ();
    00335
    00336   protected:
    00337     static bool s_openErrorDialogsActivated;
    00338     static bool s_fileChangedDialogsActivated;
    00339
    00340     static QString s_defaultEncoding;
    00341 };
    00342
    00347 class KATEPARTINTERFACES_EXPORT DocumentExt
    00348  : public KTextEditor::DocumentInfoInterface,
    00349    public KTextEditor::VariableInterface
    00350 {
    00351   public:
    00352     DocumentExt ();
    00353     virtual ~DocumentExt ();
    00354
    00355   public:
    00359     enum ModifiedOnDiskReason {
    00360       Unmodified = 0,
    00361       Modified = 1,
    00362       Created = 2,
    00363       Deleted = 3
    00364     };
    00365
    00366   public:
    00372     virtual void setModifiedOnDisk( int reason ) = 0;
    00373
    00377   public:
    00383     virtual void slotModifiedOnDisk( View *v=0 ) = 0;
    00384 };
    00385
    00391 KATEPARTINTERFACES_EXPORT Document *document (KTextEditor::Document *doc);
    00392
    00398 KATEPARTINTERFACES_EXPORT DocumentExt *documentExt (KTextEditor::Document *doc);
    00399
    00403 KATEPARTINTERFACES_EXPORT Document *createDocument ( QObject *parent = 0, const char *name = 0 );
    00404
    00405 }
    00406
    00407 #endif

This file is part of the documentation for kate Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:36:29 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003