marginpreview.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef MARGINPREVIEW_H
00021 #define MARGINPREVIEW_H
00022 
00023 #include <qwidget.h>
00024 
00025 class MarginPreview : public QWidget
00026 {
00027     Q_OBJECT
00028 
00029 public:
00030     MarginPreview(QWidget *parent = 0, const char *name = 0);
00031     ~MarginPreview();
00032     
00033     void setPageSize(float w, float h);
00034     void setMargins(float t, float b, float l, float r);
00035     void setNoPreview(bool on);
00036     void setSymetric(bool on);
00037     enum    StateType { Fixed = -1, None = 0, TMoving, BMoving, LMoving, RMoving };
00038 
00039 public slots:
00040     void enableRubberBand(bool on);
00041 
00042 signals:
00043     void marginChanged(int type, float value);
00044 
00045 protected:
00046     void paintEvent(QPaintEvent *);
00047     void resizeEvent(QResizeEvent *);
00048     void mouseMoveEvent(QMouseEvent *);
00049     void mousePressEvent(QMouseEvent *);
00050     void mouseReleaseEvent(QMouseEvent *);
00051     int locateMouse(const QPoint& p);
00052     void drawTempLine(QPainter*);
00053 
00054 private:
00055     float   width_, height_;
00056     float   top_, bottom_, left_, right_;
00057     QRect   box_, margbox_;
00058     float   zoom_;
00059     bool    nopreview_;
00060     int state_;
00061     int oldpos_;
00062     bool    symetric_;
00063 };
00064 
00065 #endif
 
This file is part of the documentation for kdeprint Library Version 3.2.0.