34
|
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: Widget extension adapter
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __XNWIDGETEXTENSIONADAPTER_H__
|
|
19 |
#define __XNWIDGETEXTENSIONADAPTER_H__
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
// User includes
|
|
25 |
#include "xncontroladapter.h"
|
|
26 |
#include "xnuistatelistener.h"
|
|
27 |
|
|
28 |
// Forward declarations
|
|
29 |
class CXnAppUiAdapter;
|
|
30 |
class CXnNode;
|
|
31 |
class CXnUiEngine;
|
|
32 |
|
|
33 |
// CLASS DECLARATION
|
|
34 |
|
|
35 |
/**
|
|
36 |
* @ingroup group_xnlayoutengine
|
|
37 |
* Popup Control adapter interface class
|
|
38 |
* @lib xnlayoutengine.lib
|
|
39 |
* @since Series 60 5.0
|
|
40 |
*/
|
|
41 |
NONSHARABLE_CLASS( CXnWidgetExtensionAdapter ) : public CXnControlAdapter,
|
|
42 |
public MXnUiStateObserver,
|
|
43 |
public MXnUiResourceChangeObserver
|
|
44 |
{
|
|
45 |
public: // Constructors and destructor
|
|
46 |
|
|
47 |
enum TPositionHint
|
|
48 |
{
|
|
49 |
ENone,
|
|
50 |
EAboveLeft,
|
|
51 |
EAboveRight,
|
|
52 |
EBelowLeft,
|
|
53 |
EBelowRight,
|
|
54 |
ELeft,
|
|
55 |
ERight
|
|
56 |
};
|
|
57 |
/**
|
|
58 |
* Two-phased constructor.
|
|
59 |
*/
|
|
60 |
static CXnWidgetExtensionAdapter* NewL( CXnNodePluginIf& aNode );
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Destructor.
|
|
64 |
*/
|
|
65 |
~CXnWidgetExtensionAdapter();
|
|
66 |
public:
|
|
67 |
/**
|
|
68 |
* From CCoeAppUiBase.
|
|
69 |
* Informs the components about the screen layout switch.
|
|
70 |
*/
|
|
71 |
void HandleScreenDeviceChangedL();
|
|
72 |
|
|
73 |
|
|
74 |
private:
|
|
75 |
// Functions from base classes
|
|
76 |
/**
|
|
77 |
* @see CCoeControl documentation
|
|
78 |
*/
|
|
79 |
void MakeVisible( TBool aVisible );
|
|
80 |
|
|
81 |
/**
|
|
82 |
* see CCoeControl
|
|
83 |
*/
|
|
84 |
void HandlePointerEventL( const TPointerEvent& aPointerEvent );
|
|
85 |
|
|
86 |
/**
|
|
87 |
* see CCoeControl
|
|
88 |
*/
|
|
89 |
void Draw( const TRect& aRect ) const;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* From CCoeControl.
|
|
93 |
* Size change notification
|
|
94 |
*/
|
|
95 |
void SizeChanged();
|
|
96 |
|
|
97 |
private:
|
|
98 |
// from MXnUiStateObserver
|
|
99 |
|
|
100 |
/**
|
|
101 |
* @see MXnUiStateObserver
|
|
102 |
*/
|
|
103 |
void NotifyForegroundChanged( TForegroundStatus aStatus );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* @see MXnUiStateObserver
|
|
107 |
*/
|
|
108 |
void NotifyLightStatusChanged( TBool aLightsOn );
|
|
109 |
|
|
110 |
/**
|
|
111 |
* @see MXnUiStateObserver
|
|
112 |
*/
|
|
113 |
void NotifyInCallStateChaged( TBool aInCall );
|
|
114 |
|
|
115 |
private:
|
|
116 |
// from MXnUiResourceChangeObserver
|
|
117 |
|
|
118 |
/**
|
|
119 |
* @see MXnUiResourceChangeObserver
|
|
120 |
*/
|
|
121 |
void NotifyStatusPaneSizeChanged();
|
|
122 |
|
|
123 |
/**
|
|
124 |
* @see MXnUiResourceChangeObserver
|
|
125 |
*/
|
|
126 |
void NotifyResourceChanged( TInt aType );
|
|
127 |
|
|
128 |
private:
|
|
129 |
// Constructors
|
|
130 |
/**
|
|
131 |
* C++ default constructor.
|
|
132 |
*/
|
|
133 |
CXnWidgetExtensionAdapter( CXnNodePluginIf& aNode );
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Two-phased constructor.
|
|
137 |
*/
|
|
138 |
void ConstructL();
|
|
139 |
|
|
140 |
private:
|
|
141 |
// New functions
|
|
142 |
|
|
143 |
void HidePopupL();
|
|
144 |
|
|
145 |
void ChangePopupPosition();
|
|
146 |
|
|
147 |
void CalculatePosition();
|
|
148 |
|
|
149 |
private:
|
|
150 |
// Data
|
|
151 |
|
|
152 |
/** UiEngine, not owned */
|
|
153 |
CXnUiEngine* iUiEngine;
|
|
154 |
/** Position hint */
|
|
155 |
TPositionHint iPositionHint;
|
|
156 |
/** Node, not owned */
|
|
157 |
CXnNodePluginIf& iNode;
|
|
158 |
/** AppUi, not owned */
|
|
159 |
CXnAppUiAdapter* iAppUiAdapter;
|
|
160 |
/** Flag to indicate whether <popup> is permanent */
|
|
161 |
TBool iPermanent;
|
|
162 |
/** Is popup element */
|
|
163 |
TBool iPopup;
|
|
164 |
};
|
|
165 |
|
|
166 |
#endif // __XNWIDGETEXTENSIONADAPTER_H__
|
|
167 |
|
|
168 |
// End of File
|