krita
kis_tool_dummy.h
00001 /* 00002 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KIS_TOOL_DUMMY_H_ 00020 #define KIS_TOOL_DUMMY_H_ 00021 00022 #include "kis_tool_non_paint.h" 00023 #include "kis_tool_factory.h" 00024 #include <koffice_export.h> 00025 00026 #include "kis_point.h" 00027 00028 class QLabel; 00029 class KisCanvasSubject; 00030 00039 class KRITATOOL_EXPORT KisToolDummy : public KisToolNonPaint { 00040 00041 typedef KisToolNonPaint super; 00042 Q_OBJECT 00043 00044 public: 00045 KisToolDummy(); 00046 virtual ~KisToolDummy(); 00047 00048 virtual void update(KisCanvasSubject *subject); 00049 00050 virtual void setup(KActionCollection *collection); 00051 virtual void buttonPress(KisButtonPressEvent *e); 00052 virtual void move(KisMoveEvent *e); 00053 virtual void buttonRelease(KisButtonReleaseEvent *e); 00054 00055 virtual QWidget* createOptionWidget(QWidget* parent); 00056 virtual QWidget* optionWidget(); 00057 00058 private: 00059 QLabel * m_optionWidget; 00060 KisCanvasSubject *m_subject; 00061 KisPoint m_dragPos; 00062 Q_INT32 m_origScrollX; 00063 Q_INT32 m_origScrollY; 00064 bool m_dragging; 00065 }; 00066 00067 class KisToolDummyFactory : public KisToolFactory { 00068 typedef KisToolFactory super; 00069 public: 00070 KisToolDummyFactory() : super() {}; 00071 virtual ~KisToolDummyFactory() {}; 00072 00073 virtual KisTool * createTool(KActionCollection * ac) { 00074 KisTool * t = new KisToolDummy(); 00075 Q_CHECK_PTR(t); 00076 t->setup(ac); 00077 return t; 00078 } 00079 virtual KisID id() { return KisID("dummy", i18n("Dummy Tool")); } 00080 }; 00081 00082 00083 #endif // KIS_TOOL_DUMMY_H_ 00084