|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Implements a (minimal) GS Plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef GS_DAS_H |
|
21 #define GS_DAS_H |
|
22 |
|
23 // Includes |
|
24 #include <aknview.h> |
|
25 #include <AknServerApp.h> |
|
26 #include <eikclb.h> |
|
27 #include <ConeResLoader.h> |
|
28 |
|
29 #include <gsplugininterface.h> |
|
30 #include "gs_das_emptycontainer.h" |
|
31 // Classes referenced |
|
32 class CDefaultAppClient; |
|
33 |
|
34 // Constants |
|
35 /** This is the name of the plugin's resource file */ |
|
36 _LIT( KDefaultAppGSPluginResourceFileName, "z:gsdasplugin_rsc.rsc" ); |
|
37 |
|
38 /** This is the plugin's UID */ |
|
39 const TUid KDefaultAppGSPluginUid = { 0x10281BA1 }; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * This class implements a GS plugin. |
|
45 * |
|
46 * This class inplements a GS plugin that acts as a client for the Default App Server, so that it can be |
|
47 * accessed from the GS application. |
|
48 * |
|
49 * @since S60 5.0 |
|
50 */ |
|
51 class CDefaultAppGSPlugin : public CGSPluginInterface, public MAknServerAppExitObserver |
|
52 { |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Symbian OS two-phased constructor |
|
58 * @return |
|
59 */ |
|
60 |
|
61 static CDefaultAppGSPlugin* NewL( TAny* aInitParams ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CDefaultAppGSPlugin(); |
|
67 |
|
68 public: // From CAknView |
|
69 |
|
70 /** |
|
71 * From CAknView |
|
72 * Returns the UID of the Plugin (see base class) |
|
73 * |
|
74 * @since S60 5.0 |
|
75 */ |
|
76 TUid Id() const; |
|
77 |
|
78 /** |
|
79 * From CAknView |
|
80 * Activates the plugin (see base class) |
|
81 * |
|
82 * @since S60 5.0 |
|
83 * @param aPrevViewId see base class |
|
84 * @param aCustomMessageId see base class |
|
85 * @param aCustomMessage see base class |
|
86 */ |
|
87 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
88 TUid aCustomMessageId, |
|
89 const TDesC8& aCustomMessage ); |
|
90 |
|
91 /** |
|
92 * From CAknView |
|
93 * Deactivates the Plugin (see base class) |
|
94 * |
|
95 * @since S60 5.0 |
|
96 */ |
|
97 void DoDeactivate(); |
|
98 |
|
99 /** |
|
100 * From CAknView |
|
101 * Handles a menu command (see base class) |
|
102 * |
|
103 * @since S60 5.0 |
|
104 * @param aCommand the command to handle |
|
105 */ |
|
106 void HandleCommandL( TInt aCommand ); |
|
107 |
|
108 public: // From CGSPluginInterface |
|
109 |
|
110 /** |
|
111 * From CGSPluginInterface |
|
112 * Returns the Plugin Caption (see base class) |
|
113 * |
|
114 * @since S60 5.0 |
|
115 * @param aCaption placeholder for the caption |
|
116 */ |
|
117 void GetCaptionL( TDes& aCaption ) const; |
|
118 |
|
119 /** |
|
120 * From CGSPluginInterface |
|
121 * Returns the plugin's icon (see CGSPluginInterface header file) |
|
122 * |
|
123 * @since S60 5.0 |
|
124 * @param aIconType icon type |
|
125 */ |
|
126 CGulIcon* CreateIconL( const TUid aIconType ); |
|
127 |
|
128 private: // From MAknServerAppExitObserver |
|
129 |
|
130 /** |
|
131 * From MAknServerAppExitObserver |
|
132 * Handles server exits |
|
133 * |
|
134 * @since S60 5.0 |
|
135 * @param aReason for the server exit |
|
136 */ |
|
137 void HandleServerAppExit ( TInt aReason ); |
|
138 |
|
139 private: |
|
140 |
|
141 /** |
|
142 * C++ default constructor. |
|
143 */ |
|
144 CDefaultAppGSPlugin(); |
|
145 |
|
146 /** |
|
147 * Symbian OS default constructor. |
|
148 */ |
|
149 void ConstructL(); |
|
150 |
|
151 private: // Data |
|
152 |
|
153 /** |
|
154 * The Resource Loader |
|
155 */ |
|
156 RConeResourceLoader iResources; // Resouce loader. |
|
157 |
|
158 /** |
|
159 * The id of the previous View, to be activated when user pushes Back |
|
160 */ |
|
161 TVwsViewId iPrevViewId; |
|
162 |
|
163 /** |
|
164 * Pointer to the Default App Client API class |
|
165 * Own. |
|
166 */ |
|
167 CDefaultAppClient* iClient; |
|
168 |
|
169 /** |
|
170 * Empty Container, used to avoid screen flickering |
|
171 * Own. |
|
172 */ |
|
173 CCEmptyContainer* iEmptyContainer; |
|
174 }; |
|
175 |
|
176 #endif // GS_DAS_H |
|
177 // End of File |