26278236a6e128fc17cfc860a0351174bf3224c8
[profile/ivi/qtdeclarative.git] / src / qtquick1 / util / qdeclarativestate.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
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.
17 **
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.
21 **
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.
29 **
30 ** Other Usage
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.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "QtQuick1/private/qdeclarativestate_p_p.h"
43 #include "QtQuick1/private/qdeclarativestate_p.h"
44
45 #include "QtQuick1/private/qdeclarativetransition_p.h"
46 #include "QtQuick1/private/qdeclarativestategroup_p.h"
47 #include "QtQuick1/private/qdeclarativestateoperations_p.h"
48 #include "QtQuick1/private/qdeclarativeanimation_p.h"
49 #include "QtQuick1/private/qdeclarativeanimation_p_p.h"
50
51 #include <QtDeclarative/private/qdeclarativebinding_p.h>
52 #include <QtDeclarative/private/qdeclarativeglobal_p.h>
53
54 #include <QtCore/qdebug.h>
55
56 QT_BEGIN_NAMESPACE
57
58
59
60 DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
61
62 QDeclarative1Action::QDeclarative1Action()
63 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), fromBinding(0), event(0),
64   specifiedObject(0)
65 {
66 }
67
68 QDeclarative1Action::QDeclarative1Action(QObject *target, const QString &propertyName,
69                const QVariant &value)
70 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false), 
71   property(target, propertyName, qmlEngine(target)), toValue(value),
72   fromBinding(0), event(0),
73   specifiedObject(target), specifiedProperty(propertyName)
74 {
75     if (property.isValid())
76         fromValue = property.read();
77 }
78
79 QDeclarative1Action::QDeclarative1Action(QObject *target, const QString &propertyName,
80                QDeclarativeContext *context, const QVariant &value)
81 : restore(true), actionDone(false), reverseEvent(false), deletableToBinding(false),
82   property(target, propertyName, context), toValue(value),
83   fromBinding(0), event(0),
84   specifiedObject(target), specifiedProperty(propertyName)
85 {
86     if (property.isValid())
87         fromValue = property.read();
88 }
89
90
91 QDeclarative1ActionEvent::~QDeclarative1ActionEvent()
92 {
93 }
94
95 QString QDeclarative1ActionEvent::typeName() const
96 {
97     return QString();
98 }
99
100 void QDeclarative1ActionEvent::execute(Reason)
101 {
102 }
103
104 bool QDeclarative1ActionEvent::isReversable()
105 {
106     return false;
107 }
108
109 void QDeclarative1ActionEvent::reverse(Reason)
110 {
111 }
112
113 bool QDeclarative1ActionEvent::changesBindings()
114 {
115     return false;
116 }
117
118 void QDeclarative1ActionEvent::clearBindings()
119 {
120 }
121
122 bool QDeclarative1ActionEvent::override(QDeclarative1ActionEvent *other)
123 {
124     Q_UNUSED(other);
125     return false;
126 }
127
128 QDeclarative1StateOperation::QDeclarative1StateOperation(QObjectPrivate &dd, QObject *parent)
129     : QObject(dd, parent)
130 {
131 }
132
133 /*!
134     \qmlclass State QDeclarative1State
135     \inqmlmodule QtQuick 1
136     \ingroup qml-state-elements
137     \since QtQuick 1.0
138     \brief The State element defines configurations of objects and properties.
139
140     A \e state is a set of batched changes from the default configuration.
141
142     All items have a default state that defines the default configuration of objects
143     and property values. New states can be defined by adding State items to the \l {Item::states}{states} property to
144     allow items to switch between different configurations. These configurations
145     can, for example, be used to apply different sets of property values or execute
146     different scripts.
147
148     The following example displays a single \l Rectangle. In the default state, the rectangle
149     is colored black. In the "clicked" state, a PropertyChanges element changes the
150     rectangle's color to red. Clicking within the MouseArea toggles the rectangle's state
151     between the default state and the "clicked" state, thus toggling the color of the
152     rectangle between black and red.
153
154     \snippet doc/src/snippets/qtquick1/state.qml 0
155
156     Notice the default state is referred to using an empty string ("").
157
158     States are commonly used together with \l{QML Animation and Transitions}{Transitions} to provide
159     animations when state changes occur.
160
161     \note Setting the state of an object from within another state of the same object is
162     not allowed.
163
164     \sa {declarative/animation/states}{states example}, {qmlstates}{States},
165     {QML Animation and Transitions}{Transitions}, QtDeclarative
166 */
167 QDeclarative1State::QDeclarative1State(QObject *parent)
168 : QObject(*(new QDeclarative1StatePrivate), parent)
169 {
170     Q_D(QDeclarative1State);
171     d->transitionManager.setState(this);
172 }
173
174 QDeclarative1State::~QDeclarative1State()
175 {
176     Q_D(QDeclarative1State);
177     if (d->group)
178         d->group->removeState(this);
179 }
180
181 /*!
182     \qmlproperty string QtQuick1::State::name
183     This property holds the name of the state.
184
185     Each state should have a unique name within its item.
186 */
187 QString QDeclarative1State::name() const
188 {
189     Q_D(const QDeclarative1State);
190     return d->name;
191 }
192
193 void QDeclarative1State::setName(const QString &n)
194 {
195     Q_D(QDeclarative1State);
196     d->name = n;
197     d->named = true;
198 }
199
200 bool QDeclarative1State::isNamed() const
201 {
202     Q_D(const QDeclarative1State);
203     return d->named;
204 }
205
206 bool QDeclarative1State::isWhenKnown() const
207 {
208     Q_D(const QDeclarative1State);
209     return d->when != 0;
210 }
211
212 /*!
213     \qmlproperty bool QtQuick1::State::when
214     This property holds when the state should be applied.
215
216     This should be set to an expression that evaluates to \c true when you want the state to
217     be applied. For example, the following \l Rectangle changes in and out of the "hidden"
218     state when the \l MouseArea is pressed:
219
220     \snippet doc/src/snippets/qtquick1/state-when.qml 0
221
222     If multiple states in a group have \c when clauses that evaluate to \c true
223     at the same time, the first matching state will be applied. For example, in
224     the following snippet \c state1 will always be selected rather than
225     \c state2 when sharedCondition becomes \c true.
226     \qml
227     Item {
228         states: [
229             State { name: "state1"; when: sharedCondition },
230             State { name: "state2"; when: sharedCondition }
231         ]
232         // ...
233     }
234     \endqml
235 */
236 QDeclarativeBinding *QDeclarative1State::when() const
237 {
238     Q_D(const QDeclarative1State);
239     return d->when;
240 }
241
242 void QDeclarative1State::setWhen(QDeclarativeBinding *when)
243 {
244     Q_D(QDeclarative1State);
245     d->when = when;
246     if (d->group)
247         d->group->updateAutoState();
248 }
249
250 /*!
251     \qmlproperty string QtQuick1::State::extend
252     This property holds the state that this state extends.
253
254     When a state extends another state, it inherits all the changes of that state.
255
256     The state being extended is treated as the base state in regards to
257     the changes specified by the extending state.
258 */
259 QString QDeclarative1State::extends() const
260 {
261     Q_D(const QDeclarative1State);
262     return d->extends;
263 }
264
265 void QDeclarative1State::setExtends(const QString &extends)
266 {
267     Q_D(QDeclarative1State);
268     d->extends = extends;
269 }
270
271 /*!
272     \qmlproperty list<Change> QtQuick1::State::changes
273     This property holds the changes to apply for this state
274     \default
275
276     By default these changes are applied against the default state. If the state
277     extends another state, then the changes are applied against the state being
278     extended.
279 */
280 QDeclarativeListProperty<QDeclarative1StateOperation> QDeclarative1State::changes()
281 {
282     Q_D(QDeclarative1State);
283     return QDeclarativeListProperty<QDeclarative1StateOperation>(this, &d->operations, QDeclarative1StatePrivate::operations_append,
284                                               QDeclarative1StatePrivate::operations_count, QDeclarative1StatePrivate::operations_at,
285                                               QDeclarative1StatePrivate::operations_clear);
286 }
287
288 int QDeclarative1State::operationCount() const
289 {
290     Q_D(const QDeclarative1State);
291     return d->operations.count();
292 }
293
294 QDeclarative1StateOperation *QDeclarative1State::operationAt(int index) const
295 {
296     Q_D(const QDeclarative1State);
297     return d->operations.at(index);
298 }
299
300 QDeclarative1State &QDeclarative1State::operator<<(QDeclarative1StateOperation *op)
301 {
302     Q_D(QDeclarative1State);
303     d->operations.append(QDeclarative1StatePrivate::OperationGuard(op, &d->operations));
304     return *this;
305 }
306
307 void QDeclarative1StatePrivate::complete()
308 {
309     Q_Q(QDeclarative1State);
310
311     for (int ii = 0; ii < reverting.count(); ++ii) {
312         for (int jj = 0; jj < revertList.count(); ++jj) {
313             if (revertList.at(jj).property() == reverting.at(ii)) {
314                 revertList.removeAt(jj);
315                 break;
316             }
317         }
318     }
319     reverting.clear();
320
321     emit q->completed();
322 }
323
324 // Generate a list of actions for this state.  This includes coelescing state
325 // actions that this state "extends"
326 QDeclarative1StateOperation::ActionList
327 QDeclarative1StatePrivate::generateActionList(QDeclarative1StateGroup *group) const
328 {
329     QDeclarative1StateOperation::ActionList applyList;
330     if (inState)
331         return applyList;
332
333     // Prevent "extends" recursion
334     inState = true;
335
336     if (!extends.isEmpty()) {
337         QList<QDeclarative1State *> states = group->states();
338         for (int ii = 0; ii < states.count(); ++ii)
339             if (states.at(ii)->name() == extends) {
340                 qmlExecuteDeferred(states.at(ii));
341                 applyList = static_cast<QDeclarative1StatePrivate*>(states.at(ii)->d_func())->generateActionList(group);
342             }
343     }
344
345     foreach(QDeclarative1StateOperation *op, operations)
346         applyList << op->actions();
347
348     inState = false;
349     return applyList;
350 }
351
352 QDeclarative1StateGroup *QDeclarative1State::stateGroup() const
353 {
354     Q_D(const QDeclarative1State);
355     return d->group;
356 }
357
358 void QDeclarative1State::setStateGroup(QDeclarative1StateGroup *group)
359 {
360     Q_D(QDeclarative1State);
361     d->group = group;
362 }
363
364 void QDeclarative1State::cancel()
365 {
366     Q_D(QDeclarative1State);
367     d->transitionManager.cancel();
368 }
369
370 void QDeclarative1Action::deleteFromBinding()
371 {
372     if (fromBinding) {
373         QDeclarativePropertyPrivate::setBinding(property, 0);
374         fromBinding->destroy();
375         fromBinding = 0;
376     }
377 }
378
379 bool QDeclarative1State::containsPropertyInRevertList(QObject *target, const QString &name) const
380 {
381     Q_D(const QDeclarative1State);
382
383     if (isStateActive()) {
384         QListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
385
386         while (revertListIterator.hasNext()) {
387             const QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
388             if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
389                 return true;
390         }
391     }
392
393     return false;
394 }
395
396 bool QDeclarative1State::changeValueInRevertList(QObject *target, const QString &name, const QVariant &revertValue)
397 {
398     Q_D(QDeclarative1State);
399
400     if (isStateActive()) {
401         QMutableListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
402
403         while (revertListIterator.hasNext()) {
404             QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
405             if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) {
406                     simpleAction.setValue(revertValue);
407                     return true;
408             }
409         }
410     }
411
412     return false;
413 }
414
415 bool QDeclarative1State::changeBindingInRevertList(QObject *target, const QString &name, QDeclarativeAbstractBinding *binding)
416 {
417     Q_D(QDeclarative1State);
418
419     if (isStateActive()) {
420         QMutableListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
421
422         while (revertListIterator.hasNext()) {
423             QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
424             if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name) {
425                 if (simpleAction.binding())
426                     simpleAction.binding()->destroy();
427
428                 simpleAction.setBinding(binding);
429                 return true;
430             }
431         }
432     }
433
434     return false;
435 }
436
437 bool QDeclarative1State::removeEntryFromRevertList(QObject *target, const QString &name)
438 {
439     Q_D(QDeclarative1State);
440
441     if (isStateActive()) {
442         QMutableListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
443
444         while (revertListIterator.hasNext()) {
445             QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
446             if (simpleAction.property().object() == target && simpleAction.property().name() == name) {
447                 QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
448                 if (oldBinding) {
449                     QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
450                     oldBinding->destroy();
451                 }
452
453                 simpleAction.property().write(simpleAction.value());
454                 if (simpleAction.binding())
455                     QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding());
456
457                 revertListIterator.remove();
458                 return true;
459             }
460         }
461     }
462
463     return false;
464 }
465
466 void QDeclarative1State::addEntryToRevertList(const QDeclarative1Action &action)
467 {
468     Q_D(QDeclarative1State);
469
470     QDeclarative1SimpleAction simpleAction(action);
471
472     d->revertList.append(simpleAction);
473 }
474
475 void QDeclarative1State::removeAllEntriesFromRevertList(QObject *target)
476 {
477      Q_D(QDeclarative1State);
478
479      if (isStateActive()) {
480          QMutableListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
481
482          while (revertListIterator.hasNext()) {
483              QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
484              if (simpleAction.property().object() == target) {
485                  QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
486                  if (oldBinding) {
487                      QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
488                      oldBinding->destroy();
489                  }
490
491                  simpleAction.property().write(simpleAction.value());
492                  if (simpleAction.binding())
493                      QDeclarativePropertyPrivate::setBinding(simpleAction.property(), simpleAction.binding());
494
495                  revertListIterator.remove();
496              }
497          }
498      }
499 }
500
501 void QDeclarative1State::addEntriesToRevertList(const QList<QDeclarative1Action> &actionList)
502 {
503     Q_D(QDeclarative1State);
504     if (isStateActive()) {
505         QList<QDeclarative1SimpleAction> simpleActionList;
506
507         QListIterator<QDeclarative1Action> actionListIterator(actionList);
508         while(actionListIterator.hasNext()) {
509             const QDeclarative1Action &action = actionListIterator.next();
510             QDeclarative1SimpleAction simpleAction(action);
511             action.property.write(action.toValue);
512             if (!action.toBinding.isNull()) {
513                 QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::binding(simpleAction.property());
514                 if (oldBinding)
515                     QDeclarativePropertyPrivate::setBinding(simpleAction.property(), 0);
516                 QDeclarativePropertyPrivate::setBinding(simpleAction.property(), action.toBinding.data(), QDeclarativePropertyPrivate::DontRemoveBinding);
517             }
518
519             simpleActionList.append(simpleAction);
520         }
521
522         d->revertList.append(simpleActionList);
523     }
524 }
525
526 QVariant QDeclarative1State::valueInRevertList(QObject *target, const QString &name) const
527 {
528     Q_D(const QDeclarative1State);
529
530     if (isStateActive()) {
531         QListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
532
533         while (revertListIterator.hasNext()) {
534             const QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
535             if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
536                 return simpleAction.value();
537         }
538     }
539
540     return QVariant();
541 }
542
543 QDeclarativeAbstractBinding *QDeclarative1State::bindingInRevertList(QObject *target, const QString &name) const
544 {
545     Q_D(const QDeclarative1State);
546
547     if (isStateActive()) {
548         QListIterator<QDeclarative1SimpleAction> revertListIterator(d->revertList);
549
550         while (revertListIterator.hasNext()) {
551             const QDeclarative1SimpleAction &simpleAction = revertListIterator.next();
552             if (simpleAction.specifiedObject() == target && simpleAction.specifiedProperty() == name)
553                 return simpleAction.binding();
554         }
555     }
556
557     return 0;
558 }
559
560 bool QDeclarative1State::isStateActive() const
561 {
562     return stateGroup() && stateGroup()->state() == name();
563 }
564
565 void QDeclarative1State::apply(QDeclarative1StateGroup *group, QDeclarative1Transition *trans, QDeclarative1State *revert)
566 {
567     Q_D(QDeclarative1State);
568
569     qmlExecuteDeferred(this);
570
571     cancel();
572     if (revert)
573         revert->cancel();
574     d->revertList.clear();
575     d->reverting.clear();
576
577     if (revert) {
578         QDeclarative1StatePrivate *revertPrivate =
579             static_cast<QDeclarative1StatePrivate*>(revert->d_func());
580         d->revertList = revertPrivate->revertList;
581         revertPrivate->revertList.clear();
582     }
583
584     // List of actions caused by this state
585     QDeclarative1StateOperation::ActionList applyList = d->generateActionList(group);
586
587     // List of actions that need to be reverted to roll back (just) this state
588     QDeclarative1StatePrivate::SimpleActionList additionalReverts;
589     // First add the reverse of all the applyList actions
590     for (int ii = 0; ii < applyList.count(); ++ii) {
591         QDeclarative1Action &action = applyList[ii];
592
593         if (action.event) {
594             if (!action.event->isReversable())
595                 continue;
596             bool found = false;
597             for (int jj = 0; jj < d->revertList.count(); ++jj) {
598                 QDeclarative1ActionEvent *event = d->revertList.at(jj).event();
599                 if (event && event->typeName() == action.event->typeName()) {
600                     if (action.event->override(event)) {
601                         found = true;
602
603                         if (action.event != d->revertList.at(jj).event() && action.event->needsCopy()) {
604                             action.event->copyOriginals(d->revertList.at(jj).event());
605
606                             QDeclarative1SimpleAction r(action);
607                             additionalReverts << r;
608                             d->revertList.removeAt(jj);
609                             --jj;
610                         } else if (action.event->isRewindable())    //###why needed?
611                             action.event->saveCurrentValues();
612
613                         break;
614                     }
615                 }
616             }
617             if (!found) {
618                 action.event->saveOriginals();
619                 // Only need to revert the applyList action if the previous
620                 // state doesn't have a higher priority revert already
621                 QDeclarative1SimpleAction r(action);
622                 additionalReverts << r;
623             }
624         } else {
625             bool found = false;
626             action.fromBinding = QDeclarativePropertyPrivate::binding(action.property);
627
628             for (int jj = 0; jj < d->revertList.count(); ++jj) {
629                 if (d->revertList.at(jj).property() == action.property) {
630                     found = true;
631                     if (d->revertList.at(jj).binding() != action.fromBinding) {
632                         action.deleteFromBinding();
633                     }
634                     break;
635                 }
636             }
637
638             if (!found) {
639                 if (!action.restore) {
640                     action.deleteFromBinding();;
641                 } else {
642                     // Only need to revert the applyList action if the previous
643                     // state doesn't have a higher priority revert already
644                     QDeclarative1SimpleAction r(action);
645                     additionalReverts << r;
646                 }
647             }
648         }
649     }
650
651     // Any reverts from a previous state that aren't carried forth
652     // into this state need to be translated into apply actions
653     for (int ii = 0; ii < d->revertList.count(); ++ii) {
654         bool found = false;
655         if (d->revertList.at(ii).event()) {
656             QDeclarative1ActionEvent *event = d->revertList.at(ii).event();
657             if (!event->isReversable())
658                 continue;
659             for (int jj = 0; !found && jj < applyList.count(); ++jj) {
660                 const QDeclarative1Action &action = applyList.at(jj);
661                 if (action.event && action.event->typeName() == event->typeName()) {
662                     if (action.event->override(event))
663                         found = true;
664                 }
665             }
666         } else {
667             for (int jj = 0; !found && jj < applyList.count(); ++jj) {
668                 const QDeclarative1Action &action = applyList.at(jj);
669                 if (action.property == d->revertList.at(ii).property())
670                     found = true;
671             }
672         }
673         if (!found) {
674             QVariant cur = d->revertList.at(ii).property().read();
675             QDeclarativeAbstractBinding *delBinding = 
676                 QDeclarativePropertyPrivate::setBinding(d->revertList.at(ii).property(), 0);
677             if (delBinding)
678                 delBinding->destroy();
679
680             QDeclarative1Action a;
681             a.property = d->revertList.at(ii).property();
682             a.fromValue = cur;
683             a.toValue = d->revertList.at(ii).value();
684             a.toBinding = QDeclarativeAbstractBinding::getPointer(d->revertList.at(ii).binding());
685             a.specifiedObject = d->revertList.at(ii).specifiedObject();
686             a.specifiedProperty = d->revertList.at(ii).specifiedProperty();
687             a.event = d->revertList.at(ii).event();
688             a.reverseEvent = d->revertList.at(ii).reverseEvent();
689             if (a.event && a.event->isRewindable())
690                 a.event->saveCurrentValues();
691             applyList << a;
692             // Store these special reverts in the reverting list
693             d->reverting << d->revertList.at(ii).property();
694         }
695     }
696     // All the local reverts now become part of the ongoing revertList
697     d->revertList << additionalReverts;
698
699 #ifndef QT_NO_DEBUG_STREAM
700     // Output for debugging
701     if (stateChangeDebug()) {
702         foreach(const QDeclarative1Action &action, applyList) {
703             if (action.event)
704                 qWarning() << "    QDeclarative1Action event:" << action.event->typeName();
705             else
706                 qWarning() << "    QDeclarative1Action:" << action.property.object()
707                            << action.property.name() << "From:" << action.fromValue 
708                            << "To:" << action.toValue;
709         }
710     }
711 #endif
712
713     d->transitionManager.transition(applyList, trans);
714 }
715
716 QDeclarative1StateOperation::ActionList QDeclarative1StateOperation::actions()
717 {
718     return ActionList();
719 }
720
721 QDeclarative1State *QDeclarative1StateOperation::state() const
722 {
723     Q_D(const QDeclarative1StateOperation);
724     return d->m_state;
725 }
726
727 void QDeclarative1StateOperation::setState(QDeclarative1State *state)
728 {
729     Q_D(QDeclarative1StateOperation);
730     d->m_state = state;
731 }
732
733
734
735 QT_END_NAMESPACE