imstutils/imconversationview/imcvuiengine/inc/mimcvenginechatinterface.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 2007-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:  chat interface 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MIMCVENGINECHATINTERFACE_H
       
    20 #define MIMCVENGINECHATINTERFACE_H
       
    21 
       
    22 #include "mimcvenginemessagesreadinterface.h"
       
    23 
       
    24 //	FORWARD CLASS DECLERATIONS
       
    25 class MIMCVEngineMessageWriteInterface;
       
    26 class MIMCVEngineNewMsgObserver;
       
    27 class MIMCVEngineMessageReadInterface;
       
    28 class MIMCVEngineBufferMemoryHandler;
       
    29 class MIMCVEngineChatListObserver;
       
    30 
       
    31 
       
    32 /**
       
    33  * Internal buffer ids, these must be specified so that they can't appear in
       
    34  * wireless village ids. And they must also be non-matchable to KNullDesC when
       
    35  * comparing with neutral compare.
       
    36  *
       
    37  * From WV_CSP_v1.1.pdf:
       
    38  *   As per URI [RFC2396], certain reserved characters must be escaped if they 
       
    39  *   occur within the User-ID, Resource,. This includes the characters 
       
    40  *   ";", "?", ":", "&", "=", "+", "$" and ",".
       
    41  *
       
    42  * When using neutral compare, atleast ";", "?", ":", "&", "=", "+", "#" and "," 
       
    43  * are invalid.
       
    44  */
       
    45 _LIT( KSendBufferId, "$" );
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50  *  Interface for getting access to message containers.
       
    51  *
       
    52  *  @lib imcvengine.dll
       
    53  *  @since 5.0
       
    54  */
       
    55 class MIMCVEngineChatInterface
       
    56 	{	    	
       
    57 	public: // Interface
       
    58 	
       
    59 		/**
       
    60 		 * Provide access to chat messages. If messageContainer does not exists
       
    61 		 * creates one. 
       
    62 		 * @param aServiceId Part of identifier to identify container.
       
    63 		 * @param aTargetId Part of identifier to identify container.		 
       
    64 		 * @param aType. Preferred type of container. If ENoneContainer, 
       
    65 		 *               resolved by container.
       
    66 		 * @return Read interface to container
       
    67 		 */
       
    68 		virtual MIMCVEngineMessageReadInterface& MessageReadInterfaceL(
       
    69             TInt aServiceId, 
       
    70             const TDesC& aTargetId = KSendBufferId,
       
    71             const TDesC& aDisplayName = KNullDesC ,
       
    72             const TDesC8& aContactLink = KNullDesC8,
       
    73             MIMCVEngineMessageReadInterface::TContainerType aType = MIMCVEngineMessageReadInterface::ENoneContainer
       
    74             ) = 0;
       
    75 
       
    76 		/**
       
    77 		 * Provide access to append chat messages. 
       
    78 		 * If messageContainer does not exists, creates one. 
       
    79 		 * @param aServiceId Part of identifier to identify container.
       
    80 		 * @param aTargetId Part of identifier to identify container.		 
       
    81 		 * @param aType. Preferred type of container. If ENoneContainer, 
       
    82 		 *               resolved by container.		 
       
    83 		 * @return Write interface to container
       
    84 		 */
       
    85 		virtual MIMCVEngineMessageWriteInterface& MessageWriteInterfaceL(
       
    86             TInt aServiceId, 
       
    87             const TDesC& aTargetId = KSendBufferId,
       
    88             const TDesC& aDisplayName = KNullDesC ,
       
    89             const TDesC8& aContactLink = KNullDesC8 ,
       
    90             MIMCVEngineMessageReadInterface::TContainerType aType = 
       
    91                         MIMCVEngineMessageReadInterface::ENoneContainer ) = 0;
       
    92 		
       
    93                     
       
    94         /**
       
    95          * Delete identified chat container		 
       
    96 		 * @param aServiceId Part of identifier to identify container.
       
    97 		 * @param aTargetId Part of identifier to identify container.		 
       
    98          */		
       
    99 		virtual void DeleteChatL( TInt aServiceId,
       
   100 		                          const TDesC& aTargetId = KSendBufferId ) = 0;
       
   101 		                          
       
   102 
       
   103 			
       
   104 		/**
       
   105 		 * @see MIMCVEngineNewMsgObserver
       
   106 		 */ 
       
   107 		virtual TInt ChatCount() const = 0 ;
       
   108 		
       
   109         /**
       
   110          * Close all open containers.
       
   111          */
       
   112         virtual void CloseAllContainers() = 0;
       
   113         
       
   114         
       
   115         /**
       
   116          * Returns the Memory Handler
       
   117          * @return Reference to MIMCVEngineBufferMemoryHandler
       
   118          */
       
   119         virtual MIMCVEngineBufferMemoryHandler& MemoryHandler() = 0;
       
   120         
       
   121         /**
       
   122 		 * Register observer for chat events. Remember to unregister 
       
   123 		 * when not needed
       
   124 		 * @param aObserver Observer which is registered.
       
   125 		 * @return KErrNone if succeed.
       
   126 		 */
       
   127 		virtual void RegisterNewMsgObserver( MIMCVEngineNewMsgObserver* aObserver ) = 0;
       
   128 
       
   129 		/**
       
   130 		 * Unregister observer for chat events.
       
   131 		 * @param aObserver Observer which is unregistered
       
   132 		 * @return KErrNone if found and unregistered.
       
   133 		 */
       
   134 		virtual void UnregisterNewMsgObserver() = 0;
       
   135 
       
   136 		
       
   137 		/**
       
   138 		 * Register observer for conversations added/deleted events. Remember to unregister 
       
   139 		 * when not needed
       
   140 		 * @param aObserver Observer which is registered.
       
   141 		 * @return KErrNone if succeed.
       
   142 		 */
       
   143 		virtual TInt RegisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) = 0;
       
   144 
       
   145 		/**
       
   146 		 * Unregister observer for conversations added/deleted.
       
   147 		 * @param aObserver Observer which is unregistered
       
   148 		 * @return KErrNone if found and unregistered.
       
   149 		 */
       
   150 		virtual TInt UnregisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) = 0;
       
   151 			                     
       
   152         	/**
       
   153 		 * @see MIMCVEngineChatInterface
       
   154 		 */ 
       
   155 		virtual ~MIMCVEngineChatInterface()
       
   156 			{
       
   157 				
       
   158 			};
       
   159 
       
   160 	};
       
   161 
       
   162 #endif      // MIMCVENGINECHATINTERFACE_H
       
   163 
       
   164 // End of File