|
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: QMpxHbVideoPlaybackViewPlugin |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 6 % |
|
19 |
|
20 |
|
21 |
|
22 #include <QtGui> |
|
23 #include <hbview.h> |
|
24 #include <xqplugin.h> |
|
25 #include <hbinstance.h> |
|
26 |
|
27 #include "mpxvideo_debug.h" |
|
28 #include "hbvideoplaybackview.h" |
|
29 #include "mpxhbvideocommondefs.h" |
|
30 #include "mpxhbvideoplaybackviewplugin.h" |
|
31 |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // Constructor |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 QMpxHbVideoPlaybackViewPlugin::QMpxHbVideoPlaybackViewPlugin() |
|
38 : mView( NULL ) |
|
39 , mViewActivated ( false ) |
|
40 { |
|
41 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::QMpxHbVideoPlaybackViewPlugin()")); |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // Destructor |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 QMpxHbVideoPlaybackViewPlugin::~QMpxHbVideoPlaybackViewPlugin() |
|
49 { |
|
50 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::~QMpxHbVideoPlaybackViewPlugin()")); |
|
51 destroyView(); |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // Create view |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 void QMpxHbVideoPlaybackViewPlugin::createView() |
|
59 { |
|
60 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::createView()")); |
|
61 |
|
62 mView = new HbVideoPlaybackView(); |
|
63 connect( mView, SIGNAL( activatePreviousView() ), this, SLOT( back() ) ); |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // Destroy view |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 void QMpxHbVideoPlaybackViewPlugin::destroyView() |
|
71 { |
|
72 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::destroyView()")); |
|
73 |
|
74 if ( mView ) |
|
75 { |
|
76 delete mView; |
|
77 mView = NULL; |
|
78 } |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // Activate view |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 void QMpxHbVideoPlaybackViewPlugin::activateView() |
|
86 { |
|
87 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::activateView()")); |
|
88 |
|
89 if ( mView && !mViewActivated ) |
|
90 { |
|
91 mView->handleActivateView(); |
|
92 mViewActivated = true; |
|
93 } |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // Deactivate view |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void QMpxHbVideoPlaybackViewPlugin::deactivateView() |
|
101 { |
|
102 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::deactivateView()")); |
|
103 |
|
104 mView->handleDeactivateView(); |
|
105 mViewActivated = false; |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // Get view |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 QGraphicsWidget* QMpxHbVideoPlaybackViewPlugin::getView() |
|
113 { |
|
114 return mView; |
|
115 } |
|
116 |
|
117 // --------------------------------------------------------------------------- |
|
118 // QMpxHbVideoPlaybackViewPlugin::orientationChange |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 void QMpxHbVideoPlaybackViewPlugin::orientationChange( Qt::Orientation orientation ) |
|
122 { |
|
123 Q_UNUSED( orientation ); |
|
124 } |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // QMpxHbVideoPlaybackViewPlugin::back |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 void QMpxHbVideoPlaybackViewPlugin::back() |
|
131 { |
|
132 MPX_ENTER_EXIT(_L("QMpxHbVideoPlaybackViewPlugin::back()")); |
|
133 |
|
134 emit command( MpxHbVideoCommon::CollectionView ); |
|
135 } |
|
136 |
|
137 XQ_EXPORT_PLUGIN2( hbvideoplaybackviewplugin, QMpxHbVideoPlaybackViewPlugin ); |
|
138 |
|
139 // End of File |