messagingfw/wappushfw/pushutils/inc/PushDispatcher.h
author Pat Downey <patd@symbian.org>
Fri, 04 Jun 2010 10:32:16 +0100
changeset 22 bde600d88860
child 35 f8ad95794a08
permissions -rw-r--r--
Revert last code drop.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
//
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
//
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
// Contributors:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
//
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
// Description:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
// This file contains the declaration of the PushAppDispatcher which Handles the push message using the
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
// extracted app ID. Other class is PushContentTypeDispatcher for creating appropiate handler to handle the push message
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
// 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
//
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
/**
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
 @file
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
 @publishedPartner
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
 @released
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
*/
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#ifndef __PUSHDISPATCHER_H__
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#define __PUSHDISPATCHER_H__
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <e32std.h>
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
//Forward declarations
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
class CPluginOwner;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
class CPluginKiller;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
class MWapPushLog;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
class MConnManObserver;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
class CPushHandlerBase;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
class CContentHandlerBase;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
/** Handle for default user agent. */
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
const TInt KUserAgentAppHandler = 0;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
/** Creates an appropriate App Handler for the given AppId or AppURI.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
	
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
	Looks up the application Id passed in and uses the WAP Plugin Server
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
	to determine the correct handler which is then created. If there is no
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
	recognised application handler to deal with the Message App Type then the
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
	default behaviour is to create an Unknown AppHandler to process message.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
	@param aAppId Application ID extracted from Push Message
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
	@param aLog Reference to logging object 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
	@param aManager Reference to Connection Manager Observer Mixin class
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
	@param aAppURI Application URI used instead of Application UID
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
	@return Reference to the application plugin handler base class 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
*/
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
//##ModelId=3B659EE80221
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
class PushAppDispatcher
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
/**
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
@publishedPartner
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
@released
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
*/
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
	{
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
public:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
	//##ModelId=3B659E6E0145
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
	IMPORT_C static CPushHandlerBase& GetHandlerL(TInt aAppId, MWapPushLog& aLog, MConnManObserver& aManager);
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
	//##ModelId=3B659E6E014D
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
	IMPORT_C static CPushHandlerBase& GetHandlerL(const TDesC8& aAppURI, MWapPushLog& aLog, MConnManObserver& aManager);
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
private:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
	//##ModelId=3B659E6E0140
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
	static CPushHandlerBase* CreatePluginFromDataL(const TDesC& aData, const TUid& aType, MWapPushLog& aLog, MConnManObserver& aManager);
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
	friend class PushContentTypeDispatcher;
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
	};
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
/** Creates an appropriate Content Type handler for the given CPushMessage.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
	The content dispatcher uses the WAP plugin server to determine the correct handler
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
	given the Content Type retrieved from the CPushMessage. It will then instantiate
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
	an instance of the correct handler and pass back a pointer to this content
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
	handler. If the Content Type is not recognised and no appropriate handler
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
	exists, a Unknown Content Handler will be created to deal with the message.
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
	@param aContentType Content type extracted from Push Message
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
	@param aLog Reference to logging object 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
	@param aManager Reference to Connection Manager Observer Mixin class
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
	@return  Reference to the content plugin handler base class 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
*/
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
//##ModelId=3B659EE902E1
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
class PushContentTypeDispatcher 
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
/**
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
@publishedPartner
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
@released
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
*/
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
	{
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
public:
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
	//##ModelId=3B659E6E030C
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
	IMPORT_C static CContentHandlerBase& GetHandlerL(const TDesC16& aContentType, MWapPushLog& aLog, MConnManObserver& aManager);
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
	};
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
bde600d88860 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
#endif