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

📄 _address_book_app_ui_8cpp-source.html

📁 symbian v9.1 下的地址本程序
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="l00120"></a>00120                         <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#234540eb0aa81f8bdc6e8a3c0b064c85">CloseItem</a>();<a name="l00121"></a>00121                         <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#a9ce352b9297b855591db3dd64de7368">ShowAbout</a>(EFalse);<a name="l00122"></a>00122                         <span class="keywordflow">break</span>;<a name="l00123"></a>00123         <span class="keywordflow">case</span> EEikCmdExit:<a name="l00124"></a>00124                 <span class="keywordflow">case</span> EAknSoftkeyExit:<a name="l00125"></a>00125             {<a name="l00126"></a>00126             Exit();<a name="l00127"></a>00127             <span class="keywordflow">break</span>;<a name="l00128"></a>00128             }<a name="l00129"></a>00129                 <span class="keywordflow">case</span> EAddressBookCmdAppConnect:<a name="l00130"></a>00130                         {<a name="l00131"></a>00131                         <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a> = EFalse;<a name="l00132"></a>00132                         <a class="code" href="class_c_address_book_app_ui.html#b7587073b932d79e53ffe2aaad4544bb">iConnecting</a> = EFalse;<a name="l00133"></a>00133                 <a name="l00134"></a>00134                         <span class="comment">// ---------------------------------------------------------------------</span><a name="l00135"></a>00135                         <span class="comment">// ExecuteL(R_CONNECTING_NOTE, *this, ETrue) runs the active scheduler, </span><a name="l00136"></a>00136                         <span class="comment">// that calls CAknWaitNoteWrapper::RunL(),it checks </span><a name="l00137"></a>00137                         <span class="comment">//       1. if is process already done - then calls function IsProcessDone() </span><a name="l00138"></a>00138                         <span class="comment">//                  (it is overridden from interface MAknBackgroundProcess to AddressBookAppUi)</span><a name="l00139"></a>00139                         <span class="comment">//       2. if process is not finished yet then RunL() calls StepL() that does one step of processing</span><a name="l00140"></a>00140                         <span class="comment">//                      (it is overridden from interface MAknBackgroundProcess to AddressBookAppUi)</span><a name="l00141"></a>00141                         <span class="comment">//                      This step establishes connection.</span><a name="l00142"></a>00142                         <span class="comment">// After establishing of connection the active scheduler calls </span><a name="l00143"></a>00143                         <span class="comment">// function DialogDismissedL(TInt aButtonId) which is overriden </span><a name="l00144"></a>00144                         <span class="comment">// in AddressBookAppUi from interface MAknBackgroundProcess </span><a name="l00145"></a>00145                         <span class="comment">// ---------------------------------------------------------------------</span><a name="l00146"></a>00146                         <span class="comment">//</span><a name="l00147"></a>00147                         <a class="code" href="class_c_address_book_app_ui.html#895121230961f0c23514d980e707cf56">iWaitNote</a>-&gt;ExecuteL(R_CONNECTING_NOTE, *<span class="keyword">this</span>, ETrue);<a name="l00148"></a>00148                         <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#a9ce352b9297b855591db3dd64de7368">ShowAbout</a>(EFalse);<a name="l00149"></a>00149                         <span class="keywordflow">break</span>;<a name="l00150"></a>00150                         }<a name="l00151"></a>00151         <span class="keywordflow">case</span> EAddressBookCmdAppSearch:<a name="l00152"></a>00152             {<a name="l00153"></a>00153                         <span class="keywordflow">if</span> (<a class="code" href="class_c_address_book_app_ui.html#14cd21f4084f18ee9caf2b98d71a32de">iFirstTime</a>)<a name="l00154"></a>00154                                 {<a name="l00155"></a>00155                                 _LIT(KInfoLine, <span class="stringliteral">"How to Search? Use first name, last name or phone number as criteria for search."</span>);<a name="l00156"></a>00156                                 CAknInformationNote* note = <span class="keyword">new</span> (ELeave) CAknInformationNote(ETrue);<a name="l00157"></a>00157                                 note-&gt;ExecuteLD(KInfoLine);<a name="l00158"></a>00158                                 }<a name="l00159"></a>00159                         TBuf&lt;50&gt; searchFor;<a name="l00160"></a>00160                         CAknTextQueryDialog* dlg = <span class="keyword">new</span>(ELeave)CAknTextQueryDialog(searchFor, CAknQueryDialog::ENoTone );<a name="l00161"></a>00161                         dlg-&gt;SetPredictiveTextInputPermitted(ETrue);<a name="l00162"></a>00162                         <span class="keywordflow">if</span> (dlg-&gt;ExecuteLD( R_MY_DATA_QUERY_DIALOG ) )<a name="l00163"></a>00163                                 {<a name="l00164"></a>00164                                 <a class="code" href="class_c_address_book_app_ui.html#14cd21f4084f18ee9caf2b98d71a32de">iFirstTime</a> = EFalse;<a name="l00165"></a>00165                                 <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a> = EFalse;<a name="l00166"></a>00166                                 <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#747630896453ebd94401850077f9ce1e">SendSearchL</a>(searchFor);<a name="l00167"></a>00167                                 <a name="l00168"></a>00168                                 <span class="comment">// ---------------------------------------------------------------------</span><a name="l00169"></a>00169                                 <span class="comment">// ExecuteL(R_SEARCHING_NOTE, *this) runs the active scheduler, </span><a name="l00170"></a>00170                                 <span class="comment">// that calls CSenServiceConnectionImpl::RunL() and it calls </span><a name="l00171"></a>00171                                 <span class="comment">// function HandleMessageL(const TDesC8&amp; aMessage)</span><a name="l00172"></a>00172                                 <span class="comment">// (it is overridden from interface MSenServiceConsumer to AddressBookAppUi)</span><a name="l00173"></a>00173                                 <span class="comment">// for receiving messages from the SendL()(CSenServiceConnection)function</span><a name="l00174"></a>00174                                 <span class="comment">// call</span><a name="l00175"></a>00175                                 <span class="comment">// ---------------------------------------------------------------------</span><a name="l00176"></a>00176                                 <span class="comment">//</span><a name="l00177"></a>00177                                 <a class="code" href="class_c_address_book_app_ui.html#895121230961f0c23514d980e707cf56">iWaitNote</a>-&gt;ExecuteL(R_SEARCHING_NOTE, *<span class="keyword">this</span>);<a name="l00178"></a>00178                                 <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#a9ce352b9297b855591db3dd64de7368">ShowAbout</a>(EFalse);<a name="l00179"></a>00179                                 }<a name="l00180"></a>00180             <span class="keywordflow">break</span>;<a name="l00181"></a>00181             }<a name="l00182"></a>00182                 <span class="keywordflow">case</span> EAddressBookCmdAppConnectAbout:<a name="l00183"></a>00183                         <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#a9ce352b9297b855591db3dd64de7368">ShowAbout</a>();<a name="l00184"></a>00184                         <span class="keywordflow">break</span>;<a name="l00185"></a>00185                 <span class="keywordflow">case</span> EAddressBookCmdAppAdd:<a name="l00186"></a>00186                         {<a name="l00187"></a>00187                         <a class="code" href="class_c_address_book_contact.html">CAddressBookContact</a>* pContact = <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#3fca94e0717b8f64d65f54d582de140c">CurrentContact</a>();<a name="l00188"></a>00188                         <span class="keywordflow">if</span> (pContact)<a name="l00189"></a>00189                                 {<a name="l00190"></a>00190                                 CPbkContactItem* newItem = <a name="l00191"></a>00191                                                                 <a class="code" href="class_c_address_book_app_ui.html#3a93d8d5f86553eb4607631b8c2acb76">iContactEngine</a>-&gt;CreateEmptyContactL();<a name="l00192"></a>00192                                 CleanupStack::PushL(newItem);<a name="l00193"></a>00193                                 <span class="comment">// Update personal information</span><a name="l00194"></a>00194                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdPhoneNumberMobile, <a name="l00195"></a>00195                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#6e69a9a71f021dae6d2dfae56693596b">MobilePhoneL</a>());<a name="l00196"></a>00196                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdPhoneNumberGeneral, <a name="l00197"></a>00197                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#11bc9239e5e38f769c8746ed0ee905b8">PhoneL</a>());<a name="l00198"></a>00198                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdFirstName, <a name="l00199"></a>00199                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#4b802aff47351035b51fb72861a29253">FirstName</a>());<a name="l00200"></a>00200                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdLastName, <a name="l00201"></a>00201                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#33e7486e759bad0c39c5f72ac3e4bd89">LastName</a>());<a name="l00202"></a>00202                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdFaxNumber, <a name="l00203"></a>00203                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#9bbb3dd9b0b5f08cd22d23fda885e419">FaxL</a>());<a name="l00204"></a>00204                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdEmailAddress, <a name="l00205"></a>00205                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#f12c7663fe92ddefb946c30741b43035">Email</a>());<a name="l00206"></a>00206                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdJobTitle, <a name="l00207"></a>00207                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#6d65b4e89ac5ada749523974f604ce8e">Title</a>());<a name="l00208"></a>00208                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdCompanyName, <a name="l00209"></a>00209                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#cd2080cbd8b77f34d29ad6ff80cbf605">Organization</a>());<a name="l00210"></a>00210                                 <a class="code" href="class_c_address_book_app_ui.html#35d06dd229187c83865b64b3641093a2">UpdateFieldL</a>( newItem, EPbkFieldIdPostalAddress, <a name="l00211"></a>00211                                         pContact-&gt;<a class="code" href="class_c_address_book_contact.html#fcb5a191f1b974a14152992f371cf605">Street</a>());<a name="l00212"></a>00212 <a name="l00213"></a>00213                                 <span class="comment">// add the new contact to the phone book. </span><a name="l00214"></a>00214                                 <a class="code" href="class_c_address_book_app_ui.html#3a93d8d5f86553eb4607631b8c2acb76">iContactEngine</a>-&gt;AddNewContactL(*newItem);<a name="l00215"></a>00215                                 CleanupStack::PopAndDestroy(newItem);<a name="l00216"></a>00216                                 }<a name="l00217"></a>00217                         }<a name="l00218"></a>00218                         <span class="keywordflow">break</span>;<a name="l00219"></a>00219         <span class="keywordflow">default</span>:<a name="l00220"></a>00220             <span class="keywordflow">break</span>;      <a name="l00221"></a>00221         }<a name="l00222"></a>00222     }<a name="l00223"></a>00223 <a name="l00224"></a>00224 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00225"></a>00225 <span class="comment">// CAddressBookAppUi::DialogDismissedL(TInt aButtonId)</span><a name="l00226"></a>00226 <span class="comment">// It is overridden function from interface MAknBackgroundProcess</span><a name="l00227"></a>00227 <span class="comment">// and is called by the active scheduler to dismiss the dialog</span><a name="l00228"></a>00228 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00229"></a>00229 <span class="comment">//</span><a name="l00230"></a><a class="code" href="class_c_address_book_app_ui.html#2220dbb6fc6782a5030c8164fcc2c231">00230</a> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_app_ui.html#2220dbb6fc6782a5030c8164fcc2c231">CAddressBookAppUi::DialogDismissedL</a>(TInt aButtonId)<a name="l00231"></a>00231         {<a name="l00232"></a>00232         <span class="keywordflow">if</span> (aButtonId == EAknSoftkeyCancel)<a name="l00233"></a>00233                 {<a name="l00234"></a>00234                 <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#e5feacc99c7a1d3ff42a6d3109717c3c">Cancel</a>();<a name="l00235"></a>00235                 }<a name="l00236"></a>00236         }<a name="l00237"></a>00237 <a name="l00238"></a>00238 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00239"></a>00239 <span class="comment">// CAddressBookAppUi::IsProcessDone() const</span><a name="l00240"></a>00240 <span class="comment">// It is overridden function from interface MAknBackgroundProcess</span><a name="l00241"></a>00241 <span class="comment">// and is called by the active scheduler to check if is process already done </span><a name="l00242"></a>00242 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00243"></a>00243 <span class="comment">//</span><a name="l00244"></a><a class="code" href="class_c_address_book_app_ui.html#34fc7596f70aed6415e69cc09bec0968">00244</a> TBool <a class="code" href="class_c_address_book_app_ui.html#34fc7596f70aed6415e69cc09bec0968">CAddressBookAppUi::IsProcessDone</a>()<span class="keyword"> const</span><a name="l00245"></a>00245 <span class="keyword">        </span>{<a name="l00246"></a>00246         <span class="keywordflow">return</span> <a class="code" href="class_c_address_book_app_ui.html#6830bcaace45857cc2764083c896a853">iReady</a>;<a name="l00247"></a>00247         }<a name="l00248"></a>00248 <a name="l00249"></a>00249 <span class="comment">// ----------------------------------------------------------------------------</span><a name="l00250"></a>00250 <span class="comment">// CAddressBookAppUi::ProcessFinished() </span><a name="l00251"></a>00251 <span class="comment">// It is overridden function from interface MAknBackgroundProcess</span>

⌨️ 快捷键说明

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