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

📄 _address_book_engine_8h-source.html

📁 symbian v9.1 下的地址本程序
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="l00103"></a>00103                 <span class="keyword">static</span> <a class="code" href="class_c_address_book_engine.html">CAddressBookEngine</a>* <a class="code" href="class_c_address_book_engine.html#49c5d4b00d914807d1d3e5b4f0b9779c">NewL</a>(<a class="code" href="class_m_address_book_engine_observer.html">MAddressBookEngineObserver</a>&amp; aObserver);<a name="l00104"></a>00104                 <span class="comment"></span><a name="l00105"></a>00105 <span class="comment">                /**</span><a name="l00106"></a>00106 <span class="comment">        * Destructor.</span><a name="l00107"></a>00107 <span class="comment">        */</span>      <a name="l00108"></a>00108                 <a class="code" href="class_c_address_book_engine.html#a4ba0d14f6a5ed5a94d6987934aca333">~CAddressBookEngine</a>();<a name="l00109"></a>00109                 <a name="l00110"></a>00110                 <span class="comment">// New functions</span><a name="l00111"></a>00111                 <span class="comment"></span><a name="l00112"></a>00112 <span class="comment">                /**</span><a name="l00113"></a>00113 <span class="comment">                * This function is called after an user has selected Search from the GUI </span><a name="l00114"></a>00114 <span class="comment">                * and typed a request. Function creates a search pattern from the descriptor</span><a name="l00115"></a>00115 <span class="comment">                * and send it to the WSP. The message from server is received through </span><a name="l00116"></a>00116 <span class="comment">                * HandleMessageL() or an error is received through HandleErrorL().</span><a name="l00117"></a>00117 <span class="comment">                * @param aSearchPattern - descriptor on Searching note that an user has typed</span><a name="l00118"></a>00118 <span class="comment">                */</span><a name="l00119"></a>00119                 <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_engine.html#747630896453ebd94401850077f9ce1e">SendSearchL</a>(<span class="keyword">const</span> TDesC&amp; aSearchPattern);<a name="l00120"></a>00120                 <span class="comment"></span><a name="l00121"></a>00121 <span class="comment">                /**</span><a name="l00122"></a>00122 <span class="comment">                * Makes a connection to an ID-WSF service.</span><a name="l00123"></a>00123 <span class="comment">                * When ConnectL() is called the first time, authentication and</span><a name="l00124"></a>00124 <span class="comment">                * discovery services are connected and the user is therefore</span><a name="l00125"></a>00125 <span class="comment">                * authenticated and the service is connected.</span><a name="l00126"></a>00126 <span class="comment">                * When ConnectL() is called again and the credentials received from</span><a name="l00127"></a>00127 <span class="comment">                * authentication and discovery services are valid, there are no need to</span><a name="l00128"></a>00128 <span class="comment">                * connect to them again. This means that SetStatus() will be called</span><a name="l00129"></a>00129 <span class="comment">                * almost immediately with value CONNECTED, but in device GPRS or data</span><a name="l00130"></a>00130 <span class="comment">                * connection is not opened yet (but instead it is opened when search</span><a name="l00131"></a>00131 <span class="comment">                * occurs).</span><a name="l00132"></a>00132 <span class="comment">                */</span><a name="l00133"></a>00133                 <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_engine.html#e8a170fa40d8d9d67f0cebf751b96e87">ConnectL</a>();<a name="l00134"></a>00134                 <span class="comment"></span><a name="l00135"></a>00135 <span class="comment">                /** </span><a name="l00136"></a>00136 <span class="comment">                * sets a state of connection as KSenConnectionStatusReady</span><a name="l00137"></a>00137 <span class="comment">                */</span><a name="l00138"></a>00138                 TBool <a class="code" href="class_c_address_book_engine.html#4b0394a07927e23c977c81ec024a8060">Connected</a>();<a name="l00139"></a>00139                 <span class="comment"></span><a name="l00140"></a>00140 <span class="comment">                /**</span><a name="l00141"></a>00141 <span class="comment">                * This function need to get a current contact (CAddressBookView::CurrentContact())</span><a name="l00142"></a>00142 <span class="comment">                * or to open an item (CAddressBookView::OpenItemL())</span><a name="l00143"></a>00143 <span class="comment">                * @param aPosition - Index of Item whose data is needed to get</span><a name="l00144"></a>00144 <span class="comment">                * @param aContact - gets Value of Item whose Index == aPosition</span><a name="l00145"></a>00145 <span class="comment">                * @return if there is such item, KErrorNotFound is returned</span><a name="l00146"></a>00146 <span class="comment">        *         otherwise returns KIndexError.</span><a name="l00147"></a>00147 <span class="comment">                */</span> <a name="l00148"></a>00148                 TInt <a class="code" href="class_c_address_book_engine.html#c53d64c2194748449107eeb2403042dc">GetContact</a>(TInt aPosition, <a class="code" href="class_c_address_book_contact.html">CAddressBookContact</a>*&amp; aContact);<a name="l00149"></a>00149                 <span class="comment"></span><a name="l00150"></a>00150 <span class="comment">                /**</span><a name="l00151"></a>00151 <span class="comment">                * Close WebServices-connection if user canceled</span><a name="l00152"></a>00152 <span class="comment">                */</span><a name="l00153"></a>00153                 <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_engine.html#e5feacc99c7a1d3ff42a6d3109717c3c">Cancel</a>();<a name="l00154"></a>00154                 <span class="comment"></span><a name="l00155"></a>00155 <span class="comment">                /**</span><a name="l00156"></a>00156 <span class="comment">                * Gets the XML query based on the search parameter passed</span><a name="l00157"></a>00157 <span class="comment">                * Method also calls WSF ServiceDescriptionL() getter and</span><a name="l00158"></a>00158 <span class="comment">                * resolves either ResourceID or EncryptedResourceID element. Later</span><a name="l00159"></a>00159 <span class="comment">                * on, this resource id may be used when generating the actual query</span><a name="l00160"></a>00160 <span class="comment">                * which is sent to the service (WSP)</span><a name="l00161"></a>00161 <span class="comment">                * @param aSearchPattern - descriptor on Searching note that an user has typed</span><a name="l00162"></a>00162 <span class="comment">                */</span><a name="l00163"></a>00163                 HBufC8* <a class="code" href="class_c_address_book_engine.html#95d3e261b03f0a2bf7f648406a80904f">GenerateQueryRequestL</a>(<span class="keyword">const</span> TDesC&amp; aSearchPattern);<a name="l00164"></a>00164 <a name="l00165"></a>00165         <span class="keyword">protected</span>: <span class="comment">// Functions from base classes</span><a name="l00166"></a>00166         <span class="comment"></span><a name="l00167"></a>00167 <span class="comment">                /** </span><a name="l00168"></a>00168 <span class="comment">                * From CSenDomFragment, is called from CAddressBookEngine::HandleMessageL </span><a name="l00169"></a>00169 <span class="comment">                * (ParseL(aMessage)) every time when XML parser finds a new element tag.</span><a name="l00170"></a>00170 <span class="comment">                * In this case we are interested in the &lt;Status&gt; and &lt;Card&gt; elements.</span><a name="l00171"></a>00171 <span class="comment">                * When Status is found, we compare if attribute 'Code' is OK or not.</span><a name="l00172"></a>00172 <span class="comment">                * SenXmlUtils::LocalName() only extracts out a possible XML prefix</span><a name="l00173"></a>00173 <span class="comment">                * (i.e. 'ab:OK').</span><a name="l00174"></a>00174 <span class="comment">                * When local name is 'Card', we have encountered a contact-object.</span><a name="l00175"></a>00175 <span class="comment">                * Then we make a new CAddressBookContact and delegate the parsing to it.</span><a name="l00176"></a>00176 <span class="comment">                *</span><a name="l00177"></a>00177 <span class="comment">                * Example server response:</span><a name="l00178"></a>00178 <span class="comment">                * &lt;ab:QueryResponse xmlns:ab="urn:nokia:test:addrbook:2004-09"&gt;</span><a name="l00179"></a>00179 <span class="comment">                *    &lt;ab:Status code="ab:OK"/&gt;</span><a name="l00180"></a>00180 <span class="comment">                * &lt;ab:Data&gt;</span><a name="l00181"></a>00181 <span class="comment">                *       &lt;ab:Card&gt;</span><a name="l00182"></a>00182 <span class="comment">                *               &lt;ab:N&gt;</span><a name="l00183"></a>00183 <span class="comment">                *                       &lt;ab:FAMILY&gt;Smith&lt;/ab:FAMILY&gt;</span><a name="l00184"></a>00184 <span class="comment">                *                       &lt;ab:GIVEN&gt;John&lt;/ab:GIVEN&gt;</span><a name="l00185"></a>00185 <span class="comment">                *               &lt;/ab:N&gt;</span><a name="l00186"></a>00186 <span class="comment">                *               &lt;ab:ADR&gt;</span><a name="l00187"></a>00187 <span class="comment">                *                       &lt;ab:EXTADR&gt;Room 123&lt;/ab:EXTADDR&gt;</span><a name="l00188"></a>00188 <span class="comment">                *                       &lt;ab:STREET&gt;1st ST 123&lt;/ab:STREET&gt;</span><a name="l00189"></a>00189 <span class="comment">                *                       &lt;ab:PCODE&gt;7698532&lt;/ab:PCODE&gt;</span><a name="l00190"></a>00190 <span class="comment">                *               &lt;/ab:ADR&gt;</span><a name="l00191"></a>00191 <span class="comment">                *               &lt;ab:TEL&gt;1234&lt;/ab:TEL&gt;</span><a name="l00192"></a>00192 <span class="comment">                *               &lt;ab:TEL type="CELL"&gt;2122345&lt;/ab:TEL&gt;</span><a name="l00193"></a>00193 <span class="comment">                *       &lt;/ab:Card&gt;</span><a name="l00194"></a>00194 <span class="comment">                * &lt;/ab:Data&gt;</span><a name="l00195"></a>00195 <span class="comment">                * &lt;/ab:QueryResponse&gt;</span><a name="l00196"></a>00196 <span class="comment">                *</span><a name="l00197"></a>00197 <span class="comment">                * @param aNsUri - namespace URI</span><a name="l00198"></a>00198 <span class="comment">                * @param aLocalName - local name (in this case may be Status or Card)</span><a name="l00199"></a>00199 <span class="comment">                * @param aQName - qualified name</span><a name="l00200"></a>00200 <span class="comment">                * @param aAttrs - we are interested if value of attribute is KCode or not</span><a name="l00201"></a>00201 <span class="comment">                */</span><a name="l00202"></a>00202                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_address_book_engine.html#a575736176d644c609425a199cd04601">StartElementL</a>(<span class="keyword">const</span> TDesC8&amp; aNsUri, <a name="l00203"></a>00203                                                                    <span class="keyword">const</span> TDesC8&amp; aLocalName,<a name="l00204"></a>00204                                                                    <span class="keyword">const</span> TDesC8&amp; aQName,<a name="l00205"></a>00205                                                                    <span class="keyword">const</span> RAttributeArray&amp; aAttrs);<a name="l00206"></a>00206                                                                    <span class="comment"></span><a name="l00207"></a>00207 <span class="comment">                /**</span><a name="l00208"></a>00208 <span class="comment">                * From CSenDomFragment, is called from CAddressBookEngine::HandleMessageL </span><a name="l00209"></a>00209 <span class="comment">                * (ParseL(aMessage)) every time when XML parser finds a closing element tag.</span><a name="l00210"></a>00210 <span class="comment">                *                                                                 </span><a name="l00211"></a>00211 <span class="comment">                * We are only interested about the &lt;/Status&gt; element.</span><a name="l00212"></a>00212 <span class="comment">                * When the &lt;/Status&gt; is found, we check for errors found in response,</span><a name="l00213"></a>00213 <span class="comment">                * and if so, notice the observer</span><a name="l00214"></a>00214 <span class="comment">                * @param aNsUri - namespace URI</span><a name="l00215"></a>00215 <span class="comment">                * @param aLocalName - local name (in this case we are interested only Status)</span><a name="l00216"></a>00216 <span class="comment">                * @param aQName - qualified name</span><a name="l00217"></a>00217 <span class="comment">                */</span>                                                         

⌨️ 快捷键说明

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