|
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 the License "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: Implementation of Scheduler server's client api* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <ipvideo/CCseSchedulerAPI.h> // Header file for this class |
|
21 #include <ipvideo/CCseScheduledProgram.h> // Represent one schedule in database |
|
22 #include <ipvideo/CseSchedulerClientServerCommon.h> // Common defines for client and server |
|
23 #include <ipvideo/RCseSchedulerClient.h> // Client common methods (server start up etc) |
|
24 #include "CseDebug.h" // Debug macros |
|
25 #include <s32mem.h> |
|
26 |
|
27 // EXTERNAL DATA STRUCTURES |
|
28 // None |
|
29 |
|
30 // EXTERNAL FUNCTION PROTOTYPES |
|
31 // None |
|
32 |
|
33 // CONSTANTS |
|
34 // None |
|
35 |
|
36 // MACROS |
|
37 // None |
|
38 |
|
39 // LOCAL CONSTANTS AND MACROS |
|
40 // None |
|
41 |
|
42 // MODULE DATA STRUCTURES |
|
43 // None |
|
44 |
|
45 // LOCAL FUNCTION PROTOTYPES |
|
46 // None |
|
47 |
|
48 // FORWARD DECLARATIONS |
|
49 // None |
|
50 |
|
51 // ============================ MEMBER FUNCTIONS =============================== |
|
52 // FUNCTION PROTOTYPES |
|
53 |
|
54 // ============================ MEMBER FUNCTIONS =============================== |
|
55 |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CCseSchedulerApi::CCseSchedulerApi |
|
59 // |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CCseSchedulerApi::CCseSchedulerApi() |
|
63 { |
|
64 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::CCseSchedulerApi"); |
|
65 |
|
66 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::CCseSchedulerApi"); |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CCseSchedulerApi::NewL |
|
71 // Static two-phased constructor. |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C CCseSchedulerApi* CCseSchedulerApi::NewL() |
|
75 { |
|
76 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::NewL"); |
|
77 CCseSchedulerApi* self = new ( ELeave ) CCseSchedulerApi(); |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(); |
|
80 CleanupStack::Pop( self ); |
|
81 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::NewL"); |
|
82 return self; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CCseSchedulerApi::ConstructL |
|
87 // Symbian 2nd phase constructor can leave. |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 void CCseSchedulerApi::ConstructL() |
|
91 { |
|
92 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::ConstructL"); |
|
93 User::LeaveIfError( iClient.Connect() ); |
|
94 User::LeaveIfError( iService.Open( iClient ) ); |
|
95 |
|
96 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::ConstructL"); |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CCseSchedulerApi::~CCseSchedulerApi |
|
101 // |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 EXPORT_C CCseSchedulerApi::~CCseSchedulerApi() |
|
105 { |
|
106 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::~CCseSchedulerApi"); |
|
107 iService.Close(); |
|
108 iClient.Close(); |
|
109 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::~CCseSchedulerApi"); |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CCseSchedulerApi::AddSchedule |
|
114 // |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 EXPORT_C TInt CCseSchedulerApi::AddSchedule( CCseScheduledProgram& aData ) const |
|
118 { |
|
119 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::AddSchedule"); |
|
120 TRAPD( err, iService.AddScheduleL( aData ) ); |
|
121 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::AddSchedule"); |
|
122 return err; |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CCseSchedulerApi::RemoveSchedule |
|
127 // |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 EXPORT_C TInt CCseSchedulerApi::RemoveSchedule( const TUint32 aDbIdentifier ) const |
|
131 { |
|
132 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::RemoveSchedule"); |
|
133 TRAPD( err, iService.RemoveScheduleL( aDbIdentifier ) ); |
|
134 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::RemoveSchedule"); |
|
135 return err; |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // CCseSchedulerApi::GetSchedule |
|
140 // |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 EXPORT_C TInt CCseSchedulerApi::GetSchedule( const TUint32 aDbIdentifier, |
|
144 CCseScheduledProgram* aProg ) const |
|
145 { |
|
146 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetSchedule"); |
|
147 TRAPD( err, iService.GetScheduleL( aDbIdentifier, aProg ) ); |
|
148 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetSchedule"); |
|
149 return err; |
|
150 } |
|
151 |
|
152 // ----------------------------------------------------------------------------- |
|
153 // CCseSchedulerApi::GetSchedulesByAppUid |
|
154 // |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 EXPORT_C TInt CCseSchedulerApi::GetSchedulesByAppUid( const TInt32 aAppUid, |
|
158 RPointerArray<CCseScheduledProgram>& aArray ) const |
|
159 { |
|
160 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetSchedulesByAppUid"); |
|
161 TRAPD( err, iService.GetSchedulesL( aAppUid, aArray ) ); |
|
162 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetSchedulesByAppUid"); |
|
163 return err; |
|
164 } |
|
165 |
|
166 // ----------------------------------------------------------------------------- |
|
167 // CCseSchedulerApi::GetSchedulesByPluginUid |
|
168 // |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 EXPORT_C TInt CCseSchedulerApi::GetSchedulesByPluginUid( const TInt32 aPluginUid, |
|
172 RPointerArray<CCseScheduledProgram>& aArray ) const |
|
173 { |
|
174 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetSchedulesByPluginUid"); |
|
175 TRAPD( err, iService.GetSchedulesByPluginUidL( aPluginUid, aArray ) ); |
|
176 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetSchedulesByPluginUid"); |
|
177 return err; |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // CCseSchedulerApi::GetSchedulesByScheduleType |
|
182 // |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 EXPORT_C TInt CCseSchedulerApi::GetSchedulesByType( const TInt32 aType, |
|
186 RPointerArray<CCseScheduledProgram>& aArray ) const |
|
187 { |
|
188 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetSchedulesByType"); |
|
189 TRAPD( err, iService.GetSchedulesByTypeL( aType, aArray ) ); |
|
190 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetSchedulesByType"); |
|
191 return err; |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // CCseSchedulerApi::GetSchedulesByTime |
|
196 // |
|
197 // ----------------------------------------------------------------------------- |
|
198 // |
|
199 EXPORT_C TInt CCseSchedulerApi::GetSchedulesByTime( const TTime& aBeginning, |
|
200 const TTime& aEnd, |
|
201 RPointerArray<CCseScheduledProgram>& aArray ) const |
|
202 { |
|
203 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetSchedulesByTime"); |
|
204 TRAPD( err, iService.GetSchedulesByTimeL( aBeginning, aEnd, aArray ) ); |
|
205 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetSchedulesByTime"); |
|
206 return err; |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CCseSchedulerApi::GetOverlappingSchedule |
|
212 // |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 EXPORT_C TInt CCseSchedulerApi::GetOverlappingSchedules( CCseScheduledProgram& aProgram, |
|
216 RPointerArray<CCseScheduledProgram>& aResultArray ) |
|
217 { |
|
218 CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerApi::GetOverlappingSchedules"); |
|
219 TRAPD( err, iService.GetOverlappingSchedulesL( aProgram, aResultArray ) ); |
|
220 CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerApi::GetOverlappingSchedules"); |
|
221 return err; |
|
222 } |
|
223 |
|
224 // End of File |