kate Library API Documentation

katedocument.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
00003    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef _KATE_DOCUMENT_H_
00022 #define _KATE_DOCUMENT_H_
00023 
00024 #include "katesupercursor.h"
00025 #include "katetextline.h"
00026 #include "kateundo.h"
00027 
00028 #include "../interfaces/document.h"
00029 
00030 #include <ktexteditor/configinterfaceextension.h>
00031 #include <ktexteditor/encodinginterface.h>
00032 #include <ktexteditor/sessionconfiginterface.h>
00033 #include <ktexteditor/editinterfaceext.h>
00034 
00035 #include <dcopobject.h>
00036 
00037 #include <kmimetype.h>
00038 #include <klocale.h>
00039 
00040 #include <qintdict.h>
00041 #include <qmap.h>
00042 #include <qdatetime.h>
00043 
00044 namespace KTextEditor { class Plugin; }
00045 
00046 namespace KIO { class TransferJob; }
00047 
00048 class KateUndoGroup;
00049 class KateCmd;
00050 class KateAttribute;
00051 class KateAutoIndent;
00052 class KateCodeFoldingTree;
00053 class KateBuffer;
00054 class KateView;
00055 class KateViewInternal;
00056 class KateArbitraryHighlight;
00057 class KateSuperRange;
00058 class KateLineInfo;
00059 class KateBrowserExtension;
00060 class KateDocumentConfig;
00061 class KateHighlighting;
00062 class KatePartPluginItem;
00063 class KatePartPluginInfo;
00064 
00065 class KSpell;
00066 class KTempFile;
00067 
00068 class QTimer;
00069 
00070 //
00071 // Kate KTextEditor::Document class (and even KTextEditor::Editor ;)
00072 //
00073 class KateDocument : public Kate::Document,
00074                      public Kate::DocumentExt,
00075                      public KTextEditor::ConfigInterfaceExtension,
00076                      public KTextEditor::EncodingInterface,
00077                      public KTextEditor::SessionConfigInterface,
00078                      public KTextEditor::EditInterfaceExt,
00079                      public DCOPObject
00080 {
00081   K_DCOP
00082   Q_OBJECT
00083 
00084   friend class KateViewInternal;
00085   friend class KateRenderer;
00086 
00087   public:
00088     KateDocument (bool bSingleViewMode=false, bool bBrowserView=false, bool bReadOnly=false,
00089         QWidget *parentWidget = 0, const char *widgetName = 0, QObject * = 0, const char * = 0);
00090     ~KateDocument ();
00091 
00092     bool closeURL();
00093 
00094   //
00095   // Plugins section
00096   //
00097   public:
00098     void unloadAllPlugins ();
00099 
00100     void enableAllPluginsGUI (KateView *view);
00101     void disableAllPluginsGUI (KateView *view);
00102 
00103     void loadPlugin (uint pluginIndex);
00104     void unloadPlugin (uint pluginIndex);
00105 
00106     void enablePluginGUI (KTextEditor::Plugin *plugin, KateView *view);
00107     void enablePluginGUI (KTextEditor::Plugin *plugin);
00108 
00109     void disablePluginGUI (KTextEditor::Plugin *plugin, KateView *view);
00110     void disablePluginGUI (KTextEditor::Plugin *plugin);
00111 
00112   private:
00113      QMemArray<KTextEditor::Plugin *> m_plugins;
00114 
00115   public:
00116     bool readOnly () const { return m_bReadOnly; }
00117     bool browserView () const { return m_bBrowserView; }
00118     bool singleViewMode () const { return m_bSingleViewMode; }
00119     KateBrowserExtension *browserExtension () { return m_extension; }
00120 
00121   private:
00122     // only to make part work, don't change it !
00123     bool m_bSingleViewMode;
00124     bool m_bBrowserView;
00125     bool m_bReadOnly;
00126     KateBrowserExtension *m_extension;
00127 
00128   //
00129   // KTextEditor::Document stuff
00130   //
00131   public:
00132     KTextEditor::View *createView( QWidget *parent, const char *name );
00133     QPtrList<KTextEditor::View> views () const;
00134 
00135     inline KateView *activeView () const { return m_activeView; }
00136 
00137   private:
00138     QPtrList<KateView> m_views;
00139     QPtrList<KTextEditor::View> m_textEditViews;
00140     KateView *m_activeView;
00141 
00142   //
00143   // KTextEditor::ConfigInterfaceExtension stuff
00144   //
00145   public slots:
00146     uint configPages () const;
00147     KTextEditor::ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 );
00148     QString configPageName (uint number = 0) const;
00149     QString configPageFullName (uint number = 0) const;
00150     QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const;
00151 
00152   //
00153   // KTextEditor::EditInterface stuff
00154   //
00155   public slots:
00156     QString text() const;
00157 
00158     QString text ( uint startLine, uint startCol, uint endLine, uint endCol ) const;
00159     QString text ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise ) const;
00160 
00161     QString textLine ( uint line ) const;
00162 
00163     bool setText(const QString &);
00164     bool clear ();
00165 
00166     bool insertText ( uint line, uint col, const QString &s );
00167     bool insertText ( uint line, uint col, const QString &s, bool blockwise );
00168 
00169     bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol );
00170     bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol, bool blockwise );
00171 
00172     bool insertLine ( uint line, const QString &s );
00173     bool removeLine ( uint line );
00174 
00175     uint numLines() const;
00176     uint numVisLines() const;
00177     uint length () const;
00178     int lineLength ( uint line ) const;
00179 
00180   signals:
00181     void textChanged ();
00182     void charactersInteractivelyInserted(int ,int ,const QString&);
00183     void backspacePressed();
00184 
00185   public:
00186     //
00187     // start edit / end edit (start/end undo, cursor update, view update)
00188     //
00189     void editBegin () { editStart(); }
00190     void editStart (bool withUndo = true);
00191     void editEnd ();
00192 
00193     //
00194     // functions for insert/remove stuff (atomic)
00195     //
00196     bool editInsertText ( uint line, uint col, const QString &s );
00197     bool editRemoveText ( uint line, uint col, uint len );
00198 
00199     bool editMarkLineAutoWrapped ( uint line, bool autowrapped );
00200 
00201     bool editWrapLine ( uint line, uint col, bool newLine = true, bool *newLineAdded = 0 );
00202     bool editUnWrapLine ( uint line, bool removeLine = true, uint length = 0 );
00203 
00204     bool editInsertLine ( uint line, const QString &s );
00205     bool editRemoveLine ( uint line );
00206 
00207     bool wrapText (uint startLine, uint endLine);
00208 
00209   signals:
00214     void editTextInserted ( uint line, uint col, uint len);
00215 
00219     void editTextRemoved ( uint line, uint col, uint len);
00220 
00224     void editLineWrapped ( uint line, uint col, uint len );
00225 
00229     void editLineUnWrapped ( uint line, uint col );
00230 
00234     void editLineInserted ( uint line );
00235 
00239     void editLineRemoved ( uint line );
00240 
00241   private:
00242     void undoStart();
00243     void undoEnd();
00244 
00245   private slots:
00246     void undoCancel();
00247 
00248   private:
00249     void editAddUndo (KateUndoGroup::UndoType type, uint line, uint col, uint len, const QString &text);
00250     void editTagLine (uint line);
00251     void editRemoveTagLine (uint line);
00252     void editInsertTagLine (uint line);
00253 
00254     uint editSessionNumber;
00255     bool editIsRunning;
00256     bool noViewUpdates;
00257     bool editWithUndo;
00258     uint editTagLineStart;
00259     uint editTagLineEnd;
00260     bool editTagFrom;
00261     KateUndoGroup* m_editCurrentUndo;
00262 
00263   //
00264   // KTextEditor::SelectionInterface stuff
00265   //
00266   public slots:
00267     bool setSelection ( const KateTextCursor & start,
00268       const KateTextCursor & end );
00269     bool setSelection ( uint startLine, uint startCol,
00270       uint endLine, uint endCol );
00271     bool clearSelection ();
00272     bool clearSelection (bool redraw, bool finishedChangingSelection = true);
00273 
00274     bool hasSelection () const;
00275     QString selection () const ;
00276 
00277     bool removeSelectedText ();
00278 
00279     bool selectAll();
00280 
00281     //
00282     // KTextEditor::SelectionInterfaceExt
00283     //
00284     int selStartLine() { return selectStart.line(); };
00285     int selStartCol()  { return selectStart.col(); };
00286     int selEndLine()   { return selectEnd.line(); };
00287     int selEndCol()    { return selectEnd.col(); };
00288 
00289   private:
00290     // some internal functions to get selection state of a line/col
00291     bool lineColSelected (int line, int col);
00292     bool lineSelected (int line);
00293     bool lineEndSelected (int line, int endCol);
00294     bool lineHasSelected (int line);
00295     bool lineIsSelection (int line);
00296 
00297     QPtrList<KateSuperCursor> m_superCursors;
00298 
00299     // stores the current selection
00300     KateSuperCursor selectStart;
00301     KateSuperCursor selectEnd;
00302 
00303   signals:
00304     void selectionChanged ();
00305 
00306   //
00307   // KTextEditor::BlockSelectionInterface stuff
00308   //
00309   public slots:
00310     bool blockSelectionMode ();
00311     bool setBlockSelectionMode (bool on);
00312     bool toggleBlockSelectionMode ();
00313 
00314   private:
00315     // do we select normal or blockwise ?
00316     bool blockSelect;
00317 
00318   //
00319   // KTextEditor::UndoInterface stuff
00320   //
00321   public slots:
00322     void undo ();
00323     void redo ();
00324     void clearUndo ();
00325     void clearRedo ();
00326 
00327     uint undoCount () const;
00328     uint redoCount () const;
00329 
00330     uint undoSteps () const;
00331     void setUndoSteps ( uint steps );
00332 
00333   private:
00334     //
00335     // some internals for undo/redo
00336     //
00337     QPtrList<KateUndoGroup> undoItems;
00338     QPtrList<KateUndoGroup> redoItems;
00339     bool m_undoDontMerge;
00340     bool m_undoIgnoreCancel;
00341     QTimer* m_undoMergeTimer;
00342     // these two variables are for resetting the document to
00343     // non-modified if all changes have been undone...
00344     KateUndoGroup* lastUndoGroupWhenSaved;
00345     bool docWasSavedWhenUndoWasEmpty;
00346 
00347     // this sets
00348     void updateModified();
00349 
00350   signals:
00351     void undoChanged ();
00352 
00353   //
00354   // KTextEditor::CursorInterface stuff
00355   //
00356   public slots:
00357     KTextEditor::Cursor *createCursor ();
00358     QPtrList<KTextEditor::Cursor> cursors () const;
00359 
00360   private:
00361     QPtrList<KTextEditor::Cursor> myCursors;
00362 
00363   //
00364   // KTextEditor::SearchInterface stuff
00365   //
00366   public slots:
00367     bool searchText (unsigned int startLine, unsigned int startCol,
00368         const QString &text, unsigned int *foundAtLine, unsigned int *foundAtCol,
00369         unsigned int *matchLen, bool casesensitive = true, bool backwards = false);
00370     bool searchText (unsigned int startLine, unsigned int startCol,
00371         const QRegExp &regexp, unsigned int *foundAtLine, unsigned int *foundAtCol,
00372         unsigned int *matchLen, bool backwards = false);
00373 
00374   //
00375   // KTextEditor::HighlightingInterface stuff
00376   //
00377   public slots:
00378     uint hlMode ();
00379     bool setHlMode (uint mode);
00380     uint hlModeCount ();
00381     QString hlModeName (uint mode);
00382     QString hlModeSectionName (uint mode);
00383 
00384   private:
00385     bool internalSetHlMode (uint mode);
00386     void setDontChangeHlOnSave();
00387 
00388   signals:
00389     void hlChanged ();
00390 
00391   //
00392   // Kate::ArbitraryHighlightingInterface stuff
00393   //
00394   public:
00395     KateArbitraryHighlight* arbitraryHL() const { return m_arbitraryHL; };
00396 
00397   private slots:
00398     void tagArbitraryLines(KateView* view, KateSuperRange* range);
00399 
00400   //
00401   // KTextEditor::ConfigInterface stuff
00402   //
00403   public slots:
00404     void readConfig ();
00405     void writeConfig ();
00406     void readConfig (KConfig *);
00407     void writeConfig (KConfig *);
00408     void readSessionConfig (KConfig *);
00409     void writeSessionConfig (KConfig *);
00410     void configDialog ();
00411 
00412   //
00413   // KTextEditor::MarkInterface and MarkInterfaceExtension
00414   //
00415   public slots:
00416     uint mark( uint line );
00417 
00418     void setMark( uint line, uint markType );
00419     void clearMark( uint line );
00420 
00421     void addMark( uint line, uint markType );
00422     void removeMark( uint line, uint markType );
00423 
00424     QPtrList<KTextEditor::Mark> marks();
00425     void clearMarks();
00426 
00427     void setPixmap( MarkInterface::MarkTypes, const QPixmap& );
00428     void setDescription( MarkInterface::MarkTypes, const QString& );
00429     QString markDescription( MarkInterface::MarkTypes );
00430     QPixmap *markPixmap( MarkInterface::MarkTypes );
00431     QColor markColor( MarkInterface::MarkTypes );
00432 
00433     void setMarksUserChangable( uint markMask );
00434     uint editableMarks();
00435 
00436   signals:
00437     void marksChanged();
00438     void markChanged( KTextEditor::Mark, KTextEditor::MarkInterfaceExtension::MarkChangeAction );
00439 
00440   private:
00441     QIntDict<KTextEditor::Mark> m_marks;
00442     QIntDict<QPixmap>           m_markPixmaps;
00443     QIntDict<QString>           m_markDescriptions;
00444     uint                        m_editableMarks;
00445 
00446   //
00447   // KTextEditor::PrintInterface
00448   //
00449   public slots:
00450     bool printDialog ();
00451     bool print ();
00452 
00453   //
00454   // KTextEditor::DocumentInfoInterface ( ### unfinished )
00455   //
00456   public:
00466     QString mimeType();
00467 
00475     long fileSize();
00476 
00484     QString niceFileSize();
00485 
00494     KMimeType::Ptr mimeTypeForContent();
00495 
00496   //
00497   // KTextEditor::VariableInterface
00498   //
00499   public:
00500     QString variable( const QString &name ) const;
00501 
00502   signals:
00503     void variableChanged( const QString &, const QString & );
00504 
00505   private:
00506     QMap<QString, QString> m_storedVariables;
00507 
00508   //
00509   // KParts::ReadWrite stuff
00510   //
00511   public:
00512     bool openURL( const KURL &url );
00513 
00514     /* Anders:
00515       I reimplemented this, since i need to check if backup succeeded
00516       if requested */
00517     bool save();
00518 
00519     bool openFile (KIO::Job * job);
00520     bool openFile ();
00521 
00522     bool saveFile ();
00523 
00524     void setReadWrite ( bool rw = true );
00525 
00526     void setModified( bool m );
00527 
00528   private slots:
00529     void slotDataKate ( KIO::Job* kio_job, const QByteArray &data );
00530     void slotFinishedKate ( KIO::Job * job );
00531 
00532   private:
00533     void abortLoadKate();
00534 
00535     void activateDirWatch ();
00536     void deactivateDirWatch ();
00537 
00538     QString m_dirWatchFile;
00539 
00540   //
00541   // Kate::Document stuff
00542   //
00543   public:
00544     Kate::ConfigPage *colorConfigPage (QWidget *);
00545     Kate::ConfigPage *fontConfigPage (QWidget *);
00546     Kate::ConfigPage *indentConfigPage (QWidget *);
00547     Kate::ConfigPage *selectConfigPage (QWidget *);
00548     Kate::ConfigPage *editConfigPage (QWidget *);
00549     Kate::ConfigPage *keysConfigPage (QWidget *);
00550     Kate::ConfigPage *hlConfigPage (QWidget *);
00551     Kate::ConfigPage *viewDefaultsConfigPage (QWidget *);
00552     Kate::ConfigPage *saveConfigPage( QWidget * );
00553 
00554     Kate::ActionMenu *hlActionMenu (const QString& text, QObject* parent = 0, const char* name = 0);
00555     Kate::ActionMenu *exportActionMenu (const QString& text, QObject* parent = 0, const char* name = 0);
00556 
00557   public:
00561     bool typeChars ( KateView *type, const QString &chars );
00562 
00566     uint lastLine() const { return numLines()-1;}
00567 
00568     KateTextLine::Ptr kateTextLine(uint i);
00569     KateTextLine::Ptr plainKateTextLine(uint i);
00570 
00571     uint configFlags ();
00572     void setConfigFlags (uint flags);
00573 
00577     void tagSelection(const KateTextCursor &oldSelectStart, const KateTextCursor &oldSelectEnd);
00578 
00579     // Repaint all of all of the views
00580     void repaintViews(bool paintOnlyDirty = true);
00581 
00582     KateHighlighting *highlight () { return m_highlight; }
00583 
00584   public slots:    //please keep prototypes and implementations in same order
00585     void tagLines(int start, int end);
00586     void tagLines(KateTextCursor start, KateTextCursor end);
00587 
00588   //export feature
00589   public slots:
00590      void exportAs(const QString&);
00591 
00592   private: //the following things should become plugins
00593     bool exportDocumentToHTML (QTextStream *outputStream,const QString &name);
00594     QString HTMLEncode (QChar theChar);
00595 
00596   signals:
00597     void modifiedChanged ();
00598     void preHighlightChanged(uint);
00599 
00600   private slots:
00601     void internalHlChanged();
00602 
00603   public:
00604     void addView(KTextEditor::View *);
00605     void removeView(KTextEditor::View *);
00606 
00607     void addSuperCursor(class KateSuperCursor *, bool privateC);
00608     void removeSuperCursor(class KateSuperCursor *, bool privateC);
00609 
00610     bool ownedView(KateView *);
00611     bool isLastView(int numViews);
00612 
00613     uint currentColumn( const KateTextCursor& );
00614     void newLine(             KateTextCursor&, KateViewInternal * ); // Changes input
00615     void backspace(     const KateTextCursor& );
00616     void del(           const KateTextCursor& );
00617     void transpose(     const KateTextCursor& );
00618     void cut();
00619     void copy();
00620     void paste ( KateView* view );
00621 
00622     void selectWord(   const KateTextCursor& cursor );
00623     void selectLine(   const KateTextCursor& cursor );
00624     void selectLength( const KateTextCursor& cursor, int length );
00625 
00626   public:
00627     void insertIndentChars ( KateView *view );
00628 
00629     void indent ( KateView *view, uint line, int change );
00630     void comment ( KateView *view, uint line, int change );
00631     void align ( uint line );
00632 
00633     enum TextTransform { Uppercase, Lowercase, Capitalize };
00634 
00642     void transform ( KateView *view, const KateTextCursor &, TextTransform );
00646     void joinLines( uint first, uint last );
00647 
00648   private:
00649     void optimizeLeadingSpace( uint line, int flags, int change );
00650     void replaceWithOptimizedSpace( uint line, uint upto_column, uint space, int flags );
00651 
00652     bool removeStringFromBegining(int line, QString &str);
00653     bool removeStringFromEnd(int line, QString &str);
00654 
00664     bool nextNonSpaceCharPos(int &line, int &col);
00665 
00673     bool previousNonSpaceCharPos(int &line, int &col);
00674 
00679     void addStartLineCommentToSingleLine(int line, int attrib=0);
00684     bool removeStartLineCommentFromSingleLine(int line, int attrib=0);
00685 
00689     void addStartStopCommentToSingleLine(int line, int attrib=0);
00693     bool removeStartStopCommentFromSingleLine(int line, int attrib=0);
00694 
00699            void addStartStopCommentToSelection( int attrib=0 );
00703           void addStartLineCommentToSelection( int attrib=0 );
00704 
00711     bool removeStartStopCommentFromSelection( int attrib=0 );
00715     bool removeStartLineCommentFromSelection( int attrib=0 );
00716 
00717   public:
00718     QString getWord( const KateTextCursor& cursor );
00719 
00720   public:
00721     void tagAll();
00722     void updateViews();
00723 
00724     void newBracketMark( const KateTextCursor& start, KateTextRange& bm );
00725     bool findMatchingBracket( KateTextCursor& start, KateTextCursor& end );
00726 
00727   private:
00728     void guiActivateEvent( KParts::GUIActivateEvent *ev );
00729 
00730   public:
00731 
00732     QString docName () {return m_docName;};
00733 
00734     void setDocName (QString docName);
00735 
00736     void lineInfo (KateLineInfo *info, unsigned int line);
00737 
00738     KateCodeFoldingTree *foldingTree ();
00739 
00740   public:
00746     bool isModifiedOnDisc() { return m_modOnHd; };
00747 
00749     void isModOnHD( bool =false ) {};
00750 
00751     void setModifiedOnDisk( int reason );
00752 
00753   public slots:
00760     void slotModifiedOnDisk( Kate::View *v=0 );
00761 
00765     void reloadFile();
00766 
00767   private:
00768     int m_isasking; // don't reenter slotModifiedOnDisk when this is true
00769                     // -1: ignore once, 0: false, 1: true
00770 
00771   public slots:
00772     void setEncoding (const QString &e);
00773     QString encoding() const;
00774 
00775   public slots:
00776     void setWordWrap (bool on);
00777     bool wordWrap ();
00778 
00779     void setWordWrapAt (uint col);
00780     uint wordWrapAt ();
00781 
00782   public slots:
00783     void setPageUpDownMovesCursor(bool on);
00784     bool pageUpDownMovesCursor();
00785 
00786   signals:
00787     void modStateChanged (Kate::Document *doc);
00788     void nameChanged (Kate::Document *doc);
00789 
00790   public slots:
00791     // clear buffer/filename - update the views
00792     void flush ();
00793 
00794   signals:
00799     void fileNameChanged ();
00800 
00801   public slots:
00802      void applyWordWrap ();
00803 
00804   public:
00805 
00806  // code folding
00807   public:
00808     unsigned int getRealLine(unsigned int virtualLine);
00809     unsigned int getVirtualLine(unsigned int realLine);
00810     unsigned int visibleLines ();
00811 
00812   signals:
00813     void codeFoldingUpdated();
00814 
00815   public slots:
00816     void dumpRegionTree();
00817 
00818   private slots:
00819     void slotModOnHdDirty (const QString &path);
00820     void slotModOnHdCreated (const QString &path);
00821     void slotModOnHdDeleted (const QString &path);
00822 
00823   private:
00833     bool createDigest ( QCString &result );
00834 
00840     QString reasonedMOHString() const;
00841 
00850     void removeTrailingSpace( uint line );
00851 
00852   public:
00853     // should cursor be wrapped ? take config + blockselection state in account
00854     bool wrapCursor ();
00855 
00856   public:
00857     void updateFileType (int newType, bool user = false);
00858 
00859     int fileType () const { return m_fileType; };
00860 
00861   //
00862   // REALLY internal data ;)
00863   //
00864   private:
00865     // text buffer
00866     KateBuffer *m_buffer;
00867 
00868     KateHighlighting *m_highlight;
00869 
00870     KateArbitraryHighlight* m_arbitraryHL;
00871 
00872     KateAutoIndent *m_indenter;
00873 
00874     bool hlSetByUser;
00875 
00876     bool m_modOnHd;
00877     unsigned char m_modOnHdReason;
00878     QCString m_digest; // MD5 digest, updated on load/save
00879 
00880     QString m_docName;
00881     int m_docNameNumber;
00882 
00883     // file type !!!
00884     int m_fileType;
00885     bool m_fileTypeSetByUser;
00886 
00890     bool m_reloading;
00891 
00892   public slots:
00893     void spellcheck();
00894     void ready(KSpell *);
00895     void misspelling( const QString&, const QStringList&, unsigned int );
00896     void corrected  ( const QString&, const QString&, unsigned int);
00897     void spellResult( const QString& );
00898     void spellCleanDone();
00899 
00900 
00901     void slotQueryClose_save(bool *handled, bool* abortClosing);
00902 
00903   private:
00904     //void makeAttribs ();
00905 
00906     void locatePosition( uint pos, uint& line, uint& col );
00907     KSpell*         m_kspell;
00908 
00909   public:
00910     void makeAttribs ();
00911 
00912     static bool checkOverwrite( KURL u );
00913 
00914     static void setDefaultEncoding (const QString &encoding);
00915 
00919   public:
00920     inline KateDocumentConfig *config () { return m_config; };
00921 
00922     void updateConfig ();
00923 
00924   private:
00925     KateDocumentConfig *m_config;
00926 
00931   private:
00936     void readVariables(bool onlyViewAndRenderer = false);
00937 
00942     void readVariableLine( QString t, bool onlyViewAndRenderer = false );
00946     void setViewVariable( QString var, QString val );
00952     static bool checkBoolValue( QString value, bool *result );
00958     static bool checkIntValue( QString value, int *result );
00959     /*
00960       Feeds value into @p col using QColor::setNamedColor() and returns
00961       wheather the color is valid
00962     */
00963     static bool checkColorValue( QString value, QColor &col );
00964 
00965     static QRegExp kvLine;
00966     static QRegExp kvVar;
00967 
00968     KIO::TransferJob *m_job;
00969     KTempFile *m_tempFile;
00970 
00971   //
00972   // IM input stuff
00973   //
00974   public:
00975     void setIMSelectionValue( uint imStartLine, uint imStart, uint imEnd,
00976                               uint imSelStart, uint imSelEnd, bool m_imComposeEvent );
00977     void getIMSelectionValue( uint *imStartLine, uint *imStart, uint *imEnd,
00978                               uint *imSelStart, uint *imSelEnd );
00979 
00980   private:
00981     uint m_imStartLine;
00982     uint m_imStart;
00983     uint m_imEnd;
00984     uint m_imSelStart;
00985     uint m_imSelEnd;
00986     bool m_imComposeEvent;
00987 
00988   k_dcop:
00989     uint documentNumber () const;
00990 };
00991 
00992 #endif
00993 
00994 // kate: space-indent on; indent-width 2; replace-tabs on;
00995 
KDE Logo
This file is part of the documentation for kate Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Feb 18 15:11:56 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003