imservices/instantmessagingcache/imcacheserver/inc/cimcachemessageheader.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:   a header of all convesation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMCACHEMESSAGEHEADER_H
       
    20 #define CIMCACHEMESSAGEHEADER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mimcachemessageheader.h"
       
    24 
       
    25 // CLASS DECLARATION
       
    26 
       
    27 /**
       
    28  *  Message header for history data
       
    29  *
       
    30  *  @lib imcacheserver.exe
       
    31  *  @since 5.0
       
    32  */
       
    33  
       
    34 class CIMCacheMessageHeader : public CBase, 
       
    35 							  public MIMCacheMessageHeader
       
    36     {
       
    37     public: // Constructors and destructors
       
    38 
       
    39 		/**
       
    40 		 * NewL for CIMCacheMessageHeader
       
    41          * Two-phase constructor
       
    42 		 * @param aServiceId , a service id .
       
    43 		 * @param aBuddyId a buddy. 
       
    44 		 * @return Instance of CIMCacheMessageHeader with header information.
       
    45 		 */        
       
    46 		static CIMCacheMessageHeader* NewL(TInt aServiceId, const TDesC& aBuddyId );
       
    47 
       
    48 		/**
       
    49 		 * Virtual destructor	
       
    50 		 */
       
    51         virtual ~CIMCacheMessageHeader();
       
    52 
       
    53     private:	// Constructors
       
    54 
       
    55 		/**
       
    56 		 * Default constructor	
       
    57 		 */
       
    58         CIMCacheMessageHeader();
       
    59 
       
    60 		/**
       
    61 		 * ConstructL for CIMCacheMessageHeader
       
    62 		 * Part of Two-phase construction
       
    63          * @param aServiceId , a service id .
       
    64 		 * @param aSender sender 
       
    65 		 * @param aBuddyId a recipient 
       
    66 		 */
       
    67         void ConstructL(TInt aServiceId, const TDesC& aBuddyId );
       
    68     
       
    69 
       
    70 	public: //new MIMCacheMessageHeader
       
    71 
       
    72 		/**
       
    73 		 *	service id
       
    74 		 *	@return a service id
       
    75 		 */
       
    76 		 TInt ServiceId() const;
       
    77 		
       
    78 		/**
       
    79 		 *	user id of recipient 
       
    80 		 *	@return recipient user id
       
    81 		 */
       
    82 		const TDesC& BuddyId() const;
       
    83 		
       
    84 		/**
       
    85 		 *	return total message count
       
    86 		 */
       
    87 		TInt MessageCount() const ;
       
    88 
       
    89 		/**
       
    90 		 * get message at given index 
       
    91 		 * @param aIndex index
       
    92 		 */
       
    93 		CIMCacheMessageBase* GetMessage(TInt aIndex ) ;
       
    94 
       
    95 		/**
       
    96 		 * append message
       
    97 		 * @param aMessge message to append
       
    98 		 */
       
    99 		void AppendMessageL(CIMCacheMessageBase* aMessge)  ; 	
       
   100 		
       
   101 		/**
       
   102 		 * UnreadMessageCount 
       
   103 		 * @return unread message count
       
   104 		 */
       
   105         TInt UnreadMessageCount() const ; 
       
   106         
       
   107         /**
       
   108         * check wheather chat started or not
       
   109         * @return ETrue started
       
   110         */
       
   111         TBool IsChatStarted();
       
   112         
       
   113 		/**
       
   114         * set chat started 
       
   115         * @param aStarted, a boolean value to set
       
   116          */
       
   117         void SetChatStarted(TBool aStarted );
       
   118        
       
   119       	/**
       
   120         * mark all message read
       
   121         */
       
   122         void MarkAllRead();
       
   123         
       
   124     private:  // Data
       
   125 	
       
   126         //owned, recipient
       
   127 		HBufC* iBuddyId;
       
   128 		
       
   129 		//service id
       
   130 		TInt iServiceId ;
       
   131 		
       
   132 		//owned,  array of all messages
       
   133 		RPointerArray< CIMCacheMessageBase > iMessageArray;
       
   134 		
       
   135 		//true if streaming is not completely done.
       
   136 		TBool iChatStarted;
       
   137 			
       
   138 	};
       
   139 
       
   140 #endif      // CIMCACHEMESSAGEHEADER_H
       
   141 
       
   142 // End of File