GraphicsEffectItem.h 3.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
/*****************************************************************************
 * GraphicsEffectItem.h: Represent an effect in the timeline.
 *****************************************************************************
 * Copyright (C) 2008-2010 VideoLAN
 *
 * Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef GRAPHICSEFFECTITEM_H
#define GRAPHICSEFFECTITEM_H

#include "AbstractGraphicsItem.h"
#include "EffectsEngine.h"

class   QUuid;

class GraphicsEffectItem : public AbstractGraphicsItem
{
    public:
        enum { Type = UserType + 3 };
        GraphicsEffectItem( Effect *effect );
36
        GraphicsEffectItem( EffectHelper *helper );
37 38 39 40 41 42 43 44

        virtual const QUuid&        uuid() const;
        virtual int                 type() const;
        virtual bool                expandable() const;
        virtual bool                moveable() const;
        virtual void                paint( QPainter *painter, const QStyleOptionGraphicsItem *option,
                                           QWidget *widget );
        virtual Workflow::TrackType trackType() const;
45
        EffectHelper*               effectHelper();
46 47
        virtual qint64              begin() const;
        virtual qint64              end() const;
48 49 50
        virtual Workflow::Helper    *helper();
        virtual void                triggerMove(TrackWorkflow *oldTrack, TrackWorkflow *newTrack,
                                                Workflow::Helper *helper, qint64 pos);
51 52
        virtual void                triggerResize( TrackWorkflow *tw, Workflow::Helper *helper,
                                           qint64 newBegin, qint64 newEnd, qint64 pos );
53
        virtual qint64              itemHeight() const;
54 55
        virtual qint32              zSelected() const;
        virtual qint32              zNotSelected() const;
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
    protected:
        virtual bool                hasResizeBoundaries() const;
        /**
         * \brief Paint the item's rectangle.
         * \param painter Pointer to a QPainter.
         * \param option Painting options.
         */
        void                paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option );
        /**
         * \brief Paint the item's title.
         * \param painter Pointer to a QPainter.
         * \param option Painting options.
         */
        void                paintTitle( QPainter* painter, const QStyleOptionGraphicsItem* option );

    private:
        Effect                      *m_effect;
73
        EffectHelper                *m_effectHelper;
74 75 76
};

#endif // GRAPHICSEFFECTITEM_H