]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
qt command buffer stuff, some image fixes
[lyx.git] / src / frontends / qt2 / QtView.h
1 // -*- C++ -*-
2 /**
3  * \file QtView.h
4  * Copyright 1995-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Lars Gullik Bjornes <larsbj@lyx.org>
8  * \author John Levon <moz@compsoc.man.ac.uk>
9  */
10
11 #ifndef QTVIEW_H
12 #define QTVIEW_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include <config.h>
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  
56 public slots:
57         /// menu item has been selected
58         void activated(int id);
59  
60         /// idle timeout
61         void update_view_state_qt();
62  
63 protected:
64         /// make sure we quit cleanly
65         virtual void closeEvent(QCloseEvent * e);
66  
67 private:
68         /// focus the command buffer widget
69         void focus_command_widget();
70
71         /// update status bar
72         void update_view_state();
73  
74         /** 
75          * setWindowTitle - set title of window
76          * @param t main window title
77          * @param it iconified (short) title
78          */
79         virtual void setWindowTitle(string const & t, string const & it) {
80                 setCaption(t.c_str());
81                 setIconText(it.c_str());
82         }
83
84         /// idle timer
85         QTimer idle_timer_;
86  
87         /// command buffer
88         QCommandBuffer * commandbuffer_;
89 };
90  
91 #endif // QTVIEW_H