85
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Base class for all bagets.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef BAGET_H
|
|
19 |
#define BAGET_H
|
|
20 |
|
|
21 |
#include <QGraphicsWidget>
|
|
22 |
|
|
23 |
#include "bagetmodel_global.h"
|
|
24 |
|
|
25 |
enum BagetState
|
|
26 |
{
|
|
27 |
BagetStateConstructed = 0,
|
|
28 |
BagetStateRunning,
|
|
29 |
BagetStateSuspended,
|
|
30 |
BagetStateStopped
|
|
31 |
};
|
|
32 |
|
|
33 |
class BagetPrivate;
|
|
34 |
|
|
35 |
class BAGETMODEL_EXPORT Baget : public QGraphicsWidget
|
|
36 |
{
|
|
37 |
Q_OBJECT
|
|
38 |
|
|
39 |
public:
|
|
40 |
|
|
41 |
Baget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
|
|
42 |
virtual ~Baget();
|
|
43 |
|
|
44 |
BagetState currentState();
|
|
45 |
|
|
46 |
public slots:
|
|
47 |
|
|
48 |
void start();
|
|
49 |
void stop();
|
|
50 |
void resume();
|
|
51 |
void suspend();
|
|
52 |
|
|
53 |
signals:
|
|
54 |
|
|
55 |
void faulted();
|
|
56 |
|
|
57 |
protected:
|
|
58 |
|
|
59 |
virtual bool onStart() = 0;
|
|
60 |
virtual bool onStop() = 0;
|
|
61 |
virtual bool onResume();
|
|
62 |
virtual bool onSuspend();
|
|
63 |
|
|
64 |
private:
|
|
65 |
|
|
66 |
Q_DISABLE_COPY(Baget)
|
|
67 |
|
|
68 |
private:
|
|
69 |
|
|
70 |
BagetPrivate * const m_d;
|
|
71 |
friend class BagetPrivate;
|
|
72 |
|
|
73 |
};
|
|
74 |
|
|
75 |
#endif // BAGET_H
|