summaryrefslogtreecommitdiffstats
path: root/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgdebuggerbase.h
blob: 2f05ec7c81e0bc867aeb9483948cb68326ce33da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/***************************************************************************
                          xsldbgdebuggerbase.h  -  The base class from
                                                      which a debugger 
                                                      could be built

                             -------------------
    begin                : Fri Feb 1 2001
    copyright            : (C) 2001 by Keith Isdale
    email                : k_isdale@tpg.com.au
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef XSLDBGDEBUGGERBASE_H
#define XSLDBGDEBUGGERBASE_H

#if defined WIN32
#  include <libxsldbg/xsldbgwin32config.h>
#else
#  ifndef  XSLDBG_SO_API
#     define XSLDBG_SO_API
#  endif
#endif

#include <tqobject.h>
#include <tqstringlist.h>
#include <libxml/tree.h>

class XsldbgEvent;
class TQApplication;
class TQStringList;

/** 
    We delegate the task of emitting our signals to XsldbgEvent , so 
    Xsldbg must become our friend
*/
class XsldbgDebuggerBase : public TQObject
{
    Q_OBJECT
  TQ_OBJECT

    friend class XsldbgEvent;

 public:
  XsldbgDebuggerBase(void);
  ~XsldbgDebuggerBase(void);

  void setInitialized(bool state) {initialized = state; };
  bool getInitialized(void) {return initialized ;};

  void setUpdateTimerID(int ID) { updateTimerID = ID;};
  int getUpdateTimerID(void) {return updateTimerID ;};


  /** Convert from libxslt UTF8 to a TQString */	
  static TQString fromUTF8(const char *text);
  static TQString fromUTF8FileName(const char *text);
	
  /** Convert from libxslt UTF8 to a TQString */	
  static TQString fromUTF8(const xmlChar *text);
  static TQString fromUTF8FileName(const xmlChar *text);

  /* list of command yet to be processed */
  TQStringList commandQueue(void) {return _commandQueue ;};
  
  void queueMessage(const TQString &text);

protected:
    TQString updateText;

 private:
  bool initialized;
  int updateTimerID;
  TQStringList _commandQueue;	

  signals: // Signals
   /** line number and/or file name changed */
   void lineNoChanged(TQString /* fileName */, int /* lineNumber */, bool /* breakpoint */);

   /** Show a message in debugger window */
   void showMessage(TQString /* msg*/);

   /** Add breakpoint to view, First parameter is TQString()
       to indicate start of breakpoint list notfication */
   void breakpointItem(TQString /* fileName*/, int /* lineNumber */, 
		       TQString /*templateName*/, TQString /* modeName */,
 		      bool /* enabled */, int /* id */);

  /** Add global variable to view, First parameter is TQString()
      to indicate start of global variable list notfication */
  void globalVariableItem(TQString /* name */, TQString /* fileName */, int /* lineNumber */);

  /** Add local variable to view, First parameter is TQString()
      to indicate start of local variable list notfication */
  void localVariableItem(TQString /*name */, TQString /* templateContext*/,
			 TQString /* fileName */, int /*lineNumber */);	
  
    /** Add a variable to view, First parameter is TQString()
      to indicate start of local variable list notfication */
  void variableItem(TQString /*name */, TQString /* templateContext*/,
			 TQString /* fileName */, int /*lineNumber */, 
			 TQString /* select XPath */, int /* is it a local variable */);	

  /** Add template to view, First parameter is TQString()
      to indicate start of template list notfication */
  void templateItem(TQString /* name*/, TQString /*mode*/, TQString /* fileName */, int /* lineNumber */);

  /** Add source to view, First parameter is TQString()
      to indicate start of source list notfication */
  void sourceItem(TQString /* fileName */, TQString /* parentFileName */, int /*lineNumber */);

  /** Add parameter to view, First parameter is TQString()
      to indicate start of parameter list notfication */
  void parameterItem(TQString /* name*/, TQString /* value */);

  /** Add callStack to view, First parameter is TQString()
      to indicate start of callstack list notfication */
  void callStackItem(TQString /* tempalteName*/, TQString /* fileName */, int /* lineNumber */);
	
  /** Add entity to view, First parameter is TQString()
      to indicate start of entity list notfication */
  void entityItem(TQString /*SystemID*/,  TQString /*PublicID*/);	
	
  /* Show the URI for SystemID or PublicID requested */
  void resolveItem(TQString /*URI*/);
  
  /* Display a integer option value First parameter is TQString()
     to indicate start of option list notification */
  void intOptionItem(TQString /* name*/, int /* value */);

  /* Display a string option value. First parameter is TQString()
     to indicate start of option list notification */
  void stringOptionItem(TQString /* name*/, TQString /* value */);

  /* Cause the names for source, data and output files to be reload from xsldbg */
  void fileDetailsChanged();

};

#endif