|
1 /* |
|
2 * Copyright (c) 2007-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: This file contains the header file of the CIAUpdateSession class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef IAUPDATESESSION_H |
|
21 #define IAUPDATESESSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AknServerApp.h> |
|
25 |
|
26 #include "iaupdaterequestobserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CIAUpdateServer; |
|
30 class RMessage2; |
|
31 class CEikonEnv; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * This class represents the main server session. |
|
37 * |
|
38 */ |
|
39 class CIAUpdateSession : public CAknAppServiceBase, |
|
40 public MIAUpdateRequestObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * C++ default constructor. |
|
46 */ |
|
47 CIAUpdateSession(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CIAUpdateSession(); |
|
53 |
|
54 public: // From CAknAppServiceBase |
|
55 |
|
56 /** |
|
57 * Handles the received message. |
|
58 * The method simply calls HandleRequestL under trap harness. |
|
59 * @param aMessage - Reference to the message that contains the request |
|
60 */ |
|
61 void ServiceL( const RMessage2& aMessage ); |
|
62 |
|
63 /** |
|
64 * Called back by the server framework if this |
|
65 * session's RunL function returns an error. |
|
66 * @param aMessage - Reference to the message that contains the request |
|
67 * @param aError - Error code. |
|
68 */ |
|
69 void ServiceError( const RMessage2& aMessage, TInt aError ); |
|
70 |
|
71 /** |
|
72 * Completes construction of this server-side |
|
73 * client session object. |
|
74 */ |
|
75 void CreateL(); |
|
76 |
|
77 |
|
78 public: // from MIAUpdateRequestObserver |
|
79 |
|
80 /** |
|
81 * @see MIAUpdateRequestObserver::RequestCompleted |
|
82 */ |
|
83 void RequestCompleted( CIAUpdateResult* aResult, |
|
84 TInt aCountOfAvailableUpdates, |
|
85 TBool aUpdateNow, |
|
86 TInt aError ); |
|
87 |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * Returns reference of the server. |
|
93 * @return Reference of the server. |
|
94 */ |
|
95 CIAUpdateServer& Server(); |
|
96 |
|
97 /** |
|
98 * Handles the request. |
|
99 * @param aMessage - Reference to the message that contains the request |
|
100 */ |
|
101 void HandleRequestL( const RMessage2& aMessage ); |
|
102 |
|
103 |
|
104 private: // From CApaAppServiceBase |
|
105 |
|
106 /** |
|
107 * Virtual framework function that is called |
|
108 * on receipt of a message from the client. This allows the service |
|
109 * implementation to define a security policy for messages from the client. |
|
110 * @param aMessage - Reference to the message that contains the request |
|
111 */ |
|
112 CPolicyServer::TCustomResult SecurityCheckL( const RMessage2& aMsg, |
|
113 TInt& aAction, |
|
114 TSecurityInfo& aMissing ); |
|
115 |
|
116 private: // Data |
|
117 |
|
118 RMessage2* iMessage; |
|
119 |
|
120 CEikonEnv* iEikEnv; //not owned |
|
121 |
|
122 |
|
123 }; |
|
124 |
|
125 |
|
126 #endif // IAUPDATESESSION_H |
|
127 |
|
128 // End of File |