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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // $Workfile: irHeader.h $
17 // $Date: 9/11/01 15:29 $
22 #if !defined (__IRHEADER_H__)
23 #define __IRHEADER_H__
27 #include <obexheader.h> //CObexMtmHeader
28 #include <obex.h> //TObexIrProtocolInfo
32 class RMsvWriteStream;
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");
44 class CIrHeader : public CObexMtmHeader
46 Base class for OBEX object headers. Allows them to be stored and restored to and from the
59 IMPORT_C ~CIrHeader();
62 * Second-phase constructor. Calls BaseConstructL to initialise the base members
65 IMPORT_C void ConstructL();
68 * Canonical NewL factory function
71 IMPORT_C static CIrHeader* NewL();
76 * Get the IR protocol info of the recipient
78 * @return The protocol info of the recipient (NB: only one recipient is currently supported)
81 IMPORT_C virtual const TObexIrProtocolInfo& IrProtocolInfo() const;
84 * Get the IR address of the recipient
86 * @return The address of the recipient (NB: only one recipient is currently supported)
89 IMPORT_C virtual TPtrC8 Addr() const;
92 * Set the IR address of the recipient
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
98 IMPORT_C virtual void SetAddrL(const TDesC8& aAddr);
100 //Called by Store/Restore--must be implelented in the base class, and must call
101 //BaseExternalizeL/BaseInternaliseL first
104 * Internaliser. Reads data in from aReadStream. Calls BaseInternalizeL() to read in the base
107 * @param aReadStream Stream to read data in from
108 * @leave KErrXXX Standard EPOC stream leave codes
111 IMPORT_C virtual void InternalizeL(RMsvReadStream& aReadStream);
114 * Externaliser. Writes data out to aWriteStream. Calls BaseExternalizeL() to write out
115 * the base data first.
117 * @param aWriteStream Stream to write data to
118 * @leave KErrXXX Standard SymbianOS stream leave codes
121 IMPORT_C virtual void ExternalizeL(RMsvWriteStream& aWriteStream) const;
126 * Default constructor, initialises the base class and sets the value of iIrProtocolInfo.iTransport
127 * as appropriate for IR
133 TObexIrProtocolInfo iIrProtocolInfo; ///< Protocol info to initialise the CObexClient. Non-const because the CObexClient's NewL() takes a non-const reference
136 #endif //!defined (__IRHEADER_H__)