|
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: Implementation of the CVmbxSimHandler class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <mpbutil.h> |
|
21 #include <cvoicemailboxentry.h> |
|
22 |
|
23 #include "vmbxpbkstore.h" |
|
24 #include "vmbxlogger.h" |
|
25 #include "vmbxsimhandler.h" |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS ============================= |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CVmbxSimHandler::CVmbxSimHandler |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 CVmbxSimHandler::CVmbxSimHandler( ) |
|
36 { |
|
37 VMBLOGSTRING( "VMBX: CVmbxSimHandler::CVmbxSimHandler =>" ); |
|
38 VMBLOGSTRING( "VMBX: CVmbxSimHandler::CVmbxSimHandler <=" ); |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // CVmbxSimHandler::ConstructL |
|
43 // Symbian 2nd phase constructor can leave. |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 void CVmbxSimHandler::ConstructL() |
|
47 { |
|
48 VMBLOGSTRING( "VMBX: CVmbxSimHandler::ConstructL =>" ); |
|
49 #ifndef __WINS__ |
|
50 // open created phonebook |
|
51 iPbkStore = CVmbxPbkStore::NewL(); |
|
52 #endif |
|
53 VMBLOGSTRING( "VMBX: CVmbxSimHandler::ConstructL <=" ); |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // CVmbxSimHandler::NewL |
|
58 // Two-phased constructor. |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 CVmbxSimHandler* CVmbxSimHandler::NewL() |
|
62 { |
|
63 VMBLOGSTRING( "VMBX: CVmbxSimHandler::NewL =>" ); |
|
64 CVmbxSimHandler* self = new( ELeave ) CVmbxSimHandler(); |
|
65 CleanupStack::PushL( self ); |
|
66 self->ConstructL(); |
|
67 CleanupStack::Pop( self ); |
|
68 VMBLOGSTRING( "VMBX: CVmbxSimHandler::NewL <=" ); |
|
69 return self; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // CVmbxSimHandler::~CVmbxSimHandler |
|
74 // Destructor |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 CVmbxSimHandler::~CVmbxSimHandler() |
|
78 { |
|
79 VMBLOGSTRING( "VMBX: CVmbxSimHandler::~CVmbxSimHandler =>" ); |
|
80 #ifndef __WINS__ |
|
81 delete iPbkStore; |
|
82 #endif |
|
83 VMBLOGSTRING( "VMBX: CVmbxSimHandler::~CVmbxSimHandler <=" ); |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // CVmbxSimHandler::GetL |
|
88 // Fetches mailbox number from Sim |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 void CVmbxSimHandler::GetL( CVoiceMailboxEntry& aEntry ) |
|
92 { |
|
93 VMBLOGSTRING( "VMBX: CVmbxSimHandler::GetL =>" ); |
|
94 iPbkStore->GetL( aEntry ); |
|
95 VMBLOGSTRING( "VMBX: CVmbxSimHandler::GetL <=" ); |
|
96 } |
|
97 |
|
98 // --------------------------------------------------------------------------- |
|
99 // CVmbxSimHandler::Save |
|
100 // Saves vmbx number to Sim |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 TInt CVmbxSimHandler::Save( const CVoiceMailboxEntry& aEntry ) |
|
104 { |
|
105 VMBLOGSTRING( "VMBX: CVmbxSimHandler::Save =>" ); |
|
106 TInt result = iPbkStore->Write( aEntry ); |
|
107 VMBLOGSTRING2( "VMBX: CVmbxSimHandler::Save: result=%I <=", result ); |
|
108 return result; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CVmbxSimHandler::IsWritable |
|
113 // Current file is writable |
|
114 // --------------------------------------------------------------------------- |
|
115 // |
|
116 TBool CVmbxSimHandler::IsWritable() |
|
117 { |
|
118 VMBLOGSTRING( "VMBX: CVmbxSimHandler::IsWritable: =>" ); |
|
119 VMBLOGSTRING( "VMBX: CVmbxSimHandler::IsWritable: <=" ); |
|
120 return iPbkStore->IsWritable(); |
|
121 } |
|
122 |
|
123 // --------------------------------------------------------------------------- |
|
124 // CVmbxSimHandler::PhoneBookType |
|
125 // Returns Sim file type |
|
126 // --------------------------------------------------------------------------- |
|
127 // |
|
128 TVmbxSimPhonebookType CVmbxSimHandler::PhoneBookType() |
|
129 { |
|
130 VMBLOGSTRING( "VMBX: CVmbxSimHandler::PhoneBookType =>" ); |
|
131 VMBLOGSTRING( "VMBX: CVmbxSimHandler::PhoneBookType <=" ); |
|
132 return iPbkStore->PhoneBookType(); |
|
133 } |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // CVmbxSimHandler::NotifyStoreEvent |
|
137 // Notify phonebook store evnet |
|
138 // --------------------------------------------------------------------------- |
|
139 // |
|
140 void CVmbxSimHandler::NotifyStoreEvent( TRequestStatus& aStatus, |
|
141 TUint32& aEvent, |
|
142 TInt& aIndex ) const |
|
143 { |
|
144 VMBLOGSTRING( "VMBX: CVmbxSimHandler::NotifyStoreEvent: =>" ); |
|
145 iPbkStore->PhonebookStore().NotifyStoreEvent( aStatus, aEvent, aIndex ); |
|
146 VMBLOGSTRING( "VMBX: CVmbxSimHandler::NotifyStoreEvent: <=" ); |
|
147 } |
|
148 |
|
149 // --------------------------------------------------------------------------- |
|
150 // CVmbxSimHandler::CancelAsyncRequest |
|
151 // Cancel phonebook store oberseved |
|
152 // --------------------------------------------------------------------------- |
|
153 // |
|
154 void CVmbxSimHandler::CancelAsyncRequest( TInt aReqToCancel ) const |
|
155 { |
|
156 VMBLOGSTRING( "VMBX: CVmbxSimHandler::CancelAsyncRequest: =>" ); |
|
157 iPbkStore->PhonebookStore().CancelAsyncRequest( aReqToCancel ); |
|
158 VMBLOGSTRING( "VMBX: CVmbxSimHandler::CancelAsyncRequest: <=" ); |
|
159 } |
|
160 |
|
161 //End of file |