contacts_plat/predictivesearch_client_api/inc/RPsSession.h
changeset 0 e686773b3f54
child 13 a6539d1e8e43
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  This is the client side interface declaration for the 
       
    15 *                predictive contact search server.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef R_PS_SESSION_H
       
    20 #define R_PS_SESSION_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 
       
    24 // SYSTEM INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 #include <e32cmn.h>
       
    28 #include <s32mem.h>
       
    29 #include <e32debug.h>
       
    30 #include <utf.h>
       
    31 #include <s32mem.h>
       
    32 #include <CPcsDefs.h>
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * Client side interface for predictive search server.
       
    37 */
       
    38 class RPsSession : public RSessionBase
       
    39 {
       
    40 
       
    41     public:
       
    42 
       
    43 		/**
       
    44 		* RPcsSession.
       
    45 		* Constructor
       
    46 		*/
       
    47 		RPsSession();	
       
    48 
       
    49 		/**
       
    50 		* Connect.
       
    51 		* Connects to the predictive search server
       
    52 		*/
       
    53 		TInt Connect();
       
    54 
       
    55 		/**
       
    56 		* Version.
       
    57 		* Returns the version number of predictive search server
       
    58 		*
       
    59 		* @return Version information
       
    60 		*/
       
    61 		TVersion Version() const;
       
    62 	
       
    63 	    /**
       
    64         * SetSearchSettingsL.
       
    65         * Send the search settings (databases/ display fields) to the server.
       
    66         * @param aSettings      The search settings.       
       
    67         */
       
    68 	    void SetSearchSettingsL(const TDes8& aSettings);
       
    69 	
       
    70         /**
       
    71         * SearchL.
       
    72         * Initiates a predictive search request to the server.
       
    73         * @param aSearchQuery   The search query.
       
    74         * @param aResultsBuffer Pointer to the initial results buffer.
       
    75 	    * @param aStatus        Holds the completion status of request.
       
    76         */
       
    77 	    void SearchL(const TDes8& aSearchQuery,
       
    78 	                 TPtr8 aResultsBuffer,
       
    79 					 TRequestStatus& aStatus);
       
    80 	
       
    81 	    /**
       
    82 	    * CancelSearchL.
       
    83 	    * Cancels a pending search request.
       
    84 	    * @param aStatus        Holds the completion status of request.
       
    85 	    */ 				 
       
    86 	    void CancelSearch();		
       
    87 	    
       
    88 	    /**
       
    89         * SearchL.
       
    90         * Initiates a predictive search request to the server.
       
    91         * @param aSearchQuery   The search query.
       
    92         * @param aSearchData    The search data.
       
    93         * @param aResultsBuffer Pointer to the initial results buffer.	 
       
    94         */
       
    95 	    void SearchL(const TDes8& aSearchQuery,
       
    96 	                 const TDes8& aSearchData,
       
    97 	                 TPtr8 aResultsBuffer);
       
    98 
       
    99 	    /**
       
   100         * SearchMatchStringL.
       
   101         * Initiates a predictive search request to the server with result as string.
       
   102         * @param aSearchQuery   The search query.
       
   103         * @param aSearchData    The search data.
       
   104         * @param aResultsBuffer Pointer to the initial results buffer.	 
       
   105         */	    
       
   106 	    void SearchMatchStringL(const TDes8& aSearchQuery,
       
   107 	                             const TDes8& aSearchData,
       
   108 	                             TDes& aResultsBuffer);
       
   109 	    
       
   110 	    /**
       
   111 	    * SendNewBufferL.
       
   112 	    * Send a new buffer to server if a overflow occurs.
       
   113 	    *
       
   114 	    * @param aResultsBuffer Pointer to the new results buffer.
       
   115 	    * @param aStatus        Holds the completion status of request.
       
   116 	    */
       
   117 	    void SendNewBufferL(TPtr8 aResultsBuffer,
       
   118 	                        TRequestStatus& aStatus);
       
   119 	                           
       
   120         /**
       
   121         * IsLanguageSupportedL
       
   122         * Sends a request to PS server to decide if the language
       
   123         * variant is supported or not
       
   124         *
       
   125         * @param aLanguage     The language id info.
       
   126         * @param aResultsBuffer Pointer to the initial results buffer.	 
       
   127         */                              
       
   128         void IsLanguageSupportedL(const TDes8& aLanguage,
       
   129                                       TPtr8 aResultsBuffer);	                        	 
       
   130         /**
       
   131         * GetDataOrderL
       
   132         * Sends a request to PS server to get the data fields supported
       
   133         * for a data store.
       
   134         *
       
   135         * @param aURI           Data store identifier.
       
   136         * @param aResultsBuffer Pointer to the results buffer.	 
       
   137         */                              
       
   138         void GetDataOrderL(const TDes8& aURI,
       
   139                            TPtr8 aResultsBuffer);
       
   140 
       
   141         /**
       
   142         * GetSortOrderL
       
   143         * Sends a request to PS server to get the sort order of fields 
       
   144         * supported for a data store.
       
   145         *
       
   146         * @param aURI           Data store identifier.
       
   147         * @param aResultsBuffer Pointer to the results buffer.	 
       
   148         */                              
       
   149         void GetSortOrderL(const TDes8& aURI,
       
   150                            TPtr8 aResultsBuffer);
       
   151 
       
   152         /**
       
   153         * ChangeSortOrderL
       
   154         * Sends a request to PS server to set the sort order of fields 
       
   155         * for a data store.
       
   156         *
       
   157         * @param aInput         Data store + Sort Order values.	 
       
   158         */                              
       
   159         void ChangeSortOrderL(const TDes8& aInput);
       
   160 
       
   161 		/**
       
   162 		* Shuts down the predictive search server
       
   163 		*/				                   
       
   164 		void ShutdownServerL();
       
   165 	
       
   166 	private:
       
   167 	
       
   168 	    /**
       
   169 	    * iSearchQueryBufferPtr. Pointer to the buffer holding search query.
       
   170 	    */
       
   171 		TPtrC8   iSearchQueryBufferPtr;
       
   172 		
       
   173 		/**
       
   174 	    * iResultsBufferPtr. Pointer to the buffer holding search results
       
   175 	    */
       
   176 		TPtr8   iResultsBufferPtr;
       
   177 			                   
       
   178 };
       
   179 
       
   180 #endif // R_PS_SESSION_H
       
   181 
       
   182 // End of file