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: irHeader.h $
|
williamr@2
|
15 |
// $Author: Stevep $
|
williamr@2
|
16 |
// $Revision: 4 $
|
williamr@2
|
17 |
// $Date: 9/11/01 15:29 $
|
williamr@2
|
18 |
//
|
williamr@2
|
19 |
//
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#if !defined (__IRHEADER_H__)
|
williamr@2
|
23 |
#define __IRHEADER_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> //TObexIrProtocolInfo
|
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 KIrMessageStreamVersion = 1;///<Stream version
|
williamr@2
|
38 |
const TUid KUidStreamIrHeaders = {0x1000AABD}; ///< Stream UID for the CIrHeaders object
|
williamr@2
|
39 |
_LIT(KIrTransport, "IrTinyTP");
|
williamr@2
|
40 |
_LIT8(KIrObexClassName, "OBEX");
|
williamr@2
|
41 |
_LIT8(KIrXferClassName, "OBEX:IrXfer");
|
williamr@2
|
42 |
_LIT8(KIrObexAttributeName, "IrDA:TinyTP:LsapSel");
|
williamr@2
|
43 |
|
williamr@2
|
44 |
class CIrHeader : public CObexMtmHeader
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
Base class for OBEX object headers. Allows them to be stored and restored to and from the
|
williamr@2
|
47 |
CMsvStore.
|
williamr@2
|
48 |
|
williamr@2
|
49 |
@internalTechnology
|
williamr@2
|
50 |
@released
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
{
|
williamr@2
|
53 |
public:
|
williamr@2
|
54 |
|
williamr@2
|
55 |
/**
|
williamr@2
|
56 |
* Destructor. Empty
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
|
williamr@2
|
59 |
IMPORT_C ~CIrHeader();
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* Second-phase constructor. Calls BaseConstructL to initialise the base members
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
|
williamr@2
|
65 |
IMPORT_C void ConstructL();
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
* Canonical NewL factory function
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
|
williamr@2
|
71 |
IMPORT_C static CIrHeader* NewL();
|
williamr@2
|
72 |
|
williamr@2
|
73 |
//Setters/Getters
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
* Get the IR protocol info of the recipient
|
williamr@2
|
77 |
*
|
williamr@2
|
78 |
* @return The protocol info of the recipient (NB: only one recipient is currently supported)
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
|
williamr@2
|
81 |
IMPORT_C virtual const TObexIrProtocolInfo& IrProtocolInfo() const;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
* Get the IR address of the recipient
|
williamr@2
|
85 |
*
|
williamr@2
|
86 |
* @return The address of the recipient (NB: only one recipient is currently supported)
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
|
williamr@2
|
89 |
IMPORT_C virtual TPtrC8 Addr() const;
|
williamr@2
|
90 |
|
williamr@2
|
91 |
/**
|
williamr@2
|
92 |
* Set the IR address of the recipient
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* @param aAddr the address of the recipient (NB: only one recipient is currently supported)
|
williamr@2
|
95 |
* @leave KErrXXX system-wide leave codes if assignment fails
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
|
williamr@2
|
98 |
IMPORT_C virtual void SetAddrL(const TDesC8& aAddr);
|
williamr@2
|
99 |
|
williamr@2
|
100 |
//Called by Store/Restore--must be implelented in the base class, and must call
|
williamr@2
|
101 |
//BaseExternalizeL/BaseInternaliseL first
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
* Internaliser. Reads data in from aReadStream. Calls BaseInternalizeL() to read in the base
|
williamr@2
|
105 |
* data first.
|
williamr@2
|
106 |
*
|
williamr@2
|
107 |
* @param aReadStream Stream to read data in from
|
williamr@2
|
108 |
* @leave KErrXXX Standard EPOC stream leave codes
|
williamr@2
|
109 |
*/
|
williamr@2
|
110 |
|
williamr@2
|
111 |
IMPORT_C virtual void InternalizeL(RMsvReadStream& aReadStream);
|
williamr@2
|
112 |
|
williamr@2
|
113 |
/**
|
williamr@2
|
114 |
* Externaliser. Writes data out to aWriteStream. Calls BaseExternalizeL() to write out
|
williamr@2
|
115 |
* the base data first.
|
williamr@2
|
116 |
*
|
williamr@2
|
117 |
* @param aWriteStream Stream to write data to
|
williamr@2
|
118 |
* @leave KErrXXX Standard SymbianOS stream leave codes
|
williamr@2
|
119 |
*/
|
williamr@2
|
120 |
|
williamr@2
|
121 |
IMPORT_C virtual void ExternalizeL(RMsvWriteStream& aWriteStream) const;
|
williamr@2
|
122 |
|
williamr@2
|
123 |
private:
|
williamr@2
|
124 |
|
williamr@2
|
125 |
/**
|
williamr@2
|
126 |
* Default constructor, initialises the base class and sets the value of iIrProtocolInfo.iTransport
|
williamr@2
|
127 |
* as appropriate for IR
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
|
williamr@2
|
130 |
CIrHeader();
|
williamr@2
|
131 |
|
williamr@2
|
132 |
private:
|
williamr@2
|
133 |
TObexIrProtocolInfo iIrProtocolInfo; ///< Protocol info to initialise the CObexClient. Non-const because the CObexClient's NewL() takes a non-const reference
|
williamr@2
|
134 |
};
|
williamr@2
|
135 |
|
williamr@2
|
136 |
#endif //!defined (__IRHEADER_H__)
|