37
|
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: Interface to HbDocumentLoader (DocML files).
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef BUBBLEWIDGETMANAGER_H
|
|
19 |
#define BUBBLEWIDGETMANAGER_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QMap>
|
|
23 |
|
|
24 |
class QGraphicsWidget;
|
|
25 |
class BubbleDocumentLoader;
|
|
26 |
class BubbleHandler;
|
|
27 |
class BubbleImageManager;
|
|
28 |
|
|
29 |
class BubbleWidgetManager : public QObject
|
|
30 |
{
|
|
31 |
Q_OBJECT
|
|
32 |
|
|
33 |
public:
|
|
34 |
enum View
|
|
35 |
{
|
|
36 |
SingleCallView,
|
|
37 |
TwoCallsView,
|
|
38 |
ThreeCallsView,
|
|
39 |
ConferenceView,
|
|
40 |
MutedOverlay
|
|
41 |
};
|
|
42 |
|
|
43 |
enum Container
|
|
44 |
{
|
|
45 |
None,
|
|
46 |
ExpandedBubble,
|
|
47 |
CollapsedBubble, // top most when 2 calls
|
|
48 |
CollapsedBubble2 // top most when 3 calls
|
|
49 |
};
|
|
50 |
|
|
51 |
enum Widget
|
|
52 |
{
|
|
53 |
Heading,
|
|
54 |
Image,
|
|
55 |
LeftButton,
|
|
56 |
CenterButton,
|
|
57 |
RightButton,
|
|
58 |
ConferenceTimer,
|
|
59 |
ParticipantList,
|
|
60 |
ParticipantListItem,
|
|
61 |
ParticipantListButton,
|
|
62 |
MutedIcon
|
|
63 |
};
|
|
64 |
|
|
65 |
public:
|
|
66 |
BubbleWidgetManager(
|
|
67 |
BubbleImageManager& imageManager,
|
|
68 |
QObject* parent=0);
|
|
69 |
virtual ~BubbleWidgetManager();
|
|
70 |
|
|
71 |
QGraphicsWidget* view(View view);
|
|
72 |
|
|
73 |
void releaseView(View view);
|
|
74 |
|
|
75 |
QGraphicsWidget* container(View view,
|
|
76 |
Container container) const;
|
|
77 |
|
|
78 |
QGraphicsWidget* widget(View view,
|
|
79 |
Container container,
|
|
80 |
Widget widget) const;
|
|
81 |
|
|
82 |
QList<BubbleHandler*>* handlers(QGraphicsWidget* widget) const;
|
|
83 |
|
|
84 |
QGraphicsWidget* createParticipantListItem();
|
|
85 |
|
|
86 |
public slots:
|
|
87 |
void handleOrientationChange(Qt::Orientation orientation);
|
|
88 |
|
|
89 |
private:
|
|
90 |
QGraphicsWidget* loadDocument(View view, Qt::Orientation orientation);
|
|
91 |
void createDocumentHandlers(View view);
|
|
92 |
void applyCustomStyles(View view);
|
|
93 |
void setButtonStyle(Widget widget, QGraphicsWidget* button);
|
|
94 |
void setBackground(QGraphicsWidget* widget);
|
|
95 |
|
|
96 |
private:
|
|
97 |
BubbleImageManager& mImageManager;
|
|
98 |
Qt::Orientation mOrientation;
|
|
99 |
QMap<int,BubbleDocumentLoader*> mDocumentLoaders;
|
|
100 |
QMap<int,QList<BubbleHandler*>*> mDocumentHandlers;
|
|
101 |
QMap<int,QGraphicsWidget*> mDocumentContent;
|
|
102 |
|
|
103 |
QMap<int,QString> mFileNames;
|
|
104 |
QMap<int,QString> mContainerName;
|
|
105 |
QMap<int,QString> mWidgetPrefix;
|
|
106 |
QMap<int,QString> mWidgetName;
|
|
107 |
QMap<int,QString> mOrientationName;
|
|
108 |
};
|
|
109 |
|
|
110 |
#endif // BUBBLEWIDGETMANAGER_H
|