]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
A couple more TODO shootdowns
[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  
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         /**
38          * show - display the top-level window
39          * @param x x position
40          * @param y y position
41          * @param title window title
42          */
43         void show(int x, int y, string const & t = string("LyX"));
44  
45         /// start modal operation
46         virtual void prohibitInput() const;
47         /// end modal operation
48         virtual void allowInput() const;
49  
50 public slots:
51         /// menu item has been selected
52         void activated(int id);
53  
54 protected:
55         /// make sure we quit cleanly
56         virtual void closeEvent(QCloseEvent * e);
57  
58 private:
59         /** 
60          * setWindowTitle - set title of window
61          * @param t main window title
62          * @param it iconified (short) title
63          */
64         virtual void setWindowTitle(string const & t, string const & it) {
65                 setCaption(t.c_str());
66                 setIconText(it.c_str());
67         }
68 };
69  
70 #endif // QTVIEW_H