]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
Get rid of the static_casts.
[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 // 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 QCommandBuffer;
25
26 /**
27  * QtView - Qt implementation of LyXView
28  *
29  * Qt-private implementation of the main LyX window.
30  */
31 class QtView : public QMainWindow, public LyXView {
32         Q_OBJECT
33 public:
34         /// create a main window of the given dimensions
35         QtView(unsigned int w, unsigned int h);
36
37         ~QtView();
38
39         /// show - display the top-level window
40         void show();
41
42         /// show busy cursor
43         virtual void busy(bool) const;
44
45         /// display a status message
46         virtual void message(string const & str);
47
48         /// clear status message
49         virtual void clearMessage();
50
51         /// add the command buffer
52         void addCommandBuffer(QWidget * parent);
53
54 public slots:
55         /// menu item has been selected
56         void activated(int id);
57
58         /// idle timeout
59         void update_view_state_qt();
60 protected:
61         /// make sure we quit cleanly
62         virtual void closeEvent(QCloseEvent * e);
63 private:
64         /// focus the command buffer widget
65         void focus_command_widget();
66
67         /// update status bar
68         void update_view_state();
69
70         /**
71          * setWindowTitle - set title of window
72          * @param t main window title
73          * @param it iconified (short) title
74          */
75         virtual void setWindowTitle(string const & t, string const & it);
76
77         QTimer statusbar_timer_;
78
79         /// command buffer
80         QCommandBuffer * commandbuffer_;
81 };
82
83 #endif // QTVIEW_H