]> git.sesse.net Git - kdenlive/blob - src/smallruler.h
const'ify
[kdenlive] / src / smallruler.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #ifndef SMALLRULER_H
22 #define SMALLRULER_H
23
24 #include <KColorScheme>
25 #include <QWidget>
26
27 #include "monitormanager.h"
28
29
30 class SmallRuler : public QWidget
31 {
32     Q_OBJECT
33
34 public:
35     explicit SmallRuler(Monitor *manager, Render *render, QWidget *parent = 0);
36     void adjustScale(int maximum);
37     void setZone(int start, int end);
38     void setZoneStart();
39     void setZoneEnd();
40     QPoint zone() const;
41     void setMarkers(const QList < CommentedTime >& list);
42     void updatePalette();
43     void refreshRuler();
44
45 protected:
46     void paintEvent(QPaintEvent *e);
47     void resizeEvent(QResizeEvent *);
48     void leaveEvent(QEvent * event);
49     void mousePressEvent(QMouseEvent * event);
50     void mouseMoveEvent(QMouseEvent * event);
51     void mouseReleaseEvent(QMouseEvent * event);
52
53 private:
54     int m_cursorPosition;
55     int m_cursorFramePosition;
56     double m_scale;
57     int m_medium;
58     int m_small;
59     int m_maxval;
60     int m_zoneStart;
61     int m_zoneEnd;
62     QColor m_zoneColor;
63     QList <CommentedTime> m_markers;
64     QPixmap m_pixmap;
65     Monitor *m_monitor;
66     Render *m_render;
67     int m_lastSeekPosition;
68     QBrush m_cursorColor;
69     void updatePixmap();
70
71 public slots:
72     bool slotNewValue(int value);
73
74 signals:
75     void zoneChanged(QPoint);
76 };
77
78 #endif