UltraScan III
us_report.h
Go to the documentation of this file.
1 #ifndef US_REPORT_H
3 #define US_REPORT_H
4 
5 #include "us_extern.h"
6 #include "us_db2.h"
7 
8 #ifndef DbgLv
9 #define DbgLv(a) if(dbg_level>=a)qDebug()
10 #endif
11 
18 {
19 
20  public:
21 
23  enum Status
24  {
30  SAVED_DB
31  };
32 
39  {
40  public:
42  ReportTypes();
43 
44  QMap< QString, QString > appLabels;
45  QMap< QString, QString > rptLabels;
46  QMap< QString, QString > extLabels;
47  QMap< QString, QString > extMTypes;
48 
50  void show ( void );
51 
52  };
53 
59  {
60  public:
61  int documentID;
62  QString documentGUID;
64  QString label;
65  QString filename;
66  QString analysis;
67  QString subAnalysis;
69  QString documentType;
71 
74 
82  Status saveDB( int, QString, US_DB2* = 0 );
83 
89  Status readDB( QString, US_DB2* = 0 );
90 
92  void reset ( void );
93 
95  void show ( void );
96 
97  private:
98  int dbg_level;
99  };
100 
107  {
108  public:
109  int tripleID;
110  QString tripleGUID;
111  int resultID;
112  QString triple;
114  QString dataDescription;
116  QVector< ReportDocument > docs;
118 
120  ReportTriple();
121 
129  Status saveDB( int, US_DB2* = 0 );
130 
136  Status readDocsDB( US_DB2* = 0 );
137 
152  Status addDocument( int ,
153  QString,
154  QString,
155  QString,
156  QString,
157  QString,
158  QString,
159  US_DB2* = 0 );
160 
168  Status addDocument( US_Report::ReportDocument , QString , US_DB2* = 0 );
169 
175  Status removeDocument( int, US_DB2* = 0 );
176 
186  int findDocument( QString, QString, QString );
187 
189  void reset ( void );
190 
192  void show ( void );
193 
194  private:
195  int dbg_level;
196  };
197 
198  int ID;
199  QString GUID;
201  QString runID;
202  QString title;
203  QString html;
204  QVector< ReportTriple > triples;
207 
209  US_Report();
210 
213 
220  Status readDB( QString, US_DB2* = 0, QString = "" );
221 
223  // \param db For database access, an open database connection
224  // \returns One of the US_Report error codes
225  Status saveDB( US_DB2* = 0 );
226 
232  Status addTriple( QString, QString = "", US_DB2* = 0 );
233 
238  Status addTriple( US_Report::ReportTriple , US_DB2* = 0 );
239 
245  Status saveAllToDB( QString, US_DB2* = 0 );
246 
253  Status removeTriple( int, US_DB2* = 0 );
254 
259  int findTriple( QString );
260 
274  Status saveDocumentFromFile( const QString&, const QString&,
275  US_DB2*, int = 1, const QString = "" );
276 
290  Status saveFileDocuments ( const QString&, const QStringList&,
291  US_DB2*, int = 1, const QString = "" );
292 
296  Status removeReport( int, US_DB2* = 0 );
297 
299  void reset();
300 
302  void show ( void );
303 
304  private:
305  int dbg_level;
306 };
307 
308 #endif