krita
kis_tool_manager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KIS_TOOL_MANAGER
00019 #define KIS_TOOL_MANAGER
00020
00021 #include <map>
00022
00023 #include <qobject.h>
00024
00025 #include "kis_tool_controller.h"
00026 #include "kis_global.h"
00027 #include "kis_tool_types.h"
00028 #include "kis_input_device.h"
00029
00030 class KoView;
00031 class KisCanvasSubject;
00032 class KisView;
00033 class KisTool;
00034 class KisToolRegistry;
00035 class KisCanvasController;
00036 class KoPaletteManager;
00037 class KoToolBox;
00038
00043 class KisToolManager : public QObject, public KisToolControllerInterface {
00044
00045 Q_OBJECT
00046
00047 public:
00048
00049 KisToolManager(KisCanvasSubject * parent, KisCanvasController * controller);
00050 ~KisToolManager();
00051
00052 public:
00053
00054 void setUp(KoToolBox * toolbox, KoPaletteManager * paletteManager, KActionCollection * collection);
00055
00056
00057 void youAintGotNoToolBox();
00058
00059 void updateGUI();
00060
00061 virtual void setCurrentTool(KisTool *tool);
00062 virtual void setCurrentTool(const QString & toolName);
00063
00064 virtual KisTool *currentTool() const;
00065
00066 void setToolForInputDevice(KisInputDevice oldDevice, KisInputDevice newDevice);
00067
00068 KisTool *findTool(const QString &toolName, KisInputDevice inputDevice = KisInputDevice::unknown()) const;
00069
00070 void activateCurrentTool();
00071
00072 private:
00073
00074 void resetToolBox(KoToolBox * toolbox);
00075
00076 private:
00077
00078 typedef std::map<KisInputDevice, KisTool *> InputDeviceToolMap;
00079 typedef std::map<KisInputDevice, vKisTool> InputDeviceToolSetMap;
00080
00081 InputDeviceToolMap m_inputDeviceToolMap;
00082 InputDeviceToolSetMap m_inputDeviceToolSetMap;
00083
00084 KisCanvasSubject * m_subject;
00085 KisCanvasController * m_controller;
00086
00087 KoPaletteManager * m_paletteManager;
00088 KActionCollection * m_actionCollection;
00089
00090 KoToolBox * m_toolBox;
00091
00092 KisTool * m_oldTool;
00093 KisTool * m_dummyTool;
00094
00095 vKisTool m_tools;
00096
00097 bool m_tools_disabled;
00098 bool setup;
00099 };
00100
00101
00102 #endif
|