2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef IMAGE_GROUPING_INCLUDED
|
|
|
|
#define IMAGE_GROUPING_INCLUDED
|
|
|
|
|
|
|
|
#include "tcommon.h"
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class StrokeSelection;
|
|
|
|
class QMenu;
|
|
|
|
|
|
|
|
#undef DVAPI
|
|
|
|
#undef DVVAR
|
|
|
|
#ifdef TNZTOOLS_EXPORTS
|
|
|
|
#define DVAPI DV_EXPORT_API
|
|
|
|
#define DVVAR DV_EXPORT_VAR
|
|
|
|
#else
|
|
|
|
#define DVAPI DV_IMPORT_API
|
|
|
|
#define DVVAR DV_IMPORT_VAR
|
|
|
|
#endif
|
|
|
|
|
2016-06-29 18:17:12 +12:00
|
|
|
class DVAPI TGroupCommand final : public QObject {
|
2016-06-15 18:43:10 +12:00
|
|
|
Q_OBJECT
|
2016-03-19 06:57:51 +13:00
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
enum {
|
|
|
|
NONE = 0,
|
|
|
|
FRONT = 1,
|
|
|
|
FORWARD = 2,
|
|
|
|
BACKWARD = 4,
|
|
|
|
BACK = 8,
|
|
|
|
GROUP = 16,
|
|
|
|
UNGROUP = 32
|
|
|
|
};
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
StrokeSelection *m_sel;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
TGroupCommand() : m_sel(0) {}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void setSelection(StrokeSelection *sel) { m_sel = sel; }
|
|
|
|
UCHAR getGroupingOptions();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void addMenuItems(QMenu *menu);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void back() {
|
|
|
|
if (!(getGroupingOptions() & BACK)) return;
|
|
|
|
moveGroup(BACK);
|
|
|
|
}
|
|
|
|
void backward() {
|
|
|
|
if (!(getGroupingOptions() & BACKWARD)) return;
|
|
|
|
moveGroup(BACKWARD);
|
|
|
|
}
|
|
|
|
void front() {
|
|
|
|
if (!(getGroupingOptions() & FRONT)) return;
|
|
|
|
moveGroup(FRONT);
|
|
|
|
}
|
|
|
|
void forward() {
|
|
|
|
if (!(getGroupingOptions() & FORWARD)) return;
|
|
|
|
moveGroup(FORWARD);
|
|
|
|
}
|
|
|
|
void group();
|
|
|
|
void ungroup();
|
|
|
|
void enterGroup();
|
|
|
|
void exitGroup();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
private:
|
2016-06-15 18:43:10 +12:00
|
|
|
void moveGroup(UCHAR moveType);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|