New patches from Fedora.
[fedora-mingw.git] / qt-win / mainwindow.h
1 /****************************************************************************
2     **
3     ** Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
4     **
5     ** This file is part of the documentation of the Qt Toolkit.
6     **
7     ** This file may be used under the terms of the GNU General Public
8 ** License version 2.0 as published by the Free Software Foundation
9 ** and appearing in the file LICENSE.GPL included in the packaging of
10 ** this file.  Please review the following information to ensure GNU
11 ** General Public Licensing requirements will be met:
12 ** http://www.trolltech.com/products/qt/opensource.html
13 **
14 ** If you are unsure which license is appropriate for your use, please
15 ** review the following information:
16 ** http://www.trolltech.com/products/qt/licensing.html or contact the
17 ** sales department at sales@trolltech.com.
18     **
19     ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20     ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21     **
22     ****************************************************************************/
23
24     #ifndef MAINWINDOW_H
25     #define MAINWINDOW_H
26
27     #include <QMainWindow>
28
29     class QAction;
30     class QMenu;
31     class QTextEdit;
32
33     class MainWindow : public QMainWindow
34     {
35         Q_OBJECT
36
37     public:
38         MainWindow();
39
40     protected:
41         void closeEvent(QCloseEvent *event);
42
43     private slots:
44         void newFile();
45         void open();
46         bool save();
47         bool saveAs();
48         void about();
49         void documentWasModified();
50
51     private:
52         void createActions();
53         void createMenus();
54         void createToolBars();
55         void createStatusBar();
56         void readSettings();
57         void writeSettings();
58         bool maybeSave();
59         void loadFile(const QString &fileName);
60         bool saveFile(const QString &fileName);
61         void setCurrentFile(const QString &fileName);
62         QString strippedName(const QString &fullFileName);
63
64         QTextEdit *textEdit;
65         QString curFile;
66
67         QMenu *fileMenu;
68         QMenu *editMenu;
69         QMenu *helpMenu;
70         QToolBar *fileToolBar;
71         QToolBar *editToolBar;
72         QAction *newAct;
73         QAction *openAct;
74         QAction *saveAct;
75         QAction *saveAsAct;
76         QAction *exitAct;
77         QAction *cutAct;
78         QAction *copyAct;
79         QAction *pasteAct;
80         QAction *aboutAct;
81         QAction *aboutQtAct;
82     };
83
84     #endif