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