wapstack/wapmessageapi/inc/wapmessage.h
author Nithin Vijay <nithin.vjay@nokia.com>
Tue, 20 Apr 2010 17:00:49 +0100
branchRCL_3
changeset 18 50bae5c5c85f
child 53 12b52b1a573e
permissions -rw-r--r--
Add wapstack/wapmessageapi component, to fix Bug 1398
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     7
//
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    10
//
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    11
// Contributors:
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    12
//
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    13
// Description:
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    14
//
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    15
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    16
#ifndef __WAPMESSAGE_H__
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    17
#define __WAPMESSAGE_H__
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    18
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    19
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    20
#include <e32base.h>
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    21
#include <e32std.h>
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    22
#include <in_sock.h>
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    23
#include <nifman.h>
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    24
#include <in_iface.h>
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    25
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    26
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    27
* @file
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    28
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    29
* The WAP Messaging API.  
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    30
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    31
* Four interfaces are defined that provide bound and fully-specified versions of WDP and Connectionless Push.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    32
* An instantiation of each may be obtained using the CreateImplementationL() function, and must be released 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    33
* using Release() when no longer required.  Release() causes the instantiation to be deleted.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    34
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    35
* For error codes returned by methods in this API, see <wapmsgerr.h>.  Most methods can return a set of general 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    36
* errors, with some returning additional specific errors.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    37
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    38
* @publishedAll
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    39
* @released since v7.0
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    40
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    41
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    42
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    43
* Defines WAP-related types and error codes. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    44
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    45
namespace Wap
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    46
	{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    47
	// Bearer type definition
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    48
	typedef enum
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    49
	/** Type definition for an enum defining WAP bearer types. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    50
		{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    51
		/** All bearers. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    52
		EAll,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    53
		/** Internet Protocol. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    54
		EIP,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    55
		/** 7-bit SMS. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    56
		ESMS7,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    57
		/** 8-bit SMS. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    58
		ESMS,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    59
		/** 7-bit SMS. The bearers WAPSMS and WAPSMS7 are intended for WAP browsing where 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    60
		delivery reports are not required and the validity period is much shorter (5 minutes). */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    61
		EWAPSMS7,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    62
		/** 8-bit SMS. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    63
		EWAPSMS
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    64
		} TBearer;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    65
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    66
	// Port number definition
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    67
	/** A port number. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    68
	typedef TUint16 TPort;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    69
 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    70
	class TAddressInfo
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    71
	/** Encapsulates an interface name and address. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    72
		{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    73
	public:
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    74
		/** Interface name. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    75
		TName iName;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    76
		/** Interface IP address. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    77
		TInetAddr iAddress;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    78
		};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    79
	}
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    80
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    81
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    82
/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    83
* The WSP status type definition.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    84
* @internalComponent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    85
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    86
typedef TUint8 TWSPStatus;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    87
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    88
/** Bound WDP */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    89
class CWapBoundDatagramService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    90
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    91
* Sends and receives datagrams over WDP using a specified local port.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    92
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    93
* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    94
* of the interface, and then call the interface's virtual functions to access 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    95
* the implementation's services. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    96
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    97
* The use of the plug-in architecture allows different implementations to use 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    98
* different underlying WAP stacks.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
    99
*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   100
* Functions can return system wide error codes, and also API-specific errors 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   101
* as defined in wapmsgerr.h. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   102
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   103
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   104
	{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   105
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   106
	IMPORT_C static CWapBoundDatagramService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   107
	IMPORT_C static CWapBoundDatagramService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   108
	IMPORT_C virtual ~CWapBoundDatagramService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   109
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   110
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   111
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   112
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   113
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   114
	* subsequent incoming datagrams.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   115
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   116
	* This overload of Connect() allows an IP address associated with a network 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   117
	* interface to be specified. In multihomed systems, this can be used to specify 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   118
	* the network interface to which the endpoint should be bound.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   119
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   120
	* All CWapBoundDatagramService implementations must automatically close this 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   121
	* endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   122
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   123
	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   124
	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   125
	* 					for the client's first SendTo()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   126
	* @param aInetAddr	The IP address of the network interface that should be used 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   127
	*					in a multihomed system.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   128
	* @return			KErrNone on successful completion, or one of the system error codes 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   129
	* 					on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   130
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   131
	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort,TInetAddr aInetAddr)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   132
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   133
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   134
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   135
	* subsequent incoming datagrams.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   136
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   137
	* All CWapBoundDatagramService implementations must automatically close this 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   138
	* endpoint upon destruction. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   139
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   140
	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   141
	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   142
	* 					for the client's first SendTo()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   143
	* @return			KErrNone on successful completion, or one of the system error codes 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   144
	* 					on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   145
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   146
	virtual TInt Connect(Wap::TBearer aBearer,Wap::TPort aPort)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   147
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   148
	/** Sends data to a remote endpoint. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   149
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   150
	* @param aRemoteHost	The address of the remote host to which to send the data. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   151
	* 						The format of the address is bearer-specific.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   152
	* @param aRemotePort	The port on the remote host to which the data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   153
	* @param aBuffer		The data buffer to be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   154
	* @param aBearer		The bearer to be used, if the bound connection was opened with EAll
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   155
	* @return				KErrNone on successful completion, or one of the system error codes 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   156
	* 						on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   157
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   158
virtual TInt SendTo(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, const TDesC8& aBuffer, Wap::TBearer aBearer)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   159
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   160
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   161
	* Waits for a datagram to be received, and discovers the size of buffer required 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   162
	* to retrieve it.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   163
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   164
	* This asynchronous method waits for a datagram to be received and will then 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   165
	* complete allowing the client to discover how large a buffer is needed to retrieve 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   166
	* the entire datagram that has been received. A later call to RecvFrom() with 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   167
	* a buffer of sufficient size will then allow the client to retrieve the datagram 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   168
	* fully. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   169
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   170
	* @param aDataSizePckg	On completion, the size of data received, in bytes
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   171
	* @param aReqStatus		Asynchonrous status word, used to signal when a data size is known
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   172
	* @return				KErrNone on successful completion, or one of the system error codes 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   173
	* 						on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   174
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   175
	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   176
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   177
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   178
	* Receives data on a bound port. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   179
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   180
	* An asynchronous notification is sent to the client when data arrives. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   181
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   182
	* @param aRemoteHost	On completion, the bearer-dependent address of the remote 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   183
	* 						host from which the data was received
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   184
	* @param aRemotePort	On completion, the port on the remote host from which the 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   185
	* 						data was received
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   186
	* @param aBuffer		A client-allocated data buffer that on completion is filled 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   187
	* 						with data received. Data that overflows the buffer is discarded.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   188
	* @param aTruncated		On completion, indicates whether the received datagram was 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   189
	* 						truncated to fit in the client's supplied buffer
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   190
	* @param aReqStatus		Asynchronous status word, used to notify the client that 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   191
	* 						a datagram was received
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   192
	* @param aTimeout		An optional millisecond time-out which allows a timed read 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   193
	* 						to be made. If no data is received within the timeout period, the request 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   194
	* 						completes with KErrTimedOut. If a value of 0 is supplied, the timeout is infinite.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   195
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   196
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   197
	virtual TInt RecvFrom(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer, TBool& aTruncated, 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   198
							TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   199
 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   200
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   201
	* Cancels a previously asynchronous RecvFrom() or AwaitRecvDataSize() request. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   202
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   203
	* If a datagram arrives at the local host, it will be discarded. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   204
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   205
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   206
	virtual void CancelRecv()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   207
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   208
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   209
	* Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   210
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   211
	* This is useful if the port was chosen automatically.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   212
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   213
	* @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   214
	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   215
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   216
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   217
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   218
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   219
	* Gets the local address of this endpoint. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   220
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   221
	* @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   222
	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   223
	* 					buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   224
	* @return			KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   225
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   226
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   227
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   228
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   229
	* Gets the bearer on which a received datagram arrived. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   230
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   231
	* This is useful when EAll was specified as the bearer in Connect().
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   232
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   233
	* @param aBearer	On return, the bearer
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   234
	* @return			KErrNone on successful completion, or one of the system error codes on failure.	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   235
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   236
	virtual TInt GetBearer(Wap::TBearer& aBearer)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   237
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   238
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   239
	* Queries the WDP bearer for its maximum datagram size and its nominal datagram size.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   240
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   241
	* The nominal size is the size within which a datagram won't have to be split 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   242
	* into smaller individual messages and then re-assembled at the other end. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   243
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   244
	* The function will fail for a stream connection.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   245
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   246
	* @param aMaxSize		On return, the maximum datagram size
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   247
	* @param aNominalSize	On return, the nominal datagram size
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   248
	* @return				KErrNone on successful completion, or one of the system error codes 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   249
	*						on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   250
	*/	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   251
	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   252
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   253
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   254
	IMPORT_C CWapBoundDatagramService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   255
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   256
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   257
private: // attributes
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   258
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   259
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   260
	};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   261
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   262
/** Fully-Specified WDP
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   263
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   264
class CWapFullySpecDatagramService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   265
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   266
* Sends and receives datagrams over WDP using a specified local port and a single, 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   267
* named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   268
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   269
* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   270
* of the interface, and then call the interface's virtual functions to access 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   271
* the implementation's services. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   272
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   273
* The use of the plug-in architecture allows different implementations to use 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   274
* different underlying WAP stacks.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   275
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   276
* Functions can return system wide error codes, and also API-specific errors 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   277
* as defined in wapmsgerr.h. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   278
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   279
	{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   280
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   281
	IMPORT_C static CWapFullySpecDatagramService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   282
	IMPORT_C static CWapFullySpecDatagramService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   283
	IMPORT_C virtual ~CWapFullySpecDatagramService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   284
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   285
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   286
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   287
	// Connect to the wapstack, opening an endpoint which is to be used only with a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   288
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   289
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   290
	* subsequent incoming datagrams.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   291
	*	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   292
	* This overload of Connect() allows an IP address associated with a network 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   293
	* interface to be specified. In multihomed systems, this can be used to specify 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   294
	* the network interface to which the endpoint should be bound.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   295
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   296
	* All CWapFullySpecDatagramService implementations must automatically close 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   297
	* this endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   298
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   299
	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   300
	* 						the data will be exchanged
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   301
	* @param aRemotePort	The port on the remote host to which data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   302
	* @param aBearer		The bearer to use. EAll cannot be used.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   303
	* @param aInetAddr		The IP address of the network interface that should be used 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   304
	* 						in a multihomed system.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   305
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   306
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   307
	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TInetAddr aInetAddr)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   308
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   309
	// Connect to the wapstack, opening an endpoint which is to be used only with a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   310
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   311
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   312
	* subsequent incoming datagrams.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   313
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   314
	* All CWapFullySpecDatagramService implementations must automatically close 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   315
	* this endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   316
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   317
	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   318
	* 						the data will be exchanged
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   319
	* @param aRemotePort	The port on the remote host to which data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   320
	* @param aBearer		The bearer to use. EAll cannot be used.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   321
	* @return 				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   322
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   323
	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   324
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   325
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   326
	* Sends data on a fully-specified connection.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   327
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   328
	* @param aBuffer	The data buffer to be written over the connection
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   329
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   330
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   331
	virtual TInt Send(const TDesC8& aBuffer)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   332
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   333
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   334
	* Waits for a datagram to be received, and discover how large a buffer is required 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   335
	* to retrieve it.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   336
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   337
	* This asynchronous request waits for a datagram to be received and will then 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   338
	* complete allowing the client to discover how large a buffer is needed to retrieve 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   339
	* the entire datagram that has been received. A later call to Recv() with a 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   340
	* buffer of sufficent size will then allow the client to retrieve the datagram 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   341
	* fully. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   342
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   343
	* @param aDataSizePckg	On completion, the size of data received, in bytes
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   344
	* @param aReqStatus		Asynchonrous status word, used to signal when a data size is known
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   345
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   346
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   347
	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   348
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   349
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   350
	* Receives data on a bound port. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   351
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   352
	* An asynchronous notification is sent to the client when data arrives. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   353
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   354
	* @param aBuffer	A client-allocated data buffer that, on completion, is filled 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   355
	* 					with data received. Data that overflows the buffer is discarded.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   356
	* @param aTruncated	On completion, indicates whether the received datagram was 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   357
	* 					truncated to fit in the client's supplied buffer
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   358
	* @param aReqStatus	Asynchronous status word, used to notify the client that 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   359
	* 					a datagram was received
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   360
	* @param aTimeout	An optional millisecond time-out which allows a timed read 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   361
	* 					to be made. If no data is received within the timeout period, the request 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   362
	* 					completes with KErrTimedOut. If a value of 0 is supplied, the timeout is infinite.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   363
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   364
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   365
	virtual TInt Recv(TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   366
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   367
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   368
	* Cancels a previously asynchronous Recv() or AwaitRecvDataSize() request. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   369
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   370
	* If a datagram arrives at the local host, it will be discarded. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   371
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   372
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   373
	virtual void CancelRecv()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   374
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   375
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   376
	* Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   377
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   378
	* This is useful if the port was chosen automatically.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   379
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   380
	* @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   381
	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   382
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   383
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   384
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   385
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   386
	* Gets the local address of this endpoint. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   387
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   388
	* @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   389
	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   390
	* 					buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   391
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   392
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   393
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   394
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   395
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   396
	* Queries the WDP bearer for its maximum datagram size and its nominal datagram size.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   397
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   398
	* The nominal size is the size within which a datagram won't have to be split 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   399
	* into smaller individual messages and then re-assembled at the other end. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   400
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   401
	* @param aMaxSize		On return, the maximum datagram size
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   402
	* @param aNominalSize	On return, the nominal datagram size
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   403
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   404
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   405
	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   406
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   407
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   408
	IMPORT_C CWapFullySpecDatagramService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   409
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   410
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   411
private: // ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   412
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   413
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   414
	};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   415
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   416
/** Bound Connectionless Push
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   417
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   418
class CWapBoundCLPushService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   419
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   420
* Listens for WAP Push messages from any sender.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   421
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   422
* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   423
* of the interface, and then call the interface's virtual functions to access 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   424
* the implementation's services. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   425
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   426
* The use of the plug-in architecture allows different implementations to use 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   427
* different underlying WAP stacks.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   428
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   429
* Functions can return system wide error codes, and also API-specific errors 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   430
* as defined in wapmsgerr.h. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   431
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   432
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   433
{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   434
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   435
	IMPORT_C static CWapBoundCLPushService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   436
	IMPORT_C static CWapBoundCLPushService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   437
	IMPORT_C virtual ~CWapBoundCLPushService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   438
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   439
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   440
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   441
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   442
	// Opens a socket which is to be used to listen for subsequent incoming Push messages from any sender;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   443
	// i.e. it has only been 'bound' to the local address	 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   444
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   445
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   446
	* Push messages from any sender.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   447
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   448
	* This overload of Connect() allows an IP address associated with a network 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   449
	* interface to be specified. In multihomed systems, this can be used to specify 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   450
	* the network interface to which the endpoint should be bound.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   451
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   452
	* All CWapBoundCLPushService implementations must automatically close this endpoint 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   453
	* upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   454
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   455
	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   456
	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   457
	* 					for the client's first SendTo()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   458
	* @param aSecure	Security flag to indicate whether WTLS should be used or not
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   459
	* @param aInetAddr	The address of the adapter to use
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   460
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   461
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   462
	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInetAddr aInetAddr)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   463
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   464
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   465
	// Opens a socket which is to be used to listen for subsequent incoming Push messages from any sender;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   466
	// i.e. it has only been 'bound' to the local address
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   467
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   468
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   469
	* Push messages from any sender.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   470
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   471
	* All CWapBoundCLPushService implementations must automatically close this endpoint 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   472
	* upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   473
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   474
	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   475
	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   476
	* 					for the client's first SendTo()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   477
	* @param aSecure	Security flag to indicate whether WTLS should be used or not
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   478
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   479
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   480
	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   481
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   482
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   483
	* Requests an asynchronous notification upon arrival of the next push message 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   484
	* on the listening connection.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   485
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   486
	* The request completes upon receipt of the message, filling the buffers with 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   487
	* as much received data as possible. A return code indicates whether further 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   488
	* data remains. The call must be re-issued for subsequent messages or to receive 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   489
	* remaining data from a previous push message.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   490
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   491
	* @param aPushHeaders	A client-allocated buffer that, on completion, is filled 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   492
	* 						with the push message's header data
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   493
	* @param aPushBody		A client-allocated buffer that, on completion, is filled with 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   494
	* 						the push message's body data
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   495
	* @param aPushIdPckg	On completion, an integer ID that uniquely specifies the 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   496
	* 						push message
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   497
	* @param aReqStatus		Asynchonrous status word, used by the service provider to 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   498
	* 						notify the client when a push message has arrived. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   499
	*						EMoreData is returned if more pushed data is available.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   500
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   501
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   502
	virtual TInt AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   503
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   504
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   505
	* Cancels a previous push message request.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   506
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   507
	* If a push message arrives, the client will not be notified. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   508
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   509
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   510
	virtual void CancelAwaitPush()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   511
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   512
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   513
	* Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   514
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   515
	* This is useful if the port was chosen automatically. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   516
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   517
	* @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   518
	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   519
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   520
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   521
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   522
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   523
	* Gets the local address of this endpoint. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   524
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   525
	* @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   526
	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   527
	* 					buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   528
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   529
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   530
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   531
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   532
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   533
	* Gets the bearer on which a received datagram arrived. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   534
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   535
	* This is useful when EAll was specified as the bearer in Connect().
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   536
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   537
	* @param aBearer	On return, the bearer
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   538
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   539
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   540
	virtual TInt GetBearer(Wap::TBearer& aBearer)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   541
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   542
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   543
	 * Gets the address of the remote server.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   544
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   545
	 * This function cannot be called when there is an outstanding AwaitPush().
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   546
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   547
	 * @param aRemoteHost	On return, the address of the remote host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   548
	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   549
	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   550
	 * @return				KErrNone on successful completion, KErrNotSupported if not implemented,
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   551
	 * 						or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   552
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   553
	virtual TInt GetServerAddress(HBufC8*& aRemoteHost)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   554
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   555
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   556
	IMPORT_C CWapBoundCLPushService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   557
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   558
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   559
private: // ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   560
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   561
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   562
};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   563
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   564
/** Fully-Specified Connectionless Push
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   565
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   566
class CWapFullySpecCLPushService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   567
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   568
* Listens for WAP Push messages from a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   569
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   570
* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   571
* of the interface, and then call the interface's virtual functions to access 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   572
* the implementation's services. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   573
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   574
* The use of the plug-in architecture allows different implementations to use 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   575
* different underlying WAP stacks.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   576
* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   577
* Functions can return system wide error codes, and also API-specific errors 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   578
* as defined in wapmsgerr.h. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   579
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   580
{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   581
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   582
	IMPORT_C static CWapFullySpecCLPushService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   583
	IMPORT_C static CWapFullySpecCLPushService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   584
	IMPORT_C virtual ~CWapFullySpecCLPushService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   585
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   586
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   587
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   588
 	// Opens a socket which is to be used only with a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   589
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   590
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   591
	* Push messages from a specified remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   592
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   593
	* This overload of Connect() allows an IP address associated with a network 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   594
	* interface to be specified. In multihomed systems, this can be used to specify 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   595
	* the network interface to which the endpoint should be bound.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   596
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   597
	* All CWapFullySpecCLPushService implementations must automatically close this 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   598
	* endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   599
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   600
	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   601
	* 						the data will be exchanged
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   602
	* @param aRemotePort	The port on the remote host to which data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   603
	* @param aBearer		The bearer to listen on. You cannot use EAll.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   604
	* @param aSecure		Security flag to indicate whether WTLS should be used or not
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   605
	* @param aInetAddr		The address of the adapter to use
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   606
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   607
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   608
	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure, TInetAddr aInetAddr)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   609
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   610
	// Opens a socket which is to be used only with a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   611
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   612
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   613
	* Push messages from a specified remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   614
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   615
	* All CWapFullySpecCLPushService implementations must automatically close this 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   616
	* endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   617
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   618
	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   619
	* 						the data will be exchanged
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   620
	* @param aRemotePort	The port on the remote host to which data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   621
	* @param aBearer		The bearer to listen on. You cannot use EAll.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   622
	* @param aSecure		Security flag to indicate whether WTLS should be used or not
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   623
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   624
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   625
	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   626
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   627
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   628
	* Requests an asynchronous notification upon arrival of the next push message 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   629
	* on the listening connection.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   630
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   631
	* The request completes upon receipt of the message, filling the buffers with 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   632
	* as much received data as possible. A return code indicates whether further 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   633
	* data remains. The call must be re-issued for subsequent messages or to receive 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   634
	* remaining data from a previous push message.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   635
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   636
	* @param aPushHeaders	A client-allocated buffer that, on completion, is filled 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   637
	* 						with the push message's header data
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   638
	* @param aPushBody		A client-allocated buffer that, on completion, is filled with 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   639
	* 						the push message's body data
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   640
	* @param aPushIdPckg	On completion, an integer ID that uniquely specifies the 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   641
	* 						push message
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   642
	* @param aReqStatus		Asynchronous status word, used by the service provider to 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   643
	* 						notify the client when a push message has arrived.  
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   644
	* 						EMoreData is returned if more pushed data is available.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   645
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   646
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   647
	virtual TInt AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   648
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   649
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   650
	* Cancels a previous push message request.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   651
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   652
	* If a push message arrives, the client will not be notified. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   653
	*
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   654
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   655
	virtual void CancelAwaitPush()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   656
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   657
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   658
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   659
	* Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   660
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   661
	* This is useful if the port was chosen automatically. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   662
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   663
	* @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   664
	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   665
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   666
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   667
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   668
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   669
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   670
	* Gets the local address of this endpoint. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   671
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   672
	* @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   673
	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   674
	* 					buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   675
	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   676
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   677
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   678
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   679
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   680
	IMPORT_C CWapFullySpecCLPushService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   681
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   682
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   683
private: // ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   684
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   685
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   686
};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   687
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   688
/** Bound Connectionless WSP
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   689
*  @released since v8.0
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   690
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   691
class CWapBoundCLWSPService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   692
{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   693
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   694
	IMPORT_C static CWapBoundCLWSPService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   695
	IMPORT_C static CWapBoundCLWSPService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   696
	IMPORT_C virtual ~CWapBoundCLWSPService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   697
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   698
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   699
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   700
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   701
	 * Connects to the WAP stack, opening an endpoint that can be used for S-Unit-MethodInvoke and 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   702
	 * S-Unit-MethodResult primitives.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   703
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   704
	 * @param aBearer	The bearer to listen on (use EAll for all bearers)
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   705
	 * @param aPort		The port to listen on. If set to 0, a local port will be chosen for the 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   706
	 *					client's first MethodInvoke()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   707
	 * @return			KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   708
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   709
	virtual TInt Connect(Wap::TBearer aBearer,Wap::TPort aPort, TBool aSecure)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   710
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   711
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   712
	 * Sends a request to a remote endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   713
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   714
	 * @param aBearer			The bearer to be used, if the bound connection was opened with EAll
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   715
	 * @param aRemoteHost		The address of the remote host to which to send the request. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   716
	 * 							The format of the address is bearer-specific.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   717
	 * @param aRemotePort		The port on the remote host to which the request will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   718
	 * @param aMethod
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   719
	 * @param aURI
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   720
	 * @param aReqHeaders
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   721
	 * @param aReqBody
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   722
	 * @param aTransactionId
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   723
	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   724
	 */ 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   725
	virtual TInt MethodInvoke(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, const TUint8 aTransactionId)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   726
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   727
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   728
	 * Waits for a datagram to be received.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   729
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   730
	 * @param aReqHeaders
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   731
	 * @param aReqBody
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   732
	 * @param aTransactionIdPckg
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   733
	 * @param aWspStatus
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   734
	 * @param aReqStatus			Asynchonrous status word, used to signal when a data size is known
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   735
	 * @param aTimeout
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   736
	 * @return 						KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   737
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   738
	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   739
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   740
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   741
	 * Cancels a previously requested asynchronous MethodResult() notification.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   742
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   743
	 * If a datagram arrives at the local host, it will be discarded.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   744
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   745
	 */	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   746
	virtual void CancelReq()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   747
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   748
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   749
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   750
	 * Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   751
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   752
	 * This is useful if the port was chosen automatically.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   753
 	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   754
 	 * @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   755
	 * @return		KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   756
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   757
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   758
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   759
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   760
	 * Gets the local address of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   761
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   762
	 * @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   763
	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   764
	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   765
	 * @return				KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   766
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   767
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   768
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   769
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   770
	 * Gets the bearer on which a received datagram arrived.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   771
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   772
	 * Useful when EAll was specified in Connect()
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   773
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   774
	 * @param aBearer	On return, the bearer
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   775
	 * @return			KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   776
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   777
	virtual TInt GetBearer(Wap::TBearer& /*aBearer*/)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   778
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   779
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   780
	 * Gets the remote server address.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   781
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   782
	 * @param aServerAddress	On return, the address of the remote server. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   783
	 * 							in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   784
	 * 							buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   785
	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   786
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   787
	virtual TInt GetServerAddress(HBufC8*& aServerAddress)=0;	// // (out) the address of the remote server
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   788
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   789
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   790
	IMPORT_C CWapBoundCLWSPService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   791
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   792
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   793
private: // ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   794
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   795
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   796
};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   797
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   798
/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   799
* Fully-Specified Connectionless WSP
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   800
*  @released since v8.0
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   801
*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   802
class CWapFullySpecCLWSPService : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   803
{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   804
public: // creation/deletion
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   805
	IMPORT_C static CWapFullySpecCLWSPService* NewL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   806
	IMPORT_C static CWapFullySpecCLWSPService* NewL(const TUid& aImplementation);
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   807
	IMPORT_C virtual ~CWapFullySpecCLWSPService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   808
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   809
public: // API methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   810
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   811
	// Opens a socket which is to be used only with a single, named remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   812
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   813
	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   814
	* Push messages from a specified remote host.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   815
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   816
	* All CWapFullySpecCLWSPService implementations must automatically close this 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   817
	* endpoint upon destruction.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   818
	* 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   819
	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   820
	*						the data will be exchanged
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   821
	* @param aRemotePort	The port on the remote host to which data will be sent
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   822
	* @param aBearer		The bearer to listen on. You cannot use EAll.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   823
	* @param aSecure		Security flag to indicate whether WTLS should be used or not
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   824
	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   825
	*/
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   826
	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   827
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   828
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   829
	 * Sends a request to a remote endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   830
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   831
	 * @param aMethod
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   832
	 * @param aURI
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   833
	 * @param aReqHeaders
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   834
	 * @param aReqBody
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   835
	 * @param aTransactionId
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   836
	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   837
	 */ 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   838
	virtual TInt MethodInvoke(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   839
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   840
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   841
	 * Waits for a datagram to be received
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   842
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   843
	 * @param aReqHeaders
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   844
	 * @param aReqBody
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   845
	 * @param aTransactionIdPckg
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   846
	 * @param aWspStatus
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   847
	 * @param aReqStatus			Asynchonrous status word, used to signal when a data size is known
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   848
	 * @param aTimeout
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   849
	 * @return						KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   850
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   851
	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   852
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   853
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   854
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   855
	 * Cancels a previously-requested MethodResult() notification. 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   856
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   857
	 * If a message arrives the client will not be notified.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   858
	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   859
	 */ 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   860
	virtual void CancelReq()=0;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   861
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   862
	/** 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   863
	 * Gets the local port of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   864
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   865
	 * This is useful if the port was chosen automatically.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   866
 	 * 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   867
 	 * @param aPort	On return, the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   868
	 * @return		KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   869
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   870
	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   871
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   872
	/**
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   873
	 * Gets the local address of this endpoint.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   874
	 *
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   875
	 * @param aLocalHost	On return, the address of the local host. Clients must pass 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   876
	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   877
	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   878
	 * @return				KErrNone on successful completion, or one of the system error codes on failure.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   879
	 */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   880
	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   881
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   882
protected: // methods
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   883
	IMPORT_C CWapFullySpecCLWSPService();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   884
	IMPORT_C void ConstructL();
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   885
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   886
private: // ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   887
	// D'tor Key identification required for ECOM
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   888
	TUid iDtor_ID_Key;
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   889
};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   890
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   891
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   892
// Utility class for client/implementation use.
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   893
class CWapMessageUtils : public CBase
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   894
/** Utility functions for use with WAP Messaging. */
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   895
	{
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   896
public:
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   897
	// // Return a list of all the addresses that are available
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   898
	IMPORT_C static TInt GetLocalAddressesL(RArray<Wap::TAddressInfo>& aAddressInfo); 
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   899
	};
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   900
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   901
	
50bae5c5c85f Add wapstack/wapmessageapi component, to fix Bug 1398
Nithin Vijay <nithin.vjay@nokia.com>
parents:
diff changeset
   902
#endif // __WAPMESSAGE_H__