]> ruin.nu Git - eonsl.git/blob - eonsl/eonsl.h
These files is for making the project
[eonsl.git] / eonsl / eonsl.h
1 /***************************************************************************
2                           eonsl.h  -  description
3                              -------------------
4     begin     : mån okt 23 17:11:28 CEST 2000
5     copyright : (C) 2000 by Michael Andreen
6     email     : whale@linux.nu
7     changes   :
8  ***************************************************************************/
9
10 /***************************************************************************
11  *                                                                         *
12  *   This program is free software; you can redistribute it and/or modify  *
13  *   it under the terms of the GNU General Public License as published by  *
14  *   the Free Software Foundation; either version 2 of the License, or     *
15  *   (at your option) any later version.                                   *
16  *                                                                         *
17  ***************************************************************************/
18
19 #ifndef EONSL_H
20 #define EONSL_H
21
22 // include files for QT
23 #include <qstring.h>
24 #include <qpopupmenu.h>
25 #include <qmainwindow.h>
26 #include <qaccel.h>
27 #include <qmenubar.h>
28 #include <qtoolbar.h>
29 #include <qpixmap.h>
30 #include <qtoolbutton.h>
31 #include <qapp.h>
32 #include <qstatusbar.h>
33 #include <qwhatsthis.h>
34 #include <qmsgbox.h>
35 #include <qfiledialog.h>
36 #include <qprinter.h>
37 #include <qpainter.h>
38
39 // application specific includes
40 #include "eonslview.h"
41 #include "eonsldoc.h"
42 #include "resource.h"
43
44 /**
45   * This Class is the base class for your application. It sets up the main
46   * window and providing a menubar, toolbar
47   * and statusbar. For the main view, an instance of class EonSLView is
48   * created which creates your view.
49   */
50 class EonSL : public QMainWindow
51 {
52   Q_OBJECT
53   
54   public:
55     /** construtor */
56     EonSL();
57     /** destructor */
58     ~EonSL();
59     /** initMenuBar creates the menu_bar and inserts the menuitems */
60     void initMenuBar();
61     /** this creates the toolbars. Change the toobar look and add new toolbars in this
62      * function */
63     void initToolBar();
64     /** setup the statusbar */
65     void initStatusBar();
66     /** setup the document*/
67     void initDoc();
68     /** setup the mainview*/
69     void initView();
70   
71     /** overloaded for Message box on last window exit */
72     bool queryExit();
73   
74   public slots:
75   
76     /** switch argument for Statusbar help entries on slot selection */
77     void statusCallback(int id_);
78     /** open a new application window */
79   
80     /** generate a new document in the actual view */
81     void slotFileNew();
82     /** open a document */
83     void slotFileOpen();
84     /** save a document */
85     void slotFileSave();
86     /** save a document under a different filename*/
87     void slotFileSaveAs();
88     /** close the actual file */
89     void slotFileClose();
90     /** print the actual file */
91     void slotFilePrint();
92     /** exits the application */
93     void slotFileQuit();
94     /** put the marked text/object into the clipboard and remove
95      * it from the document */
96     void slotEditCut();
97     /** put the marked text/object into the clipboard*/
98     void slotEditCopy();
99     /** paste the clipboard into the document*/
100     void slotEditPaste();
101     /** toggle the toolbar*/
102     void slotViewToolBar();
103     /** toggle the statusbar*/
104     void slotViewStatusBar();
105   
106     /** shows an about dlg*/
107     void slotHelpAbout();
108   
109     /** change the status message of the whole statusbar temporary */
110     void slotStatusHelpMsg(const QString &text);
111   
112   private:
113
114     /** view is the main widget which represents your working area. The View
115      * class should handle all events of the view widget.  It is kept empty so
116      * you can create your view according to your application's needs by
117      * changing the view class.
118      */
119     EonSLView *view;
120     /** doc represents your actual document and is created only once. It keeps
121      * information such as filename and does the serialization of your files.
122      */
123     EonSLDoc *doc;
124   
125     /** file_menu contains all items of the menubar entry "File" */
126     QPopupMenu *fileMenu;
127     /** edit_menu contains all items of the menubar entry "Edit" */
128     QPopupMenu *editMenu;
129     /** view_menu contains all items of the menubar entry "View" */
130     QPopupMenu *viewMenu;
131     /** view_menu contains all items of the menubar entry "Help" */
132     QPopupMenu *helpMenu;
133   
134     QToolBar *fileToolbar;
135
136 };
137 #endif 
138