Back to index

scribus-ng  1.3.4.dfsg+svn20071115
hruler.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                                           hruler.h  -  description
00009                                                  -------------------
00010        begin                : Tue Apr 10 2001
00011        copyright            : (C) 2001 by Franz Schmid
00012        email                : Franz.Schmid@altmuehlnet.de
00013 ***************************************************************************/
00014 
00015 /***************************************************************************
00016 *                                                                         *
00017 *   This program is free software; you can redistribute it and/or modify  *
00018 *   it under the terms of the GNU General Public License as published by  *
00019 *   the Free Software Foundation; either version 2 of the License, or     *
00020 *   (at your option) any later version.                                   *
00021 *                                                                         *
00022 ***************************************************************************/
00023 
00024 #ifndef HRULER_H
00025 #define HRULER_H
00026 
00027 #include <qwidget.h>
00028 #include <qpainter.h>
00029 
00030 #include "scribusapi.h"
00031 #include "pageitem.h"
00032 
00033 class ScribusView;
00034 class ScribusDoc;
00035 class ScribusMainWindow;
00036 class PrefsManager;
00037 
00041 class SCRIBUS_API Hruler : public QWidget
00042 {
00043        Q_OBJECT
00044 
00045 public:
00046        Hruler(ScribusView *pa, ScribusDoc *doc);
00047        ~Hruler() {};
00048 
00049        bool ItemPosValid;
00050        double ColGap;
00051        double lineCorr;
00052        int Cols;
00053        double RExtra;
00054        double Extra;
00055        double Indent;
00056        double First;
00057        double RMargin;
00058        bool Revers;
00059        QValueList<ParagraphStyle::TabRecord> TabValues;
00060        PageItem * currItem;
00061        // following is used in view (only read access, see DrawPageItems(), line 822)
00062        double ItemPos;
00063        double ItemEndPos;
00064        double offs;
00065        
00066        void setItem(PageItem * item);
00067 
00068 private:
00069        void paintEvent(QPaintEvent *e);
00070        void drawNumber(QString num, int startx, int starty, QPainter & p);
00071        void mousePressEvent(QMouseEvent *m);
00072        void mouseReleaseEvent(QMouseEvent *);
00073        void mouseMoveEvent(QMouseEvent *m);
00074        void UpdateTabList();
00075 
00076        int Markp;
00077        int oldMark;
00078        bool Mpressed;
00079        int ActCol;
00080        int ActTab;
00081        double Scaling;
00082        int RulerCode;
00083        int MouseX;
00084 
00085        ScribusDoc *currDoc;
00086        ScribusView *currView;
00087 
00088 public slots: // Public slots
00091        void Draw(int where);
00092        void unitChange();
00093 
00094 signals:
00095        void DocChanged(bool);
00096        void MarkerMoved(double, double);
00097 
00098 private:
00099        double iter, iter2;
00100        int cor;
00101        PrefsManager *prefsManager;
00102 
00103        //void drawGuides();
00104 };
00105 
00106 #endif