|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Abstract base class for WV engine service APIs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SimpleCommon_H |
|
21 #define SimpleCommon_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KRangeSize = 100; // range of operation ids for each client handle |
|
29 |
|
30 const TUint KSimpleOK = 200; // return code for SIP |
|
31 const TUint KCreatedOK = 201; // return code for SIP |
|
32 const TUint KSimpleAccepted = 202; // return code for SIP |
|
33 |
|
34 _LIT8 ( KSimpleApplicationType, "application"); |
|
35 _LIT8 ( KSimpleMultiType, "multipart"); |
|
36 _LIT8 ( KSimplePidfSubType, "pidf+xml"); |
|
37 _LIT8 ( KSimpleListSubType, "rlmi+xml"); |
|
38 _LIT8 ( KSimpleMultipartSubType, "related"); |
|
39 _LIT8 ( KSimpleWinfoSubType, "watcherinfo+xml"); |
|
40 _LIT8 ( KSimpleDocumentType, "application/pidf+xml"); |
|
41 _LIT8 ( KSimpleListType, "application/rlmi+xml"); |
|
42 _LIT8 ( KSimpleWinfoType, "application/watcherinfo+xml"); |
|
43 _LIT8 ( KSimpleSubscribeSubType, "simple-filter+xml"); |
|
44 _LIT8 ( KSimpleMultipartType, "multipart/related"); |
|
45 _LIT8 ( KSimplePRESENCE, "PRESENCE"); |
|
46 _LIT8 ( KSimplePUBLISH, "PUBLISH" ); |
|
47 _LIT8 ( KSimpleNOTIFY, "NOTIFY" ); |
|
48 _LIT8 ( KSimpleSTATUS, "STATUS" ); |
|
49 _LIT8 ( KSimpleSipIfMatch, "SIP-If-Match"); |
|
50 _LIT8 ( KSimpleETag, "SIP-ETag"); |
|
51 _LIT8 ( KSimplePrivacy, "Privacy"); |
|
52 _LIT8 ( KSimplePIdentity, "P-Preferred-Identity"); |
|
53 |
|
54 _LIT8 ( KSimpleMediaType, "text" ); // the 1st part of content type of IM |
|
55 _LIT8 ( KSimpleMediaSubType, "plain" ); // the 2nd part of content type of IM |
|
56 |
|
57 // OMA data specifications |
|
58 _LIT8 ( KSimpleXmlStart, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ); |
|
59 _LIT8 ( KDocumentLocalName, "presence" ); |
|
60 _LIT8 ( KFilterLocalName, "filter-set" ); |
|
61 _LIT8 ( KWinfoLocalName, "watcherinfo" ); |
|
62 _LIT8 ( KRlmiLocalName, "list" ); |
|
63 |
|
64 // DATA TYPES |
|
65 |
|
66 enum TSimpleSipState |
|
67 { |
|
68 /** Connection initializing */ |
|
69 ESimpleSipIdle=1, |
|
70 /** Connection active */ |
|
71 ESimpleSipActive, |
|
72 /** Connection suspended */ |
|
73 ESimpleSipSuspend, |
|
74 /** Connection is inactive */ |
|
75 ESimpleSipInactive, |
|
76 /** Connection is permanently unavailable */ |
|
77 ESimpleSipUnavailable |
|
78 }; |
|
79 |
|
80 |
|
81 // Notice: Remove the hard coded values later, and values not needed |
|
82 namespace NSimpleDocument |
|
83 { |
|
84 _LIT8( KBoundary, "--%S\r\n"); |
|
85 _LIT8( KEndBoundary, "--%S--"); |
|
86 _LIT8( KSimpleBoundary, "simple-1" ); // Notice: static now. |
|
87 _LIT8( KSimpleAvatarContent8, "simpleavatar.nokia.com" ); // notice: static now, supports only one |
|
88 _LIT8( KSimpleAvatarCID8, "<simpleavatar.nokia.com>" ); // notice: static now, supports only one |
|
89 // const TInt boundarySize = 4; |
|
90 const TInt KSimpleBoundarySize = 8; |
|
91 // const TInt KContentTypeSize_only = 14; // Length of "content-type: " |
|
92 namespace NSimpleMulti |
|
93 { |
|
94 // 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123 |
|
95 _LIT8( KContentType, "Content-Type: multipart/related; type=\"application/pidf+xml\"; start=\"<1.simple.nokia.com>\"; boundary=\"%S\"\r\n"); |
|
96 _LIT8( KContentTypeFullValue, "multipart/related; type=\"application/pidf+xml\"; start=\"<1.simple.nokia.com>\"; boundary=\"simple-1\"\r\n"); |
|
97 _LIT8( KContentTypeValue, "multipart/related; type=\"application/pidf+xml\"; start=\"<1.simple.nokia.com>\"; boundary=\"%S\"\r\n"); |
|
98 _LIT8( KBoundaryHeader, "boundary=--%S\r\n"); |
|
99 const TInt KContentTypeSize = 85; // 93 - 8 = 85 |
|
100 const TInt KBoundaryHeaderSize = 13; |
|
101 } |
|
102 namespace NSimpleRoot |
|
103 { // 12345678901234567890123456789012345678 |
|
104 _LIT8( KContentType, "Content-Type: application/pidf+xml\r\n"); |
|
105 _LIT8( KCID, "Content-ID: <1.simple.nokia.com>\r\n"); // notice: use tag and not static id |
|
106 // 12345678901234567890123456789012345678 |
|
107 const TInt KContentTypeSize = 36; // 38 - 2 |
|
108 const TInt KCIDSize = 34; // 36-2 |
|
109 } |
|
110 namespace NSimpleContent |
|
111 { |
|
112 _LIT8( KContentType, "Content-Type: %S\r\n"); |
|
113 _LIT8( KCID, "Content-ID: <%S>\r\n"); // notice: use tag and not static id |
|
114 _LIT8( KContentEncoding, "Content-Transfer-Encoding: BASE64\r\n"); |
|
115 // 12345678901234567890123456789012345678 |
|
116 const TInt KContentTypeSize = 16; // 20 - 4 |
|
117 const TInt KCIDSize = 16; // 20-4 |
|
118 const TInt KContentEncodingSize = 35; |
|
119 } |
|
120 } |
|
121 |
|
122 |
|
123 #endif |
|
124 |
|
125 // End of File |