121 lines
2.4 KiB
C++
Executable File
121 lines
2.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* widget in MVC pattern which manages the entire timeline to add on a layout or widget
|
|
* $Id: TimelineWidget.h 49755 2020-02-04 08:44:47Z ehrlicher $
|
|
* $HeadURL: svn://192.168.133.21/TDS/branches/product/features/hotline/Lts/Common/LtsTimelineClassic/TimelineWidget.h $
|
|
* $Author: ehrlicher $
|
|
* Created by Mike Wille, SLSE, 2014-10-01
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "timeline_utils.h"
|
|
|
|
#include <LtsTimeline/ltstimeline_export.h>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
class QScrollBar;
|
|
class QAbstractItemModel;
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class Timeline;
|
|
}
|
|
|
|
|
|
namespace LtsTimeline
|
|
{
|
|
|
|
class TimelineView;
|
|
class TimelineHeaderView;
|
|
class TimelineModel;
|
|
|
|
|
|
class LTSTIMELINE_EXPORT TimelineWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TimelineWidget(QWidget *parent = nullptr);
|
|
~TimelineWidget();
|
|
|
|
TimelineView *view();
|
|
|
|
TimelineHeaderView *header();
|
|
|
|
TimelineModel *timelineModel();
|
|
void setModel(QAbstractItemModel *model);
|
|
|
|
QScrollBar *slider();
|
|
|
|
ZoomFactor zoomFactor() const;
|
|
void setZoomFactor(ZoomFactor factor);
|
|
|
|
ZoomFactor minimumZoomFactor() const;
|
|
void setMinimumZoomFactor(ZoomFactor factor);
|
|
|
|
ZoomFactor maximumZoomFactor() const;
|
|
void setMaximumZoomFactor(ZoomFactor factor);
|
|
|
|
qint64 startTime() const;
|
|
void setStartTime(qint64 time);
|
|
|
|
qint64 currentTime() const;
|
|
void setCurrentTime(qint64 time);
|
|
|
|
qint64 endTime() const;
|
|
void setEndTime(qint64 time);
|
|
|
|
int duration() const;
|
|
void setDuration(int duration);
|
|
|
|
bool isCursorTextVisible() const;
|
|
void setCursorTextVisible(bool visible);
|
|
void setCursorText(const QString &text);
|
|
void setCursorText(const QStringList &texts);
|
|
|
|
bool isSnapEnabled() const;
|
|
void setSnapEnabled(bool enabled);
|
|
void enableSnap();
|
|
void disableSnap();
|
|
void triggerSnap();
|
|
|
|
void setZoomInIcon(QIcon icon);
|
|
void setZoomOutIcon(QIcon icon);
|
|
|
|
QWidget *placeholder();
|
|
void setPlaceholder(QWidget *widget);
|
|
|
|
void showDebugWidget();
|
|
void hideDebugWidget();
|
|
|
|
private:
|
|
void populateZoomFactorComboBox();
|
|
|
|
public:
|
|
void onUpdateZoomButtons();
|
|
|
|
private slots:
|
|
void onSectionResized(int logicalIndex, int oldSize, int newSize);
|
|
void onSliderValueChanged(int value);
|
|
void onZoomChanged(ZoomFactor factor);
|
|
void onZoomSelected();
|
|
void onZoomIn();
|
|
void onZoomOut();
|
|
|
|
void onUpdateDebugInfo();
|
|
|
|
signals:
|
|
|
|
private:
|
|
Ui::Timeline *m_ui{nullptr};
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
|
|
} // namespace LtsTimeline
|