Warning, file /office/calligra/libs/flake/SimpleShapeContainerModel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2006-2007, 2010 Thomas Zander <zander@kde.org>
0003  * Copyright (C) 2011 Boudewijn Rempt <boud@kogmbh.com>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 #ifndef SIMPLESHAPECONTAINERMODEL_H
0021 #define SIMPLESHAPECONTAINERMODEL_H
0022 
0023 #include "KoShapeContainerModel.h"
0024 
0025 /// \internal
0026 class SimpleShapeContainerModel: public KoShapeContainerModel
0027 {
0028 public:
0029     SimpleShapeContainerModel() {}
0030     ~SimpleShapeContainerModel() override {}
0031     void add(KoShape *child) override {
0032         if (m_members.contains(child))
0033             return;
0034         m_members.append(child);
0035     }
0036     void setClipped(const KoShape *, bool) override { }
0037     bool isClipped(const KoShape *) const override {
0038         return false;
0039     }
0040     void remove(KoShape *child) override {
0041         m_members.removeAll(child);
0042     }
0043     int count() const override {
0044         return m_members.count();
0045     }
0046     QList<KoShape*> shapes() const override {
0047         return QList<KoShape*>(m_members);
0048     }
0049     void containerChanged(KoShapeContainer *, KoShape::ChangeType) override { }
0050     bool isChildLocked(const KoShape *child) const override {
0051         Q_ASSERT(child->parent());
0052         if (child->parent()) {
0053            return child->isGeometryProtected() || child->parent()->isGeometryProtected();
0054         }
0055         else {
0056             return child->isGeometryProtected();
0057         }
0058     }
0059     void setInheritsTransform(const KoShape *, bool ) override { }
0060     bool inheritsTransform(const KoShape *) const override {
0061         return false;
0062     }
0063 
0064 private: // members
0065     QList <KoShape *> m_members;
0066 };
0067 
0068 #endif