imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagesreadinterface.h
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22: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:  message read interface
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MIMCVENGINEMESSAGESREADINTERFACE_H__
       
    19 #define __MIMCVENGINEMESSAGESREADINTERFACE_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 //	FORWARD CLASS DECLERATIONS
       
    24 class MIMCVEngineMessage;
       
    25 class MIMCVEngineMessageObserver;
       
    26 class MIMCVEngineMessageContainerInfo;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31  *  Interface for getting access to messages.
       
    32  *
       
    33  *  @lib imcvengine.dll
       
    34  *  @since 5.0
       
    35  */
       
    36 class MIMCVEngineMessageReadInterface
       
    37 	{
       
    38 
       
    39 	public: // Definitions
       
    40 		
       
    41 		/**
       
    42 		 * How many messages we want to change from unread to read.
       
    43 		 */
       
    44 		enum TReadType
       
    45 			{
       
    46 			EReadAll,
       
    47 			EReadAmount,
       
    48 			EReadOne,
       
    49 			EReadInvalid
       
    50 			};	
       
    51 	
       
    52         /**
       
    53          * Type of container
       
    54          */
       
    55         enum TContainerType
       
    56             {
       
    57             ENoneContainer,            
       
    58             EChatContainer,
       
    59             ESendContainer
       
    60             };
       
    61             
       
    62          /**
       
    63           *
       
    64           */
       
    65          enum TUnreadFilter
       
    66             {
       
    67             EUnreadAll,
       
    68             EUnreadReceived
       
    69             };	
       
    70 	
       
    71 	public: // Interface
       
    72 	
       
    73 		/**
       
    74 		 * Get count of unread messages.
       
    75 		 * @param aUnreadFilter Show only received messages as unread or all.
       
    76 		 * @return Amount of unread messages.
       
    77 		 */
       
    78 		virtual TInt UnreadCount( TUnreadFilter aUnreadFilter = EUnreadAll ) const = 0;
       
    79 		
       
    80 		/**
       
    81 		 * Get count of readable messages. 
       
    82 		 * @return Amount of readable messages. Does not include unread messages.
       
    83 		 */		 
       
    84 		virtual TInt MessageCount() const = 0;
       
    85 		
       
    86 		/**
       
    87 		 * Get stores the previously typed message before switching the tab 
       
    88 		 * 
       
    89 		 */      
       
    90 		virtual void StoreEditerMessageL(const TDesC& aEditorMessage ) = 0;
       
    91 		        
       
    92 		/**
       
    93 		 * Gets the previously stored message
       
    94 		 * @return the message
       
    95 		  */   
       
    96 		virtual const TDesC& GetEditerMessage() = 0;
       
    97 		                        
       
    98 		
       
    99 		/**
       
   100 		 * Move unread messages to read.
       
   101 		 * @param aReadType Type of read. EReadAll, EReadAmount, EReadOne
       
   102 		 * @param aReadAmount Amount of messages to move from unread to read. 
       
   103 		 * 		  Default 0, Needed if TReadAmount is used.
       
   104 		 */
       
   105 		virtual void Read( TReadType aReadType, TInt aReadAmount = 0 ) = 0;
       
   106 		
       
   107 		/**
       
   108 		 * Get message.
       
   109 		 * @param aIndex, Index of message in messagearray.
       
   110 		 * @return Reference to message.
       
   111 		 */
       
   112 		virtual MIMCVEngineMessage& Message( TInt aIndex ) const = 0;
       
   113 		
       
   114 		/**
       
   115 		 * Get next unread message
       
   116 		 * @return Reference to next unread message.
       
   117 		 */
       
   118 		virtual MIMCVEngineMessage& ReadNextUnread() = 0;
       
   119 		
       
   120 		/**
       
   121 		 * Read one unread message from index aIndex.
       
   122 		 * @since S60 v3.2
       
   123 		 * @param aIndex Index to wanted message.
       
   124 		 * @return Reference to last unread message.
       
   125 		 */
       
   126 		virtual MIMCVEngineMessage& ReadUnreadFromIndex( TInt aIndex ) = 0;
       
   127 		
       
   128 		/**
       
   129 		 * Set observer for observing changes in messages container.
       
   130 		 * Observer can handle different situations like e.g.
       
   131 		 * containers destruction, messages arrival etc.
       
   132 		 * @param aObserver Observer class to get notifications.
       
   133 		 * 		  Uninstall observer with passing NULL as parameter.
       
   134 		 */
       
   135 		virtual void SetObserver( MIMCVEngineMessageObserver* aObserver ) = 0;
       
   136 		
       
   137 		/**
       
   138 		 * Get name of chat.
       
   139 		 * @return Name of chat.
       
   140 		 */
       
   141 		virtual TPtrC Name() const = 0;
       
   142 		
       
   143 		/**
       
   144 		 * Delete message in index.
       
   145 		 * @param aIndex, Index of message to be deleted.
       
   146 		 * @param aFreeMemory, ETrue if message should be deleted. EFalse if ownership of message
       
   147 		 * is transferred to caller. Remember to achieve 
       
   148 		 * @return Pointer to message if not ownership is tranferred to caller. NULL if not.
       
   149 		 */
       
   150 		virtual void DeleteMessage( TInt aIndex ) = 0;
       
   151         /**
       
   152          * Id information of message container.
       
   153          * @return Container information.
       
   154          */
       
   155         virtual MIMCVEngineMessageContainerInfo& TargetId() = 0;
       
   156         
       
   157         /**
       
   158          * Lock/unlock messages from deletion
       
   159          * @param aLocked, ETrue locks, EFalse unlocks.
       
   160          */
       
   161         virtual void Lock( TBool aLocked ) = 0;
       
   162         
       
   163         /**
       
   164          * Sets whether the Conversation is Currently Active in UI
       
   165          * @param aActiveChat, ETrue ActiveConversation, EFalse InActiveConversation.
       
   166          */
       
   167         virtual void SetActive( TBool aActiveChat ) = 0;
       
   168         
       
   169          /**
       
   170          * Gets whether the Conversation is Currently Active in UI
       
   171          * @return ETrue ActiveConversation in UI, EFalse InActiveConversation.
       
   172          */
       
   173         virtual TBool IsActive() = 0;
       
   174 		
       
   175         /*
       
   176          * return contact link.
       
   177          */
       
   178         virtual TPtrC8 ContactLink() const = 0;
       
   179         
       
   180         /**
       
   181          * returns displayname
       
   182          */ 
       
   183         virtual TDesC DisplayName() const = 0;
       
   184     
       
   185     protected: // For protection
       
   186 		/**
       
   187 		 * Destructor for protection
       
   188 		 */
       
   189 		virtual ~MIMCVEngineMessageReadInterface(){}
       
   190 	};
       
   191 
       
   192 #endif      // __MIMCVENGINEMESSAGESREADINTERFACE_H__
       
   193 
       
   194 // End of File