]> git.lyx.org Git - lyx.git/blob - src/frontends/qt3/QtView.h
Extracted from r14281
[lyx.git] / src / frontends / qt3 / QtView.h
1 // -*- C++ -*-
2 /**
3  * \file QtView.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  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QTVIEW_H
14 #define QTVIEW_H
15
16 #include <config.h>
17
18 #include "frontends/LyXView.h"
19
20 #include <qmainwindow.h>
21 #include <qtimer.h>
22
23 class FuncRequest;
24
25 namespace lyx {
26 namespace frontend {
27
28 class QCommandBuffer;
29
30 /**
31  * QtView - Qt implementation of LyXView
32  *
33  * Qt-private implementation of the main LyX window.
34  */
35 class QtView : public QMainWindow, public LyXView {
36         Q_OBJECT
37 public:
38         /// create a main window of the given dimensions
39         QtView(Gui & owner);
40
41         ~QtView();
42
43         /// initialise the object members (menubars, toolbars, etc..)
44         void init();
45
46         /// show - display the top-level window
47         void show();
48
49         /// show busy cursor
50         virtual void busy(bool) const;
51
52         /// display a status message
53         virtual void message(std::string const & str);
54
55         /// clear status message
56         virtual void clearMessage();
57
58         /// add the command buffer
59         void addCommandBuffer(QWidget * parent);
60
61         /// menu item has been selected
62         void activated(FuncRequest const &);
63
64         // returns true if this view has the focus.
65         virtual bool hasFocus() const;
66
67         ///
68         void initFloatingGeometry(QRect const &);
69
70 public slots:
71         /// idle timeout
72         void update_view_state_qt();
73
74         ///
75         virtual void resizeEvent(QResizeEvent * e);
76
77         ///
78         virtual void moveEvent(QMoveEvent * e);
79
80 protected:
81         /// make sure we quit cleanly
82         virtual void closeEvent(QCloseEvent * e);
83 private:
84         /// focus the command buffer widget
85         void focus_command_widget();
86
87         /// update status bar
88         void update_view_state();
89
90         /**
91          * setWindowTitle - set title of window
92          * @param t main window title
93          * @param it iconified (short) title
94          */
95         virtual void setWindowTitle(std::string const & t, std::string const & it);
96
97         QTimer statusbar_timer_;
98
99         /// command buffer
100         QCommandBuffer * commandbuffer_;
101         
102         ///
103         void updateFloatingGeometry();
104         ///
105         QRect floatingGeometry_;
106         ///
107         int maxWidth;
108 };
109
110 } // namespace frontend
111 } // namespace lyx
112
113 #endif // QTVIEW_H