• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Kate

kateindentscriptabstracts.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2005 Joseph Wenninger <jowenn@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., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef _KATEINDENTSCRIPTABSTRACTS_H_
00020 #define _KATEINDENTSCRIPTABSTRACTS_H_
00021 
00022 #include <qstring.h>
00023 #include <kdebug.h>
00024 
00025 namespace Kate {
00026     class View;
00027 }
00028 
00029 class KateDocCursor;
00030 
00031 
00032 class KateIndentScriptImplAbstract {
00033   public:
00034     friend class KateIndentScript;
00035     KateIndentScriptImplAbstract(const QString& internalName,
00036         const QString  &filePath, const QString &niceName,
00037         const QString &copyright, double version);
00038     virtual ~KateIndentScriptImplAbstract();
00039     
00040     virtual bool processChar( class Kate::View *view, QChar c, QString &errorMsg )=0;
00041     virtual bool processLine( class Kate::View *view, const KateDocCursor &line, QString &errorMsg )=0;
00042     virtual bool processNewline( class Kate::View *view, const KateDocCursor &begin, bool needcontinue, QString &errorMsg )=0;
00043   protected:
00044     virtual void decRef();
00045     long refCount() {return m_refcount;}
00046     QString filePath() const {return m_filePath;}
00047   private:
00048     void incRef();
00049     long m_refcount;
00050     QString m_internalName;
00051     QString m_filePath;
00052     QString m_niceName;
00053     QString m_copyright;
00054     double m_version;
00055 };
00056 
00057 
00058 class KateIndentScript {
00059   public:
00060     KateIndentScript(KateIndentScriptImplAbstract *scr):m_scr(scr) { if (scr) scr->incRef(); }
00061     ~KateIndentScript() {if (m_scr) m_scr->decRef();}
00062     KateIndentScript():m_scr(0) {}
00063     KateIndentScript(const KateIndentScript &p):m_scr(p.m_scr){if (m_scr) m_scr->incRef();}
00064     KateIndentScript &operator=(const KateIndentScript &p) {
00065       if (m_scr==p.m_scr) return *this;
00066       if (m_scr) m_scr->decRef();
00067       m_scr=p.m_scr;
00068       if (m_scr) m_scr->incRef();
00069       return *this;
00070     }
00071     /*operator KateIndentJScript*() const { return m_scr; }*/
00072     bool processChar( class Kate::View *view, QChar c, QString &errorMsg ) {
00073       kdDebug(13050)<<"KateIndentScript::processChar: m_scr:"<<m_scr<<endl;
00074       if (m_scr) return m_scr->processChar(view,c,errorMsg); else return true;
00075     }
00076     bool processLine( class Kate::View *view, const KateDocCursor& line, QString &errorMsg ) {
00077       kdDebug(13050)<<"KateIndentScript::processLine: m_scr:"<<m_scr<<endl;
00078       if (m_scr) return m_scr->processLine(view,line,errorMsg); else return true;
00079     }
00080     bool processNewline( class Kate::View *view, const KateDocCursor& begin, bool needcontinue, QString &errorMsg ) {
00081       kdDebug(13050)<<"KateIndentScript::processNewLine: m_scr:"<<m_scr<<endl;
00082       if (m_scr) return m_scr->processNewline(view,begin,needcontinue,errorMsg); else return true;
00083     }
00084 
00085     bool isNull () const {return (m_scr==0);}
00086   private:
00087     KateIndentScriptImplAbstract *m_scr;
00088 };
00089 
00090 class KateIndentScriptManagerAbstract
00091 {
00092 
00093   public:
00094     KateIndentScriptManagerAbstract () {};
00095     virtual ~KateIndentScriptManagerAbstract () {};
00096     virtual KateIndentScript script(const QString &scriptname)=0;
00097 };
00098 
00099 #endif

Kate

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal