tahoma2d/toonz/sources/include/toonzqt/tselectionhandle.h
Shinya Kitaoka d1f6c4e95b REFACTORING: Add final specifiers (#537)
* add final specifiers

* apply clang-format

* fix for macOS
2016-06-29 15:17:12 +09:00

59 lines
1.3 KiB
C++

#pragma once
#ifndef TSELECTIONHANDLE_H
#define TSELECTIONHANDLE_H
#include <QObject>
#include <string>
#include <vector>
#include "toonzqt/menubarcommand.h"
#include "tcommon.h"
#undef DVAPI
#undef DVVAR
#ifdef TOONZQT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
// forward declaration
class TSelection;
class CommandHandlerInterface;
//=============================================================================
// TSelectionHandle
//-----------------------------------------------------------------------------
class DVAPI TSelectionHandle final : public QObject {
Q_OBJECT
std::vector<TSelection *> m_selectionStack;
std::vector<std::string> m_enabledCommandIds;
public:
TSelectionHandle();
~TSelectionHandle();
TSelection *getSelection() const;
void setSelection(TSelection *selection);
void pushSelection();
void popSelection();
// called by TSelection::enableCommand
void enableCommand(std::string cmdId, CommandHandlerInterface *handler);
void notifySelectionChanged();
static TSelectionHandle *getCurrent();
signals:
void selectionSwitched(TSelection *oldSelection, TSelection *newSelection);
void selectionChanged(TSelection *selection);
};
#endif // TSELECTIONHANDLE_H