core/vgui/impl/qt/vgui_qt_dialog_impl.h
Go to the documentation of this file.
00001 // This is core/vgui/impl/qt/vgui_qt_dialog_impl.h
00002 #ifndef VGUI_QT_DIALOG_IMPL_H_
00003 #define VGUI_QT_DIALOG_IMPL_H_
00004 //:
00005 // \file
00006 // \brief QT Dialog wrapper
00007 // \author Joris Schouteden, ESAT, K.U.Leuven
00008 //
00009 // \verbatim
00010 //  Modifications
00011 //   27.03.2000 JS  Initial Version, adapted from vgui_Fl_dialog_impl
00012 //   26.10.2000 JS  Added file browser and text message
00013 //   09.11.2000 JS  Added colour browser
00014 //   14.11.2005 Chanop Silpa-Anan  adapted to QT 3.3.5 for X11/Mac
00015 // \endverbatim
00016 
00017 #include <vgui/internals/vgui_dialog_impl.h>
00018 #include <qdialog.h>
00019 #include <qobject.h>
00020 
00021 //: QT implementation of vgui_dialog_impl.
00022 class vgui_qt_dialog_impl :
00023    public QDialog,
00024    public vgui_dialog_impl
00025 {
00026    Q_OBJECT
00027  public:
00028     vgui_qt_dialog_impl(const char* name);
00029    ~vgui_qt_dialog_impl() {}
00030 
00031    void* bool_field_widget(const char*, bool&);
00032    void* int_field_widget(const char*, int&);
00033    void* long_field_widget(const char*, long&);
00034    void* float_field_widget(const char*, float&);
00035    void* double_field_widget(const char*, double&);
00036    void* string_field_widget(const char*, vcl_string&);
00037    void* choice_field_widget(const char*, const vcl_vector<vcl_string>&, int&);
00038 
00039    void* text_message_widget(const char*);
00040    void* file_browser_widget(const char*, vcl_string&, vcl_string&);
00041    void* inline_file_browser_widget(const char *,vcl_string&, vcl_string&);
00042    void* color_chooser_widget(const char *,vcl_string&);//, vcl_string&);
00043    void* inline_color_chooser_widget(const char *,vcl_string&);//, vcl_string&);
00044    void* inline_tableau_widget(const vgui_tableau_sptr tab,
00045                                unsigned int width, unsigned int height);
00046    void  modal(bool m);
00047 
00048    bool  ask();
00049 };
00050 
00051 #include <qhgroupbox.h>
00052 #include <qlineedit.h>
00053 #include <qstring.h>
00054 #include <qframe.h>
00055 
00056 class vgui_qt_filebrowser_impl : public QHGroupBox
00057 {
00058    Q_OBJECT
00059  public:
00060    vgui_qt_filebrowser_impl(QWidget* parent, const char*, vcl_string&, vcl_string&);
00061   ~vgui_qt_filebrowser_impl() {}
00062 
00063    vcl_string  file() const { return vcl_string(edit_->text().latin1()); }
00064 
00065  public slots:
00066    void get_a_file();
00067 
00068  private:
00069    vcl_string& filter_;
00070    QLineEdit*  edit_;
00071 };
00072 
00073 class vgui_qt_colorchooser_impl : public QHGroupBox
00074 {
00075    Q_OBJECT
00076  public:
00077    vgui_qt_colorchooser_impl(QWidget* parent, const char*, vcl_string&);
00078   ~vgui_qt_colorchooser_impl() {}
00079 
00080   vcl_string  color() const { return value_; }
00081 
00082  public slots:
00083    void get_a_color();
00084 
00085  private:
00086    vcl_string& value_;
00087    QFrame*     frame_;
00088 };
00089 
00090 
00091 class vgui_qt_tableau_impl : public QWidget
00092 {
00093    Q_OBJECT
00094  public:
00095    vgui_qt_tableau_impl(QWidget* parent, const vgui_tableau_sptr tab,
00096                         unsigned int width, unsigned int height);
00097   ~vgui_qt_tableau_impl() {}
00098 };
00099 
00100 #endif // VGUI_QT_DIALOG_IMPL_H_