imservices/instantmessagingcache/imcacheserver/inc/cimcacheserver.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2008 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:  instantmessagingcache server class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CIMCACHESERVER_H__
       
    20 #define __CIMCACHESERVER_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <imcachedefs.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CIMCacheSession;
       
    27 class CCacheServerActiveHelper;
       
    28 class MIMCacheMessageHeader ;
       
    29 class CIMCacheMessageBase;
       
    30 /**
       
    31  * Service server.
       
    32  */
       
    33 NONSHARABLE_CLASS( CIMCacheServer ): public CPolicyServer
       
    34     {
       
    35         	
       
    36     public:     // Execution and destructors
       
    37          static void ExecuteL();
       
    38         
       
    39         virtual ~CIMCacheServer();
       
    40 
       
    41     private:    // C++ constructor
       
    42         CIMCacheServer();
       
    43 
       
    44     protected:     // Methods from CPolicyServer
       
    45 
       
    46         CSession2* NewSessionL( const TVersion& aVersion,
       
    47                                 const RMessage2& aMessage ) const;
       
    48 
       
    49   
       
    50     public:     //New methods
       
    51     
       
    52     	/**
       
    53          * SessionCreatedL  
       
    54          * @param aSession a session created 
       
    55          */
       
    56 	    void SessionCreatedL( CIMCacheSession* aSession );
       
    57 	   
       
    58 	    /**
       
    59          * SessionDied  
       
    60          * @param aSession a session died 
       
    61          */
       
    62 	    void SessionDied( CIMCacheSession* aSession );
       
    63 	    
       
    64 	    			
       
    65 		/**
       
    66          * helper is owned by server class   
       
    67          * may any session requied to access
       
    68          * to get the same instance
       
    69          * @return pointer to the active helper
       
    70          */								 
       
    71 		CCacheServerActiveHelper* GetActiveHelper();
       
    72 					
       
    73 		
       
    74 		/**
       
    75          * pack and notify msg notification  
       
    76          * @param aChangeType , notification type
       
    77          * @param aMsgHeader, chat header 
       
    78          * @param aMessage , a message
       
    79          */	
       
    80 		void PackAndNotifyEventL( TIMCacheOperationsCode aChangeType,
       
    81                                   TInt aServiceId,
       
    82 								  MIMCacheMessageHeader* aMsgHeader = NULL, 
       
    83 								  CIMCacheMessageBase* aMessage = NULL ) ; 
       
    84 	    
       
    85           
       
    86 
       
    87 	private: // New methods
       
    88 	
       
    89 	
       
    90 		/**
       
    91          * initialization will be done here
       
    92          */
       
    93 	    void InitializeL(CIMCacheServer& aServer);
       
    94 	    
       
    95 	   
       
    96 	    
       
    97     private:    //Data
       
    98     	// owned, session count
       
    99         TInt iSessionCount;
       
   100         // owned, array of all open sessions
       
   101         RPointerArray<CIMCacheSession> iSessions;
       
   102     	// owned, active helper	
       
   103       	CCacheServerActiveHelper* iActiveHelper;
       
   104     };
       
   105 
       
   106 
       
   107 #endif      //  __CIMCACHESERVER_H__
       
   108 
       
   109 
       
   110 //  END OF FILE
       
   111 
       
   112