summaryrefslogtreecommitdiffstats
path: root/kxsldbg/kxsldbgpart/kxsldbg_part.h
blob: e8de28a78e2210dece2a0ac4746bee38d5ffd649 (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#ifndef KXSLDBGKPART_H
#define KXSLDBGKPART_H

#include <kparts/part.h>
#include <tqvariant.h>
#include <tqdict.h>
#include <tqmainwindow.h>
#include "xsldbgdebugger.h"
#include "xsldbginspector.h"
#include <dcopclient.h>
#include "kxsldbg_partif.h"
#include <ktexteditor/document.h> 
#include <ktexteditor/view.h> 

class TQVBoxLayout;
class TQHBoxLayout;
class TQGridLayout;
class TQAction;
class TQActionGroup;
class TQToolBar;
class TQPopupMenu;
class TQTextBrowser;
class TQLineEdit;
class TQDockWindow;
class TQWidgetStack;

class XsldbgBrkStatusView;
class QXsldbgDoc;
class XsldbgOutputView;
class XsldbgConfigImpl;

class TQWidget;
class TQPainter;
class KURL;
class TQMultiLineEdit;
class TDEAboutData;

typedef TQDict<QXsldbgDoc> XsldbgDocDict;

/**
 * This is a "Part".  It that does all the real work in a KPart
 * application.
 *
 * @short Main Part
 * @author Keith Isdale <k_isdale@tpg.com.au>
 * @version 0.1
 */
class KXsldbgPart : public KParts::ReadOnlyPart, public KXsldbgPartIf 
{
    Q_OBJECT
  

public:
    /**
     * Default constructor
     */
    KXsldbgPart(TQWidget *parentWidget, const char *widgetName,
                    TQObject *parent, const char *name, const TQStringList &args);

    /**
     * Destructor
     */
    virtual ~KXsldbgPart();

    static TDEAboutData *createAboutData();


   /** Checks the debugger, if it is not ready then
     *      display a error in a message box
     *
     * @returns TRUE if debugger is ready, otherwise FALSE
     */
    bool checkDebugger();
    void lookupSystemID(TQString systemID);
    void lookupPublicID(TQString publicID);
    void createInspector();

public slots:
    virtual bool openURL(const KURL &url);
    virtual bool closeURL();
    void quit();
    void emitOpenFile(TQString file, int line, int row);
    void slotLookupSystemID();
    void slotLookupPublicID();
    void walkCmd_activated();
    void walkStopCmd_activated();
    void traceCmd_activated();
    void traceStopCmd_activated();
    void configureEditorCmd_activated(); 

  //Tool bar commands
    void configureCmd_activated();
    void inspectorCmd_activated();
    void runCmd_activated();
    void stepCmd_activated();
    void nextCmd_activated();
    void continueCmd_activated();
    void stepupCmd_activated();
    void stepdownCmd_activated();
    void sourceCmd_activated();
    void dataCmd_activated();
    void outputCmd_activated();
    void refreshCmd_activated();
    void enableCmd_activated();
    void breakCmd_activated();
    void deleteCmd_activated();

    /** Evaluate expression entered */	
    void evaluateCmd_activated();

    /** Goto/display file XPath entered */
    void gotoXPathCmd_activated();

    virtual void lineNoChanged( TQString fileName, int lineNumber,
				bool breakpoint );

    void addBreakPoint(int lineNumber);
    void enableBreakPoint(int lineNumber);
    void deleteBreakPoint(int lineNumber);

    /** Evaluate expression entered in expressionEdit */
    void slotEvaluate();

    /** Goto/display file that matches XPath specified in xPathEdit */
    void slotGotoXPath();

     /** Run search on data base , see search.dtd for DTD of search database */
    void slotSearch();

    /* Process the the URI for SystemID or PublicID requested */
    void slotProcResolveItem(TQString URI);

    /* used to get breakpoint list notfication */
    void breakpointItem(TQString fileName, int  lineNumber ,
			TQString /*templateName*/, TQString /* modeName */,
			bool  enabled , int /* id */);

    void cursorPositionChanged();
    void docChanged();
    
    void debuggerStarted();

protected:
    /**
     * This must be implemented by each part
     */
    virtual bool openFile();
    bool fetchURL(const KURL &url);

protected slots:
    void fileOpen();

private:
    QXsldbgDoc *currentDoc;
    TQWidgetStack *mainView;

    TQPushButton *xPathBtn, *searchBtn, *evaluateBtn;
    TQLineEdit *newXPath, *newSearch, *newEvaluate;
    TQGridLayout* qxsldbgLayout;

    uint currentLineNo, currentColumnNo;
    XsldbgDocDict docDictionary;
    XsldbgInspector *inspector;
    XsldbgDebugger *debugger;
    XsldbgConfigImpl *configWidget;
    TQString currentFileName;

    XsldbgOutputView *outputview;
};

#endif // KXSLDBGPART_H