]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
reverse last change
[lyx.git] / src / frontends / qt2 / 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 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "frontends/LyXView.h"
21
22 #include <qmainwindow.h>
23 #include <qtimer.h>
24
25 class QCommandBuffer;
26
27 /**
28  * QtView - Qt implementation of LyXView
29  *
30  * Qt-private implementation of the main LyX window.
31  */
32 class QtView : public QMainWindow, public LyXView {
33         Q_OBJECT
34 public:
35         /// create a main window of the given dimensions
36         QtView(unsigned int w, unsigned int h);
37
38         ~QtView();
39
40         /// show - display the top-level window
41         void show();
42
43         /// start modal operation
44         virtual void prohibitInput() const;
45         /// end modal operation
46         virtual void allowInput() const;
47
48         /// display a status message
49         virtual void message(string const & str);
50 public slots:
51         /// menu item has been selected
52         void activated(int id);
53
54         /// idle timeout
55         void update_view_state_qt();
56 protected:
57         /// make sure we quit cleanly
58         virtual void closeEvent(QCloseEvent * e);
59 private:
60         /// focus the command buffer widget
61         void focus_command_widget();
62
63         /// update status bar
64         void update_view_state();
65
66         /**
67          * setWindowTitle - set title of window
68          * @param t main window title
69          * @param it iconified (short) title
70          */
71         virtual void setWindowTitle(string const & t, string const & it);
72
73         /// idle timer
74         QTimer idle_timer_;
75
76         /// command buffer
77         QCommandBuffer * commandbuffer_;
78 };
79
80 #endif // QTVIEW_H