VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
LevelProgressionList.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef LEVELPROGRESSIONLIST_H
18 #define LEVELPROGRESSIONLIST_H
19 
20 #include <QObject>
21 #include <QQmlListProperty>
22 
23 class LevelProgression;
24 
31 class LevelProgressionList : public QObject {
32  Q_OBJECT
33 
39 
40 public:
45  explicit LevelProgressionList(QObject* parent = nullptr);
46 
54  QList<LevelProgression*>& getProgressions() { return mProgressions; }
58  const QList<LevelProgression*>& getProgressions() const { return mProgressions; }
59 
64  Q_INVOKABLE LevelProgression* getLevelProgressionByName(const QString& name) const;
65 
66 signals:
70  void progressionsChanged();
71 
72 private:
73  QList<LevelProgression*> mProgressions;
74 };
75 Q_DECLARE_METATYPE(LevelProgressionList*)
76 
77 #endif // LEVELPROGRESSIONLIST_H
QQmlListProperty< LevelProgression > progressions
QML mutable list of LevelProgressions that are contained in this collection.
Definition: LevelProgressionList.h:38
QList< LevelProgression * > & getProgressions()
Returns progressions as a QList.
Definition: LevelProgressionList.h:54
LevelProgressionList(QObject *parent=nullptr)
Constructs a LevelProgressionList.
Grouping of related Environments together into a logical, ordered list.
Definition: LevelProgression.h:34
Collection of LevelProgressions.
Definition: LevelProgressionList.h:31
void progressionsChanged()
Emitted when progressions changes.
Q_INVOKABLE LevelProgression * getLevelProgressionByName(const QString &name) const
Returns child LevelProgression identified by name.
QQmlListProperty< LevelProgression > getProgressionsListProperty()
Returns progressions.
QObject * parent() const
const QList< LevelProgression * > & getProgressions() const
Returns progressions as a const QList.
Definition: LevelProgressionList.h:58