Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

canvasgesture_rulermove.h

Go to the documentation of this file.
00001 /*
00002  For general Scribus (>=1.3.2) copyright and licensing information please refer
00003  to the COPYING file provided with the program. Following this notice may exist
00004  a copyright and/or license notice that predates the release of Scribus 1.3.2
00005  for which a new license (GPL+exception) is in place.
00006  */
00007 /***************************************************************************
00008 *                                                                         *
00009 *   This program is free software; you can redistribute it and/or modify  *
00010 *   it under the terms of the GNU General Public License as published by  *
00011 *   the Free Software Foundation; either version 2 of the License, or     *
00012 *   (at your option) any later version.                                   *
00013 *                                                                         *
00014 ***************************************************************************/
00015 
00016 
00017 
00018 #ifndef CANVAS_GESTURE_RULERMOVE_H
00019 #define CANVAS_GESTURE_RULERMOVE_H
00020 
00021 #include <QPoint>
00022 
00023 #include "scribusapi.h"
00024 #include "canvas.h"
00025 #include "canvasgesture.h"
00026 #include "canvasmode.h"
00027 
00028 class QCursor;
00029 class QDragEnterEvent;
00030 class QDragMoveEvent;
00031 class QDragLeaveEvent;
00032 class QDropEvent;
00033 class QEvent;
00034 class QInputMethodEvent;
00035 class QMouseEvent;
00036 class QKeyEvent;
00037 class QPainter;
00038 
00042 class SCRIBUS_API RulerGesture : public CanvasGesture
00043 {
00044 public:
00045     enum Mode { HORIZONTAL, VERTICAL, ORIGIN };
00046     RulerGesture (ScribusView* view, Mode mode) : 
00047         CanvasGesture(view), m_mode(mode), m_haveGuide(false), m_haveCursor(false), m_xy(0,0) {};
00048 
00053     void prepare(Mode mode);
00054     void clear();
00055     
00056     virtual void drawControls(QPainter* p);
00057     virtual void activate(bool);
00058     virtual void deactivate(bool);
00059     virtual void mouseReleaseEvent(QMouseEvent *m);
00060     virtual void mouseMoveEvent(QMouseEvent *m);
00065     virtual void mousePressEvent(QMouseEvent *m);
00066     
00067     Mode getMode() { return m_mode; }
00072     bool mouseHitsGuide(FPoint mousePointDoc);
00073 private:
00074     Mode m_mode;
00075     bool m_haveGuide;
00076     int m_page;
00077     double m_guide;
00078     bool m_haveCursor;
00079     QCursor m_cursor;
00080     QPoint m_xy;
00081     void movePoint(QMouseEvent *m);
00082 };
00083 
00084 
00085 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.