~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to libs/plasma/widgets/layoutanimator.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-11 14:04:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071011140448-v0eb7lxbb24zagca
Tags: 3.94.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 *
45
45
 * animator->setTimeLine(timeLine);
46
46
 * animator->setEffect( LayoutAnimator::InsertedState , LayoutAnimator::FadeInMoveEffect );
47
 
 * animator->setEffect( LayoutAnimator::NormalState , LayoutAnimator::MoveEffect );
 
47
 * animator->setEffect( LayoutAnimator::StandardState , LayoutAnimator::MoveEffect );
48
48
 * animator->setEffect( LayoutAnimator::RemovedState , LayoutAnimator::FadeOutMoveEffect );
49
49
 * myLayout->setAnimator(animator);
50
50
 *
69
69
        /** 
70
70
         * State for an item which has recently been added to a layout. 
71
71
         * When the animation completes, the item's state will change to
72
 
         * NormalState 
 
72
         * StandardState 
73
73
         */
74
74
        InsertedState,
75
75
        /** 
77
77
         * Items will remain in this state until it is explicitly changed
78
78
         * via setCurrentState()
79
79
         */
80
 
        NormalState,
 
80
        StandardState,
81
81
        /** 
82
 
         * State for an item which is being removed from a layout. 
 
82
         * State for an item which is currently being removed from a layout. 
83
83
         * When the animation completes, the item will be removed from the 
84
84
         * animator and its state will be undefined. 
85
85
         */
86
 
        RemovedState
 
86
        RemovedState,
 
87
        /**
 
88
         * State for an item whoose geometry is not managed by the animator.
 
89
         *
 
90
         * All LayoutItems are initially in this state and are moved into a 
 
91
         * different state ( usually InsertedState ) by calling
 
92
         * setCurrentState( item , state )
 
93
         *
 
94
         * An item transitions into this state when the animation completes
 
95
         * whilst the item is in RemovedState
 
96
         */
 
97
        DeadState
87
98
    };
88
99
 
89
100
    /** 
146
157
    /** 
147
158
     * Sets the new geometry for a layout item.  
148
159
     * The item will animate from its current geometry to @p geometry, using
149
 
     * the effect specified in setEffect() 
 
160
     * the effect specified in setEffect() for the state currently associated
 
161
     * with @p item 
150
162
     */
151
163
    virtual void setGeometry( LayoutItem* item , const QRectF& geometry );
152
164
 
159
171
    /** Returns the QTimeLine used by this animator. */
160
172
    QTimeLine* timeLine() const;
161
173
 
 
174
    /** 
 
175
     * Convenience feature which causes LayoutItems and their associated
 
176
     * QGraphicsItems to be automatically deleted when their removal 
 
177
     * animation finishes.
 
178
     *
 
179
     * The default is false.
 
180
     */
 
181
    void setAutoDeleteOnRemoval(bool autoDelete);
 
182
    /** See setAutoDeleteOnRemoval() */
 
183
    bool autoDeleteOnRemoval() const;
 
184
 
 
185
Q_SIGNALS:
 
186
    /** This signal is emitted when the state of an item in the animator changes. */
 
187
    void stateChanged( LayoutItem *item , State oldState , State newState );
 
188
 
162
189
protected:
163
190
    virtual void updateItem( qreal value , LayoutItem* item );
164
191
 
165
 
private slots:
 
192
private Q_SLOTS:
166
193
    void valueChanged(qreal value);
167
 
    
 
194
    void animationCompleted();
 
195
    void itemAutoDeleter( LayoutItem *item , State oldState , State newState );
 
196
 
168
197
private:
169
198
    void moveEffectUpdateItem(qreal value,LayoutItem* item,Effect effect);
170
199
    void noEffectUpdateItem(qreal value,LayoutItem* item);