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 _TZCFGVIEW_H_
00031 #define _TZCFGVIEW_H_
00032
00033
00034
00035
00036
00037
00038 #include <tcdist.h>
00039 #include <qlistview.h>
00040
00041
00042 #include <tomenu.h>
00043 #include "tautils.h"
00044
00045
00046
00047
00048
00049
00050 namespace OSB_GUI {
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00064 class LvTzConfig : public QListView {
00065 Q_OBJECT
00066 public:
00068 enum Col {
00070 colTz = 0,
00072 colOrigin = 1,
00074 colDest = 2,
00076 colStatus = 3,
00078 colStart = 4,
00080 colEnd = 5
00081 };
00082 public:
00084 explicit LvTzConfig(
00085 QWidget* parent = 0,
00086 const char* name = "lvTzConfig_",
00087 WFlags flags = 0
00088 );
00089 public:
00091 void languageChange();
00102 void display(
00103 const OSB_LIB::TariffZone::Oid& tzId,
00104 bool allTz,
00105 bool readOnly
00106 );
00108 ToMenu* cfgMenu();
00109 private:
00111 void add(const OSB_LIB::TzConfig& cfg);
00113 void newCfg();
00114 private slots:
00116 void setupMenu();
00118 void showCfgMenu(
00119 QListViewItem* item,
00120 const QPoint& pos,
00121 int col
00122 );
00124 void commandEvent(ToMenuCmd cmd);
00125 private:
00131 OSB_LIB::TariffZone::Oid tzId_;
00133 bool allTz_;
00135 bool readOnly_;
00137 ToMenu* cfgMenu_;
00138 };
00139
00143 class TzConfigItem : public QListViewItem {
00144 public:
00146 explicit TzConfigItem(
00147 LvTzConfig* parent,
00148 const OSB_LIB::TzConfig& tzConfig,
00149 const std::string& tzName,
00150 const std::string& originName,
00151 const std::string& destName
00152 );
00154 int compare(
00155 QListViewItem* item,
00156 int col,
00157 bool asc
00158 ) const;
00160 const QPixmap* pixmap(int col) const;
00162 void setupMenu(
00163 ToMenu& menu,
00164 bool readOnly
00165 ) const;
00167 void showCfg();
00169 void changeStatus();
00171 void delCfg();
00172 private:
00174 OSB_LIB::TzConfig tzConfig_;
00175 };
00176
00181 class TzCfgStatusProxy : public ToCfgTsStatusProxy {
00182 public:
00188 explicit TzCfgStatusProxy(
00189 OSB_LIB::TzConfig& tzCfg
00190 );
00192 TzCfgStatusProxy& operator=(const TzCfgStatusProxy&);
00193 public:
00195 OSB_LIB::ToCfgTsBase& toCfgTs();
00200 void setStatus(
00201 OSB_LIB::CfgStatus newStatus,
00202 OSB_LIB::OsbErrors& errors
00203 );
00204
00205 bool setReleaseTs(
00206 const OSB_LIB::DateTime& ts,
00207 OSB_LIB::OsbErrors& errors
00208 );
00209 private:
00211 OSB_LIB::TzConfig& tzCfg_;
00212 };
00213 }
00214
00215
00216
00217 namespace OSB_GUI {
00218 }
00219 #endif // #ifndef _TZCFGVIEW_H_