epoc32/include/irheader.h
branchSymbian2
changeset 2 2fe1408b6811
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // $Workfile: irHeader.h $
       
    15 // $Author: Stevep $
       
    16 // $Revision: 4 $
       
    17 // $Date: 9/11/01 15:29 $
       
    18 // 
       
    19 //
       
    20 
       
    21 
       
    22 #if !defined (__IRHEADER_H__)
       
    23 #define __IRHEADER_H__
       
    24 
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <obexheader.h>    //CObexMtmHeader
       
    28 #include <obex.h>	//TObexIrProtocolInfo
       
    29 
       
    30 class CMsvStore;
       
    31 class RMsvReadStream;
       
    32 class RMsvWriteStream;
       
    33 
       
    34 
       
    35 // Stream version -- increment by one each time the externalized data format changes
       
    36 // for a significant release.
       
    37 const TInt32 KIrMessageStreamVersion = 1;///<Stream version
       
    38 const TUid KUidStreamIrHeaders  = {0x1000AABD};    ///< Stream UID for the CIrHeaders object
       
    39 _LIT(KIrTransport, "IrTinyTP");
       
    40 _LIT8(KIrObexClassName, "OBEX");
       
    41 _LIT8(KIrXferClassName, "OBEX:IrXfer");
       
    42 _LIT8(KIrObexAttributeName, "IrDA:TinyTP:LsapSel");
       
    43 
       
    44 class CIrHeader : public CObexMtmHeader
       
    45 /**
       
    46 Base class for OBEX object headers. Allows them to be stored and restored to and from the
       
    47 CMsvStore.
       
    48  
       
    49 @internalTechnology
       
    50 @released
       
    51 */
       
    52 	{
       
    53 public:
       
    54 
       
    55 	/**
       
    56 	 * Destructor. Empty
       
    57 	 */
       
    58 
       
    59     IMPORT_C ~CIrHeader();
       
    60     
       
    61 	/**
       
    62 	 * Second-phase constructor. Calls BaseConstructL to initialise the base members
       
    63 	 */
       
    64 	
       
    65 	IMPORT_C void ConstructL();
       
    66     
       
    67 	/**
       
    68 	 * Canonical NewL factory function
       
    69 	 */
       
    70 	
       
    71 	IMPORT_C static CIrHeader* NewL();
       
    72 	
       
    73 	//Setters/Getters
       
    74 	
       
    75 	/**
       
    76 	 * Get the IR protocol info of the recipient
       
    77 	 *
       
    78 	 * @return The protocol info of the recipient (NB: only one recipient is currently supported)
       
    79 	 */
       
    80 	
       
    81 	IMPORT_C virtual const TObexIrProtocolInfo& IrProtocolInfo() const;
       
    82 	
       
    83 	/**
       
    84 	 * Get the IR address of the recipient
       
    85 	 *
       
    86 	 * @return The address of the recipient (NB: only one recipient is currently supported)
       
    87 	 */
       
    88 	
       
    89 	IMPORT_C virtual TPtrC8 Addr() const;
       
    90 	
       
    91 	/**
       
    92 	 * Set the IR address of the recipient
       
    93 	 *
       
    94 	 * @param aAddr the address of the recipient (NB: only one recipient is currently supported)
       
    95 	 * @leave KErrXXX system-wide leave codes if assignment fails
       
    96 	 */
       
    97 
       
    98 	IMPORT_C virtual void SetAddrL(const TDesC8& aAddr);
       
    99 
       
   100 	//Called by Store/Restore--must be implelented in the base class, and must call
       
   101 	//BaseExternalizeL/BaseInternaliseL first
       
   102 
       
   103 	/**
       
   104 	 * Internaliser. Reads data in from aReadStream. Calls BaseInternalizeL() to read in the base
       
   105 	 * data first.
       
   106 	 *
       
   107 	 * @param aReadStream Stream to read data in from
       
   108 	 * @leave KErrXXX Standard EPOC stream leave codes
       
   109 	 */
       
   110 
       
   111     IMPORT_C virtual void InternalizeL(RMsvReadStream& aReadStream);
       
   112     
       
   113 	/** 
       
   114 	 * Externaliser. Writes data out to aWriteStream. Calls BaseExternalizeL() to write out
       
   115 	 * the base data first.
       
   116 	 *
       
   117 	 * @param aWriteStream Stream to write data to
       
   118 	 * @leave KErrXXX Standard SymbianOS stream leave codes
       
   119 	 */
       
   120 	
       
   121 	IMPORT_C virtual void ExternalizeL(RMsvWriteStream& aWriteStream) const;
       
   122 
       
   123 private:
       
   124 
       
   125 	/**
       
   126 	 * Default constructor, initialises the base class and sets the value of iIrProtocolInfo.iTransport
       
   127 	 * as appropriate for IR
       
   128 	 */
       
   129 
       
   130 	CIrHeader();
       
   131 
       
   132 private:
       
   133 	TObexIrProtocolInfo iIrProtocolInfo; ///< Protocol info to initialise the CObexClient. Non-const because the CObexClient's NewL() takes a non-const reference
       
   134 	};
       
   135 
       
   136 #endif	//!defined (__IRHEADER_H__)