Toshihiro Shimizu 890ddd
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
Toshihiro Shimizu 890ddd
class DVAPI TSelectionHandle : public QObject
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	Q_OBJECT
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	std::vector<tselection *=""> m_selectionStack;</tselection>
Toshihiro Shimizu 890ddd
	std::vector<std::string> m_enabledCommandIds;</std::string>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TSelectionHandle();
Toshihiro Shimizu 890ddd
	~TSelectionHandle();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TSelection *getSelection() const;
Toshihiro Shimizu 890ddd
	void setSelection(TSelection *selection);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void pushSelection();
Toshihiro Shimizu 890ddd
	void popSelection();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// called by TSelection::enableCommand
Toshihiro Shimizu 890ddd
	void enableCommand(std::string cmdId, CommandHandlerInterface *handler);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void notifySelectionChanged();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	static TSelectionHandle *getCurrent();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
signals:
Toshihiro Shimizu 890ddd
	void selectionSwitched(TSelection *oldSelection, TSelection *newSelection);
Toshihiro Shimizu 890ddd
	void selectionChanged(TSelection *selection);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif //TSELECTIONHANDLE_H