QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RMixedOperation.h
Go to the documentation of this file.
1 #ifndef RMIXEDOPERATION_H
2 #define RMIXEDOPERATION_H
3 
4 #include <QList>
5 #include <QSharedPointer>
6 #include <QFlags>
7 
8 #include "RDocument.h"
9 #include "RExporter.h"
10 #include "ROperation.h"
11 #include "RTransaction.h"
12 #include "RVector.h"
13 
14 class RObject;
15 
22 class RMixedOperation: public ROperation {
23 public:
24  enum Mode {
25  NoMode = 0x0,
27  Delete = 0x2
28  };
29  Q_DECLARE_FLAGS(Modes, Mode)
30 
31 public:
32  RMixedOperation(bool undoable = true);
33  virtual ~RMixedOperation() {
34  }
35 
36  QSharedPointer<RObject> addObject(const QSharedPointer<RObject>& obj,
37  bool useCurrentAttributes = true);
38  void deleteObject(const QSharedPointer<RObject>& obj);
39 
40  virtual RTransaction apply(RDocument& document, bool preview = false) const;
41 
42 protected:
43  void setMode(RMixedOperation::Modes& modes, RMixedOperation::Mode mode, bool on = true);
44  bool getMode(const RMixedOperation::Modes& modes, RMixedOperation::Mode mode) const;
45 
46 private:
47  QList<QPair<QSharedPointer<RObject>, Modes> > list;
48 };
49 
50 Q_DECLARE_OPERATORS_FOR_FLAGS(RMixedOperation::Modes)
53 
54 #endif