]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
Some string(widget->text()) fixes. Weirdness
[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         /**
41          * show - display the top-level window
42          * @param x x position
43          * @param y y position
44          * @param title window title
45          */
46         void show(int x, int y, string const & t = string("LyX"));
47
48         /// start modal operation
49         virtual void prohibitInput() const;
50         /// end modal operation
51         virtual void allowInput() const;
52
53         /// display a status message
54         virtual void message(string const & str);
55 public slots:
56         /// menu item has been selected
57         void activated(int id);
58
59         /// idle timeout
60         void update_view_state_qt();
61 protected:
62         /// make sure we quit cleanly
63         virtual void closeEvent(QCloseEvent * e);
64 private:
65         /// focus the command buffer widget
66         void focus_command_widget();
67
68         /// update status bar
69         void update_view_state();
70
71         /**
72          * setWindowTitle - set title of window
73          * @param t main window title
74          * @param it iconified (short) title
75          */
76         virtual void setWindowTitle(string const & t, string const & it) {
77                 setCaption(t.c_str());
78                 setIconText(it.c_str());
79         }
80
81         /// idle timer
82         QTimer idle_timer_;
83
84         /// command buffer
85         QCommandBuffer * commandbuffer_;
86 };
87
88 #endif // QTVIEW_H