]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiView.h
Make signals and slots to not be defined, and replace them with Q_SIGNALS and Q_SLOTS
[lyx.git] / src / frontends / qt4 / GuiView.h
1 // -*- C++ -*-
2 /**
3  * \file GuiView.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjornes
8  * \author John Levon
9  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUI_VIEW_H
15 #define GUI_VIEW_H
16
17 // Must be here because of moc.
18 #include <config.h>
19
20 #include "frontends/LyXView.h"
21 #include "funcrequest.h"
22
23 #include <QMainWindow>
24 #include <QTimer>
25 #include <QAction>
26 #include <QCloseEvent>
27
28 class QToolBar;
29
30 //class FuncRequest;
31
32 //class string;
33
34 namespace lyx {
35 namespace frontend {
36
37 class QCommandBuffer;
38
39 QWidget* mainWindow();
40
41 /**
42  * GuiView - Qt4 implementation of LyXView
43  *
44  * qt4-private implementation of the main LyX window.
45  */
46 class GuiView : public QMainWindow, public LyXView {
47         Q_OBJECT
48 public:
49         /// create a main window of the given dimensions
50         GuiView(Gui & owner);
51
52         ~GuiView();
53
54         /// initialize the object
55         virtual void init();
56
57         /// show - display the top-level window
58         void show();
59
60         /// show busy cursor
61         virtual void busy(bool) const;
62
63         /// display a status message
64         virtual void message(std::string const & str);
65
66         /// clear status message
67         virtual void clearMessage();
68
69         /// add the command buffer
70         void addCommandBuffer(QToolBar * toolbar);
71
72         /// menu item has been selected
73         void activated(FuncRequest const &);
74
75         /// returns true if this view has the focus.
76         virtual bool hasFocus() const;
77
78         ///
79         static QMainWindow* mainWidget();
80
81 public Q_SLOTS:
82         /// idle timeout
83         void update_view_state_qt();
84
85         /// populate a toplevel menu and all its children on demand
86         void updateMenu(QAction *);
87
88 protected:
89         /// make sure we quit cleanly
90         virtual void closeEvent(QCloseEvent * e);
91
92         ///
93         virtual void resizeEvent(QResizeEvent * e);
94
95         ///
96         virtual void moveEvent(QMoveEvent * e);
97
98 private:
99         /// focus the command buffer widget
100         void focus_command_widget();
101
102         /// update status bar
103         void update_view_state();
104
105         /**
106          * setWindowTitle - set title of window
107          * @param t main window title
108          * @param it iconified (short) title
109          */
110         virtual void setWindowTitle(std::string const & t, std::string const & it);
111
112         QTimer statusbar_timer_;
113
114         /// command buffer
115         QCommandBuffer * commandbuffer_;
116
117         ///
118         static QMainWindow* mainWidget_;
119
120         ///
121         void updateFloatingGeometry();
122         ///
123         QRect floatingGeometry_;
124 };
125
126 } // namespace frontend
127 } // namespace lyx
128
129 #endif // GUIVIEW_H