1 /* |
|
2 * Copyright (c) 2007 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: Content Harvester Server Session |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "contentharvestersession.h" |
|
21 #include "contentharvesterengine.h" |
|
22 #include "contentharvesterserver.h" |
|
23 #include "contentharvesterglobals.h" |
|
24 #include "cpdebug.h" |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CContentHarvesterSession::NewL |
|
30 // Two-phased constructor. |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CContentHarvesterSession* CContentHarvesterSession::NewL( |
|
34 CContentHarvesterServer* aServer ) |
|
35 { |
|
36 CContentHarvesterSession* self = |
|
37 CContentHarvesterSession::NewLC( aServer ); |
|
38 CleanupStack::Pop( self ) ; |
|
39 return self; |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CContentHarvesterSession::NewLC |
|
44 // Two-phased constructor. |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CContentHarvesterSession* CContentHarvesterSession::NewLC( |
|
48 CContentHarvesterServer* aServer ) |
|
49 { |
|
50 CContentHarvesterSession* self = new ( ELeave ) |
|
51 CContentHarvesterSession(aServer); |
|
52 CleanupStack::PushL( self ); |
|
53 self->ConstructL( ) ; |
|
54 return self; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CContentHarvesterSession::~CContentHarvesterSession |
|
59 // Destructor. |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CContentHarvesterSession::~CContentHarvesterSession() |
|
63 { |
|
64 |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CContentHarvesterSession::ServiceL |
|
69 // Handle client requests. |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 void CContentHarvesterSession::ServiceL( const RMessage2& aMessage ) |
|
73 { |
|
74 CP_DEBUG(_L8("CContentHarvesterSession::ServiceL")); |
|
75 switch ( aMessage.Function( ) ) |
|
76 { |
|
77 case EContentHarvesterUpdate: |
|
78 CP_DEBUG(_L8("Update command")); |
|
79 aMessage.Complete( EContentHarvesterUpdateComplete ); |
|
80 iContentHarvesterServer->Engine().Update( ); |
|
81 break; |
|
82 case EContentHarvesterStop: |
|
83 CP_DEBUG(_L8("Stop command")); |
|
84 aMessage.Complete( EContentHarvesterStopComplete ); |
|
85 iContentHarvesterServer->Stop( ); |
|
86 break; |
|
87 default: |
|
88 iContentHarvesterServer->PanicClient( aMessage, |
|
89 EContentHarvesterBadRequest ); |
|
90 break; |
|
91 } |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CContentHarvesterSession::CContentHarvesterSession |
|
96 // C++ default constructor can NOT contain any code, that |
|
97 // might leave. |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 CContentHarvesterSession::CContentHarvesterSession( |
|
101 CContentHarvesterServer* aServer ) : |
|
102 CSession2() |
|
103 { |
|
104 iContentHarvesterServer = aServer; |
|
105 } |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CContentHarvesterSession::ConstructL |
|
109 // Symbian 2nd phase constructor can leave. |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CContentHarvesterSession::ConstructL() |
|
113 { |
|
114 CP_DEBUG(_L8("CContentHarvesterSession::ConstructL")); |
|
115 } |
|
116 |
|
117 // End of File |
|