messagingfw/wappushfw/pushutils/inc/PushDispatcher.h
changeset 22 bde600d88860
child 35 f8ad95794a08
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     1 // Copyright (c) 2000-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 // This file contains the declaration of the PushAppDispatcher which Handles the push message using the
       
    15 // extracted app ID. Other class is PushContentTypeDispatcher for creating appropiate handler to handle the push message
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @released
       
    23 */
       
    24 
       
    25 #ifndef __PUSHDISPATCHER_H__
       
    26 #define __PUSHDISPATCHER_H__
       
    27 
       
    28 #include <e32std.h>
       
    29 
       
    30 //Forward declarations
       
    31 class CPluginOwner;
       
    32 class CPluginKiller;
       
    33 class MWapPushLog;
       
    34 class MConnManObserver;
       
    35 class CPushHandlerBase;
       
    36 class CContentHandlerBase;
       
    37 
       
    38 /** Handle for default user agent. */
       
    39 const TInt KUserAgentAppHandler = 0;
       
    40 
       
    41 /** Creates an appropriate App Handler for the given AppId or AppURI.
       
    42 	
       
    43 	Looks up the application Id passed in and uses the WAP Plugin Server
       
    44 	to determine the correct handler which is then created. If there is no
       
    45 	recognised application handler to deal with the Message App Type then the
       
    46 	default behaviour is to create an Unknown AppHandler to process message.
       
    47 
       
    48 	@param aAppId Application ID extracted from Push Message
       
    49 	@param aLog Reference to logging object 
       
    50 	@param aManager Reference to Connection Manager Observer Mixin class
       
    51 	@param aAppURI Application URI used instead of Application UID
       
    52 
       
    53 	@return Reference to the application plugin handler base class 
       
    54 */
       
    55 //##ModelId=3B659EE80221
       
    56 class PushAppDispatcher
       
    57 /**
       
    58 @publishedPartner
       
    59 @released
       
    60 */
       
    61 	{
       
    62 public:
       
    63 	//##ModelId=3B659E6E0145
       
    64 	IMPORT_C static CPushHandlerBase& GetHandlerL(TInt aAppId, MWapPushLog& aLog, MConnManObserver& aManager);
       
    65 	//##ModelId=3B659E6E014D
       
    66 	IMPORT_C static CPushHandlerBase& GetHandlerL(const TDesC8& aAppURI, MWapPushLog& aLog, MConnManObserver& aManager);
       
    67 
       
    68 private:
       
    69 	//##ModelId=3B659E6E0140
       
    70 	static CPushHandlerBase* CreatePluginFromDataL(const TDesC& aData, const TUid& aType, MWapPushLog& aLog, MConnManObserver& aManager);
       
    71 
       
    72 	friend class PushContentTypeDispatcher;
       
    73 	};
       
    74 
       
    75 
       
    76 /** Creates an appropriate Content Type handler for the given CPushMessage.
       
    77 
       
    78 	The content dispatcher uses the WAP plugin server to determine the correct handler
       
    79 	given the Content Type retrieved from the CPushMessage. It will then instantiate
       
    80 	an instance of the correct handler and pass back a pointer to this content
       
    81 	handler. If the Content Type is not recognised and no appropriate handler
       
    82 	exists, a Unknown Content Handler will be created to deal with the message.
       
    83 
       
    84 	@param aContentType Content type extracted from Push Message
       
    85 	@param aLog Reference to logging object 
       
    86 	@param aManager Reference to Connection Manager Observer Mixin class
       
    87 
       
    88 	@return  Reference to the content plugin handler base class 
       
    89 */
       
    90 //##ModelId=3B659EE902E1
       
    91 class PushContentTypeDispatcher 
       
    92 /**
       
    93 @publishedPartner
       
    94 @released
       
    95 */
       
    96 	{
       
    97 public:
       
    98 	//##ModelId=3B659E6E030C
       
    99 	IMPORT_C static CContentHandlerBase& GetHandlerL(const TDesC16& aContentType, MWapPushLog& aLog, MConnManObserver& aManager);
       
   100 	};
       
   101 
       
   102 
       
   103 #endif