18
|
1 |
/*
|
|
2 |
* Copyright (c) 2005 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: SVGScreenSaver provides an implementation of ScreenSaverPlugin
|
|
15 |
* for Svg files.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef SVGSCREENSAVER_H
|
|
21 |
#define SVGSCREENSAVER_H
|
|
22 |
|
|
23 |
#include <coecntrl.h>
|
|
24 |
#include <pluginadapterinterface.h>
|
|
25 |
#include <SVGTAppObserver.h>
|
|
26 |
#include <NPNExtensions.h>
|
|
27 |
|
|
28 |
const TInt KMaxFileSize=10000;
|
|
29 |
class CSVGTCustControl;
|
|
30 |
class CEikonEnv;
|
|
31 |
|
|
32 |
|
|
33 |
/**
|
|
34 |
* CSvgScreenSaver provides an implementation of MSvgtAppObserver
|
|
35 |
* It makes use of RenderFrames Control or SVGTCustControl to render
|
|
36 |
* the SVGT content.
|
|
37 |
* @lib SVGTScreenSaverPlugin.lib
|
|
38 |
* @since 3.1
|
|
39 |
*/
|
|
40 |
class CSvgScreenSaver: public CBase,
|
|
41 |
public MSvgtAppObserver,
|
|
42 |
public MPluginNotifier
|
|
43 |
{
|
|
44 |
|
|
45 |
public:
|
|
46 |
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Default Constructor
|
|
50 |
* @since 3.1
|
|
51 |
*/
|
|
52 |
CSvgScreenSaver();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Destructor.
|
|
56 |
*/
|
|
57 |
virtual ~CSvgScreenSaver();
|
|
58 |
|
|
59 |
/**
|
|
60 |
* 2nd phase constructor
|
|
61 |
* @since 3.1
|
|
62 |
*/
|
|
63 |
void ConstructL( const CCoeControl* aParent );
|
|
64 |
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Creates an SVG Custom Control or RenderFrames Control
|
|
68 |
* for the file
|
|
69 |
* @param aFileName
|
|
70 |
* @since 3.1
|
|
71 |
*/
|
|
72 |
TInt AsFile(const TDesC& aFileName);
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Sets the rect for SVG Custom Control or RenderFrames Control
|
|
76 |
* for the file
|
|
77 |
* @param aRect
|
|
78 |
* @since 3.1
|
|
79 |
*/
|
|
80 |
void SetRect(const TRect& aRect);
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Sends the command to SVG Custom Control or RenderFrames Control
|
|
84 |
* @param aCommand command to be sent to the control
|
|
85 |
* @since 3.1
|
|
86 |
*/
|
|
87 |
void SendCommandL( TInt aCommand );
|
|
88 |
|
|
89 |
/**
|
|
90 |
* makes the control to be (in)visible
|
|
91 |
* @param aVisible ETrue makes the control visible
|
|
92 |
* EFalse makes the control invisible
|
|
93 |
* @since 3.1
|
|
94 |
*/
|
|
95 |
void MakeVisible( TBool aVisible );
|
|
96 |
|
|
97 |
/**
|
|
98 |
* gets the last error encountered by the Control
|
|
99 |
* @since 3.1
|
|
100 |
*/
|
|
101 |
TInt GetLastError() const;
|
|
102 |
|
|
103 |
public: // Functions From MSvgtAppObserver
|
|
104 |
|
|
105 |
/**
|
|
106 |
* From MSvgtAppObserver
|
|
107 |
* @see MSvgtAppObserver::FetchImage
|
|
108 |
*/
|
|
109 |
virtual TInt FetchImage( const TDesC& aUri, RFs& aSession,
|
|
110 |
RFile& aFileHandle );
|
|
111 |
|
|
112 |
/**
|
|
113 |
* From MSvgtAppObserver
|
|
114 |
* @see MSvgtAppObserver::GetSmilFitValue
|
|
115 |
*/
|
|
116 |
virtual void GetSmilFitValue(TDes& aSmilValue);
|
|
117 |
|
|
118 |
/**
|
|
119 |
* From MSvgtAppObserver
|
|
120 |
* @see MSvgtAppObserver::LinkActivated
|
|
121 |
*/
|
|
122 |
virtual TBool LinkActivated( const TDesC& aUri );
|
|
123 |
|
|
124 |
|
|
125 |
/**
|
|
126 |
* From MSvgtAppObserver
|
|
127 |
* @see MSvgtAppObserver::LinkActivatedWithShow
|
|
128 |
*/
|
|
129 |
virtual TBool LinkActivatedWithShow( const TDesC& aUri,
|
|
130 |
const TDesC& aShow );
|
|
131 |
|
|
132 |
/**
|
|
133 |
* This function is called by the application to enable/disable the
|
|
134 |
* downloads menu in the options menu
|
|
135 |
* @since 3.0
|
|
136 |
* @param aAddDownloadMenu enable/disable the downloads menu
|
|
137 |
*/
|
|
138 |
|
|
139 |
void SetDownloadMenu( TBool aAddDownloadMenu );
|
|
140 |
|
|
141 |
/**
|
|
142 |
* This function is called by the Ui Dialog to enable/disable the
|
|
143 |
* downloads menu in the options menu
|
|
144 |
* @since 3.0
|
|
145 |
* @return iDownloadMenuEnabled enable/disable the downloads menu
|
|
146 |
*/
|
|
147 |
virtual TBool CanShowDownload() const;
|
|
148 |
|
|
149 |
|
|
150 |
/**
|
|
151 |
* From MSvgtAppObserver
|
|
152 |
* @see MSvgtAppObserver::DisplayDownloadMenuL
|
|
153 |
*/
|
|
154 |
virtual void DisplayDownloadMenuL();
|
|
155 |
|
|
156 |
/**
|
|
157 |
* From MSvgtAppObserver
|
|
158 |
* @see MSvgtAppObserver::CanShowSave
|
|
159 |
*/
|
|
160 |
virtual TBool CanShowSave();
|
|
161 |
|
|
162 |
/**
|
|
163 |
* From MSvgtAppObserver
|
|
164 |
* @see MSvgtAppObserver::IsSavingDone
|
|
165 |
*/
|
|
166 |
virtual TBool IsSavingDone();
|
|
167 |
|
|
168 |
/**
|
|
169 |
* From MSvgtAppObserver
|
|
170 |
* @see MSvgtAppObserver::DoSaveL
|
|
171 |
*/
|
|
172 |
virtual void DoSaveL( TInt aCommandId );
|
|
173 |
|
|
174 |
/**
|
|
175 |
* From MSvgtAppObserver
|
|
176 |
* @see MSvgtAppObserver::NewFetchImageData
|
|
177 |
*/
|
|
178 |
virtual TInt NewFetchImageData( const TDesC& aUri );
|
|
179 |
|
|
180 |
/**
|
|
181 |
* From MSvgtAppObserver
|
|
182 |
* @see MSvgtAppObserver::AssignEmbededDataL
|
|
183 |
*/
|
|
184 |
virtual void AssignEmbededDataL( const TDesC& aUri );
|
|
185 |
|
|
186 |
/**
|
|
187 |
* From MSvgtAppObserver
|
|
188 |
* @see MSvgtAppObserver::ExitWhenOrientationChange
|
|
189 |
*/
|
|
190 |
virtual TBool ExitWhenOrientationChange();
|
|
191 |
|
|
192 |
private: // In MPluginNotify in S60
|
|
193 |
TInt NotifyL(TNotificationType aCallType, void* aParam);
|
|
194 |
|
|
195 |
private:
|
|
196 |
|
|
197 |
// Pointer to the Svg control
|
|
198 |
CCoeControl* iSvgControl;
|
|
199 |
|
|
200 |
// Pointer to the Parent Control
|
|
201 |
const CCoeControl* iParent;
|
|
202 |
|
|
203 |
// file Handle of the file displayed
|
|
204 |
RFile iFileHandle;
|
|
205 |
|
|
206 |
// environment pointer
|
|
207 |
CEikonEnv* iEikEnv;
|
|
208 |
|
|
209 |
// current size of the control
|
|
210 |
TRect iRect;
|
|
211 |
|
|
212 |
// flag to indicate whether render frames control or
|
|
213 |
// Custom control is used.
|
|
214 |
TBool iIsRenderFrameControl;
|
|
215 |
|
|
216 |
// Name of the Svg file
|
|
217 |
TFileName iFileName;
|
|
218 |
|
|
219 |
// last error encountered by the SVG Plugin
|
|
220 |
TInt iLastError;
|
|
221 |
};
|
|
222 |
|
|
223 |
#endif // SVGSCREENSAVER_H
|
|
224 |
// End of File
|