|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * View activator - activates a tab view upon client request |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __XSPVIEWACTIVATOR_H__ |
|
21 #define __XSPVIEWACTIVATOR_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32svr.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 #include <CPbk2ViewState.h> |
|
28 |
|
29 #include "CxSPViewIdChanger.h" |
|
30 #include "xSPViewServices_priv.h" |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * This class is a server which listens to client application |
|
36 * requests and activates the requested tab view according |
|
37 * to the client request. |
|
38 */ |
|
39 class CxSPViewActivator : public CServer2 |
|
40 { |
|
41 public: // Construction and destruction |
|
42 |
|
43 /** |
|
44 * Static factory function for creating an instance of the class. |
|
45 * |
|
46 * @param aViewIdChanger view id changer |
|
47 * @return Newly created CxSPViewActivator server object. |
|
48 */ |
|
49 static CxSPViewActivator* NewL(CxSPViewIdChanger* aViewIdChanger); |
|
50 |
|
51 /** |
|
52 * Standard C++ destructor. |
|
53 */ |
|
54 virtual ~CxSPViewActivator(); |
|
55 |
|
56 public: // Public methods |
|
57 |
|
58 /** |
|
59 * Executes client request to activate a given view. May leave on if the |
|
60 * request cannot be carried out. |
|
61 * |
|
62 * @param aMessage Client request |
|
63 */ |
|
64 void ActivateView1L(const RMessage2 &aMessage); |
|
65 |
|
66 /** |
|
67 * Executes client request to activate a given view. May leave on if the |
|
68 * request cannot be carried out. |
|
69 * |
|
70 * @param aMessage Client request |
|
71 */ |
|
72 void ActivateView2L(const RMessage2 &aMessage); |
|
73 |
|
74 /** |
|
75 * Executes client request to activate a given view. May leave on if the |
|
76 * request cannot be carried out. Asynchronous version. |
|
77 * |
|
78 * @param aMessage Client request |
|
79 */ |
|
80 void ActivateView2AsyncL(const RMessage2 &aMessage); |
|
81 |
|
82 /** |
|
83 * Executes client request to get view count. |
|
84 * |
|
85 * @param aMessage Client request |
|
86 */ |
|
87 void GetViewCountL(const RMessage2 &aMessage); |
|
88 |
|
89 /** |
|
90 * Executes client request to get view packed data length. |
|
91 * |
|
92 * @param aMessage Client request |
|
93 */ |
|
94 void GetViewDataPackLengthL(const RMessage2 &aMessage); |
|
95 |
|
96 /** |
|
97 * Executes client request to get view data. |
|
98 * |
|
99 * @param aMessage Client request |
|
100 */ |
|
101 void GetViewDataL(const RMessage2 &aMessage); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * Performs the 2nd phase of the construction. |
|
107 */ |
|
108 void ConstructL(); |
|
109 |
|
110 /** |
|
111 * Standard C++ constructor. |
|
112 * |
|
113 * @param aViewIdChanger view id changer |
|
114 */ |
|
115 CxSPViewActivator(CxSPViewIdChanger* aViewIdChanger); |
|
116 |
|
117 /** |
|
118 * Creates a new client session when a client contacts the server for the first time. |
|
119 * @param aVersion Client's SW version |
|
120 * @return A new session |
|
121 */ |
|
122 CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& ) const; |
|
123 |
|
124 /** |
|
125 * Starts the server and signals the client application that the server |
|
126 * is ready to receive requests. |
|
127 * |
|
128 * @param aName Server name |
|
129 */ |
|
130 void StartL(const TDesC &aName); |
|
131 |
|
132 private: // Data |
|
133 |
|
134 ///Ref: view id changer |
|
135 CxSPViewIdChanger* iViewIdChanger; |
|
136 }; |
|
137 |
|
138 // CLASS DECLARATION |
|
139 /** |
|
140 * This class is the server session class, |
|
141 * which dispatches client requests. |
|
142 */ |
|
143 class CxSPViewActivatorSession : public CSession2 |
|
144 { |
|
145 public: |
|
146 |
|
147 /** |
|
148 * Called when the client makes a request to change the view. |
|
149 * @param aMessage Contains details about the view to bring in front. |
|
150 */ |
|
151 void ServiceL(const RMessage2 &aMessage); |
|
152 }; |
|
153 |
|
154 #endif // __XSPVIEWACTIVATOR_H__ |
|
155 |
|
156 // End of file. |