AddWidgetTool.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : AddWidgetTool.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2008 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : Tool for adding enrichements to a plot.
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef ADD_WIDGET_TOOL_H
00030 #define ADD_WIDGET_TOOL_H
00031 
00032 #include "PlotToolInterface.h"
00033 #include <QObject>
00034 
00035 class QAction;
00036 class QPoint;
00037 class FrameWidget;
00038 
00043 class AddWidgetTool : public QObject, public PlotToolInterface
00044 {
00045     Q_OBJECT
00046     public:
00047         enum WidgetType{
00048             Text = 0,
00049             TexEquation,
00050             Rectangle,
00051             Ellipse,
00052             UserWidget = 1000
00053         };
00054 
00055         AddWidgetTool(WidgetType type, Graph *graph, QAction *d_action, const QObject *status_target = NULL, const char *status_slot = "");
00056         virtual ~AddWidgetTool();
00057 
00058         virtual int rtti() const {return PlotToolInterface::Rtti_AddWidgetTool;};
00060         WidgetType widgetType(){return d_widget_type;};
00061 
00062     signals:
00067         void statusText(const QString&);
00068 
00069     protected:
00070         void addEllipse(const QPoint& point);
00071         void addRectangle(const QPoint& point);
00072         void addEquation(const QPoint& point);
00073         void addText(const QPoint& point);
00074         void addWidget(const QPoint& point);
00075 
00076         virtual bool eventFilter(QObject *obj, QEvent *event);
00077         QAction *d_action;
00078         WidgetType d_widget_type;
00079         FrameWidget *d_fw;
00080 };
00081 
00082 #endif // ifndef ADD_WIDGET_TOOL_H

Generated by  doxygen 1.6.2