36 int DialpadSymbianWrapperPrivate::getMailboxNumber(QString &vmbxNumber) |
36 int DialpadSymbianWrapperPrivate::getMailboxNumber(QString &vmbxNumber) |
37 { |
37 { |
38 int errValue(KErrNone); |
38 int errValue(KErrNone); |
39 CVoiceMailboxEntry* vmbxEntry = NULL; |
39 CVoiceMailboxEntry* vmbxEntry = NULL; |
40 TVoiceMailboxParams vmbxParams; |
40 TVoiceMailboxParams vmbxParams; |
|
41 vmbxParams.iType = EVmbxVoice; |
|
42 |
|
43 errValue = mVmbx->GetStoredEntry(vmbxParams, vmbxEntry); |
41 |
44 |
42 if (KErrNone == mVmbx->GetStoredEntry(vmbxParams, vmbxEntry)) { |
45 if (KErrNone == errValue) { |
43 // Number retrieved succesfully: |
46 // Number retrieved succesfully: |
44 vmbxNumber = getVmbxNumber(*vmbxEntry); |
47 vmbxNumber = getVmbxNumber(*vmbxEntry); |
45 } |
48 } |
46 // Entry ownership was transferred. |
49 // Entry ownership was transferred. |
47 delete vmbxEntry; |
50 delete vmbxEntry; |
54 int errValue(KErrNone); |
57 int errValue(KErrNone); |
55 CVoiceMailboxEntry* vmbxEntry = NULL; |
58 CVoiceMailboxEntry* vmbxEntry = NULL; |
56 TVoiceMailboxParams vmbxParams; |
59 TVoiceMailboxParams vmbxParams; |
57 vmbxParams.iType = EVmbxVideo; |
60 vmbxParams.iType = EVmbxVideo; |
58 |
61 |
59 if (KErrNone == mVmbx->GetStoredEntry(vmbxParams, vmbxEntry)) { |
62 errValue = mVmbx->GetStoredEntry(vmbxParams, vmbxEntry); |
|
63 |
|
64 if (KErrNone == errValue) { |
60 // Number retrieved succesfully: |
65 // Number retrieved succesfully: |
61 vmbxNumber = getVmbxNumber(*vmbxEntry); |
66 vmbxNumber = getVmbxNumber(*vmbxEntry); |
62 } |
67 } |
63 // Entry ownership was transferred. |
68 // Entry ownership was transferred. |
64 delete vmbxEntry; |
69 delete vmbxEntry; |
68 |
73 |
69 int DialpadSymbianWrapperPrivate::defineMailboxNumber(QString &vmbxNumber) |
74 int DialpadSymbianWrapperPrivate::defineMailboxNumber(QString &vmbxNumber) |
70 { |
75 { |
71 CVoiceMailboxEntry* vmbxEntry = NULL; |
76 CVoiceMailboxEntry* vmbxEntry = NULL; |
72 TVoiceMailboxParams vmbxParams; |
77 TVoiceMailboxParams vmbxParams; |
73 int errValue = mVmbx->QueryVmbxType( vmbxParams ); |
78 vmbxParams.iType = EVmbxVoice; |
74 |
79 |
75 if ((KErrNotFound == errValue)) { |
80 int errValue = mVmbx->QueryNewEntry(vmbxParams, vmbxEntry); |
76 errValue = mVmbx->QueryNewEntry(vmbxParams, vmbxEntry); |
81 if (KErrNone == errValue) { |
77 if (KErrNone == errValue) { |
82 mVmbx->SaveEntry(*vmbxEntry); |
78 mVmbx->SaveEntry(*vmbxEntry); |
83 // Do appropriate tasks, e.g. save number. |
79 // Do appropriate tasks, e.g. save number. |
84 vmbxNumber = getVmbxNumber(*vmbxEntry); |
80 vmbxNumber = getVmbxNumber(*vmbxEntry); |
|
81 } |
|
82 } |
85 } |
|
86 |
83 return errValue; |
87 return errValue; |
84 } |
88 } |
85 |
89 |
86 int DialpadSymbianWrapperPrivate::defineVideoMailboxNumber(QString &vmbxNumber) |
90 int DialpadSymbianWrapperPrivate::defineVideoMailboxNumber(QString &vmbxNumber) |
87 { |
91 { |
88 CVoiceMailboxEntry* vmbxEntry = NULL; |
92 CVoiceMailboxEntry* vmbxEntry = NULL; |
89 TVoiceMailboxParams vmbxParams; |
93 TVoiceMailboxParams vmbxParams; |
90 vmbxParams.iType = EVmbxVideo; |
94 vmbxParams.iType = EVmbxVideo; |
91 int errValue = mVmbx->QueryVmbxType( vmbxParams ); |
95 |
92 |
96 int errValue = mVmbx->QueryNewEntry(vmbxParams, vmbxEntry); |
93 if ((KErrNotFound == errValue)) { |
97 if (KErrNone == errValue) { |
94 errValue = mVmbx->QueryNewEntry(vmbxParams, vmbxEntry); |
98 mVmbx->SaveEntry(*vmbxEntry); |
95 if (KErrNone == errValue) { |
99 // Do appropriate tasks, e.g. save number. |
96 mVmbx->SaveEntry(*vmbxEntry); |
100 vmbxNumber = getVmbxNumber(*vmbxEntry); |
97 // Do appropriate tasks, e.g. save number. |
|
98 vmbxNumber = getVmbxNumber(*vmbxEntry); |
|
99 } |
|
100 } |
101 } |
|
102 |
101 return errValue; |
103 return errValue; |
102 } |
104 } |
103 |
105 |
104 QString DialpadSymbianWrapperPrivate::getVmbxNumber(CVoiceMailboxEntry &vmbxEntry) |
106 QString DialpadSymbianWrapperPrivate::getVmbxNumber(CVoiceMailboxEntry &vmbxEntry) |
105 { |
107 { |