|
1 /* |
|
2 * Copyright (c) 2003 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: This module contains the implementation of CCbsEtelMessaging |
|
15 * class member functions. |
|
16 * |
|
17 * CCbsEtelMessaging acts as a wrapper to RMobileBroadcastMessaging instance. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDE FILES |
|
24 /******************************* |
|
25 * Series 60 Customer / Etel |
|
26 * Series 60 Etel API |
|
27 *******************************/ |
|
28 #include <mmretrieve.h> |
|
29 #include "CCbsEtelMessaging.h" |
|
30 #include "CbsLogger.h" |
|
31 |
|
32 // ================= MEMBER FUNCTIONS ======================= |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CCbsEtelMessaging::CCbsEtelMessaging |
|
36 // C++ default constructor can NOT contain any code, that |
|
37 // might leave. |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 CCbsEtelMessaging::CCbsEtelMessaging() |
|
41 { |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CCbsEtelMessaging::ConstructL |
|
46 // Symbian 2nd phase constructor can leave. |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 void CCbsEtelMessaging::ConstructL() |
|
50 { |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CCbsEtelMessaging::NewL |
|
55 // Two-phased constructor. |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 CCbsEtelMessaging* CCbsEtelMessaging::NewL() |
|
59 { |
|
60 CCbsEtelMessaging* self = new ( ELeave ) CCbsEtelMessaging; |
|
61 CleanupStack::PushL( self ); |
|
62 self->ConstructL(); |
|
63 CleanupStack::Pop(); |
|
64 return self; |
|
65 } |
|
66 |
|
67 |
|
68 // Destructor |
|
69 /******************************* |
|
70 * Series 60 Customer / Etel |
|
71 * Series 60 Etel API |
|
72 *******************************/ |
|
73 CCbsEtelMessaging::~CCbsEtelMessaging() |
|
74 { |
|
75 CBSLOGSTRING("CBSSERVER: >>> CCbsEtelMessaging::~CCbsEtelMessaging()"); |
|
76 iMessaging.Close(); |
|
77 CBSLOGSTRING("CBSSERVER: <<< CCbsEtelMessaging::~CCbsEtelMessaging()"); |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CCbsEtelMessaging::Open |
|
82 // Opens an ETel messaging session. |
|
83 // (other items were commented in a header). |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 /******************************* |
|
87 * Series 60 Customer / Etel |
|
88 * Series 60 Etel API |
|
89 *******************************/ |
|
90 TInt CCbsEtelMessaging::Open( |
|
91 RMobilePhone& aPhone ) |
|
92 { |
|
93 return iMessaging.Open( aPhone ); |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CCbsEtelMessaging::Close |
|
98 // Closes ETel messaging session. |
|
99 // (other items were commented in a header). |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 /******************************* |
|
103 * Series 60 Customer / Etel |
|
104 * Series 60 Etel API |
|
105 *******************************/ |
|
106 void CCbsEtelMessaging::Close() |
|
107 { |
|
108 iMessaging.Close(); |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CCbsEtelMessaging::ReceiveMessage |
|
113 // Requests forwarding of the next received CB message. |
|
114 // (other items were commented in a header). |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 /******************************* |
|
118 * Series 60 Customer / Etel |
|
119 * Series 60 Etel API |
|
120 *******************************/ |
|
121 void CCbsEtelMessaging::ReceiveMessage( |
|
122 TRequestStatus& aReqStatus, |
|
123 TDes8& aMsgData, |
|
124 TDes8& aMsgAttributes ) |
|
125 { |
|
126 iMessaging.ReceiveMessage( aReqStatus, aMsgData, aMsgAttributes ); |
|
127 } |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // CCbsEtelMessaging::ReceiveMessageCancel |
|
131 // Cancels an outstanding ReceiveMessage() request. |
|
132 // (other items were commented in a header). |
|
133 // ----------------------------------------------------------------------------- |
|
134 // |
|
135 /******************************* |
|
136 * Series 60 Customer / Etel |
|
137 * Series 60 Etel API |
|
138 *******************************/ |
|
139 void CCbsEtelMessaging::ReceiveMessageCancel() |
|
140 { |
|
141 // Use the base class method to cancel |
|
142 iMessaging.CancelAsyncRequest( EMobileBroadcastMessagingReceiveMessage ); |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CCbsEtelMessaging::SetFilterSetting |
|
147 // Sets CBS receive mode. |
|
148 // (other items were commented in a header). |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 /******************************* |
|
152 * Series 60 Customer / Etel |
|
153 * Series 60 Etel API |
|
154 *******************************/ |
|
155 void CCbsEtelMessaging::SetFilterSetting( |
|
156 TRequestStatus& aReqStatus, |
|
157 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter aSetting ) const |
|
158 { |
|
159 iMessaging.SetFilterSetting( aReqStatus, aSetting ); |
|
160 } |
|
161 |
|
162 // ----------------------------------------------------------------------------- |
|
163 // CCbsEtelMessaging::SetFilterSettingCancel |
|
164 // Cancels active SetFilterSetting request. |
|
165 // (other items were commented in a header). |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 /******************************* |
|
169 * Series 60 Customer / Etel |
|
170 * Series 60 Etel API |
|
171 *******************************/ |
|
172 void CCbsEtelMessaging::SetFilterSettingCancel() |
|
173 { |
|
174 // Use the base class method to cancel |
|
175 iMessaging.CancelAsyncRequest( EMobileBroadcastMessagingSetFilterSetting ); |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CCbsEtelMessaging::GetFilterSetting |
|
180 // Retrieves the current CBS receive mode. |
|
181 // (other items were commented in a header). |
|
182 // ----------------------------------------------------------------------------- |
|
183 // |
|
184 /******************************* |
|
185 * Series 60 Customer / Etel |
|
186 * Series 60 Etel API |
|
187 *******************************/ |
|
188 TInt CCbsEtelMessaging::GetFilterSetting( |
|
189 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter& aSetting ) |
|
190 { |
|
191 return iMessaging.GetFilterSetting( aSetting ); |
|
192 } |
|
193 |
|
194 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
195 |
|
196 // End of File |