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 _DLGTCSMAPPING_H_
00031 #define _DLGTCSMAPPING_H_
00032
00033
00034
00035
00036
00037
00038 #include <osbtype.h>
00039
00040
00041 #include "dlgtovs.h"
00042 #include "dlgtcsvs.h"
00043 #include "ui/tcsmappinggui.h"
00044
00045
00046
00047 namespace OSB_LIB {
00048 class Cdr;
00049 class CpMapper;
00050 class MappingDistTcs;
00051 class UsageType;
00052 }
00053
00054 namespace OSB_GUI {
00055 template<typename T> class ValueCombo;
00056 template<typename T> class LeValueCombo;
00057 }
00058 class QLineEdit;
00059
00060
00061
00062 namespace OSB_GUI {
00063
00064
00065
00066 class TcsMapping;
00067 class CmbCpm;
00068
00069
00070
00071
00072
00073
00077 class DlgMappingTcs : public DlgTcsVs, private DlgToVs {
00078 public:
00080 DlgMappingTcs(
00081 QWidget* parent,
00082 const char* name = "DlgMappingTcs",
00083 bool modal = false,
00084 WFlags fl = 0
00085 );
00086 public:
00088 int showTcsVs(
00089 const OSB_LIB::TcsVersion& tcsVs
00090 );
00092 int editTcsVs(
00093 OSB_LIB::TcsVersion* tcsVs
00094 );
00095 private:
00096
00097 void languageChange();
00098
00099 void addGeneralInfo(
00100 QVBoxLayout* dlgLayout,
00101 ToVsHead* generalInfo
00102 );
00109 void display(
00110 const OSB_LIB::MappingDistTcs& tcs,
00111 bool showOnly
00112 );
00113 private:
00115 TcsMapping* cfg_;
00116 };
00117
00121 class TcsMapping : public TcsMappingGui {
00122 private:
00124 typedef OSB_LIB::TypeId<OSB_LIB::CpMapper> CpmType;
00126 typedef LeValueCombo<CpmType> LineEdit;
00128 typedef OSB_LIB::TypeId<OSB_LIB::Cdr, 1> CdrUsgType;
00130 struct Row {
00131 CdrUsgType type_;
00132 LineEdit* leOrigin_;
00133 LineEdit* leDest_;
00134 Row() : leOrigin_(0), leDest_(0) {}
00135 };
00137 typedef std::list<Row> MappingDefs;
00138 public:
00140 explicit TcsMapping(
00141 QWidget* parent,
00142 const char* name = "tcsMapping_",
00143 WFlags fl = 0
00144 );
00146 void languageChange();
00148 void allowEdit(bool allow);
00150 void resetMappings();
00157 void display(
00158 const OSB_LIB::MappingDistTcs& tcs,
00159 bool showOnly
00160 );
00166 void populate(
00167 OSB_LIB::MappingDistTcs* tcs
00168 ) const;
00169 private:
00171 void addRow(
00172 const OSB_LIB::UsageType& type,
00173 int pos,
00174 QLabel* buddy = 0
00175 );
00177 Row* findRow(const OSB_LIB::UsageType& type);
00178 private:
00180 CmbCpm* cmbCpm_;
00182 MappingDefs mappings_;
00183 };
00184 }
00185
00186
00187
00188 namespace OSB_GUI {
00189 }
00190 #endif // #ifndef _DLGTCSMAPPING_H_