Scribus
Open source desktop publishing at your fingertips
vruler.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  vruler.h - description
9  -------------------
10  begin : Wed Apr 11 2001
11  copyright : (C) 2001 by Franz Schmid
12  email : Franz.Schmid@altmuehlnet.de
13  ***************************************************************************/
14 
15 /***************************************************************************
16  * *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or *
20  * (at your option) any later version. *
21  * *
22  ***************************************************************************/
23 
24 #ifndef VRULER_H
25 #define VRULER_H
26 
27 #include <QWidget>
28 #include "scribusapi.h"
29 
30 class QPaintEvent;
31 class QMouseEvent;
32 class PrefsManager;
33 class RulerGesture;
34 class ScribusDoc;
35 class ScribusView;
36 
40 class SCRIBUS_API Vruler : public QWidget
41 {
42  Q_OBJECT
43 
44 public:
45  Vruler(ScribusView *pa, ScribusDoc *doc);
46  ~Vruler() {};
47 
48  double offs;
49  bool repainted;
50  int oldMark;
51  bool Mpressed;
52  double ruleSpacing();
53 
54 private: // Private attributes
55  virtual void paintEvent(QPaintEvent *e);
56  virtual void mousePressEvent(QMouseEvent *m);
57  virtual void mouseReleaseEvent(QMouseEvent *m);
58  virtual void mouseMoveEvent(QMouseEvent *m);
59 
60  void drawNumber(QString num, int starty, QPainter *p);
61 
62  ScribusDoc *m_doc;
63  ScribusView *m_view;
64 
65 public slots: // Public slots
68  void Draw(int where);
69  void unitChange();
70  void shift(double pos) { offs = pos; }
71  void shiftRel(double dist) { offs += dist; }
72 
73 private:
74  double iter, iter2;
75  double cor;
76  bool drawMark;
77  int whereToDraw;
78  PrefsManager *prefsManager;
79  RulerGesture* rulerGesture;
80 };
81 
82 #endif
Definition: canvasgesture_rulermove.h:46
Vertical ruler.
Definition: vruler.h:40
the Document Class
Definition: scribusdoc.h:90
Definition: scribusview.h:87
Manage Scribus preferences here, and here alone Start to move the preferences out of scribus...
Definition: prefsmanager.h:43