115 lines
2.0 KiB
C++
Executable File
115 lines
2.0 KiB
C++
Executable File
|
|
|
|
|
|
#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;
|
|
|
|
};
|
|
|
|
}
|