Color blindness simulation for kmag... not so useful for people with color blindness...
[kdeaccessibility.git] / kmag / kmag.h
blob682f4e2452f5db0c8a9eded94c9af208f98aac25
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 copyright : (C) 2008 by Matthew Woehlke
10 email : mw_triad@users.sourceforge.net
11 ***************************************************************************/
13 /***************************************************************************
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 ***************************************************************************/
23 #ifndef KMAG_H
24 #define KMAG_H
26 #include "kmagzoomview.h"
28 #include <vector>
30 // include files for Qt
31 #include <QtGui/QContextMenuEvent>
33 // include files for KDE
34 #include <kxmlguiwindow.h>
35 #include <k3dockwidget.h>
36 #include <kaction.h>
37 #include <knuminput.h>
38 #include <kconfig.h>
40 /**
41 * The base class for Kmag application windows. It sets up the main
42 * window and reads the config file as well as providing a menubar, toolbar
43 * and statusbar. An instance of KmagView creates your center view, which is connected
44 * to the window's Doc object.
45 * KmagApp reimplements the methods that KXmlGuiWindow provides for main window handling and supports
46 * full session management as well as using KActions.
47 * @see KXmlGuiWindow
48 * @see KApplication
49 * @see KConfig
51 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
52 * @version KDevelop version 1.2 code generation
54 class KmagApp : public KXmlGuiWindow
56 Q_OBJECT
58 public:
59 /**
60 * Construtor of KmagApp, calls all init functions to create the application.
62 explicit KmagApp(QWidget* parent=0, const char* name=0);
64 /// Default destructor
65 ~KmagApp();
69 protected:
70 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
71 * file
73 void saveOptions();
74 /** read general Options again and initialize all variables like the recent file list
76 void readOptions();
77 /** initializes the KActions of the application */
78 void initActions();
80 /** creates the centerwidget of the KTMainWindow instance and sets it as the view
82 void initView();
84 /// Initialize all connections
85 void initConnections();
87 virtual bool queryClose();
89 /** queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent().
90 * Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's
91 * properties.
92 * @see KTMainWindow#queryExit
93 * @see KTMainWindow#closeEvent
95 virtual bool queryExit();
97 /// Catch context menu events
98 void contextMenuEvent ( QContextMenuEvent * e );
100 public slots:
101 /** open a new application window by creating a new instance of KmagApp */
102 void slotFileNewWindow();
104 /** print the actual file */
105 void slotFilePrint();
107 void slotFileQuit();
109 /** put the marked text/object into the clipboard
111 void copyToClipBoard();
113 /// Toggle the refreshing of the window
114 void slotToggleRefresh();
116 void slotModeFollowMouse();
117 void slotModeWholeScreen();
118 void slotModeSelWin();
120 /// Zooms in
121 void zoomIn();
123 /// Zooms out
124 void zoomOut();
126 /// Save the zoomed image
127 void saveZoomPixmap();
129 /// Sets the zoom index to index
130 void setZoomIndex(int index);
132 /// Sets the rotation index to index
133 void setRotationIndex(int index);
135 /// Sets the fps index to index
136 void setFPSIndex(int index);
138 /// Sets the color index to index
139 void setColorIndex(int index);
141 /// Shows/hides the mouse cursor
142 void showMouseCursor(bool show);
144 void slotShowMenu();
145 void slotShowMainToolBar();
146 void slotShowViewToolBar();
147 void slotShowSettingsToolBar();
149 void slotToggleHideCursor();
151 /// Opens shortcut key configuration dialog
152 void slotConfKeys();
154 /// Called when toolbar config is updated
155 void slotNewToolbarConfig();
157 /// Called when "configure toolbar" is clicked
158 void slotEditToolbars();
160 void slotChangeZoomBoxIndex(int index);
161 void slotChangeRotationBoxIndex(int index);
162 void slotChangeFPSIndex(int index);
163 void slotChangeColorIndex(int index);
166 signals:
167 /// This signal is raised whenever the index into the zoom array is changed
168 void updateZoomIndex(int);
170 /// This signal is raised whenever the zoom value changes
171 void updateZoomValue(float);
173 /// This signal is raised whenever the index into the rotation array is changed
174 void updateRotationIndex(int);
176 /// This signal is raised whenever the rotation value changes
177 void updateRotationValue(int);
179 /// This signal is raised whenever the index into the fps array is changed
180 void updateFPSIndex(int);
182 /// This signal is raised whenever the fps value changes
183 void updateFPSValue(float);
185 /// This signal is raised whenever the index into the color array is changed
186 void updateColorIndex(int);
188 /// This signal is raised whenever the color value changes
189 void updateColorValue(int);
191 private:
192 /// the configuration object of the application
193 KSharedConfigPtr config;
195 // KAction pointers to enable/disable actions
196 QAction *fileNewWindow, *m_pSnapshot, *m_pCopy, *m_keyConf, *m_toolConf;
197 QAction *m_pPrint;
198 QAction *m_pZoomIn;
199 QAction *m_pZoomOut;
200 QAction *m_pQuit;
201 QAction *refreshSwitch;
202 KToggleAction *m_pShowMenu, *m_pShowMainToolBar, *m_pShowViewToolBar, *m_pShowSettingsToolBar;
203 KSelectAction *m_pZoomBox, *m_pRotationBox, *m_pFPSBox, *m_pColorBox;
205 /// zoom slider
206 KIntNumInput *m_zoomSlider;
208 /// Current index into the zoomArray
209 unsigned int m_zoomIndex;
211 /// Current index into the rotationArray
212 unsigned int m_rotationIndex;
214 /// Current index into the fpsArray
215 unsigned int m_fpsIndex;
217 /// Current index into the colorArray
218 unsigned int m_colorIndex;
220 QStringList zoomArrayString;
221 std::vector<float> zoomArray;
223 QStringList rotationArrayString;
224 std::vector<int> rotationArray;
226 QStringList fpsArrayString;
227 std::vector<float> fpsArray;
229 QStringList colorArrayString;
230 std::vector<int> colorArray;
232 KMagZoomView* m_zoomView;
233 KToggleAction *m_hideCursor;
234 KToggleAction *m_modeFollowMouse, *m_modeWholeScreen, *m_modeSelWin;
236 /// Stores the non-zero cursor type to be used
237 unsigned int m_mouseCursorType;
239 unsigned int m_defaultMouseCursorType;
243 #endif // KMAG_H