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

kate

  • kate
  • part
kateindentscriptabstracts.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2005 Joseph Wenninger <jowenn@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 _KATEINDENTSCRIPTABSTRACTS_H_
20 #define _KATEINDENTSCRIPTABSTRACTS_H_
21 
22 #include <tqstring.h>
23 #include <kdebug.h>
24 
25 namespace Kate {
26  class View;
27 }
28 
29 class KateDocCursor;
30 
31 
32 class KateIndentScriptImplAbstract {
33  public:
34  friend class KateIndentScript;
35  KateIndentScriptImplAbstract(const TQString& internalName,
36  const TQString &filePath, const TQString &niceName,
37  const TQString &copyright, double version);
38  virtual ~KateIndentScriptImplAbstract();
39 
40  virtual bool processChar( class Kate::View *view, TQChar c, TQString &errorMsg )=0;
41  virtual bool processLine( class Kate::View *view, const KateDocCursor &line, TQString &errorMsg )=0;
42  virtual bool processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, TQString &errorMsg )=0;
43  protected:
44  virtual void decRef();
45  long refCount() {return m_refcount;}
46  TQString filePath() const {return m_filePath;}
47  private:
48  void incRef();
49  long m_refcount;
50  TQString m_internalName;
51  TQString m_filePath;
52  TQString m_niceName;
53  TQString m_copyright;
54  double m_version;
55 };
56 
57 
58 class KateIndentScript {
59  public:
60  KateIndentScript(KateIndentScriptImplAbstract *scr):m_scr(scr) { if (scr) scr->incRef(); }
61  ~KateIndentScript() {if (m_scr) m_scr->decRef();}
62  KateIndentScript():m_scr(0) {}
63  KateIndentScript(const KateIndentScript &p):m_scr(p.m_scr){if (m_scr) m_scr->incRef();}
64  KateIndentScript &operator=(const KateIndentScript &p) {
65  if (m_scr==p.m_scr) return *this;
66  if (m_scr) m_scr->decRef();
67  m_scr=p.m_scr;
68  if (m_scr) m_scr->incRef();
69  return *this;
70  }
71  /*operator KateIndentJScript*() const { return m_scr; }*/
72  bool processChar( class Kate::View *view, TQChar c, TQString &errorMsg ) {
73  kdDebug(13050)<<"KateIndentScript::processChar: m_scr:"<<m_scr<<endl;
74  if (m_scr) return m_scr->processChar(view,c,errorMsg); else return true;
75  }
76  bool processLine( class Kate::View *view, const KateDocCursor& line, TQString &errorMsg ) {
77  kdDebug(13050)<<"KateIndentScript::processLine: m_scr:"<<m_scr<<endl;
78  if (m_scr) return m_scr->processLine(view,line,errorMsg); else return true;
79  }
80  bool processNewline( class Kate::View *view, const KateDocCursor& begin, bool needcontinue, TQString &errorMsg ) {
81  kdDebug(13050)<<"KateIndentScript::processNewLine: m_scr:"<<m_scr<<endl;
82  if (m_scr) return m_scr->processNewline(view,begin,needcontinue,errorMsg); else return true;
83  }
84 
85  bool isNull () const {return (m_scr==0);}
86  private:
87  KateIndentScriptImplAbstract *m_scr;
88 };
89 
90 class KateIndentScriptManagerAbstract
91 {
92 
93  public:
94  KateIndentScriptManagerAbstract () {};
95  virtual ~KateIndentScriptManagerAbstract () {};
96  virtual KateIndentScript script(const TQString &scriptname)=0;
97 };
98 
99 #endif
KateDocCursor
Cursor class with a pointer to its document.
Definition: katecursor.h:92
Kate::View
The Kate::View text editor interface.
Definition: view.h:42
kdDebug
kdbgstream kdDebug(int area=0)
endl
kndbgstream & endl(kndbgstream &s)
Kate
Kate namespace All classes in this namespace must stay BC during one major release series (e...
Definition: document.h:50

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.8.8
This website is maintained by Timothy Pearson.