00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CURSORS_H
00023 #define CURSORS_H
00024
00025 #include "ViewItem.h"
00026 #include <QTimer>
00027 #include <QTimeLine>
00028
00029 class Sheet;
00030 class SheetView;
00031 class ClipsViewPort;
00032
00033 class PlayHead : public ViewItem
00034 {
00035 Q_OBJECT
00036
00037 public:
00038 PlayHead(SheetView* sv, Sheet* sheet, ClipsViewPort* vp);
00039 ~PlayHead();
00040
00041 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00042 void set_bounding_rect(QRectF rect);
00043
00044 bool is_active();
00045 void set_active(bool active);
00046
00047 enum PlayHeadMode {
00048 FLIP_PAGE,
00049 CENTERED,
00050 ANIMATED_FLIP_PAGE
00051 };
00052
00053 void set_mode(PlayHeadMode mode);
00054 void toggle_follow();
00055
00056 private:
00057 Sheet* m_sheet;
00058 QTimer m_playTimer;
00059 QTimeLine m_animation;
00060 ClipsViewPort* m_vp;
00061 bool m_follow;
00062 bool m_followDisabled;
00063 PlayHeadMode m_mode;
00064 int m_animationScrollStartPos;
00065 int m_animFrameRange;
00066 qreal m_animScaleFactor;
00067
00068 private slots:
00069 void check_config();
00070 void play_start();
00071 void play_stop();
00072 void set_animation_value(int);
00073 void animation_finished();
00074
00075 public slots:
00076 void update_position();
00077 void enable_follow();
00078 void disable_follow();
00079 };
00080
00081
00082
00083 class WorkCursor : public ViewItem
00084 {
00085 Q_OBJECT
00086
00087 public:
00088 WorkCursor(SheetView* sv, Sheet* sheet);
00089 ~WorkCursor();
00090
00091 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00092 void set_bounding_rect(QRectF rect);
00093
00094 private:
00095 Sheet* m_sheet;
00096 SheetView* m_sv;
00097 QPixmap m_pix;
00098
00099 void update_background();
00100
00101 public slots:
00102 void update_position();
00103 };
00104
00105
00106 #endif
00107
00108