imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessage.h
branchRCL_3
changeset 23 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
22:3104fc151679 23:9a48e301e94b
       
     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 interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MIMCVENGINEMESSAGE_H
       
    20 #define MIMCVENGINEMESSAGE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <badesca.h>
       
    24 
       
    25 //	FORWARD CLASS DECLERATIONS
       
    26 class MIMCVEngineMessageContainerInfo;
       
    27 class TXIMPRequestId;
       
    28 // MDesCArray must not be fwd declared, or compiling test code will break
       
    29 // since it's a MACRO. hence the include to badesca.h
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  *  Interface for handling one message
       
    35  *
       
    36  *  @lib imcvengine.dll
       
    37  *  @since 5.0
       
    38  */
       
    39 class MIMCVEngineMessage
       
    40 	{
       
    41 	public: // Definitions
       
    42 	
       
    43 		/** 
       
    44 		 * Different message types
       
    45 		 */
       
    46 		enum TMessageType
       
    47 			{
       
    48 			EMessagePTOP,
       
    49 			EMessageWhisper,
       
    50 			EMessageGroup,
       
    51 			EMessageSystem,
       
    52 			EMessageInvalid
       
    53 			};
       
    54 	
       
    55         /**
       
    56          * System message enumerations.
       
    57          */			
       
    58 	    enum TSystemMessage
       
    59 	        {
       
    60 	        ESystemMessageNone,
       
    61 	        ESystemMessageWelcome,
       
    62 	        ESystemMessageNewUsers,
       
    63 	        ESystemMessageTopicChanged,
       
    64 	        ESystemMessagePrivatChanged,
       
    65 	        ESystemMessageLeftUsers,
       
    66 	        ESystemMessageDateChange
       
    67 	        };
       
    68 
       
    69 		/**
       
    70 		 * Direction of message. Coming or going or other.
       
    71 		 */
       
    72 		enum TMessagerType
       
    73 			{
       
    74 			EMessageSent,
       
    75 			EMessageReceived,
       
    76 			EMessageOther,
       
    77 			EMessageStarted
       
    78 			};
       
    79 		
       
    80 		/**
       
    81 		 * Different message content types
       
    82 		 */
       
    83 		enum TContentType
       
    84 			{
       
    85 			EContentText,
       
    86 			EContentPicture,
       
    87 			EContentOther,
       
    88 			EContentInvalid
       
    89 			};
       
    90 			
       
    91 	    /**
       
    92 	     * Content processing states
       
    93 	     */
       
    94 	    enum TContentProcessState
       
    95 	        {
       
    96 	        EContentNotProcessed = 0,
       
    97 	        EContentNotSupported,
       
    98 	        EContentNotSupportedDrm,
       
    99 	        EContentCorrupted,
       
   100 	        EBitmapDecoded,
       
   101 	        EBitmapScaled,
       
   102 	        EContentReady,
       
   103 	        EContentDecoded,
       
   104 	        EThumbnailReady
       
   105 	        };
       
   106 	
       
   107 	public: // General information
       
   108 	
       
   109 		/**
       
   110 		 * Get timestamp when this message has been created.
       
   111 		 * For prioritization of message deletion and timestamping
       
   112 		 * chat messages
       
   113 		 */
       
   114 		virtual const TTime& TimeStamp() const = 0;
       
   115 
       
   116 		/**
       
   117 		 * @see MIMMessageBase
       
   118 		 */
       
   119 		virtual void SetTimeStamp(TTime aTime ) = 0 ;
       
   120 		
       
   121 		/**
       
   122 		 * Message size in bytes.
       
   123 		 * @return Size of message in bytes.
       
   124 		 */
       
   125 		virtual TInt SizeInBytes() const = 0;
       
   126 
       
   127     public: // Type of message
       
   128 		/**
       
   129 		 * Type of message
       
   130 		 * @return Type of message. EMessageGroup, EMessagePersonal, 
       
   131 		 *         EMessageSystem
       
   132 		 */
       
   133 		virtual TMessageType MessageType() const = 0;
       
   134 
       
   135 		/**
       
   136 		 * Type of messager
       
   137 		 * @return Type of message. EMessageFrom, EMessageTo, EMessageOther 
       
   138 		 */
       
   139 		virtual TMessagerType MessagerType() const = 0;
       
   140 
       
   141 		/**
       
   142 		 * Type of content of message
       
   143 		 * @return Type of message. EMessageText, EMessagePicture
       
   144 		 */
       
   145 		virtual TContentType ContentType() const = 0;
       
   146 		
       
   147 		/**
       
   148 		 * Is message failed or not
       
   149 		 * @return ETrue if is, EFalse if not.
       
   150 		 */ 
       
   151         virtual TBool FailedMessage() const = 0;
       
   152 				
       
   153 		/**
       
   154 		 * Returns the type of system message.
       
   155 		 * @return type of system message or
       
   156 		 *         TSystemMessageNone if not system message
       
   157 		 */ 
       
   158 		virtual TSystemMessage SystemMessageType() = 0;
       
   159 		
       
   160 		/**
       
   161 	     * Increase owner count. There can be multiply owners for one message. 
       
   162 	     * This method is for increasing the count. Every owner class
       
   163 	     * must use also DecreaseOwnerCount.
       
   164 	     */
       
   165 	    virtual void IncreaseOwnerCount() = 0;
       
   166 	    
       
   167 	    /**
       
   168 	     * Decrease owner count. There can be multiply owners for one message.
       
   169 	     * This method is for decreasing the count. Every owner class
       
   170 	     * must have called IncreaseOwnerCount before calling this method. 
       
   171 	     * @return ETrue if owner can delete message. EFalse if not.
       
   172 	     */ 
       
   173 	    virtual TBool DecreaseOwnerCount() = 0;
       
   174 	    
       
   175 		
       
   176 	public: // Identification of message
       
   177 		/**
       
   178 		 * Operation code of message. One way to identify message.
       
   179 		 * @return Operation code of message.
       
   180 		 */
       
   181 	    virtual TXIMPRequestId OperationCode() const = 0;
       
   182 	    
       
   183 	    /**
       
   184 	     * Set operation code of message.
       
   185 	     * @param aOpId, new operation code for message
       
   186 	     */
       
   187 	    virtual void SetOperationCode(TXIMPRequestId aRequestId ) = 0;
       
   188 	    
       
   189 	    
       
   190 
       
   191 	    /**
       
   192 	     * Part of container identifier which contains this message
       
   193 	     * @return User id to identify container which contains this message
       
   194 	     */
       
   195 	    //virtual const TDesC& UserId() const = 0;
       
   196 	    
       
   197 	   	    
       
   198 	    /**
       
   199 	     * Set containerinfo of message. Needed for identifying of message.
       
   200 	     * @param aInfo. ContainerInfo.
       
   201 	     */
       
   202         virtual void SetContainerInfo( MIMCVEngineMessageContainerInfo* aInfo ) = 0;
       
   203 	    	    
       
   204     public: // Content of message	    
       
   205 	    
       
   206 	    /**
       
   207 	     * Recipient of message.
       
   208 	     * @return Recipient of message. To whom the message is sent.
       
   209 	     */
       
   210 	    virtual const TDesC& Recipient() const = 0;
       
   211 	    
       
   212 	    /**
       
   213 	     * Sender of message
       
   214 	     * @return Sender of message. To who has sent the message.
       
   215 	     */
       
   216 	    virtual const TDesC& Sender() const = 0;
       
   217 
       
   218 	    
       
   219 	    /**
       
   220 	     * Textual content of message
       
   221 	     * @return Textual content.
       
   222 	     */
       
   223 	    virtual const TDesC& Text() const = 0;
       
   224 	    
       
   225                
       
   226        
       
   227     public: 
       
   228      
       
   229 		/**
       
   230 		 * Virtual destructor
       
   231 		 */
       
   232 		virtual ~MIMCVEngineMessage(){}
       
   233 	}; 
       
   234 
       
   235 #endif      // MIMCVENGINEMESSAGE_H
       
   236 
       
   237 // End of File
       
   238