messagingapp/msgappfw/plugin/inc/ccsmsg.h
changeset 27 e4592d119491
parent 25 84d9eb65b26f
child 30 6a20128ce557
child 32 f3f513612312
equal deleted inserted replaced
25:84d9eb65b26f 27:e4592d119491
     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:  Message Plugin main class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _C_CS_MSG_H_
       
    20 #define _C_CS_MSG_H_
       
    21 
       
    22 // INCLUDE FILES
       
    23 
       
    24 // SYSTEM INCLUDES
       
    25 
       
    26 // USER INCLUDES
       
    27 #include "ccsplugin.h"
       
    28 #include "mcsmsgobserver.h"
       
    29 #include "ccsdebug.h"
       
    30 #include "ccsdefs.h"
       
    31 
       
    32 // FORWARD DECLARATION
       
    33 class MCsPluginEventObserver;
       
    34 class MCsMsgObserver;
       
    35 class CCsConversationEntry;
       
    36 class CCsMsgHandler;
       
    37 
       
    38 /**
       
    39  *  Message plugin class
       
    40  *  This class interacts with MsvServer to fetch the message data.
       
    41  */
       
    42 class CCsMsg : public CCsPlugin, public MCsMsgObserver
       
    43     {
       
    44 public: 
       
    45 
       
    46     /**
       
    47      * Two phase construction
       
    48      */
       
    49     static CCsMsg* NewL( MCsPluginEventObserver* aMCsPluginEventObserver);
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54     virtual ~CCsMsg();
       
    55 
       
    56 
       
    57 public: // From base class CCsPlugin
       
    58     /**
       
    59      *  GetConversationsL
       
    60      *  This function starts the state machine to fetch msg data from msvserver
       
    61      */        
       
    62     void GetConversationsL();
       
    63 
       
    64 public: //MCsMsgObserver
       
    65     /**
       
    66      *  HandleReadCompleteL
       
    67      *  Sends the CCsConversationEntry array to Conversation Server
       
    68      *  @param aConversationEntryLists The object to be used to handle updates 
       
    69      *  from the plugin
       
    70      */
       
    71     void HandleReadCompleteL( const RPointerArray<CCsConversationEntry> *aConversationEntryLists);
       
    72 
       
    73     /**
       
    74      *  HandleUpdateCompleteL
       
    75      *  Sends the CCsConversationEntry array to Conversation Server
       
    76      *  @param aConversationEntryLists The object to be used to handle updates 
       
    77      *  from the plugin
       
    78      */
       
    79     void HandleUpdateCompleteL( const RPointerArray<CCsConversationEntry> *aConversationEntryLists);
       
    80 
       
    81     /**
       
    82      *  HandleDeleteCompleteL
       
    83      *  Sends the CCsConversationEntry array to Conversation Server
       
    84      *  @param aConversationEntryLists The object to be used to handle updates 
       
    85      *  from the plugin
       
    86      */
       
    87     void HandleDeleteCompleteL( const RPointerArray<CCsConversationEntry> *aConversationEntryLists);
       
    88 
       
    89     /**
       
    90      * HandleRefreshCompleteL
       
    91      * Notify conversation server to refresh the conversations from this plugin.
       
    92      */
       
    93     void HandleRefreshCompleteL();
       
    94     
       
    95     /**
       
    96      *  HandleCachingCompleted
       
    97      *  Sends the cache completed status to server
       
    98      */
       
    99     void HandleCachingCompleted();
       
   100 
       
   101     /**
       
   102      *  HandleCachingError
       
   103      *  Sends the error occured during the caching to server
       
   104      */
       
   105     void HandleCachingError(const TInt aError);
       
   106     
       
   107 private:
       
   108 
       
   109     /**
       
   110      * Constructor
       
   111      */
       
   112     CCsMsg(MCsPluginEventObserver* aObserver);
       
   113 
       
   114     /**
       
   115      * 2nd phase construtor
       
   116      */
       
   117     void ConstructL();
       
   118 
       
   119 private: //Data
       
   120 
       
   121     /**
       
   122      * The msg plugin class which sends the initial set of conversation 
       
   123      * entries upon bootup to conversations server.
       
   124      * and notifies the conversations server about the new MsvServer events
       
   125      */
       
   126     CCsMsgHandler* iMsgHandler;  
       
   127 
       
   128     /**
       
   129      * iPluginEventObserver
       
   130      * Plugin event observer
       
   131      * Not Own.
       
   132      */
       
   133     MCsPluginEventObserver* iPluginEventObserver;
       
   134     };
       
   135 
       
   136 #endif // _C_CS_MSG_H_