|
1 /* |
|
2 * Copyright (c) 2008 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: Qt Mpx blank view plugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <QtGui> |
|
21 #include <QTimer> |
|
22 |
|
23 #include <hbview.h> |
|
24 #include <hblabel.h> |
|
25 //#include <hbgridlayout.h> |
|
26 #include <hbtoolbutton.h> |
|
27 #include <hbaction.h> |
|
28 #include <qgraphicsgridlayout.h> |
|
29 #include <hbpushbutton.h> |
|
30 #include <glxstatemanager.h> |
|
31 #include <qplugin2.h> |
|
32 #include "glxexternalviewplugin.h" |
|
33 #include <glxplugincommandid.hrh> |
|
34 |
|
35 GlxExternalViewPlugin::GlxExternalViewPlugin() : iView( NULL ), |
|
36 collectionButton( NULL ), |
|
37 imageButton( NULL ), |
|
38 iLayout ( NULL ) |
|
39 { |
|
40 qDebug("GlxExternalViewPlugin::GlxExternalViewPlugin"); |
|
41 QObject::connect(&mStateMgr, SIGNAL(externalCommand(int )), this, SLOT(externalCommand(int )) ); |
|
42 } |
|
43 |
|
44 GlxExternalViewPlugin::~GlxExternalViewPlugin() |
|
45 { |
|
46 qDebug("GlxExternalViewPlugin::~GlxExternalViewPlugin"); |
|
47 if( iView ){ |
|
48 delete iView; |
|
49 } |
|
50 } |
|
51 |
|
52 QGraphicsWidget* GlxExternalViewPlugin::getView() |
|
53 { |
|
54 qDebug("GlxExternalViewPlugin::getView"); |
|
55 if( !iView ){ |
|
56 iView = new HbView(); |
|
57 } |
|
58 return iView; |
|
59 } |
|
60 |
|
61 void GlxExternalViewPlugin::destroyView() |
|
62 { |
|
63 qDebug("GlxExternalViewPlugin::destroyView"); |
|
64 } |
|
65 |
|
66 void GlxExternalViewPlugin::activateView() |
|
67 { |
|
68 qDebug("GlxExternalViewPlugin::activateView"); |
|
69 mStateMgr.launchFromExternal(); |
|
70 |
|
71 } |
|
72 |
|
73 void GlxExternalViewPlugin::deactivateView() |
|
74 { |
|
75 qDebug("GlxExternalViewPlugin::deactivateView"); |
|
76 mStateMgr.cleanupExternal(); |
|
77 } |
|
78 |
|
79 void GlxExternalViewPlugin::externalCommand(int cmdId) |
|
80 { |
|
81 qDebug("GlxExternalViewPlugin::externalCommand"); |
|
82 emit command( cmdId ); |
|
83 } |
|
84 |
|
85 void GlxExternalViewPlugin::orientationChange( Qt::Orientation /*orientation*/ ) |
|
86 { |
|
87 qDebug("GlxExternalViewPlugin::orientationChange"); |
|
88 |
|
89 } |
|
90 |
|
91 |
|
92 Q_EXPORT_PLUGIN3( GlxExternalViewPlugin, GlxExternalViewPlugin ); |