Back to index

texmacs  1.0.7.15
qt_widget.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : qt_widget.hpp
00004 * DESCRIPTION: QT widget class
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_WIDGET_HPP
00013 #define QT_WIDGET_HPP
00014 
00015 #include "widget.hpp"
00016 
00017 class QWidget;
00018 class QAction;
00019 class QMenu;
00020 class QLayoutItem;
00021 
00032 class qt_widget_rep : public widget_rep {
00033 public:
00034   qt_widget_rep() : widget_rep () { };
00035 
00050   virtual widget plain_window_widget (string s, command q);
00051   
00053   virtual widget make_popup_widget ();
00054   
00056   virtual widget popup_window_widget (string s);
00057 
00058   
00060   
00061   virtual QAction* as_qaction ();
00062   
00066   virtual QWidget* as_qwidget () { return NULL; }
00067   
00074   virtual QMenu *get_qmenu() { return NULL; }
00075 
00076   
00080   virtual QWidget* get_canvas () { return NULL; }
00081   
00084   virtual QLayoutItem *as_qlayoutitem () { return NULL; }
00085   
00086 };
00087 
00088 
00094 class qt_widget {
00095 public:
00096   ABSTRACT_NULL(qt_widget); // Automagically declared constructor, methods, etc.
00097 
00098   inline bool operator == (qt_widget w) { return rep == w.rep; }
00099   inline bool operator != (qt_widget w) { return rep != w.rep; }
00100 };
00101 
00102 /*
00103  * Automagically create definitions for the stuff declared inside qt_widget with
00104  * the macro ABSTRACT_NULL(). See src/Kernel/Abstractions/basic.hpp
00105  */
00106 
00107 ABSTRACT_NULL_CODE(qt_widget);
00108 
00110 inline widget abstract (qt_widget w) { return widget (w.rep); }
00111 
00113 inline qt_widget concrete (widget w) { return qt_widget ((qt_widget_rep*) w.rep); }
00114 
00115 #endif // defined QT_WIDGET_HPP