messagingfw/wappushfw/SISLPushMsgUtils/inc/CSIPushMsgEntry.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     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 __CSIPUSHMSGENTRY_H__
       
    23 #define __CSIPUSHMSGENTRY_H__
       
    24 
       
    25 #include <pushentry.h>
       
    26 
       
    27 
       
    28 /** 
       
    29 Handles storage of Service Indication (SI) WAP Push Messages in the message server.
       
    30 
       
    31 It provides additional accessor functions to allow access to all the fields holding 
       
    32 data for the SI push messages. The additional information for a SI message is:
       
    33 
       
    34 1. Action: 5 possible action levels are stored in bits 4-7 of TMsvEntry::iMtmData1
       
    35 
       
    36 2. SI ID (unique identifier for this SI Message).
       
    37 
       
    38 3. URL (location of the content to present to the user).
       
    39 
       
    40 4. Creation (date and time of creation of the message). 
       
    41 
       
    42 5. Expires (date and time after which the message is invalid and should be discarded).
       
    43 
       
    44 6. Text (additional information sent with the message).
       
    45 
       
    46 @see	CPushMsgEntryBase
       
    47 
       
    48 @publishedPartner
       
    49 @released
       
    50 */
       
    51 class CSIPushMsgEntry : public CPushMsgEntryBase
       
    52 	{
       
    53 public:
       
    54 	/** 
       
    55 	SI Push messages Action flags. 
       
    56 	
       
    57 	@publishedPartner
       
    58 	@released
       
    59 	*/
       
    60 	enum TSIPushMsgAction 
       
    61 		{			
       
    62 		// Note that these values get bit-shifted so that they set Bits 4-7 of iMtmData1
       
    63 		/** Delete action. */
       
    64 		ESIPushMsgDelete = 0,	// effectively  Bit 4 = 0
       
    65 		/** Signal none action. */
       
    66 		ESIPushMsgSignalNone,	//              Bit 4 = 1, i.e. 16   
       
    67 		/** Signal low action. */
       
    68 		ESIPushMsgSignalLow,	//              Bit 4 = 0, 5 =1. i.e. 32
       
    69 		/** Signal medium action. */
       
    70 		ESIPushMsgSignalMedium,
       
    71 		/** Signal high action. */
       
    72 		ESIPushMsgSignalHigh
       
    73 		};
       
    74 
       
    75 	IMPORT_C static CSIPushMsgEntry* NewL();
       
    76 	IMPORT_C static CSIPushMsgEntry* NewL(const TPtrC8& aAppURI);
       
    77 	IMPORT_C static CSIPushMsgEntry* NewL(TInt& aAppID);
       
    78 	IMPORT_C ~CSIPushMsgEntry();
       
    79 	inline const TDesC& Id() const;
       
    80 	IMPORT_C void SetIdL(const TDesC& aID);
       
    81 	IMPORT_C TInt Action() const;
       
    82 	IMPORT_C void SetAction(TInt aActionFlags);
       
    83 
       
    84 	inline const TTime& Created() const;
       
    85 	inline void	SetCreated(const TTime& aCreated);
       
    86 	inline const TTime& Expires() const;
       
    87 	inline void	SetExpires(const TTime& aExpires);
       
    88 	inline const TDesC&  Url() const;
       
    89 	inline const TDesC& ContentType() const;
       
    90 
       
    91 	IMPORT_C void SetUrlL(const TDesC& aUrl);
       
    92 	IMPORT_C const TDesC& Text() const;
       
    93 	IMPORT_C void SetTextL(const TDesC& aText);
       
    94 	IMPORT_C TInt32 PushMsgType() const;
       
    95 	
       
    96 	IMPORT_C void SetTrusted(TBool aTrusted);
       
    97 	IMPORT_C TBool Trusted() const;
       
    98 	IMPORT_C void SetMsgOriginUriL(const TDesC8& aOriginUri);
       
    99 	IMPORT_C const TDesC8& MsgOriginUri() const;
       
   100 
       
   101 private:  //functions
       
   102 	CSIPushMsgEntry();
       
   103 	void ExternalizeL(RMsvWriteStream& aStream);
       
   104 	void InternalizeL(RMsvReadStream& aStream);
       
   105 	void SetPushMsgType();
       
   106 
       
   107 private: //data
       
   108 	TTime	iExpiryDate;
       
   109 	TTime	iCreatedDate;
       
   110 	HBufC*	iText;
       
   111 	HBufC*	iUrl;
       
   112 	HBufC*  iMsgID;
       
   113 	HBufC8*	iOriginUri;
       
   114 	};
       
   115 
       
   116 #include <push/csipushmsgentry.inl>
       
   117 
       
   118 #endif // __CSIPUSHMSGENTRY_H__