krita/ui

kis_shape_selection_model.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 2007 Sven Langkamp <sven.langkamp@gmail.com>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef KIS_SHAPE_SELECTION_MODEL_H
00020 #define KIS_SHAPE_SELECTION_MODEL_H
00021 
00022 #include "KoShapeContainerModel.h"
00023 #include "kis_types.h"
00024 
00025 class KisShapeSelection;
00026 
00030 class KisShapeSelectionModel: public KoShapeContainerModel
00031 {
00032 public:
00033     KisShapeSelectionModel(KisImageWSP image, KisSelectionSP selection, KisShapeSelection* shapeSelection);
00034     ~KisShapeSelectionModel();
00035 
00036     void add(KoShape *child);
00037     void remove(KoShape *child);
00038 
00039     void setClipping(const KoShape *child, bool clipping);
00040     bool childClipped(const KoShape *child) const;
00041 
00042     int count() const;
00043     QList<KoShape*> childShapes() const;
00044 
00045     void containerChanged(KoShapeContainer *);
00046     void childChanged(KoShape * child, KoShape::ChangeType type);
00047     bool isChildLocked(const KoShape *child) const;
00048 
00049 private:
00050     QMap<KoShape*, QRectF> m_shapeMap;
00051     KisImageWSP m_image;
00052     KisSelectionSP m_parentSelection;
00053     KisShapeSelection* m_shapeSelection;
00054 };
00055 
00056 #endif