don't use config.h if not needed
[kdeaccessibility.git] / kmag / kmag.h
blobe13d8beb4aae092119d94af1698600948d296c0d
1 /***************************************************************************
2 kmag.h - description
3 -------------------
4 begin : Mon Feb 12 23:45:41 EST 2001
5 copyright : (C) 2001 by Sarang Lakare
6 email : sarang@users.sourceforge.net
7 copyright : (C) 2003-2004 by Olaf Schmidt
8 email : ojschmidt@kde.org
9 ***************************************************************************/
11 /***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
21 #ifndef KMAG_H
22 #define KMAG_H
24 #include "kmagzoomview.h"
26 #include <vector>
27 // include files for Qt
28 #include <QStringList>
29 //Added by qt3to4:
30 #include <QContextMenuEvent>
32 // include files for KDE
33 #include <kmainwindow.h>
34 #include <k3dockwidget.h>
35 #include <kaction.h>
36 #include <knuminput.h>
37 #include <kconfig.h>
39 /**
40 * The base class for Kmag application windows. It sets up the main
41 * window and reads the config file as well as providing a menubar, toolbar
42 * and statusbar. An instance of KmagView creates your center view, which is connected
43 * to the window's Doc object.
44 * KmagApp reimplements the methods that KMainWindow provides for main window handling and supports
45 * full session management as well as using KActions.
46 * @see KMainWindow
47 * @see KApplication
48 * @see KConfig
50 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
51 * @version KDevelop version 1.2 code generation
53 class KmagApp : public KMainWindow
55 Q_OBJECT
57 public:
58 /**
59 * Construtor of KmagApp, calls all init functions to create the application.
61 KmagApp(QWidget* parent=0, const char* name=0);
63 /// Default destructor
64 ~KmagApp();
68 protected:
69 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
70 * file
72 void saveOptions();
73 /** read general Options again and initialize all variables like the recent file list
75 void readOptions();
76 /** initializes the KActions of the application */
77 void initActions();
79 /** creates the centerwidget of the KTMainWindow instance and sets it as the view
81 void initView();
83 /// Initialize all connections
84 void initConnections();
86 virtual bool queryClose();
88 /** queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent().
89 * Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's
90 * properties.
91 * @see KTMainWindow#queryExit
92 * @see KTMainWindow#closeEvent
94 virtual bool queryExit();
96 /// Catch context menu events
97 void contextMenuEvent ( QContextMenuEvent * e );
99 public slots:
100 /** open a new application window by creating a new instance of KmagApp */
101 void slotFileNewWindow();
103 /** print the actual file */
104 void slotFilePrint();
106 void slotFileQuit();
108 /** put the marked text/object into the clipboard
110 void copyToClipBoard();
112 /// Toggle the refreshing of the window
113 void slotToggleRefresh();
115 void slotModeFollowMouse();
116 void slotModeWholeScreen();
117 void slotModeSelWin();
119 /// Zooms in
120 void zoomIn();
122 /// Zooms out
123 void zoomOut();
125 /// Save the zoomed image
126 void saveZoomPixmap();
128 /// Sets the zoom index to index
129 void setZoomIndex(int index);
131 /// Sets the rotation index to index
132 void setRotationIndex(int index);
134 /// Sets the fps index to index
135 void setFPSIndex(int index);
137 /// Shows/hides the mouse cursor
138 void showMouseCursor(bool show);
140 void slotShowMenu();
141 void slotShowMainToolBar();
142 void slotShowViewToolBar();
143 void slotShowSettingsToolBar();
145 void slotToggleHideCursor();
147 /// Opens shortcut key configuration dialog
148 void slotConfKeys();
150 /// Called when toolbar config is updated
151 void slotNewToolbarConfig();
153 /// Called when "configure toolbar" is clicked
154 void slotEditToolbars();
156 signals:
157 /// This signal is raised whenever the index into the zoom array is changed
158 void updateZoomIndex(int);
160 /// This signal is raised whenever the zoom value changes
161 void updateZoomValue(float);
163 /// This signal is raised whenever the index into the rotation array is changed
164 void updateRotationIndex(int);
166 /// This signal is raised whenever the rotation value changes
167 void updateRotationValue(int);
169 /// This signal is raised whenever the index into the fps array is changed
170 void updateFPSIndex(int);
172 /// This signal is raised whenever the fps value changes
173 void updateFPSValue(float);
175 private:
176 /// the configuration object of the application
177 KSharedConfigPtr config;
179 // KAction pointers to enable/disable actions
180 QAction *fileNewWindow, *m_pSnapshot, *m_pCopy, *m_keyConf, *m_toolConf;
181 QAction *m_pPrint;
182 QAction *m_pZoomIn;
183 QAction *m_pZoomOut;
184 QAction *m_pQuit;
185 QAction *refreshSwitch;
186 KToggleAction *m_pShowMenu, *m_pShowMainToolBar, *m_pShowViewToolBar, *m_pShowSettingsToolBar;
187 KSelectAction *m_pZoomBox, *m_pRotationBox, *m_pFPSBox;
189 /// zoom slider
190 KIntNumInput *m_zoomSlider;
192 /// Current index into the zoomArray
193 unsigned int m_zoomIndex;
195 /// Current index into the rotationArray
196 unsigned int m_rotationIndex;
198 /// Current index into the fpsArray
199 unsigned int m_fpsIndex;
201 QStringList zoomArrayString;
202 std::vector<float> zoomArray;
204 QStringList rotationArrayString;
205 std::vector<int> rotationArray;
207 QStringList fpsArrayString;
208 std::vector<float> fpsArray;
210 KMagZoomView* m_zoomView;
211 KToggleAction *m_hideCursor;
212 KToggleAction *m_modeFollowMouse, *m_modeWholeScreen, *m_modeSelWin;
214 /// Stores the non-zero cursor type to be used
215 unsigned int m_mouseCursorType;
217 unsigned int m_defaultMouseCursorType;
221 #endif // KMAG_H