epoc32/include/btheader.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// $Workfile: btHeader.h $
williamr@2
    15
// $Author: Stevep $
williamr@2
    16
// $Revision: 5 $
williamr@2
    17
// $Date: 23/01/02 13:31 $
williamr@2
    18
// 
williamr@2
    19
//
williamr@2
    20
williamr@2
    21
williamr@2
    22
#if !defined (__BTHEADER_H__)
williamr@2
    23
#define __BTHEADER_H__
williamr@2
    24
williamr@2
    25
williamr@2
    26
#include <e32std.h>
williamr@2
    27
#include <obexheader.h>		//CObexMtmHeader
williamr@2
    28
#include <obex.h>			//TObexBluetoothProtocolInfo
williamr@2
    29
williamr@2
    30
class CMsvStore;
williamr@2
    31
class RMsvReadStream;
williamr@2
    32
class RMsvWriteStream;
williamr@2
    33
williamr@2
    34
williamr@2
    35
// Stream version -- increment by one each time the externalized data format changes
williamr@2
    36
// for a significant release.
williamr@2
    37
const TInt32 KBtMessageStreamVersion = 1;///<Stream version
williamr@2
    38
const TUid KUidStreamBtHeaders  = {0x1000AABC};    ///< Stream UID for the CBtHeaders object
williamr@2
    39
_LIT(KBtTransport, "RFCOMM");
williamr@2
    40
williamr@2
    41
class CBtHeader : public CObexMtmHeader
williamr@2
    42
/**
williamr@2
    43
Base class for OBEX object headers. Allows them to be stored and restored to and from the
williamr@2
    44
CMsvStore.
williamr@2
    45
williamr@2
    46
@internalTechnology
williamr@2
    47
@released
williamr@2
    48
*/
williamr@2
    49
	{
williamr@2
    50
public:
williamr@2
    51
williamr@2
    52
	/**
williamr@2
    53
	 * Destructor. Empty
williamr@2
    54
	 */
williamr@2
    55
	
williamr@2
    56
    IMPORT_C ~CBtHeader();
williamr@2
    57
    
williamr@2
    58
	/**
williamr@2
    59
	 * Second-phase constructor. Calls BaseConstructL to initialise the base members
williamr@2
    60
	 */
williamr@2
    61
	
williamr@2
    62
	IMPORT_C void ConstructL();
williamr@2
    63
    
williamr@2
    64
	/**
williamr@2
    65
	 * Canonical NewL factory function
williamr@2
    66
	 */
williamr@2
    67
williamr@2
    68
	IMPORT_C static CBtHeader* NewL();
williamr@2
    69
	//Setters/Getters
williamr@2
    70
	
williamr@2
    71
	
williamr@2
    72
	/**
williamr@2
    73
	 * Get the BT protocol info of the recipient
williamr@2
    74
	 *
williamr@2
    75
	 * @return The protocol info of the recipient (NB: only one recipient is currently supported)
williamr@2
    76
	 */
williamr@2
    77
williamr@2
    78
	IMPORT_C virtual const TObexBluetoothProtocolInfo& BtProtocolInfo() const;
williamr@2
    79
	
williamr@2
    80
	/**
williamr@2
    81
	 * Get the BT address of the recipient
williamr@2
    82
	 *
williamr@2
    83
	 *  @return The address of the recipient (NB: only one recipient is currently supported)
williamr@2
    84
	 */
williamr@2
    85
	
williamr@2
    86
	IMPORT_C virtual TPtrC8 Addr() const;
williamr@2
    87
	
williamr@2
    88
	/**
williamr@2
    89
	 * Set the BT address of the recipient.  The RfComm service slot will be obtained through 
williamr@2
    90
	 * an SDP lookup in the server side MTM.
williamr@2
    91
	 *
williamr@2
    92
	 *  @param aAddr the address of the recipient (NB: only one recipient is currently supported)
williamr@2
    93
	 */
williamr@2
    94
	
williamr@2
    95
	IMPORT_C virtual void SetAddrL(const TDesC8& aAddr);
williamr@2
    96
williamr@2
    97
	//Called by Store/Restore--must be implelented in the base class, and must call
williamr@2
    98
	//BaseExternalizeL/BaseInternaliseL first
williamr@2
    99
williamr@2
   100
	/**
williamr@2
   101
	 * Internaliser. Reads data in from aReadStream. Calls BaseInternalizeL() to read in the base 
williamr@2
   102
	 * data first.
williamr@2
   103
	 *
williamr@2
   104
	 * @param aReadStream Stream to read data in from
williamr@2
   105
	 * @leave KErrXXX Standard EPOC stream leave codes
williamr@2
   106
	 */
williamr@2
   107
williamr@2
   108
    IMPORT_C virtual void InternalizeL(RMsvReadStream& aReadStream);
williamr@2
   109
    
williamr@2
   110
	/**
williamr@2
   111
	 * Externaliser. Writes data out to aWriteStream. Calls BaseExternalizeL() to write out
williamr@2
   112
	 * the base data first.
williamr@2
   113
	 *
williamr@2
   114
	 * @param aWriteStream Stream to write data to
williamr@2
   115
	 * @leave KErrXXX Standard SymbianOS stream leave codes
williamr@2
   116
	 */
williamr@2
   117
	
williamr@2
   118
	IMPORT_C virtual void ExternalizeL(RMsvWriteStream& aWriteStream) const;
williamr@2
   119
williamr@2
   120
private:
williamr@2
   121
williamr@2
   122
	/**
williamr@2
   123
	 * Default constructor, initialises the base class and sets the value of iBtProtocolInfo.iTransport
williamr@2
   124
	 * as appropriate for BT
williamr@2
   125
	 */
williamr@2
   126
williamr@2
   127
	CBtHeader();
williamr@2
   128
williamr@2
   129
private:
williamr@2
   130
	TObexBluetoothProtocolInfo iBtProtocolInfo;		///< Protocol info to be internalised/externalised
williamr@2
   131
	};
williamr@2
   132
williamr@2
   133
#endif	//!defined (__BTHEADER_H__)