messagingfw/wappushfw/SISLPushMsgUtils/inc/CSLPushMsgEntry.h
changeset 22 bde600d88860
parent 0 8e480a14352b
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef __CSLPUSHMSGENTRY_H__
       
    23 #define __CSLPUSHMSGENTRY_H__
       
    24 
       
    25 #include <pushentry.h>
       
    26 
       
    27 
       
    28 /** 
       
    29 Handles storage of Service Loading (SL) WAP Push Messages in the message server.
       
    30 
       
    31 There are three items of data that are stored in addition to the data held by 
       
    32 the base class. These are:
       
    33 
       
    34 1. Action: action levels are stored in bits 4-7 of TMsvEntry::iMtmData1
       
    35 
       
    36 2. URL (location of the service to load).
       
    37 
       
    38 3. The time that the message was sent.
       
    39 
       
    40 @see	CPushMsgEntryBase
       
    41   
       
    42 @publishedPartner
       
    43 @released
       
    44 */
       
    45 class CSLPushMsgEntry : public CPushMsgEntryBase
       
    46 	{
       
    47 public:
       
    48 	/** 
       
    49 	SL Push messages Action flags. 
       
    50 	
       
    51 	@publishedPartner
       
    52 	@released
       
    53 	*/
       
    54 	enum TSLPushMsgAction 
       
    55 		{ 
       
    56 		//Note that these values get bit-shifted so that they set Bits 4-7 of iMtmData1.
       
    57 		/** Execute cache action. */							
       
    58 		ESLPushMsgExecuteCache	 = 0,	// effectively Bit 4 = 0
       
    59 		/** Execute low action. */
       
    60 		ESLPushMsgExecuteLow,	//			  Bit 4 = 1, i.e. 16   
       
    61 		/** Execute high action. */
       
    62 		ESLPushMsgExecuteHigh	//	  Bit 4 = 0, 5 =1. i.e. 32
       
    63 		};		
       
    64 
       
    65 	IMPORT_C static	CSLPushMsgEntry* NewL();
       
    66 	IMPORT_C static CSLPushMsgEntry* NewL(const TPtrC8& aAppURI);
       
    67 	IMPORT_C static CSLPushMsgEntry* NewL(TInt& aAppID);
       
    68 	
       
    69 	IMPORT_C ~CSLPushMsgEntry();
       
    70 	IMPORT_C TInt Action() const;
       
    71 	IMPORT_C void SetAction(TInt aActionFlags);
       
    72 	inline const TDesC&	Url() const;
       
    73 	IMPORT_C void SetUrlL(const TDesC& aUrl);
       
    74 	inline void	SetTimeSent(const TTime& aTime);
       
    75 	inline const TTime& TimeSent() const;
       
    76 	TInt32 PushMsgType() const;
       
    77 	inline const TDesC& ContentType() const;
       
    78 	
       
    79 	IMPORT_C void SetTrusted(TBool aTrusted);
       
    80 	IMPORT_C TBool Trusted() const;
       
    81 	IMPORT_C void SetMsgOriginUriL(const TDesC8& aOriginUri);
       
    82 	IMPORT_C const TDesC8& MsgOriginUri() const;
       
    83 
       
    84 private:
       
    85 	CSLPushMsgEntry();
       
    86 	inline void SetPushMsgType();
       
    87 	void ExternalizeL(RMsvWriteStream& aStream);
       
    88 	void InternalizeL(RMsvReadStream& aStream);
       
    89 
       
    90 private:
       
    91 	TTime	iTimeSent;
       
    92 	HBufC*	iUrl;
       
    93 	HBufC8*	iOriginUri;
       
    94 	};
       
    95 
       
    96 #include <push/cslpushmsgentry.inl>
       
    97 
       
    98 #endif // __CSLPUSHMSGENTRY_H__