1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
52 #ifndef Patternist_XsdModelGroup_H
53 #define Patternist_XsdModelGroup_H
55 #include <private/qxsdparticle_p.h>
56 #include <private/qxsdterm_p.h>
62 template<typename N> class QList;
67 * @short Represents a XSD model group object.
69 * This class represents the <em>model group</em> object of a XML schema as described
70 * <a href="http://www.w3.org/TR/xmlschema11-1/#cModel_Group_Definitions">here</a>.
72 * It contains information from either a <em>sequence</em> object, a <em>choice</em> object or an
73 * <em>all</em> object.
75 * @see <a href="http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/xml-schema-api.html#Interface-XSModelGroup">XML Schema API reference</a>
76 * @ingroup Patternist_schema
77 * @author Tobias Koenig <tobias.koenig@nokia.com>
79 class XsdModelGroup : public XsdTerm
82 typedef QExplicitlySharedDataPointer<XsdModelGroup> Ptr;
83 typedef QList<XsdModelGroup::Ptr> List;
86 * Describes the <a href="http://www.w3.org/TR/xmlschema11-1/#mg-compositor">compositor</a> of the model group.
90 SequenceCompositor, ///< The model group is a sequence.
91 ChoiceCompositor, ///< The model group is a choice.
92 AllCompositor ///< The model group contains elements only.
96 * Creates a new model group object.
101 * Returns always @c true, used to avoid dynamic casts.
103 virtual bool isModelGroup() const;
106 * Sets the @p compositor of the model group.
108 * @see ModelCompositor
110 void setCompositor(ModelCompositor compositor);
113 * Returns the compositor of the model group.
115 ModelCompositor compositor() const;
118 * Sets the list of @p particles of the model group.
120 * @see <a href="http://www.w3.org/TR/xmlschema11-1/#mg-particles">Particles Definition</a>
122 void setParticles(const XsdParticle::List &particles);
125 * Returns the list of particles of the model group.
127 XsdParticle::List particles() const;
130 ModelCompositor m_compositor;
131 XsdParticle::List m_particles;