3 * wxbDataParser, class that receives and analyses data
4 * wxbPanel, main frame's notebook panels
6 * Nicolas Boichat, April 2004
10 Copyright (C) 2004 Kern Sibbald and John Walker
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 as published by the Free Software Foundation; either version 2
15 of the License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include "wx/wxprec.h"
37 * abstract class that can receive director information.
42 /* Creates a new wxbDataParser, and register it in wxbMainFrame
43 * lineanalysis : indicate if date is to be analysed line by line (true)
44 * or packet by packet (false).
46 wxbDataParser(bool lineanalysis);
48 /* Destroy a wxbDataParser, and unregister it in wxbMainFrame */
49 virtual ~wxbDataParser();
52 * Receives director information, forwarded by wxbMainFrame, and sends it
53 * line by line to the virtual function Analyse.
55 * Returns true if status == CS_PROMPT and the message has been parsed
58 bool Print(wxString str, int status);
61 * Receives data to analyse.
63 virtual bool Analyse(wxString str, int status) = 0;
70 * abstract panel that can receive director information.
72 class wxbPanel : public wxPanel
75 wxbPanel(wxWindow* parent) : wxPanel(parent) {}
78 * Tab title in the notebook.
80 virtual wxString GetTitle() = 0;
83 * Enable or disable this panel
85 virtual void EnablePanel(bool enable = true) = 0;
89 * Receives director information, and splits it by line.
91 * datatokenizer[0] retrieves first line
93 class wxbDataTokenizer: public wxbDataParser, public wxArrayString
96 /* Creates a new wxbDataTokenizer */
97 wxbDataTokenizer(bool linebyline);
99 /* Destroy a wxbDataTokenizer */
100 virtual ~wxbDataTokenizer();
103 * Receives data to analyse.
105 virtual bool Analyse(wxString str, int status);
107 /* Returns true if the last signal received was an end signal,
108 * indicating that no more data is available */
116 * Receives director information, and check if the last messages are questions.
118 class wxbPromptParser: public wxbDataParser
121 /* Creates a new wxbDataTokenizer */
124 /* Destroy a wxbDataTokenizer */
125 virtual ~wxbPromptParser();
128 * Receives data to analyse.
130 virtual bool Analyse(wxString str, int status);
132 /* Returns true if the last signal received was an prompt signal,
133 * or an end signal */
136 /* Returns true if the last message received is a prompt message */
139 /* Returns multiple choice question's introduction */
140 wxString getIntroString();
142 /* Returns question string */
143 wxString getQuestionString();
145 /* Return a wxArrayString containing the indexed choices we have
146 * to answer the question, or NULL if this question is not a multiple
148 wxArrayString* getChoices();
156 wxArrayString* choices;
157 wxString questionStr;