]> ruin.nu Git - hbs.git/blob - bs/bs.h
Changed lots of classnames from Bc to BS
[hbs.git] / bs / bs.h
1 /***************************************************************************
2                           bc.h  -  description
3                              -------------------
4     begin                : Sun May 27 22:13:58 CEST 2001
5     copyright            : (C) 2001 by Michael Andreen
6     email                : whale@linux.nu
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef BC_H
19 #define BC_H
20
21 // include files for QT
22 #include <qapp.h>
23 #include <qmainwindow.h>
24 #include <qaction.h>
25 #include <qmenubar.h>
26 #include <qpopupmenu.h>
27 #include <qtoolbar.h>
28 #include <qtoolbutton.h>
29 #include <qstatusbar.h>
30 #include <qwhatsthis.h>
31 #include <qstring.h>
32 #include <qpixmap.h>
33 #include <qmsgbox.h>
34 #include <qfiledialog.h>
35 #include <qprinter.h>
36 #include <qpainter.h>
37
38 // application specific includes
39 #include "bsview.h"
40 #include "bsdoc.h"
41
42 /**
43   * This Class is the base class for your application. It sets up the main
44   * window and providing a menubar, toolbar
45   * and statusbar. For the main view, an instance of class BcView is
46   * created which creates your view.
47   */
48 class BSApp : public QMainWindow
49 {
50   Q_OBJECT
51   
52   public:
53     /** construtor */
54     BSApp();
55     /** destructor */
56     ~BSApp();
57     /** initializes all QActions of the application */
58     void initActions();
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     /** generate a new document in the actual view */
77     void slotFileNew();
78     /** open a document */
79     void slotFileOpen();
80     /** save a document */
81     void slotFileSave();
82     /** save a document under a different filename*/
83     void slotFileSaveAs();
84     /** close the actual file */
85     void slotFileClose();
86     /** print the actual file */
87     void slotFilePrint();
88     /** exits the application */
89     void slotFileQuit();
90     /** put the marked text/object into the clipboard and remove
91      * it from the document */
92     void slotEditCut();
93     /** put the marked text/object into the clipboard*/
94     void slotEditCopy();
95     /** paste the clipboard into the document*/
96     void slotEditPaste();
97     /** toggle the toolbar*/
98     void slotViewToolBar(bool toggle);
99     /** toggle the statusbar*/
100     void slotViewStatusBar(bool toggle);
101
102     /** shows an about dlg*/
103     void slotHelpAbout();
104
105
106   private:
107
108     /** view is the main widget which represents your working area. The View
109      * class should handle all events of the view widget.  It is kept empty so
110      * you can create your view according to your application's needs by
111      * changing the view class.
112      */
113     BSView* view;
114     /** doc represents your actual document and is created only once. It keeps
115      * information such as filename and does the serialization of your files.
116      */
117     BSDoc *doc;
118   
119     /** file_menu contains all items of the menubar entry "File" */
120     QPopupMenu *fileMenu;
121     /** edit_menu contains all items of the menubar entry "Edit" */
122     QPopupMenu *editMenu;
123     /** view_menu contains all items of the menubar entry "View" */
124     QPopupMenu *viewMenu;
125     /** view_menu contains all items of the menubar entry "Help" */
126     QPopupMenu *helpMenu;
127     /** the main toolbar */
128     QToolBar *fileToolbar;
129     /** actions for the application initialized in initActions() and used to en/disable them
130       * according to your needs during the program */
131     QAction *fileNew;
132     QAction *fileOpen;
133     QAction *fileSave;
134     QAction *fileSaveAs;
135     QAction *fileClose;
136     QAction *filePrint;
137     QAction *fileQuit;
138
139     QAction *editCut;
140     QAction *editCopy;
141     QAction *editPaste;
142
143     QAction *viewToolBar;
144     QAction *viewStatusBar;
145
146     QAction *helpAboutApp;
147 };
148 #endif 
149