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 _GUIUTILS_H_
00031 #define _GUIUTILS_H_
00032
00033
00034
00035
00036 #include <string>
00037 #include <sstream>
00038
00039
00040 #include <osbconst.h>
00041 #include <stringutil.h>
00042
00043
00044
00045
00046
00047
00048 class QCheckBox;
00049 class QCursor;
00050 class QDate;
00051 class QDateTime;
00052 class QLabel;
00053 class QListView;
00054 class QPixmap;
00055 class QRadioButton;
00056 class QRect;
00057 class QTime;
00058 class QWidget;
00059
00060 namespace OSB_LIB {
00061 class Date;
00062 class DateTime;
00063 class Guard;
00064 class OsbError;
00065 class OsbException;
00066 class Time;
00067 }
00068
00069
00070
00071 namespace OSB_GUI {
00072
00073
00074 using OSB_LIB::mkStr;
00075
00076
00077
00078
00080
00081
00082 inline int defMargin() { return 11; }
00084 inline int defSpacing() { return 6; }
00086
00092
00093 void setOsbPalette(QLabel* lbl);
00095 void setOsbPalette(QRadioButton* rb);
00097 void setOsbPalette(QCheckBox* cb);
00099 void setOsbPalette(QListView* lv, bool mandatory = false);
00101 void setOsbPalette(QWidget* w, bool mandatory = false);
00103
00122 OSB_LIB::Guard setAppCursor(
00123 const QCursor& cursor,
00124 bool replace = false
00125 );
00126
00132 OSB_LIB::Guard setAppCursor(
00133 int cursorShape,
00134 bool replace = false
00135 );
00137
00143 class PopupMover {
00144 public:
00152 explicit PopupMover(
00153 QWidget* popup,
00154 const QWidget* visParent = 0
00155 );
00156 public:
00158 bool insideTop() const;
00168 bool intoTop();
00182 bool intoTop(bool coverParent);
00183 private:
00185 QRect rect(
00186 const QWidget* widget,
00187 bool relTop
00188 ) const;
00189 private:
00191 QWidget* popup_;
00193 const QWidget* parent_;
00195 const QWidget* topLevel_;
00196 };
00197
00199
00200
00201 std::string mkStr(const OSB_LIB::CfgStatus cfgStatus);
00210 std::string mkTsStr(
00211 const QDateTime& ts,
00212 const std::string& notValid = ""
00213 );
00219 std::string mkTsStr(
00220 const OSB_LIB::DateTime& ts,
00221 const std::string& notValid = ""
00222 );
00231 std::string mkDateStr(
00232 const QDateTime& ts,
00233 const std::string& notValid = ""
00234 );
00240 std::string mkDateStr(
00241 const OSB_LIB::DateTime& ts,
00242 const std::string& notValid = ""
00243 );
00252 std::string mkDateStr(
00253 const QDate& date,
00254 const std::string& notValid = ""
00255 );
00261 std::string mkDateStr(
00262 const OSB_LIB::Date& ts,
00263 const std::string& notValid = ""
00264 );
00266
00268
00269
00270 const QPixmap& deletePixmap();
00272 const QPixmap& yesPixmap();
00274 const QPixmap& noPixmap();
00276 const QPixmap& nextPixmap();
00278 const QPixmap& prevPixmap();
00280 const QPixmap& mkPixmap(const OSB_LIB::CfgStatus cfgStatus);
00282
00288 QDateTime mkDt(const OSB_LIB::DateTime& dt);
00289 QDateTime mkDt(const OSB_LIB::Date& d);
00290 QDate mkDate(const OSB_LIB::Date& d);
00291 QTime mkTime(const OSB_LIB::Time& t);
00293
00295
00296 OSB_LIB::Date mkDate(const QDate& d);
00297 OSB_LIB::Date mkDate(const QDateTime& d);
00299
00301
00302
00303 void mbCritical(const OSB_LIB::OsbError& e);
00304 void mbCritical(const OSB_LIB::OsbException& e);
00306 }
00307
00308
00309
00310 namespace OSB_GUI {
00311 }
00312 #endif // #ifndef _GUIUTILS_H_