00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _RECCNTS_H_
00031 #define _RECCNTS_H_
00032
00033
00034
00035
00036 #include <vector>
00037 #include <map>
00038 #include <set>
00039
00040
00041 #include <qscrollview.h>
00042
00043 #include <callback.h>
00044 #include <recordstream.h>
00045
00046
00047 #include "adminwidget.h"
00048 #include "barchart.h"
00049
00050
00051 namespace OSB_DB {
00052 class Session;
00053 }
00054
00055 namespace OSB_LIB {
00056 class CaCounts;
00057 class CaModuleResult;
00058 class CaResults;
00059 class CaStreamResult;
00060 class RecordStreamFilter;
00061 class RecordStreamInfo;
00062 class RecordStreams;
00063 }
00064
00065 namespace OSB_GUI {
00066 class DateEdit;
00067 class DlgStreamInfo;
00068 }
00069
00070
00071 class QCheckBox;
00072 class QHBoxLayout;
00073 class QLabel;
00074 class QPushButton;
00075 class QSpacerItem;
00076 class QVBoxLayout;
00077
00078
00079
00080 namespace OSB_GUI {
00081
00082
00083
00084 class RecCountView;
00085 class RecCounts;
00086
00087
00088
00089
00090
00091
00092
00096 class RecCountsAdmin : public AdminWidget {
00097 Q_OBJECT
00098 public:
00103 RecCountsAdmin(
00104 AdminType type,
00105 QWidget* parent,
00106 const char* name = 0,
00107 WFlags flags = 0
00108 );
00109
00110 public slots:
00112 void languageChange();
00113
00114 public:
00122 void activated(bool minimized);
00123
00124
00125 std::string menuTitle() const;
00126
00127 QPopupMenu* menu();
00128
00129 void clearMenuAccels();
00130
00131 private slots:
00133 void readStreams();
00135 void showResult();
00136
00137 private:
00144 void keyPressEvent(QKeyEvent* event);
00152 void message();
00153
00154 private:
00156 RecCountView* recCountView_;
00158 QFrame* lineCtl_;
00160 QHBoxLayout* loCtl_;
00162 QLabel* tlFrom_;
00164 DateEdit* from_;
00166 QLabel* tlTo_;
00168 DateEdit* to_;
00170 QCheckBox* cbByStream_;
00172 QSpacerItem* spPb_;
00174 QPushButton* pbGo_;
00175
00177 QVBoxLayout* layout_;
00178 };
00179
00184 class RecCountView : public QScrollView {
00186 friend class RecCountsAdmin;
00187
00188 public:
00192 RecCountView(
00193 QWidget* parent,
00194 const char* name = 0,
00195 WFlags flags = 0
00196 );
00197
00199 ~RecCountView();
00200
00201 public:
00207 void showInfo(
00208 const OSB_LIB::RecordStreamInfo::Oid& rsId
00209 ) const;
00216 bool showByModule();
00223 bool showByStream();
00229 bool empty() const;
00235 bool noInfo() const;
00236
00237 private:
00241 void clear();
00248 void readStreams(
00249 const OSB_DB::Session& session,
00250 const OSB_LIB::RecordStreamFilter& filter
00251 );
00260 void readCa(
00261 const OSB_DB::Session& session
00262 );
00263
00265 QSize contentsSize() const;
00267 void viewportResizeEvent(QResizeEvent* e);
00268
00269 private:
00271 OSB_LIB::RecordStreams* rsList_;
00273 OSB_LIB::CaResults* caResults_;
00275 std::set<RecCounts*> recCounts_;
00281 mutable DlgStreamInfo* streamDlg_;
00283 BarChartInfo* chartInfo_;
00284 };
00285
00290 class RecCounts : public BarChart {
00291 public:
00295 RecCounts(
00296 BarChartInfo& chartInfo,
00297 const RecCountView* mgr,
00298 QWidget* parent,
00299 const char* name = 0,
00300 WFlags flags = 0
00301 );
00302
00303 public:
00311 void show(
00312 const OSB_LIB::RecordStreamInfo& rsInfo,
00313 const OSB_LIB::CaStreamResult& caRes
00314 );
00315
00323 void show(
00324 const OSB_LIB::CaModuleResult& modRes,
00325 const OSB_LIB::RecordStreams& rsList
00326 );
00327
00328 private:
00330 void mouseDoubleClickEvent(QMouseEvent* e);
00338 bool buildChart(
00339 const OSB_LIB::CaStreamResult& caRes
00340 );
00341 void buildRanges(
00342 Ranges& dest,
00343 const OSB_LIB::CaCounts& Counts,
00344 const double numRecs
00345 );
00346
00347 private:
00349 typedef OSB_LIB::Id<OSB_LIB::RecordStreamInfo> RsId;
00350
00352 const RecCountView* mgr_;
00354 std::map<const QWidget*, RsId> rsMap_;
00355 };
00356 }
00357
00358
00359
00360 namespace OSB_GUI {
00361 }
00362 #endif // #ifndef _RECCNTS_H_