36
|
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: Stub test class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// Version : %version: %
|
|
19 |
|
|
20 |
#include "stub/inc/mpxviewpluginqt.h"
|
|
21 |
|
|
22 |
class TestViewPlugin : public MpxViewPlugin
|
|
23 |
{
|
|
24 |
Q_OBJECT
|
|
25 |
|
|
26 |
public:
|
|
27 |
TestViewPlugin();
|
|
28 |
~TestViewPlugin();
|
|
29 |
|
|
30 |
/**
|
|
31 |
* createView is the second operation (after plugin construction which is done somewhere
|
|
32 |
* in the plugin framework) executed in the application layer to make a fully operational
|
|
33 |
* View Plugin descendant.
|
|
34 |
* I should allocate all of those resources that are required by plugin, but which are
|
|
35 |
* too expensive to allocate in constructor (eg. in case of plugin prefetching).
|
|
36 |
*/
|
|
37 |
virtual void createView();
|
|
38 |
|
|
39 |
/**
|
|
40 |
* destroyView is an operation that should be executed just before plugin deletion.
|
|
41 |
* Implementation should destroy all of resources allocated during createView execution.
|
|
42 |
* It's reason d'etre is based on a fact, that application doesn't controll when exactly
|
|
43 |
* plugin will be deleted, so destructor execution could be postponed still holding resources.
|
|
44 |
*/
|
|
45 |
virtual void destroyView();
|
|
46 |
|
|
47 |
/* COMMENT:
|
|
48 |
* view activation and deactivation are reversible operations
|
|
49 |
* that allows us to give up resources that we could temporary deallocate when that
|
|
50 |
* specific view plugin goes into background.
|
|
51 |
*/
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Called to notice view activation.
|
|
55 |
*/
|
|
56 |
virtual void activateView();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Called to notice view deactivation.
|
|
60 |
*/
|
|
61 |
virtual void deactivateView();
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Is active.
|
|
65 |
*/
|
|
66 |
virtual bool activated();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* gives actual view component, ready to put somewhere into the app layout.
|
|
70 |
* However, beware that calling to activate/deactivate in the meantime
|
|
71 |
* can invalidate that pointer.
|
|
72 |
*
|
|
73 |
* NOTE: Returned type is choosen to be as generic as possible,
|
|
74 |
* so please ensure that it fulfills all your needs (it was HbView* before)
|
|
75 |
*/
|
|
76 |
virtual QGraphicsWidget* getView();
|
|
77 |
|
|
78 |
|
|
79 |
virtual MpxViewPlugin* viewPlugin();
|
|
80 |
|
|
81 |
public slots:
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Signalled by application when orientation has changed.
|
|
85 |
*/
|
|
86 |
virtual void orientationChange(Qt::Orientation orientation);
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Implementation should take care either to implement
|
|
90 |
* go-back operation internally or to emit proper
|
|
91 |
* command signal to delegate that responsibility to
|
|
92 |
* framework (eg. to switch to previous view).
|
|
93 |
*/
|
|
94 |
virtual void back();
|
|
95 |
|
|
96 |
private:
|
|
97 |
|
|
98 |
bool mActive;
|
|
99 |
};
|
|
100 |
|