00001 /*************************************************************************** 00002 * * 00003 * DrawPad - a drawing program for Opie Environment * 00004 * * 00005 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 ***************************************************************************/ 00013 00014 #ifndef SHAPETOOL_H 00015 #define SHAPETOOL_H 00016 00017 #include "tool.h" 00018 00019 #include <qpointarray.h> 00020 00021 class ShapeTool : public Tool 00022 { 00023 public: 00024 ShapeTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas); 00025 ~ShapeTool(); 00026 00027 void mousePressEvent(QMouseEvent* e); 00028 void mouseReleaseEvent(QMouseEvent* e); 00029 void mouseMoveEvent(QMouseEvent* e); 00030 00031 protected: 00032 virtual void drawFinalShape(QPainter& p) = 0; 00033 virtual void drawTemporaryShape(QPainter& p) = 0; 00034 00035 QPointArray m_polyline; 00036 00037 private: 00038 bool m_mousePressed; 00039 }; 00040 00041 #endif // SHAPETOOL_H
1.4.2