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