Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TSELECTIONHANDLE_H
Toshihiro Shimizu 890ddd
#define TSELECTIONHANDLE_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qobject></qobject>
Toshihiro Shimizu 890ddd
#include <string></string>
Toshihiro Shimizu 890ddd
#include <vector></vector>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonzqt/menubarcommand.h"
Toshihiro Shimizu 890ddd
#include "tcommon.h"
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
// forward declaration
Toshihiro Shimizu 890ddd
class TSelection;
Toshihiro Shimizu 890ddd
class CommandHandlerInterface;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// TSelectionHandle
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TSelectionHandle final : public QObject {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  std::vector<tselection *=""> m_selectionStack;</tselection>
Shinya Kitaoka 120a6e
  std::vector<std::string> m_enabledCommandIds;</std::string>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSelectionHandle();
Shinya Kitaoka 120a6e
  ~TSelectionHandle();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TSelection *getSelection() const;
Shinya Kitaoka 120a6e
  void setSelection(TSelection *selection);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void pushSelection();
Shinya Kitaoka 120a6e
  void popSelection();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // called by TSelection::enableCommand
Shinya Kitaoka 120a6e
  void enableCommand(std::string cmdId, CommandHandlerInterface *handler);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void notifySelectionChanged();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static TSelectionHandle *getCurrent();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
signals:
Shinya Kitaoka 120a6e
  void selectionSwitched(TSelection *oldSelection, TSelection *newSelection);
Shinya Kitaoka 120a6e
  void selectionChanged(TSelection *selection);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // TSELECTIONHANDLE_H