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