⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _address_book_app_ui_8cpp-source.html

📁 symbian v9.1 下的地址本程序
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="l00252"></a>00252 <span class="comment">// and is called by the active scheduler to finish the process </span><a name="l00253"></a>00253 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00254"></a>00254 <span class="comment">//</span><a name="l00255"></a><a class="code" href="class_c_address_book_app_ui.html#9fadb422c50df5ad198f645d92cf408c">00255</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#9fadb422c50df5ad198f645d92cf408c">CAddressBookAppUi::ProcessFinished</a>()<a name="l00256"></a>00256         {<a name="l00257"></a>00257         }<a name="l00258"></a>00258 <a name="l00259"></a>00259 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00260"></a>00260 <span class="comment">// CAddressBookAppUi::StepL() </span><a name="l00261"></a>00261 <span class="comment">// It is overridden function from interface MAknBackgroundProcess</span><a name="l00262"></a>00262 <span class="comment">// and is called by the active scheduler to do one step of processing</span><a name="l00263"></a>00263 <span class="comment">// Purpose this function in AddressBook to run AddressBookEngine::ConnectL() </span><a name="l00264"></a>00264 <span class="comment">// if connection is not established yet</span><a name="l00265"></a>00265 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00266"></a>00266 <span class="comment">//</span><a name="l00267"></a><a class="code" href="class_c_address_book_app_ui.html#2b047861e8a98fc470be28703b1bd9d0">00267</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#2b047861e8a98fc470be28703b1bd9d0">CAddressBookAppUi::StepL</a>()<a name="l00268"></a>00268         {<a name="l00269"></a>00269         <span class="keywordflow">if</span> (!<a class="code" href="class_c_address_book_app_ui.html#b7587073b932d79e53ffe2aaad4544bb">iConnecting</a>)<a name="l00270"></a>00270                 {<a name="l00271"></a>00271                 <a class="code" href="class_c_address_book_app_ui.html#b7587073b932d79e53ffe2aaad4544bb">iConnecting</a> = ETrue;    <span class="comment">// do this only once</span><a name="l00272"></a>00272                 <a class="code" href="class_c_address_book_app_ui.html#c22846eecaea51cfb97699603e4227b3">iEngine</a>-&gt;<a class="code" href="class_c_address_book_engine.html#e8a170fa40d8d9d67f0cebf751b96e87">ConnectL</a>();<a name="l00273"></a>00273                 }<a name="l00274"></a>00274         }<a name="l00275"></a>00275 <a name="l00276"></a>00276 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00277"></a>00277 <span class="comment">// CAddressBookAppUi::ErrorL(TInt aCode)</span><a name="l00278"></a>00278 <span class="comment">// It is overridden function from interface MAddressBookEngineObserver</span><a name="l00279"></a>00279 <span class="comment">// Checks errors that can happen</span><a name="l00280"></a>00280 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00281"></a>00281 <span class="comment">//</span><a name="l00282"></a><a class="code" href="class_c_address_book_app_ui.html#71d57a12d321bb2d3b96b42fff19da55">00282</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#71d57a12d321bb2d3b96b42fff19da55">CAddressBookAppUi::ErrorL</a>(TInt aCode)<a name="l00283"></a>00283         {<a name="l00284"></a>00284         _LIT(KNotReady, <span class="stringliteral">"Connection is not ready."</span>);<a name="l00285"></a>00285         _LIT(KTooManyMatches, <span class="stringliteral">"Too many search results, please refine your search."</span>);<a name="l00286"></a>00286         _LIT(KSearchFailed, <span class="stringliteral">"Internal error, please try again."</span>);<a name="l00287"></a>00287 <a name="l00288"></a>00288         <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a> = ETrue;<a name="l00289"></a>00289         CAknErrorNote* note = <span class="keyword">new</span> (ELeave) CAknErrorNote(EFalse);<a name="l00290"></a>00290         TBuf&lt;70&gt; errorMessage;<a name="l00291"></a>00291         <span class="keywordflow">switch</span>(aCode) <a name="l00292"></a>00292                 {<a name="l00293"></a>00293                 <span class="keywordflow">case</span> EConnectionNotReady:<a name="l00294"></a>00294                         errorMessage = KNotReady;<a name="l00295"></a>00295                         <span class="keywordflow">break</span>;<a name="l00296"></a>00296                 <span class="keywordflow">case</span> ETooManyMatches:<a name="l00297"></a>00297                         errorMessage = KTooManyMatches;<a name="l00298"></a>00298                         <span class="keywordflow">break</span>;<a name="l00299"></a>00299                 <span class="keywordflow">case</span> ESearchFailed:<a name="l00300"></a>00300                         errorMessage = KSearchFailed;<a name="l00301"></a>00301                         <span class="keywordflow">break</span>;<a name="l00302"></a>00302                 <span class="keywordflow">default</span>:<a name="l00303"></a>00303                         <span class="keywordflow">break</span>;<a name="l00304"></a>00304                 }<a name="l00305"></a>00305         note-&gt;ExecuteLD(errorMessage);<a name="l00306"></a>00306         }<a name="l00307"></a>00307 <a name="l00308"></a>00308 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00309"></a>00309 <span class="comment">// CAddressBookAppUi::ConnectionReady()</span><a name="l00310"></a>00310 <span class="comment">// It is overridden function from interface MAddressBookEngineObserver</span><a name="l00311"></a>00311 <span class="comment">// It is called by the CAddressBookEngine::SetStatus(const TInt aStatus)</span><a name="l00312"></a>00312 <span class="comment">// to set conection's status as ready</span><a name="l00313"></a>00313 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00314"></a>00314 <span class="comment">//</span><a name="l00315"></a><a class="code" href="class_c_address_book_app_ui.html#0a22907cd96f62d44b6543dddf3704ee">00315</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#0a22907cd96f62d44b6543dddf3704ee">CAddressBookAppUi::ConnectionReady</a>()<a name="l00316"></a>00316         {<a name="l00317"></a>00317         <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a> = ETrue;<a name="l00318"></a>00318         }<a name="l00319"></a>00319 <a name="l00320"></a>00320 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00321"></a>00321 <span class="comment">// CAddressBookAppUi::UpdateFieldL (CPbkContactItem* modifiableItem,</span><a name="l00322"></a>00322 <span class="comment">//                                         TPbkFieldId fieldId,</span><a name="l00323"></a>00323 <span class="comment">//                                         const TDesC8&amp; newValue)</span><a name="l00324"></a>00324 <span class="comment">// Updates field of CPbkContactItem when user select the point of menu "Add to contacts". </span><a name="l00325"></a>00325 <span class="comment">// The change doesn't reflect to database.</span><a name="l00326"></a>00326 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00327"></a>00327 <span class="comment">//</span><a name="l00328"></a><a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">00328</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">CAddressBookAppUi::UpdateFieldL</a>(CPbkContactItem* modifiableItem,<a name="l00329"></a>00329                                       TPbkFieldId fieldId,<a name="l00330"></a>00330                                       <span class="keyword">const</span> TDesC8&amp; newValue)<a name="l00331"></a>00331         {<a name="l00332"></a>00332     TPbkContactItemField* Field =<a name="l00333"></a>00333         modifiableItem-&gt;FindField(fieldId);<a name="l00334"></a>00334     <span class="keywordflow">if</span>( Field )<a name="l00335"></a>00335                 {<a name="l00336"></a>00336                 HBufC* pValAsUnicode = SenXmlUtils::ToUnicodeLC(newValue);<a name="l00337"></a>00337         <span class="keywordflow">if</span>(pValAsUnicode)<a name="l00338"></a>00338                         {<a name="l00339"></a>00339                         Field-&gt;TextStorage()-&gt;SetTextL(*pValAsUnicode);<a name="l00340"></a>00340                         }<a name="l00341"></a>00341                 CleanupStack::PopAndDestroy(pValAsUnicode); <a name="l00342"></a>00342                 }<a name="l00343"></a>00343         }<a name="l00344"></a>00344         <a name="l00345"></a>00345 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00346"></a>00346 <span class="comment">// CAddressBookAppUi::SearchFinishedL(RPointerArray&lt;CAddressBookContact&gt;&amp; aContactArray) </span><a name="l00347"></a>00347 <span class="comment">// It is overridden function from MAddressBookEngineObserver interface</span><a name="l00348"></a>00348 <span class="comment">// Updates bufer containing the contact information and sets status as READY</span><a name="l00349"></a>00349 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00350"></a>00350 <span class="comment">//      </span><a name="l00351"></a><a class="code" href="class_c_address_book_app_ui.html#cb5842c326a788fa5aaa4f00cc718c06">00351</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#cb5842c326a788fa5aaa4f00cc718c06">CAddressBookAppUi::SearchFinishedL</a>(RPointerArray&lt;CAddressBookContact&gt;&amp; aContactArray)<a name="l00352"></a>00352         {<a name="l00353"></a>00353         <a class="code" href="class_c_address_book_app_ui.html#c25cfbb86775b001ed268ecaef2f307d">iAppContainer</a>-&gt;<a class="code" href="class_c_address_book_view.html#2f829fab6b84b31478f831680aa6cabb">UpdateL</a>(aContactArray);<a name="l00354"></a>00354         <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a> = ETrue;<a name="l00355"></a>00355         }<a name="l00356"></a>00356 <a name="l00357"></a>00357 <span class="comment">// End of File  </span><a name="l00358"></a>00358 </pre></div><hr><table x-use-null-cells		style="x-cell-content-align: top;				width: 100%;				border-spacing: 0px;				border-spacing: 0px;"		cellspacing=0		width=100%>  <col style="width: 50%;">  <col style="width: 50%;">  <tr style="x-cell-content-align: top;"	valign=top>  <td style="width: 50%;			padding-right: 10px;			padding-left: 10px;			border-right-style: None;			border-left-style: None;			border-top-style: None;			border-bottom-style: None;"	width=50%>  <p style="font-family: Arial;"><small style="font-size: smaller;">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -