ccservices/cmsservices/cmsengine/Server/inc/cmsserversession.h
changeset 0 e686773b3f54
child 5 81f8547efd4f
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *       
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CMSSESSION_H__
       
    21 #define __CMSSESSION_H__
       
    22 
       
    23 // FORWARD DECLARATIONS
       
    24 class CCmsServer;
       
    25 class CCmsPhoneBookProxy;
       
    26 class MCmsContactInterface;
       
    27 
       
    28 /**
       
    29  * CCmsServerSession represents a session for a client thread on the
       
    30  * server side.
       
    31  */ 
       
    32 NONSHARABLE_CLASS( CCmsServerSession ) : public CSession2
       
    33     {
       
    34     public:  // Constructors and destructor
       
    35         
       
    36         /**
       
    37         * Creates new server session
       
    38         *
       
    39         * @param CCmsServer* The main server object
       
    40         * @return CCmsSession* New session
       
    41         */ 
       
    42         static CCmsServerSession* NewL( CCmsServer* aServer );
       
    43 
       
    44         /**
       
    45         * Service an incoming request
       
    46         * @param RMessage2& Kernel message with client's data
       
    47         *
       
    48         * @return void
       
    49         */ 
       
    50         void ServiceL( const RMessage2& aMessage );
       
    51         
       
    52         /**
       
    53         * Destructor.
       
    54         */      
       
    55         ~CCmsServerSession();
       
    56     
       
    57     public: // Public methods
       
    58         
       
    59         /**
       
    60         * Notifies session that stores open is complete.
       
    61         */           
       
    62         void StoreOpenComplete();
       
    63         
       
    64         /**
       
    65         * Notifies session that contact retrieving is done.
       
    66         * 
       
    67         * @param aError Operation completion status
       
    68         */
       
    69         void CmsSingleContactOperationComplete( TInt aError );
       
    70     
       
    71     private:
       
    72         
       
    73         /**
       
    74         * Symbian OS second-phase constructor
       
    75         */ 
       
    76         void ConstructL();
       
    77 
       
    78         /**
       
    79         * C++ default constructor is private.
       
    80         *
       
    81         * @param CCmsServer* The main server object
       
    82         */      
       
    83         CCmsServerSession( CCmsServer* aServer );
       
    84         
       
    85         /**
       
    86         * Panic the client
       
    87         *
       
    88         * @param TInt Panic code
       
    89         */ 
       
    90         void PanicClient( TInt aPanic );
       
    91         
       
    92         /**
       
    93         * Creates new CCmsServerContact and fetches contact info
       
    94         *
       
    95         * @param aMessage Kernel message with client's data
       
    96         */
       
    97         void CreateContactL( const RMessage2& aMessage );
       
    98         
       
    99         /**
       
   100         * Fetches list of enabled (i.e. with some content) fields
       
   101         *
       
   102         * @param aMessage Kernel message with client's data
       
   103         */
       
   104         void EnabledFieldsL( const RMessage2& aMessage );
       
   105 
       
   106         /**
       
   107         * Fetches contact field
       
   108         * 
       
   109         * @param aMessage Kernel message with client's data
       
   110         */
       
   111         void FetchDataL( const RMessage2& aMessage );
       
   112 
       
   113         /**
       
   114         * Fetches contact identifier (ID)
       
   115         *
       
   116         * @param aMessage Kernel message with client's data
       
   117         */
       
   118         void FetchContactIdentifierL( const RMessage2& aMessage );
       
   119                         
       
   120         /**
       
   121         * Cancels ongoing async operation
       
   122         *
       
   123         * @param aMessage Kernel message with client's data
       
   124         */
       
   125         void CancelOperation( const RMessage2& aMessage );
       
   126         
       
   127         /**
       
   128         * Activates notifications
       
   129         *
       
   130         * @param aMessage Kernel message with client's data
       
   131         * @param aAskMore If ETrue, returns current presence status imemdiately
       
   132         *   from the presence cache and notify later about any changes
       
   133         */
       
   134         void OrderNotifyL( const RMessage2& aMessage, TBool aAskMore );  
       
   135          
       
   136         /**
       
   137         * Cancels notifications
       
   138         *
       
   139         * @param aMessage Kernel message with client's data
       
   140         */
       
   141         void CompleteNotify( const RMessage2& aMessage );
       
   142         
       
   143         /**
       
   144         * Finds services (IM, Voip, etc) availability
       
   145         *
       
   146         * @param aMessage Kernel message with client's data
       
   147         * @return 0 if not available, 1 otherwise
       
   148         */
       
   149         TInt FindServiceAvailabilityL( const RMessage2& aMessage );
       
   150         
       
   151         /**
       
   152         * Returns current contact's store
       
   153         *
       
   154         * @param aMessage Kernel message with client's data
       
   155         * @return Contact store, see TCmsContactStore from CCmsServerContact
       
   156         */
       
   157         TInt FindParentStoreL( const RMessage2& aMessage );
       
   158         
       
   159         /**
       
   160         * Finds a contact from xSP store
       
   161         *
       
   162         * @param aMessage Kernel message with client's data
       
   163         */
       
   164         void FindXSPContactL( const RMessage2& aMessage );
       
   165         
       
   166         /**
       
   167         * Cancels xSP contact search
       
   168         *
       
   169         * @param aMessage Kernel message with client's data
       
   170         */
       
   171         void CancelXSPContactFindL( const RMessage2& aMessage );
       
   172         
       
   173         /**
       
   174         * Fetches contact information
       
   175         *
       
   176         * @param aMessage Kernel message with client's data
       
   177         * @param aContactInterface Observer to be notified about
       
   178         *                          operation completion
       
   179         */
       
   180         void FetchContactL( const RMessage2& aMessage,
       
   181                             MCmsContactInterface* aContactInterface );
       
   182         
       
   183         /**
       
   184          * Gets contact action field count.
       
   185          */
       
   186         TInt GetContacActionFieldCountL( const RMessage2& aMessage );
       
   187         
       
   188         /**
       
   189         * Handles clients requests
       
   190         *
       
   191         * @param aMessage Kernel message with client's data
       
   192         */
       
   193         void DoServiceL( const RMessage2& aMessage );
       
   194 
       
   195     private: //Data
       
   196         
       
   197         /// CMS server instance. Not owned.
       
   198         CCmsServer*                             iCmsServer;
       
   199         
       
   200         // CCmsServerContact instance. Owned.
       
   201         CCmsServerContact*                      iServerContact;
       
   202         
       
   203         /// Service message to fetch a contact. Completed when contact 
       
   204         /// retrieving operation is done.
       
   205         RMessage2                               iCmsContactRetrieveMessage;
       
   206         
       
   207         /// Copy of the service message received from the client. It's saved for 
       
   208         /// delayed processing if stores are not opened yet.
       
   209         RMessage2                               iServiceMessage;
       
   210         
       
   211         /// ETrue, if FeatureManager library was initialized.
       
   212         TBool                                   iFeatureManagerInitialized;
       
   213     };
       
   214 
       
   215 
       
   216 #endif
       
   217 
       
   218 // End of File