]> git.lyx.org Git - lyx.git/blob - src/frontends/qt3/QtView.h
eab76c803f0fc78e0ad8a0498775c060606ae942
[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 // Must be here because of moc.
17 #include <config.h>
18
19 #include "frontends/LyXView.h"
20
21 #include <qmainwindow.h>
22 #include <qtimer.h>
23
24 class FuncRequest;
25
26 namespace lyx {
27 namespace frontend {
28
29 class QCommandBuffer;
30
31 /**
32  * QtView - Qt implementation of LyXView
33  *
34  * Qt-private implementation of the main LyX window.
35  */
36 class QtView : public QMainWindow, public LyXView {
37         Q_OBJECT
38 public:
39         /// create a main window of the given dimensions
40         QtView(unsigned int w, unsigned int h, bool maximize);
41
42         ~QtView();
43
44         /// show - display the top-level window
45         void show();
46
47         /// show busy cursor
48         virtual void busy(bool) const;
49
50         /// display a status message
51         virtual void message(std::string const & str);
52
53         /// clear status message
54         virtual void clearMessage();
55
56         /// add the command buffer
57         void addCommandBuffer(QWidget * parent);
58
59         /// menu item has been selected
60         void activated(FuncRequest const &);
61
62         // returns true if this view has the focus.
63         virtual bool hasFocus() const;
64
65 public slots:
66         /// idle timeout
67         void update_view_state_qt();
68 protected:
69         /// make sure we quit cleanly
70         virtual void closeEvent(QCloseEvent * e);
71 private:
72         /// focus the command buffer widget
73         void focus_command_widget();
74
75         /// update status bar
76         void update_view_state();
77
78         /**
79          * setWindowTitle - set title of window
80          * @param t main window title
81          * @param it iconified (short) title
82          */
83         virtual void setWindowTitle(std::string const & t, std::string const & it);
84
85         QTimer statusbar_timer_;
86
87         /// command buffer
88         QCommandBuffer * commandbuffer_;
89 };
90
91 } // namespace frontend
92 } // namespace lyx
93
94 #endif // QTVIEW_H