messagingfw/wappushfw/plugins/PushContentHandler/CSIAContentHandler.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2001-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 #ifndef __CSIACONTENTHANDLER_H__
       
    17 #define __CSIACONTENTHANDLER_H__
       
    18 
       
    19 // System includes
       
    20 //
       
    21 #include <e32base.h>
       
    22 #include <push/ccontenthandlerbase.h>
       
    23 
       
    24 // Local includes
       
    25 //
       
    26 #include "pushcpoint.h"
       
    27 
       
    28 // Constants
       
    29 //
       
    30 const TInt KNotifierBufferSize			= 100;
       
    31 const TUid KUidPushSIAContentHandler	= { 0x101F3E62 };
       
    32 _LIT(KSIAContentHandlerData,"application/vnd.wap.sia");
       
    33 
       
    34 // Forward class declarations
       
    35 //
       
    36 class CWapPushMsgUtils;
       
    37 class CCommsDatabase;
       
    38 
       
    39 /** 
       
    40  * CSIAContentHandler Handles Session Initiation Application Content.
       
    41  *
       
    42  *	The SIA is outlined in WAP-189-PushOTA (p.16...) and provides a
       
    43  *	string listing the available connection points. Thus the body of the
       
    44  *	CPushMessage (in octets) must be parsed to retrieve this list, and
       
    45  *	then validate any connection points found. The first valid point will
       
    46  *	be used to open a connection via the Connection Manager. If no valid
       
    47  *	points exist then the handler simply quits.
       
    48  */ 
       
    49 class CSIAContentHandler : public CContentHandlerBase
       
    50 /**
       
    51 @internalComponent
       
    52 @released
       
    53 */
       
    54 	{
       
    55 public:	// Methods
       
    56 
       
    57 	static CSIAContentHandler* NewL();
       
    58 
       
    59 	virtual ~CSIAContentHandler();
       
    60 
       
    61 private:	// Methods from CPushHandlerBase
       
    62 
       
    63 	virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus);
       
    64 
       
    65 	virtual void HandleMessageL(CPushMessage* aPushMsg);
       
    66 	
       
    67 	virtual void CancelHandleMessage();
       
    68 
       
    69 	virtual void CPushHandlerBase_Reserved1();
       
    70 
       
    71 	virtual void CPushHandlerBase_Reserved2();
       
    72 
       
    73 private:	// Methods from CActive
       
    74 
       
    75 	virtual void DoCancel();
       
    76 
       
    77 	virtual void RunL();
       
    78 
       
    79 	virtual TInt RunError(TInt aError);
       
    80 	
       
    81 private:	// Methods
       
    82 
       
    83 	CSIAContentHandler();
       
    84 
       
    85 	void ConstructL();
       
    86 
       
    87 	void ParsePushMsgL();
       
    88 
       
    89 	void OpenConnectionL();	
       
    90 
       
    91 	void RequestConnectionL();
       
    92 
       
    93 	void ObtainContactPointsListL();
       
    94 
       
    95 	TBool RetrieveContactPoint();
       
    96 
       
    97 	TBool ValidContactPointL();
       
    98 
       
    99 private:	// Attributes
       
   100 
       
   101 	CWapPushMsgUtils*	iWapPushUtils;
       
   102 
       
   103 	CCommsDatabase*		iCommDb;
       
   104 	
       
   105 	//notifier
       
   106 
       
   107 	RNotifier					iNotifier;
       
   108 
       
   109 	TBuf8<KNotifierBufferSize>	iNotifierResponse;
       
   110 
       
   111 	//class states
       
   112 	enum TState {EParsing, ERequestingConn, EOpeningCOconn, EDone};
       
   113 
       
   114 	//string listing all points available
       
   115 
       
   116 	TPtrC8				iContactList;
       
   117 
       
   118 	// current point being checked
       
   119 	TPtrC8				iContactPoint;
       
   120 
       
   121 	// the valid connection point passed to COMan
       
   122 	TPushConnPoint		iConnPoint;
       
   123 	
       
   124 	}; 
       
   125 
       
   126 #endif	// __CSIACONTENTHANDLER_H__