]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QtView.h
The initial merge of the Qt frontend, and the necessary compile 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  
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         /// set the x,y of the top level window
38         virtual void setPosition(unsigned int, unsigned int);
39  
40         /**
41          * show - display the top-level window
42          * @param place general placement (FIXME: GUII)
43          * @param border border border type (FIXME: GUII)
44          * @param title window title
45          */
46         virtual void show(int, int, 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         /// redraw the main form.
54         void redraw();
55  
56 public slots:
57         /// menu item has been selected
58         void activated(int id);
59  
60 protected:
61         /// make sure we quit cleanly
62         virtual void closeEvent(QCloseEvent * e);
63  
64 private:
65         /** 
66          * setWindowTitle - set title of window
67          * @param t main window title
68          * @param it iconified (short) title
69          */
70         virtual void setWindowTitle(string const & t, string const & it) {
71                 setCaption(t.c_str());
72                 setIconText(it.c_str());
73         }
74 };
75  
76 #endif // QTVIEW_H