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

kate

katetemplatehandler.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2004 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 #ifndef _KATE_TEMPLATE_HANDLER_H_
00019 #define _KATE_TEMPLATE_HANDLER_H_
00020 
00021 #include "katesupercursor.h"
00022 #include "katekeyinterceptorfunctor.h"
00023 #include <tqobject.h>
00024 #include <tqmap.h>
00025 #include <tqdict.h>
00026 #include <tqptrlist.h>
00027 #include <tqstring.h>
00028 
00029 class KateDocument;
00030 
00031 class KateTemplateHandler: public TQObject, public KateKeyInterceptorFunctor {
00032         Q_OBJECT
00033     public:
00034         KateTemplateHandler(KateDocument *doc,uint line,uint column, const TQString &templateString, const TQMap<TQString,TQString> &initialValues);
00035         virtual ~KateTemplateHandler();
00036         inline bool initOk() {return m_initOk;}
00037         virtual bool operator()(KKey key);
00038     private:
00039         struct KateTemplatePlaceHolder {
00040             KateSuperRangeList ranges;
00041             bool isCursor;
00042             bool isInitialValue;
00043         };
00044         class KateTemplateHandlerPlaceHolderInfo{
00045             public:
00046                 KateTemplateHandlerPlaceHolderInfo():begin(0),len(0),placeholder(""){};
00047                 KateTemplateHandlerPlaceHolderInfo(uint begin_,uint len_,const TQString& placeholder_):begin(begin_),len(len_),placeholder(placeholder_){}
00048                 uint begin;
00049                 uint len;
00050                 TQString placeholder;
00051         };
00052         class KateSuperRangeList *m_ranges;
00053         class KateDocument *m_doc;
00054         TQPtrList<KateTemplatePlaceHolder> m_tabOrder;
00055         TQDict<KateTemplatePlaceHolder> m_dict;
00056         void generateRangeTable(uint insertLine,uint insertCol, const TQString& insertString, const TQValueList<KateTemplateHandlerPlaceHolderInfo> &buildList);
00057         int m_currentTabStop;
00058         KateSuperRange *m_currentRange;
00059         void locateRange(const KateTextCursor &cursor );
00060         bool m_initOk;
00061         bool m_recursion;
00062     private slots:
00063         void slotTextInserted(int,int);
00064         void slotDocumentDestroyed();
00065         void slotAboutToRemoveText(const KateTextRange &range);
00066         void slotTextRemoved();
00067 };
00068 #endif

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