krita/ui
kis_shape_selection.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KIS_SHAPE_SELECTION_H
00019 #define KIS_SHAPE_SELECTION_H
00020
00021 #include <KoShapeLayer.h>
00022 #include <KoShapeFactory.h>
00023
00024 #include <kis_selection_component.h>
00025 #include <kis_types.h>
00026
00027 #include <krita_export.h>
00028
00029 class KoStore;
00030 class KisShapeSelectionCanvas;
00031
00035 class KRITAUI_EXPORT KisShapeSelection : public KoShapeLayer, public KisSelectionComponent
00036 {
00037 public:
00038
00039 KisShapeSelection(KisImageWSP image, KisSelectionSP selection);
00040
00041 virtual ~KisShapeSelection();
00042
00043 KisShapeSelection(const KisShapeSelection& rhs);
00044
00045 KisSelectionComponent* clone();
00046
00047 bool saveSelection(KoStore * store) const;
00048
00049 bool loadSelection(KoStore * store);
00056 virtual void renderToProjection(KisSelection* projection);
00057 virtual void renderToProjection(KisSelection* projection, const QRect& r);
00058
00059 virtual void setDirty();
00060
00061 void addChild(KoShape *object);
00062 void removeChild(KoShape *object);
00063
00064 virtual QPainterPath selectionOutline();
00065
00066 KoShapeManager *shapeManager() const;
00067
00068 protected:
00069
00070 virtual void paintComponent(QPainter& painter, const KoViewConverter& converter);
00071
00072 private:
00073
00074 void renderSelection(KisSelection* projection, const QRect& r);
00075
00076 KisImageWSP m_image;
00077 QPainterPath m_outline;
00078 bool m_dirty;
00079 KisShapeSelectionCanvas* m_canvas;
00080
00081 friend class KisShapeSelectionModel;
00082 };
00083
00084
00085 class KRITAUI_EXPORT KisShapeSelectionFactory : public KoShapeFactory
00086 {
00087 Q_OBJECT
00088 public:
00089
00090 using KoShapeFactory::createDefaultShape;
00091 using KoShapeFactory::createShape;
00092
00093 KisShapeSelectionFactory(QObject* parent);
00094 ~KisShapeSelectionFactory() {}
00095
00096 KoShape* createDefaultShape() const;
00097 KoShape* createShape(const KoProperties* params) const;
00098
00099 bool hidden() const {
00100 return true;
00101 }
00102 };
00103
00104 #endif
|