📄 class_c_address_book_app_ui.html
字号:
</tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>From CEikAppUi, takes care of command handling. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>aCommand</em> </td><td>command to be handled </td></tr> </table></dl><p>Definition at line <a class="el" href="_address_book_app_ui_8cpp-source.html#l00114">114</a> of file <a class="el" href="_address_book_app_ui_8cpp-source.html">AddressBookAppUi.cpp</a>.<p>References <a class="el" href="_address_book_view_8cpp-source.html#l00319">CAddressBookView::ChangeCbaL()</a>, <a class="el" href="_address_book_view_8cpp-source.html#l00237">CAddressBookView::CloseItem()</a>, <a class="el" href="_address_book_view_8cpp-source.html#l00350">CAddressBookView::CurrentContact()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00120">CAddressBookContact::Email()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00180">CAddressBookContact::FaxL()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00060">CAddressBookContact::FirstName()</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00144">iAppContainer</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00150">iConnecting</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00146">iContactEngine</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00145">iEngine</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00149">iFirstTime</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00148">iReady</a>, <a class="el" href="_address_book_app_ui_8h-source.html#l00147">iWaitNote</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00070">CAddressBookContact::LastName()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00110">CAddressBookContact::MobilePhoneL()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00200">CAddressBookContact::Organization()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00100">CAddressBookContact::PhoneL()</a>, <a class="el" href="_address_book_engine_8cpp-source.html#l00369">CAddressBookEngine::SendSearchL()</a>, <a class="el" href="_address_book_view_8cpp-source.html#l00338">CAddressBookView::ShowAbout()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00080">CAddressBookContact::Street()</a>, <a class="el" href="_address_book_contact_8cpp-source.html#l00190">CAddressBookContact::Title()</a>, and <a class="el" href="_address_book_app_ui_8cpp-source.html#l00328">UpdateFieldL()</a>.<div class="fragment"><pre class="fragment"><a name="l00115"></a>00115 {<a name="l00116"></a>00116 <span class="keywordflow">switch</span> ( aCommand )<a name="l00117"></a>00117 {<a name="l00118"></a>00118 <span class="keywordflow">case</span> EAknSoftkeyBack:<a name="l00119"></a>00119 <a class="code" href="class_c_address_book_app_ui.html#c25cfbb86775b001ed268ecaef2f307d">iAppContainer</a>-><a class="code" href="class_c_address_book_view.html#df3662103f51dd273915341322626ceb">ChangeCbaL</a>(R_AVKON_SOFTKEYS_OPTIONS_EXIT, EDrawNow);<a name="l00120"></a>00120 <a class="code" href="class_c_address_book_app_ui.html#c25cfbb86775b001ed268ecaef2f307d">iAppContainer</a>-><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>-><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>->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>-><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->ExecuteLD(KInfoLine);<a name="l00158"></a>00158 }<a name="l00159"></a>00159 TBuf<50> searchFor;<a name="l00160"></a>00160 CAknTextQueryDialog* dlg = <span class="keyword">new</span>(ELeave)CAknTextQueryDialog(searchFor, CAknQueryDialog::ENoTone );<a name="l00161"></a>00161 dlg->SetPredictiveTextInputPermitted(ETrue);<a name="l00162"></a>00162 <span class="keywordflow">if</span> (dlg->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>-><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& 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>->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>-><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>-><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>-><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>->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-><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-><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-><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-><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-><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-><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-><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-><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-><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>->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 }</pre></div><p> </td> </tr></table><a class="anchor" name="0664643ad6fd66cf11afb7fdf7f5c6cc"></a><!-- doxytag: member="CAddressBookAppUi::HandleKeyEventL" ref="0664643ad6fd66cf11afb7fdf7f5c6cc" args="(const TKeyEvent &aKeyEvent, TEventCode aType)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">TKeyResponse CAddressBookAppUi::HandleKeyEventL </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const TKeyEvent & </td> <td class="mdname" nowrap> <em>aKeyEvent</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>TEventCode </td> <td class="mdname" nowrap> <em>aType</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [private, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>From CEikAppUi, handles key events. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>aKeyEvent</em> </td><td>Event to handled. </td></tr> <tr><td valign="top"></td><td valign="top"><em>aType</em> </td><td>Type of the key event. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Response code (EKeyWasConsumed, EKeyWasNotConsumed). </dd></dl><p>Definition at line <a class="el" href="_address_book_app_ui_8cpp-source.html#l00103">103</a> of file <a class="el" href="_address_book_app_ui_8cpp-source.html">AddressBookAppUi.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00105"></a>00105 {<a name="l00106"></a>00106 <span class="keywordflow">return</span> EKeyWasNotConsumed;<a name="l00107"></a>00107 }</pre></div><p> </td> </tr></table><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 + -