predictivesearch/PcsServer/inc/CPcsSession.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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:  PCS Session class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PCS_SESSION_H
       
    19 #define PCS_SESSION_H
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <e32base.h>
       
    23 #include "CPsSettings.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CPcsServer;
       
    27 class CPsQuery;
       
    28 
       
    29 /**
       
    30  * Represents a session (version 2) for a client thread on 
       
    31  * the server side
       
    32  */
       
    33 class CPcsSession : public CSession2
       
    34 {
       
    35     public:
       
    36     
       
    37         /**
       
    38          * Two phase construction
       
    39          */
       
    40 		static CPcsSession* NewL(CPcsServer* aServer);
       
    41 		
       
    42 		/**
       
    43 		 * Handles the servicing of client requests
       
    44 		 * Implements CSession2 ServiceL
       
    45 		 */
       
    46 		void ServiceL(const RMessage2& aMessage);
       
    47 		
       
    48 		/**
       
    49 		 * Handles the leaves generated by ServiceL function
       
    50 		 * Implements CSession2 ServiceError
       
    51 		 */
       
    52 		void ServiceError(const RMessage2& aMessage, TInt aError);
       
    53 
       
    54     private:
       
    55     
       
    56         /**
       
    57          * Second phase constructor
       
    58          */
       
    59 		void ConstructL();
       
    60 		
       
    61 		/**
       
    62 		 * Constructor
       
    63 		 */
       
    64 		CPcsSession(CPcsServer* aServer);
       
    65 		
       
    66 		/** Destructor
       
    67 		 *
       
    68 		 */
       
    69 		~CPcsSession();
       
    70 		
       
    71 		/**
       
    72 		 * Serve the client requests
       
    73 		 */
       
    74 		void DoServiceL(const RMessage2& aMessage);
       
    75 	
       
    76 	    /** 
       
    77 		 * Service method to handle search settings
       
    78 		 */
       
    79 		void SetSearchSettingsL(const RMessage2& aMessage);	
       
    80 				
       
    81 		/** 
       
    82 		 * Service method to perform predictive contact search
       
    83 		 */
       
    84 		void GetAsyncPcsResultsL(const RMessage2& aMessage);
       
    85 		
       
    86 	    /** 
       
    87 		 * Service method to perform predictive search on input data
       
    88 		 */
       
    89 		void SearchInputL(const RMessage2& aMessage);
       
    90 
       
    91         /** 
       
    92          * Service method to perform predictive search on input data
       
    93          * with string as result
       
    94          */
       
    95         void SearchMatchStringL(const RMessage2& aMessage);		
       
    96 		
       
    97 		/**
       
    98 		 * Service method to check if the laguage is supported or not
       
    99 		 */
       
   100 		void IsLanguageSupportedL(const RMessage2& aMessage);
       
   101 				
       
   102 	    /**
       
   103 		 * Service method to get supported data fields
       
   104 		 */
       
   105 		void GetDataOrderL(const RMessage2& aMessage);
       
   106 							
       
   107 	    /**
       
   108 		 * Service method to get sort order of data fields
       
   109 		 */
       
   110 		void GetSortOrderL(const RMessage2& aMessage);
       
   111 		
       
   112 		/**
       
   113 		 * Service method to get sort order of data fields
       
   114 		 */
       
   115 		void ChangeSortOrderL(const RMessage2& aMessage);
       
   116 		
       
   117 		/**
       
   118 		 * Service method to get Adaptive Grid
       
   119 		 */
       
   120 		void GetAdaptiveGridL(const RMessage2& aMessage);
       
   121 		
       
   122 		/**
       
   123 		 * Service method to shutdown the server
       
   124 		 */
       
   125 		void ShutdownServerL(const RMessage2& aMessage);
       
   126 
       
   127 		/**
       
   128 		 * Utility function for reading search query from message
       
   129 		 */
       
   130 		static CPsQuery* ReadQueryLC( TInt aParam, const RMessage2& aMessage );
       
   131 		
       
   132     private:
       
   133     
       
   134         /**
       
   135          * Reference to server (not owned)
       
   136          */
       
   137 		CPcsServer*             iServer;
       
   138 		
       
   139 		/**
       
   140 		 * Indicates if a buffer overflow has occurred (owned)
       
   141 		 */
       
   142 		TBool				    iBufferOverFlow;
       
   143 		
       
   144 		/**
       
   145 		 * Used to cache the results in case of overflow (owned)
       
   146 		 */
       
   147 		HBufC8*                 iDes;
       
   148 		
       
   149 		/**
       
   150 		* Search settings for the session
       
   151 		*/
       
   152 		CPsSettings*            iSettings;
       
   153 		
       
   154 		/**
       
   155 		* Hold a copy of search message
       
   156 		*/
       
   157 		RMessagePtr2            iMessage;					   		
       
   158 };
       
   159 
       
   160 #endif // End of file