|
1 // Copyright (c) 2006-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef PBAPAPPHEADER_H |
|
17 #define PBAPAPPHEADER_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <cntdb.h> |
|
21 #include "pbaprequest.h" |
|
22 #include "pbapoperation.h" |
|
23 |
|
24 |
|
25 // PBAP obex type header values |
|
26 _LIT8(KObexTypeBTvCard, "x-bt/vcard"); |
|
27 _LIT8(KObexTypeBTvCardPhoneBook, "x-bt/phonebook"); |
|
28 _LIT8(KObexTypeBTvCardListing, "x-bt/vcard-listing"); |
|
29 |
|
30 |
|
31 class CPbapAppHeader : public CBase |
|
32 { |
|
33 public: |
|
34 enum TApplicationHeaderTagId |
|
35 { |
|
36 EOrder =0x1, |
|
37 ESearchValue =0x2, |
|
38 ESearchAttribute=0x3, |
|
39 EMaxListCount =0x4, |
|
40 EListStartOffset=0x5, |
|
41 EFilter =0x6, |
|
42 EFormat =0x7, |
|
43 EPhonebookSize =0x8, // PSE sends |
|
44 ENewMissedCalls =0x9, // PSE sends |
|
45 EBeginningOfUnspecifiedTags = 0xA, |
|
46 }; |
|
47 |
|
48 public: |
|
49 static CPbapAppHeader* NewL(); |
|
50 ~CPbapAppHeader(); |
|
51 |
|
52 void ParseL(const TDesC8& aObexApplicationHeader); |
|
53 TPbapOperation DeterminePBAPOperationL(const TDesC8& aTypeHeader); |
|
54 |
|
55 inline TPbapOperation Operation() const; |
|
56 inline TBool TagPresent(TApplicationHeaderTagId aTag) const; |
|
57 inline TUint64 Filter() const; |
|
58 inline SymbianPBAP::TOrder Order() const; |
|
59 inline TInt MaxListCount() const; |
|
60 inline TVCardVersion VCardVersion() const; |
|
61 inline TInt ListStartOffset() const; |
|
62 inline const RBuf& SearchValue() const; |
|
63 inline SymbianPBAP::TSearchAttribute SearchAttribute() const; |
|
64 inline TBool IsAbsolutePathOp() const; |
|
65 |
|
66 void Reset(); |
|
67 |
|
68 private: |
|
69 CPbapAppHeader(); |
|
70 |
|
71 SymbianPBAP::TOrder ConvertToOrder(TUint8 aValue) const; |
|
72 SymbianPBAP::TSearchAttribute ConvertToSearchAttribute(TUint8 aValue) const; |
|
73 TVCardVersion ConvertToVCardVersionL(TUint8 aValue) const; |
|
74 TUint64 ConvertToFilter(const TUint8* aPtr) const; |
|
75 |
|
76 private: |
|
77 TFixedArray<TBool, EBeginningOfUnspecifiedTags> iTagsPresent; |
|
78 SymbianPBAP::TOrder iOrder; |
|
79 TUint16 iMaxListCount; |
|
80 TUint16 iListStartOffset; |
|
81 TUint64 iAttributeMask; |
|
82 TVCardVersion iVCardVersion; |
|
83 RBuf iSearchValue; |
|
84 SymbianPBAP::TSearchAttribute iSearchAttribute; |
|
85 TPbapOperation iOperation; |
|
86 TBool iIsAbsolutePathOp; |
|
87 }; |
|
88 |
|
89 |
|
90 // |
|
91 // inline functions |
|
92 // |
|
93 inline TPbapOperation CPbapAppHeader::Operation() const |
|
94 { |
|
95 return iOperation; |
|
96 } |
|
97 |
|
98 inline TUint64 CPbapAppHeader::Filter() const |
|
99 { |
|
100 return iAttributeMask; |
|
101 } |
|
102 |
|
103 inline SymbianPBAP::TOrder CPbapAppHeader::Order() const |
|
104 { |
|
105 return iOrder; |
|
106 } |
|
107 |
|
108 inline TInt CPbapAppHeader::MaxListCount() const |
|
109 { |
|
110 return iMaxListCount; |
|
111 } |
|
112 |
|
113 inline TVCardVersion CPbapAppHeader::VCardVersion() const |
|
114 { |
|
115 return iVCardVersion; |
|
116 } |
|
117 |
|
118 inline TInt CPbapAppHeader::ListStartOffset() const |
|
119 { |
|
120 return iListStartOffset; |
|
121 } |
|
122 |
|
123 inline const RBuf& CPbapAppHeader::SearchValue() const |
|
124 { |
|
125 return iSearchValue; |
|
126 } |
|
127 |
|
128 inline SymbianPBAP::TSearchAttribute CPbapAppHeader::SearchAttribute() const |
|
129 { |
|
130 return iSearchAttribute; |
|
131 } |
|
132 |
|
133 inline TBool CPbapAppHeader::IsAbsolutePathOp() const |
|
134 { |
|
135 return iIsAbsolutePathOp; |
|
136 } |
|
137 |
|
138 #endif //PBAPAPPHEADER_H |