messagingapp/msgappfw/server/inc/ccsserver.h
changeset 31 ebfee66fde93
parent 23 238255e8b033
child 37 518b245aa84c
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     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:  CS Server main class. Co-ordinates server startup 
       
    15  *                and shutdown and receives client requests.
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef __C_CS_SERVER_H
       
    20 #define __C_CS_SERVER_H
       
    21 
       
    22 // SYSTEM INCLUDE FILES
       
    23 #include <mcsplugineventobserver.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MCsPluginEventObserver;
       
    27 class CCsPluginInterface;
       
    28 class CCsConversationCache;
       
    29 class CCsConversationEntry;
       
    30 class CCsSession;
       
    31 class CCsContactsManager;
       
    32 class CCsClientConversation;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /** 
       
    36  * CS Server main class. Co-ordinates server startup and shutdown 
       
    37  * and receives client requests.
       
    38  */
       
    39 class CCsServer : public CServer2,
       
    40         public MCsPluginEventObserver
       
    41 {
       
    42 public:
       
    43 
       
    44     /**
       
    45      * NewL
       
    46      * Two phase construction
       
    47      */
       
    48     static CCsServer* NewL();
       
    49 
       
    50     /**
       
    51      * Destructor
       
    52      */
       
    53     ~CCsServer();
       
    54 
       
    55     /**
       
    56      * NewSessionL
       
    57      * Creates a server side session object
       
    58      * Implements NewSessionL of CServer2
       
    59      * 
       
    60      * @param aVersion, defines the version
       
    61      * @param aMessage, instance of the PDU b/w server and client
       
    62      * @return session instance
       
    63      */
       
    64     CSession2
       
    65             * NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
       
    66 
       
    67     /**
       
    68      * ConversationCacheInterface
       
    69      * Return the Conversation Cache interface instance
       
    70      * 
       
    71      * @return CCsConversationCache instance
       
    72      */
       
    73     CCsConversationCache* ConversationCacheInterface();
       
    74 
       
    75     /**
       
    76      * Get caching status
       
    77      */
       
    78     TUint8 GetCachingStatus()
       
    79     {
       
    80         return iCsCachingStatus;
       
    81     }
       
    82 
       
    83     /* ------------ from MCsPluginEventObserver class ----------------------*/
       
    84     /**
       
    85      * AddConversations
       
    86      * Handle Conversation event from  Plugin, to handle new events
       
    87      * 
       
    88      * @param aConversationEntryLists, List of conversation entries.
       
    89      */
       
    90     void
       
    91             AddConversations(
       
    92                              const RPointerArray<CCsConversationEntry>& aConversationEntryLists);
       
    93 
       
    94     /**
       
    95      * ModifyConversations
       
    96      * event to modify existing conversation
       
    97      * 
       
    98      * @param aConversationEntryLists, List of conversation entries.
       
    99      */
       
   100     void
       
   101             ModifyConversations(
       
   102                                 const RPointerArray<CCsConversationEntry>& aConversationEntryLists);
       
   103 
       
   104     /**
       
   105      * DeleteConversations
       
   106      * Handle delete Conversation event from Plugin
       
   107      * 
       
   108      * @param aConversationEntryLists, List of conversation entries
       
   109      * to be deleted.
       
   110      */
       
   111     void
       
   112             DeleteConversations(
       
   113                                 const RPointerArray<CCsConversationEntry>& aConversationEntryLists);
       
   114 
       
   115     /**
       
   116      * RefreshConversations
       
   117      * Refresh conversations from plugin.
       
   118      */
       
   119     void RefreshConversations();
       
   120 
       
   121     /**
       
   122      * Caching completed.
       
   123      */
       
   124     void CachingCompleted();
       
   125 
       
   126     /**
       
   127      * Caching error
       
   128      * @param Error Code
       
   129      */
       
   130     void CachingError(const TInt /*aError*/)
       
   131     {
       
   132     }
       
   133     ;
       
   134 
       
   135 public:
       
   136 
       
   137     /**
       
   138      * NotifySessions 
       
   139      * Notify on-the-fly data changes to all sessions
       
   140      * 
       
   141      * @param aConversation , conversation 
       
   142      * @param aEvent,  event for the change
       
   143      */
       
   144     void NotifySessions(CCsClientConversation* aConversation, TUint32 aEvent);
       
   145 
       
   146 private:
       
   147 
       
   148     /**
       
   149      * Constructor
       
   150      */
       
   151     CCsServer();
       
   152 
       
   153     /**
       
   154      * Second phase constructor
       
   155      */
       
   156     void ConstructL();
       
   157 
       
   158 private:
       
   159 
       
   160     /**
       
   161      * iContactsManager
       
   162      * Contact manager instance
       
   163      * Own.
       
   164      */
       
   165     CCsContactsManager* iContactsManager;
       
   166 
       
   167     /**
       
   168      * iConversationPlugin
       
   169      * A CS Plugin instance 
       
   170      * Own.
       
   171      */
       
   172     CCsPluginInterface* iConversationPlugin;
       
   173 
       
   174     /** 
       
   175      * iConversationCache
       
   176      * Conversation Cache
       
   177      * Own. 
       
   178      */
       
   179     CCsConversationCache* iConversationCache;
       
   180 
       
   181     /**
       
   182      * iCsCachingStatus
       
   183      * Caching status
       
   184      */
       
   185     TUint8 iCsCachingStatus;
       
   186 };
       
   187 
       
   188 #endif // __C_CS_SERVER_H