|
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: Used for sending events from Service Manager to client* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "CIptvSmEvent.h" |
|
23 #include <s32mem.h> |
|
24 #include "IptvDebug.h" |
|
25 |
|
26 // EXTERNAL DATA STRUCTURES |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // LOCAL CONSTANTS AND MACROS |
|
35 |
|
36 // MODULE DATA STRUCTURES |
|
37 |
|
38 // LOCAL FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // ============================= LOCAL FUNCTIONS =============================== |
|
43 |
|
44 // ============================ MEMBER FUNCTIONS =============================== |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CIptvSmEvent::CIptvSmEvent |
|
48 // C++ default constructor can NOT contain any code, that |
|
49 // might leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 CIptvSmEvent::CIptvSmEvent() |
|
53 { |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CIptvSmEvent::ConstructL |
|
58 // Symbian 2nd phase constructor can leave. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 void CIptvSmEvent::ConstructL() |
|
62 { |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CIptvSmEvent::NewL |
|
67 // Two-phased constructor. |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 EXPORT_C CIptvSmEvent* CIptvSmEvent::NewL() |
|
71 { |
|
72 CIptvSmEvent* self = new( ELeave ) CIptvSmEvent; |
|
73 |
|
74 CleanupStack::PushL( self ); |
|
75 self->ConstructL(); |
|
76 CleanupStack::Pop(self); |
|
77 |
|
78 return self; |
|
79 } |
|
80 |
|
81 |
|
82 // Destructor |
|
83 EXPORT_C CIptvSmEvent::~CIptvSmEvent() |
|
84 { |
|
85 } |
|
86 |
|
87 EXPORT_C void CIptvSmEvent::Destruct() |
|
88 { |
|
89 delete this; |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // CIptvSmEvent::InternalizeL |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C void CIptvSmEvent::InternalizeL(RReadStream& aStream) |
|
97 { |
|
98 iEvent = static_cast<TEvent>(aStream.ReadInt32L()); |
|
99 iServiceId = aStream.ReadUint32L(); |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CIptvSmEvent::ExternalizeL |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 EXPORT_C void CIptvSmEvent::ExternalizeL(RWriteStream& aStream) |
|
107 { |
|
108 aStream.WriteInt32L(static_cast<TInt32>(iEvent)); |
|
109 aStream.WriteUint32L(iServiceId); |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CIptvSmEvent::CountExternalizeSize |
|
114 // ----------------------------------------------------------------------------- |
|
115 // |
|
116 EXPORT_C TUint32 CIptvSmEvent::CountExternalizeSize() |
|
117 { |
|
118 return 8; |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // CIptvSmEvent::GetCopy |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C MIptvEvent* CIptvSmEvent::GetCopyL() |
|
126 { |
|
127 CIptvSmEvent* event = CIptvSmEvent::NewL(); |
|
128 event->iEvent = iEvent; |
|
129 event->iServiceId = iServiceId; |
|
130 |
|
131 return event; |
|
132 } |
|
133 |
|
134 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
135 |
|
136 // End of File |