Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / inc / MafwGstRendererHaltState.h
1 /*
2  * This file is part of QMAFW
3  *
4  * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights
5  * reserved.
6  *
7  * Contact: Visa Smolander <visa.smolander@nokia.com>
8  *
9  * This software, including documentation, is protected by copyright controlled
10  * by Nokia Corporation. All rights are reserved. Copying, including
11  * reproducing, storing, adapting or translating, any or all of this material
12  * requires the prior written consent of Nokia Corporation. This material also
13  * contains confidential information which may not be disclosed to others
14  * without the prior written consent of Nokia.
15  *
16  */
17
18 #ifndef MAFWGSTRENDERERHALTSTATE_H
19 #define MAFWGSTRENDERERHALTSTATE_H
20
21 #include <MafwRenderer.h>
22
23 #include <QTimer>
24
25 class MafwGstRendererHaltState : public QObject
26 {
27     Q_OBJECT
28 public:
29     static int DECAY_TIME;
30 public:
31     MafwGstRendererHaltState();
32     MafwGstRendererHaltState(const QString &uri, MafwRenderer::State state, int position);
33     ~MafwGstRendererHaltState();
34
35     /**
36      * Assigns other halt state to this object, also resets the decay timer.
37      */
38     MafwGstRendererHaltState(const MafwGstRendererHaltState &other);
39
40     /**
41      * Assigns other halt state to this object, also resets the decay timer.
42      */
43     MafwGstRendererHaltState& operator =(const MafwGstRendererHaltState &other);
44
45
46     /**
47      * Set new renderer state for halt state, user pressed pause etc
48      * @param  newState, if newState is MafwRenderer::Paused the decay time is paused also
49      */
50     void setState(MafwRenderer::State newState);
51
52     /**
53      * Is the halt state valid? Not decayed and contains relevenat information
54      */
55     bool isSet() const;
56
57     /**
58      * Clears the halt state from any valid content, also stop the decay timer
59      */
60     void clear();
61
62     QString uri() const;
63     MafwRenderer::State state() const;
64     int position() const;
65
66 Q_SIGNALS:
67     /**
68      * This signal is emitted when the MafwGstRendererHaltState::DECAY_TIME has passed
69      * from object creation or when valid parameters were assigned to it.
70      */
71     void decayed();
72
73 private:
74     void initializeDecayTimer();
75
76 private:
77     QString m_uri;
78     MafwRenderer::State m_state;
79     int m_position;
80     QTimer m_decayTimer;
81 };
82
83 #endif // MAFWGSTRENDERERHALTSTATE_H