Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef FUNCTIONTOOLBAR_INCLUDED
Toshihiro Shimizu 890ddd
#define FUNCTIONTOOLBAR_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tdoubleparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzQt includes
Toshihiro Shimizu 890ddd
#include "toonzqt/lineedit.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// Qt includes
Toshihiro Shimizu 890ddd
#include <qtoolbar></qtoolbar>
Toshihiro Shimizu 890ddd
#include <qaction></qaction>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZQT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//============================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//    Forward declarations
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TDoubleParam;
Toshihiro Shimizu 890ddd
class TFrameHandle;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace DVGui {
Toshihiro Shimizu 890ddd
class MeasuredDoubleLineEdit;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class FrameNavigator;
Toshihiro Shimizu 890ddd
class FunctionKeyframeNavigator;
Toshihiro Shimizu 890ddd
class FunctionSelection;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//============================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace DVGui {
Shinya Kitaoka 120a6e
class ToolBar : public QToolBar {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  ToolBar(QWidget *parent = 0) : QToolBar(parent) {
Shinya Kitaoka 120a6e
    setFixedHeight(22);          // ;_;
Shinya Kitaoka 120a6e
    setIconSize(QSize(23, 17));  //
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//*************************************************************************
Toshihiro Shimizu 890ddd
//    FunctionToolbar  declaration
Toshihiro Shimizu 890ddd
//*************************************************************************
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class FunctionToolbar final : public DVGui::ToolBar, public TParamObserver {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QToolBar *m_valueToolbar, *m_keyframeToolbar;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  DVGui::MeasuredDoubleLineEdit *m_valueFld;
Shinya Kitaoka 120a6e
  FrameNavigator *m_frameNavigator;
Shinya Kitaoka 120a6e
  FunctionKeyframeNavigator *m_keyframeNavigator;
Shinya Kitaoka 120a6e
  DVGui::LineEdit *m_stepFld;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TDoubleParam *m_curve;
Shinya Kitaoka 120a6e
  TFrameHandle *m_frameHandle;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  FunctionSelection *m_selection;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // in una toolbar ogni widget ha un'action associata
Shinya Kitaoka 120a6e
  QAction
Shinya Kitaoka 120a6e
      *m_valueFldAction;  // brutto: da eliminare. serve solo per fare show/hide
Shinya Kitaoka 120a6e
  QAction *m_keyframeNavigatorAction;  // brutto: da eliminare. serve solo per
Shinya Kitaoka 120a6e
                                       // fare show/hide
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  FunctionToolbar(QWidget *parent = 0);
Shinya Kitaoka 120a6e
  ~FunctionToolbar();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setSelection(FunctionSelection *);
Shinya Kitaoka 120a6e
  void setFrameHandle(TFrameHandle *frameHandle);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void onChange(const TParamChange &) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool anyWidgetHasFocus();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
signals:
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void numericalColumnToggled();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public slots:
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void setCurve(TDoubleParam *curve);
Shinya Kitaoka 120a6e
  void setFrame(double frame);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private slots:
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void onValueFieldChanged();
Shinya Kitaoka 120a6e
  void onFrameSwitched();
Shinya Kitaoka 120a6e
  void onNavFrameSwitched();
Shinya Kitaoka 120a6e
  void onSelectionChanged();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // FUNCTIONTOOLBAR_INCLUDED