|
1 /* |
|
2 * Copyright (c) 2005 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "mcecommediasource.h" |
|
22 #include "mceserial.h" |
|
23 #include "mceevents.h" |
|
24 |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CMceComMediaSource::NewL |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CMceComMediaSource* CMceComMediaSource::NewL() |
|
33 { |
|
34 CMceComMediaSource* self = NewLC(); |
|
35 CleanupStack::Pop( self ); |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CMceComMediaSource::NewLC |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CMceComMediaSource* CMceComMediaSource::NewLC() |
|
44 { |
|
45 CMceComMediaSource* self = new (ELeave) CMceComMediaSource( KMceEmptySource ); |
|
46 CleanupStack::PushL( self ); |
|
47 return self; |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CMceComMediaSource::CloneL |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CMceComMediaSource* CMceComMediaSource::CloneL() |
|
55 { |
|
56 CMceComMediaSource* copy = new (ELeave) CMceComMediaSource( iType ); |
|
57 Mem::Copy( copy, this, sizeof(CMceComMediaSource) ); |
|
58 copy->Zero(); |
|
59 return copy; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CMceComMediaSource::~CMceComMediaSource |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 CMceComMediaSource::~CMceComMediaSource() |
|
67 { |
|
68 } |
|
69 |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CMceComMediaSource::CMceComMediaSource |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 CMceComMediaSource::CMceComMediaSource( TMceSourceType aType ) |
|
76 : CMceComEndpoint( KMceCategorySource, aType ) |
|
77 { |
|
78 |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CMceComMediaSource::InternalizeFlatL |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 void CMceComMediaSource::InternalizeFlatL( RReadStream& aReadStream ) |
|
86 { |
|
87 CMceComEndpoint::InternalizeFlatL( aReadStream ); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CMceComMediaSource::ExternalizeFlatL |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CMceComMediaSource::ExternalizeFlatL( RWriteStream& aWriteStream ) |
|
95 { |
|
96 CMceComEndpoint::ExternalizeFlatL( aWriteStream ); |
|
97 } |
|
98 |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CMceComMediaSource::Factory |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 TMceComSourceFactory CMceComMediaSource::Factory() |
|
105 { |
|
106 return TMceComSourceFactory(); |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CMceComMediaSource::UpdateL |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 void CMceComMediaSource::UpdateL( CMceComMediaSource& aUpdate ) |
|
114 { |
|
115 BaseUpdateL( aUpdate ); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CMceComMediaSource::EventReceivedL |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 TInt CMceComMediaSource::EventReceivedL( TMceComEvent& aEvent ) |
|
123 { |
|
124 TInt status = KMceEventNotOwner; |
|
125 TBool idMatch = aEvent.Id().iSourceID == iID; |
|
126 if ( !idMatch ) |
|
127 { |
|
128 return KMceEventNotOwner; |
|
129 } |
|
130 |
|
131 if ( aEvent.Id().IsSourceId() ) |
|
132 { |
|
133 status = aEvent.Handler().HandleL( *this, aEvent ); |
|
134 } |
|
135 else |
|
136 { |
|
137 status = KMceEventNotConsumed; |
|
138 } |
|
139 |
|
140 return status; |
|
141 |
|
142 } |
|
143 |
|
144 |
|
145 #ifdef MCE_COMMON_SERVER_SIDE |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CMceComMediaSource::MccType |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 const TUid CMceComMediaSource::MccType() |
|
152 { |
|
153 return KUidMccAnySource; |
|
154 } |
|
155 |
|
156 #endif//MCE_COMMON_SERVER_SIDE |
|
157 |
|
158 // End of file |
|
159 |