]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QtView.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / 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  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef QTVIEW_H
15 #define QTVIEW_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
40 /**
41  * QtView - Qt implementation of LyXView
42  *
43  * Qt-private implementation of the main LyX window.
44  */
45 class QtView : public QMainWindow, public LyXView {
46         Q_OBJECT
47 public:
48         /// create a main window of the given dimensions
49         QtView(unsigned int w, unsigned int h);
50
51         ~QtView();
52
53         /// show - display the top-level window
54         void show();
55
56         /// show busy cursor
57         virtual void busy(bool) const;
58
59         /// display a status message
60         virtual void message(std::string const & str);
61
62         /// clear status message
63         virtual void clearMessage();
64
65         /// add the command buffer
66         void addCommandBuffer(QToolBar * toolbar);
67
68         /// menu item has been selected
69         void activated(FuncRequest const &);
70
71         // returns true if this view has the focus.
72         virtual bool hasFocus() const;
73
74 public slots:
75         /// idle timeout
76         void update_view_state_qt();
77
78         /// populate a toplevel menu and all its children on demand
79         void updateMenu(QAction *);
80
81 protected:
82         /// make sure we quit cleanly
83         virtual void closeEvent(QCloseEvent * e);
84 private:
85         /// focus the command buffer widget
86         void focus_command_widget();
87
88         /// update status bar
89         void update_view_state();
90
91         /**
92          * setWindowTitle - set title of window
93          * @param t main window title
94          * @param it iconified (short) title
95          */
96         virtual void setWindowTitle(std::string const & t, std::string const & it);
97
98         QTimer statusbar_timer_;
99
100         /// command buffer
101         QCommandBuffer * commandbuffer_;
102 };
103
104 } // namespace frontend
105 } // namespace lyx
106
107 #endif // QTVIEW_H