GenerateVariableMenuOperation.h
48 lines
| 1.8 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r195 | #ifndef SCIQLOP_GENERATEVARIABLEMENUOPERATION_H | ||
#define SCIQLOP_GENERATEVARIABLEMENUOPERATION_H | ||||
#include "Visualization/IVisualizationWidgetVisitor.h" | ||||
#include <Common/spimpl.h> | ||||
Alexandre Leroux
|
r196 | #include <QLoggingCategory> | ||
Alexandre Leroux
|
r675 | #include <set> | ||
Alexandre Leroux
|
r195 | class QMenu; | ||
Alexandre Leroux
|
r675 | class IVisualizationWidget; | ||
Alexandre Leroux
|
r195 | class Variable; | ||
Alexandre Leroux
|
r196 | Q_DECLARE_LOGGING_CATEGORY(LOG_GenerateVariableMenuOperation) | ||
Alexandre Leroux
|
r195 | /** | ||
* @brief The GenerateVariableMenuOperation class defines an operation that traverses all of | ||||
* visualization widgets to determine which can accommodate a variable. The result of the operation | ||||
* is a menu that contains actions to add the variable into the containers. | ||||
*/ | ||||
class GenerateVariableMenuOperation : public IVisualizationWidgetVisitor { | ||||
public: | ||||
/** | ||||
* Ctor | ||||
* @param menu the menu to which to attach the generated menu | ||||
* @param variable the variable for which to generate the menu | ||||
Alexandre Leroux
|
r675 | * @param variableContainers the containers that already contain the variable for which to | ||
* generate the menu | ||||
Alexandre Leroux
|
r195 | */ | ||
Alexandre Leroux
|
r675 | explicit GenerateVariableMenuOperation(QMenu *menu, std::shared_ptr<Variable> variable, | ||
std::set<IVisualizationWidget *> variableContainers); | ||||
Alexandre Leroux
|
r195 | |||
void visitEnter(VisualizationWidget *widget) override final; | ||||
void visitLeave(VisualizationWidget *widget) override final; | ||||
void visitEnter(VisualizationTabWidget *tabWidget) override final; | ||||
void visitLeave(VisualizationTabWidget *tabWidget) override final; | ||||
void visitEnter(VisualizationZoneWidget *zoneWidget) override final; | ||||
void visitLeave(VisualizationZoneWidget *zoneWidget) override final; | ||||
void visit(VisualizationGraphWidget *graphWidget) override final; | ||||
private: | ||||
class GenerateVariableMenuOperationPrivate; | ||||
spimpl::unique_impl_ptr<GenerateVariableMenuOperationPrivate> impl; | ||||
}; | ||||
#endif // SCIQLOP_GENERATEVARIABLEMENUOPERATION_H | ||||