|
1 /* |
|
2 * Copyright (c) 2009 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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <tmsclientsource.h> |
|
19 #include <tmsclientsourceobsrvr.h> |
|
20 #include "tmsclientsourcebody.h" |
|
21 |
|
22 using namespace TMS; |
|
23 |
|
24 EXPORT_C TMSClientSource::TMSClientSource() : |
|
25 iBody(NULL) |
|
26 { |
|
27 } |
|
28 |
|
29 EXPORT_C TMSClientSource::~TMSClientSource() |
|
30 { |
|
31 delete iBody; |
|
32 } |
|
33 |
|
34 EXPORT_C gint TMSClientSource::AddObserver(TMSClientSourceObserver& obsrvr, |
|
35 gpointer user_data) |
|
36 { |
|
37 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
38 if (iBody) |
|
39 { |
|
40 status = iBody->AddObserver(obsrvr, user_data); |
|
41 } |
|
42 return status; |
|
43 } |
|
44 |
|
45 EXPORT_C gint TMSClientSource::RemoveObserver(TMSClientSourceObserver& obsrvr) |
|
46 { |
|
47 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
48 if (iBody) |
|
49 { |
|
50 status = iBody->RemoveObserver(obsrvr); |
|
51 } |
|
52 return status; |
|
53 } |
|
54 |
|
55 // In pull mode, client calls this.??? How to identify last buffer. |
|
56 // Option 1 is to move setlast buffer to TMSBuffer interface. |
|
57 // Option 2 is to have overloaded function with another parameter. |
|
58 EXPORT_C gint TMSClientSource::BufferFilled(TMSBuffer& buffer) |
|
59 { |
|
60 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
61 if (iBody) |
|
62 { |
|
63 status = iBody->BufferFilled(buffer); |
|
64 } |
|
65 return status; |
|
66 } |
|
67 |
|
68 // Push mode |
|
69 EXPORT_C gint TMSClientSource::ProcessBuffer(TMSBuffer* buffer) |
|
70 { |
|
71 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
72 if (iBody) |
|
73 { |
|
74 status = iBody->ProcessBuffer(buffer); |
|
75 } |
|
76 return status; |
|
77 } |
|
78 |
|
79 // Indicates framework to queue ProcessBuffer. default is off |
|
80 // unsupported in pull mode??? (atleast initially) |
|
81 EXPORT_C gint TMSClientSource::SetEnqueueMode(const gboolean enable) |
|
82 { |
|
83 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
84 if (iBody) |
|
85 { |
|
86 status = iBody->SetEnqueueMode(enable); |
|
87 } |
|
88 return status; |
|
89 } |
|
90 |
|
91 EXPORT_C gint TMSClientSource::GetEnqueueMode(gboolean& enable) |
|
92 { |
|
93 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
94 if (iBody) |
|
95 { |
|
96 status = iBody->GetEnqueueMode(enable); |
|
97 } |
|
98 return status; |
|
99 } |
|
100 |
|
101 // Sends batch data to framework and clears queue mode. |
|
102 // Valid only when queue mode is set, otherwise no-op |
|
103 EXPORT_C gint TMSClientSource::Flush() |
|
104 { |
|
105 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
106 if (iBody) |
|
107 { |
|
108 status = iBody->Flush(); |
|
109 } |
|
110 return status; |
|
111 } |
|
112 |
|
113 EXPORT_C gint TMSClientSource::GetType(TMSSourceType& sourcetype) |
|
114 { |
|
115 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
|
116 if (iBody) |
|
117 { |
|
118 status = iBody->GetType(sourcetype); |
|
119 } |
|
120 return status; |
|
121 } |
|
122 |
|
123 // End of file |