Files
oak-editor/app/panel/panel.h
T
itsmattkc 25b6b07a06 Squashed commit of the following:
commit 60c0f65c5e3c2faf1f7b0ae10b4131dabbcf715b
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Wed Feb 15 22:34:16 2023 -0800

    mainwindow: don't close last timeline panel when removing sequence

commit bc892810d67c1dd4f9c0639767c563681f29701d
Merge: 69051a120 aef08f8cd
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 17:05:25 2023 -0800

    Merge branch 'master' into kddockwidgets

commit 69051a120b8423d0ad7b38def2f7555d323cd74d
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 15:29:24 2023 -0800

    finished kddockwidgets integration

commit 9a39dbeade871a0b9454b424c7f7a7482671d40b
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 11:54:25 2023 -0800

    switch to kddockwidgets
2023-02-16 00:44:08 -08:00

249 lines
5.5 KiB
C++

/***
Olive - Non-Linear Video Editor
Copyright (C) 2022 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef PANEL_WIDGET_H
#define PANEL_WIDGET_H
#include <kddockwidgets/DockWidget.h>
#include <QEvent>
#include "common/define.h"
namespace olive {
/**
* @brief A widget that is always dockable within the MainWindow.
*/
class PanelWidget : public KDDockWidgets::DockWidget
{
Q_OBJECT
public:
/**
* @brief PanelWidget Constructor
*
* @param parent
*
* The PanelWidget's parent, enforced to help with memory handling. Most of the time this will be an instance of
* MainWindow.
*/
PanelWidget(const QString& object_name);
virtual ~PanelWidget() override;
/**
* @brief Set visibility of panel's highlighted border, mostly used for showing panel focus
*
* @param enabled
*/
void SetBorderVisible(bool enabled);
/**
* @brief If enabled, sends signal CloseRequested() when the user closes instead of closing
*
* Defaults to FALSE. Use this to override default panel closing functionality.
*/
void SetSignalInsteadOfClose(bool e);
using Info = std::map<QString, QString>;
virtual void LoadData(const Info &info){}
virtual Info SaveData() const {return Info();}
/**
* @brief Called whenever this panel is focused and user uses "Zoom In" (either in menus or as a keyboard shortcut)
*
* This function is up to the Panel's interpretation of what the user intends to zoom into. Default behavior is a
* no-op.
*/
virtual void ZoomIn(){}
/**
* @brief Called whenever this panel is focused and user uses "Zoom Out" (either in menus or as a keyboard shortcut)
*
* This function is up to the Panel's interpretation of what the user intends to zoom out of. Default behavior is a
* no-op.
*/
virtual void ZoomOut(){}
virtual void GoToStart(){}
virtual void PrevFrame(){}
/**
* @brief Called whenever this panel is focused and user uses "Play/Pause" (either in menus or as a keyboard shortcut)
*
* This function is up to the Panel's interpretation of what the user intends to zoom out of. Default behavior is a
* no-op.
*/
virtual void PlayPause(){}
virtual void PlayInToOut(){}
virtual void NextFrame(){}
virtual void GoToEnd(){}
virtual void SelectAll(){}
virtual void DeselectAll(){}
virtual void RippleToIn(){}
virtual void RippleToOut(){}
virtual void EditToIn(){}
virtual void EditToOut(){}
virtual void ShuttleLeft(){}
virtual void ShuttleStop(){}
virtual void ShuttleRight(){}
virtual void GoToPrevCut(){}
virtual void GoToNextCut(){}
virtual void RenameSelected(){}
virtual void DeleteSelected(){}
virtual void RippleDelete(){}
virtual void IncreaseTrackHeight(){}
virtual void DecreaseTrackHeight(){}
virtual void SetIn(){}
virtual void SetOut(){}
virtual void ResetIn(){}
virtual void ResetOut(){}
virtual void ClearInOut(){}
virtual void SetMarker(){}
virtual void ToggleLinks(){}
virtual void CutSelected(){}
virtual void CopySelected(){}
virtual void Paste(){}
virtual void PasteInsert(){}
virtual void ToggleShowAll(){}
virtual void GoToIn(){}
virtual void GoToOut(){}
virtual void DeleteInToOut(){}
virtual void RippleDeleteInToOut(){}
virtual void ToggleSelectedEnabled(){}
virtual void Duplicate(){}
virtual void SetColorLabel(int){}
virtual void NudgeLeft(){}
virtual void NudgeRight(){}
virtual void MoveInToPlayhead(){}
virtual void MoveOutToPlayhead(){}
signals:
void CloseRequested();
protected:
/**
* @brief paintEvent
* @param event
*/
void paintEvent(QPaintEvent *event) override;
virtual void changeEvent(QEvent* e) override;
virtual void closeEvent(QCloseEvent* event) override;
virtual void Retranslate();
void SetWidgetWithPadding(QWidget* widget);
protected slots:
/**
* @brief Set panel's title
*
* Use this function to set the title of the panel.
*
* A PanelWidget has the default format of "Title: Subtitle" (can differ depending on translation). If no Subtitle
* is set, the title will just be formatted "Title".
*
* @param t
*
* String to set the title to
*/
void SetTitle(const QString& t);
/**
* @brief Set panel's subtitle
*
* Use this function to set the subtitle of the panel.
*
* A PanelWidget has the default format of "Title: Subtitle" (can differ depending on translation). If no Subtitle
* is set, the title will just be formatted "Title".
*
* @param t
*
* String to set the subtitle to
*/
void SetSubtitle(const QString& t);
private:
/**
* @brief Internal function that sets the QDockWidget's window title whenever the title/subtitle change.
*
* Should be called any time a change is made to title_ or subtitle_
*/
void UpdateTitle();
QString title_;
QString subtitle_;
bool border_visible_;
bool signal_instead_of_close_;
};
}
#endif // PANEL_WIDGET_H