Back to index

texmacs  1.0.7.15
qt_other_widgets.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : qt_other_widgets.hpp
00004 * DESCRIPTION: some QT widgets class declarations
00005 * COPYRIGHT  : (C) 2008  Massimiliano Gubinelli
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef QT_OTHER_WIDGETS_HPP
00013 #define QT_OTHER_WIDGETS_HPP
00014 
00015 #include "qt_widget.hpp"
00016 #include "QTMInteractiveInputHelper.hpp"
00017 #include "QTMWidget.hpp"
00018 
00019 #include <QLabel>
00020 #include <QMainWindow>
00021 #include <QStackedWidget>
00022 #include <QAbstractScrollArea>
00023 #include <QToolBar>
00024 
00025 
00026 class qt_tm_widget_rep: public qt_view_widget_rep {
00027 public: 
00028   QLabel *rightLabel;
00029   QLabel *leftLabel;
00030 
00031   QToolBar *mainToolBar;
00032   QToolBar *modeToolBar;
00033   QToolBar *focusToolBar;
00034   QToolBar *userToolBar;
00035         
00036   QTMInteractiveInputHelper helper;
00037         
00038   qt_widget int_prompt;
00039   qt_widget int_input;
00040 
00041   bool visibility[6];
00042 
00043   command quit;
00044   
00045   widget main_menu_widget;
00046   widget main_icons_widget;
00047   widget mode_icons_widget;
00048   widget focus_icons_widget;
00049   widget user_icons_widget;
00050   widget waiting_main_menu_widget;
00051 
00052 public:
00053   qt_tm_widget_rep (int mask, command _quit);
00054   ~qt_tm_widget_rep ();
00055         
00056   virtual void send (slot s, blackbox val);
00057   virtual blackbox query (slot s, int type_id);
00058   virtual widget read (slot s, blackbox index);
00059   virtual void write (slot s, blackbox index, widget w);
00060   // virtual void notify (slot s, blackbox new_val);    
00061   // virtual void connect (slot s, widget w2, slot s2);
00062   // virtual void deconnect (slot s, widget w2, slot s2);
00063   virtual widget plain_window_widget (string s);
00064         
00065   QMainWindow* tm_mainwindow () {
00066     return qobject_cast<QMainWindow*> (view); }
00067   QStackedWidget* tm_centralwidget () {
00068     return qobject_cast<QStackedWidget*> (tm_mainwindow()->centralWidget()); }
00069   QTMScrollView* tm_scrollarea () {
00070     return qobject_cast<QTMScrollView*> (tm_centralwidget()->currentWidget()); }
00071   QTMWidget* tm_canvas () {
00072     return qobject_cast<QTMWidget*> (tm_scrollarea()); }
00073 
00074 
00075   // void layout();
00076   void updateVisibility();
00077   void do_interactive_prompt ();
00078   void install_main_menu ();
00079 };
00080 
00081 class qt_window_widget_rep: public widget_rep {
00082 public:
00083 
00084   QWidget *wid;
00085 
00086   qt_window_widget_rep (QWidget* _wid);
00087   ~qt_window_widget_rep ();
00088 
00089   virtual void send (slot s, blackbox val);
00090   virtual blackbox query (slot s, int type_id);
00091   virtual widget read (slot s, blackbox index);
00092   virtual void write (slot s, blackbox index, widget w);
00093   virtual void notify (slot s, blackbox new_val);
00094   // virtual void connect (slot s, widget w2, slot s2);
00095   // virtual void deconnect (slot s, widget w2, slot s2);
00096 };
00097 
00098 #endif // defined QT_OTHER_WIDGETS_HPP