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

kate

  • kate
  • part
katetemplatehandler.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2004 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 #ifndef _KATE_TEMPLATE_HANDLER_H_
19 #define _KATE_TEMPLATE_HANDLER_H_
20 
21 #include "katesupercursor.h"
22 #include "katekeyinterceptorfunctor.h"
23 #include <tqobject.h>
24 #include <tqmap.h>
25 #include <tqdict.h>
26 #include <tqptrlist.h>
27 #include <tqstring.h>
28 
29 class KateDocument;
30 
31 class KateTemplateHandler: public TQObject, public KateKeyInterceptorFunctor {
32  TQ_OBJECT
33  public:
34  KateTemplateHandler(KateDocument *doc,uint line,uint column, const TQString &templateString, const TQMap<TQString,TQString> &initialValues);
35  virtual ~KateTemplateHandler();
36  inline bool initOk() {return m_initOk;}
37  virtual bool operator()(KKey key);
38  private:
39  struct KateTemplatePlaceHolder {
40  KateSuperRangeList ranges;
41  bool isCursor;
42  bool isInitialValue;
43  };
44  class KateTemplateHandlerPlaceHolderInfo{
45  public:
46  KateTemplateHandlerPlaceHolderInfo():begin(0),len(0),placeholder(""){};
47  KateTemplateHandlerPlaceHolderInfo(uint begin_,uint len_,const TQString& placeholder_):begin(begin_),len(len_),placeholder(placeholder_){}
48  uint begin;
49  uint len;
50  TQString placeholder;
51  };
52  class KateSuperRangeList *m_ranges;
53  class KateDocument *m_doc;
54  TQPtrList<KateTemplatePlaceHolder> m_tabOrder;
55  TQDict<KateTemplatePlaceHolder> m_dict;
56  void generateRangeTable(uint insertLine,uint insertCol, const TQString& insertString, const TQValueList<KateTemplateHandlerPlaceHolderInfo> &buildList);
57  int m_currentTabStop;
58  KateSuperRange *m_currentRange;
59  void locateRange(const KateTextCursor &cursor );
60  bool m_initOk;
61  bool m_recursion;
62  private slots:
63  void slotTextInserted(int,int);
64  void slotDocumentDestroyed();
65  void slotAboutToRemoveText(const KateTextRange &range);
66  void slotTextRemoved();
67 };
68 #endif
KKey
KateSuperRange
Represents a range of text, from the start() to the end().
Definition: katesupercursor.h:169
KateTextCursor
Simple cursor class with no document pointer.
Definition: katecursor.h:34

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.9.1
This website is maintained by Timothy Pearson.