Back to index

texmacs  1.0.7.15
qt_tm_widget.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003  * MODULE     : qt_tm_widget.hpp
00004  * DESCRIPTION: The main TeXmacs widget for the Qt GUI
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_TM_WIDGET_HPP
00013 #define QT_TM_WIDGET_HPP
00014 
00015 #include "list.hpp"
00016 
00017 #include "qt_widget.hpp"
00018 #include "qt_view_widget.hpp"
00019 
00020 #include "QTMInteractiveInputHelper.hpp"
00021 #include "QTMWidget.hpp"
00022 #include "QTMScrollView.hpp"
00023 
00024 #include <QMainWindow>
00025 #include <QStackedWidget>
00026 #include <QLayout>
00027 
00028 class QLabel; class QToolBar;
00029 class QTMInteractivePrompt;
00030 
00037 class qt_tm_widget_rep: public qt_view_widget_rep {
00038 public: 
00039   QLabel *rightLabel;
00040   QLabel *leftLabel;
00041   
00042   QToolBar *mainToolBar;
00043   QToolBar *modeToolBar;
00044   QToolBar *focusToolBar;
00045   QToolBar *userToolBar;
00046   
00047 
00048 #ifdef Q_WS_MAC
00049   QToolBar *dumbToolBar;
00050   
00051   QAction *modeToolBarAction;
00052   QAction *mainToolBarAction;
00053   
00054   QWidget *rulerWidget;
00055 #endif
00056   
00057   
00058   QWidget *centralWidget;
00059   
00060   QTMInteractiveInputHelper helper;
00061   
00062   QTMInteractivePrompt *prompt;
00063   
00064   qt_widget int_prompt;
00065   qt_widget int_input;
00066   
00067   bool visibility[6];
00068   bool full_screen;
00069   
00070   command quit;
00071   
00072   widget main_menu_widget;
00073   widget main_icons_widget;
00074   widget mode_icons_widget;
00075   widget focus_icons_widget;
00076   widget user_icons_widget;
00077   widget waiting_main_menu_widget;
00078   
00079 public:
00080   qt_tm_widget_rep (int mask, command _quit);
00081   ~qt_tm_widget_rep ();
00082   
00083   virtual void send (slot s, blackbox val);
00084   virtual blackbox query (slot s, int type_id);
00085   virtual widget read (slot s, blackbox index);
00086   virtual void write (slot s, blackbox index, widget w);
00087   
00088   virtual widget plain_window_widget (string s, command q);
00089   
00090   QMainWindow* tm_mainwindow () {
00091     return qobject_cast<QMainWindow*> (view); }
00092   QStackedWidget* tm_centralwidget () {
00093     return tm_mainwindow()->findChild<QStackedWidget*>("stacked widget"); }
00094   QTMScrollView* tm_scrollarea () {
00095     return qobject_cast<QTMScrollView*> (tm_centralwidget()->currentWidget()); }
00096   QTMWidget* tm_canvas () {
00097     return qobject_cast<QTMWidget*> (tm_scrollarea()); }
00098   
00099   void updateVisibility();
00100   void install_main_menu ();
00101   void set_full_screen (bool flag);
00102 };
00103 
00104 
00108 extern list<qt_tm_widget_rep*> waiting_widgets;
00109 
00113 extern int menu_count;
00114 
00115 
00116 #endif // QT_TM_WIDGET_HPP