|
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: SIMPLE Engine presence data publisher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_simplepublisher_H |
|
22 #define M_simplepublisher_H |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 // FORWARD DECLARATION |
|
27 class MSimpleDocument; |
|
28 class MSimpleConnection; |
|
29 class MSimpleETagObserver; |
|
30 |
|
31 |
|
32 /** |
|
33 * MSimplePublisher |
|
34 * |
|
35 * SIMPLE Engine presence data publisher |
|
36 * |
|
37 * @lib simpleengine |
|
38 * @since S60 3.2 |
|
39 */ |
|
40 |
|
41 class MSimplePublisher |
|
42 { |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Destroy this entity |
|
48 * |
|
49 * @since S60 v3.2 |
|
50 */ |
|
51 virtual void Close() = 0; |
|
52 |
|
53 /** |
|
54 * Getter for the SIMPLE Engine connection. |
|
55 * |
|
56 * @since S60 3.2 |
|
57 * @return the attribute name. |
|
58 */ |
|
59 virtual const MSimpleConnection& Connection() = 0; |
|
60 |
|
61 /** |
|
62 * Start to publish data. |
|
63 * Leaves with KErrInUse if there is already active publication |
|
64 * in this MSimplePublisher entity. |
|
65 * Expiry time is set based on SIMPLE settings. |
|
66 * Refreshing is made by SIMPLE Engine. |
|
67 * |
|
68 * @since S60 3.2 |
|
69 * @param aDocument data to be published |
|
70 * @param aRefresh whether refresh is made automatically |
|
71 * @return operation id |
|
72 */ |
|
73 virtual TInt StartPublishL( MSimpleDocument& aDocument, |
|
74 TBool aRefresh ) = 0; |
|
75 |
|
76 /** |
|
77 * Continue data publication |
|
78 * Leaves with KErrInUse if there is already active publication |
|
79 * in this MSimplePublisher entity. |
|
80 * Expiry time is set based on SIMPLE settings. |
|
81 * Refreshing is made by SIMPLE Engine. |
|
82 * |
|
83 * @since S60 3.2 |
|
84 * @param aDocument data to be published |
|
85 * @param aRefresh whether refresh is made automatically |
|
86 * @param aETag SIP ETag header value to be used in SIP-If-Match header. |
|
87 * @return operation id |
|
88 */ |
|
89 virtual TInt ContinuePublishL( MSimpleDocument& aDocument, |
|
90 TBool aRefresh, const TDesC8& aETag ) = 0; |
|
91 |
|
92 /** |
|
93 * Update published data. This will overwrite the previous |
|
94 * presence data. StartPublishL() must be completed before |
|
95 * calling this method. |
|
96 * Remote URI is not modified but taken from an initial |
|
97 * StartPublishL document. |
|
98 * |
|
99 * @since S60 3.2 |
|
100 * @param aDocument data to be published |
|
101 * @return operation id |
|
102 */ |
|
103 virtual TInt ModifyPublishL( MSimpleDocument& aDocument ) = 0; |
|
104 |
|
105 /** |
|
106 * Stop publishing data. |
|
107 * |
|
108 * @since S60 3.2 |
|
109 * @return operation id |
|
110 */ |
|
111 virtual TInt StopPublishL() = 0; |
|
112 |
|
113 /** |
|
114 * Stop publication. |
|
115 * |
|
116 * @since S60 3.2 |
|
117 * @param aETag SIP ETag header value to be used in SIP-If-Match header. |
|
118 * @return operation id |
|
119 */ |
|
120 virtual TInt StopPublishL( const TDesC8& aETag ) = 0; |
|
121 |
|
122 /** |
|
123 * SIP Status code accessor. |
|
124 * Get the status of the last completed request. |
|
125 * Refer to RFC3261, RFC3265, RFC3903. |
|
126 * |
|
127 * @since S60 3.2 |
|
128 * @return SIP status, 0 if not available |
|
129 */ |
|
130 virtual TUint SIPStatus() = 0; |
|
131 |
|
132 /** |
|
133 * SIP Retry-after header value accessor. |
|
134 * Get the SIP retry-fater header value of the last completed request. |
|
135 * Refer to RFC3261, RFC3265, RFC3903. |
|
136 * |
|
137 * @since S60 3.2 |
|
138 * @return retry-after value in seconds, 0 if not available |
|
139 */ |
|
140 virtual TUint SIPRetryAfter() = 0; |
|
141 |
|
142 /** |
|
143 * SIP ETag header value accessor. |
|
144 * Refer to RFC3903. |
|
145 * |
|
146 * @since S60 3.2 |
|
147 * @return Current ETag header value received from a network server. |
|
148 * Zero length if not available. |
|
149 */ |
|
150 virtual TPtrC8 SIPETag() = 0; |
|
151 |
|
152 /** |
|
153 * SIP ETag header value change observer setter. |
|
154 * Notice that this value may change after each modification or automatic refresh |
|
155 * of publication. Observer is called when the ETag value changes next time. |
|
156 * Refer to RFC3903. |
|
157 * |
|
158 * @since S60 3.2 |
|
159 * @param aObs ETag value observer. Can be NULL to stop notification. |
|
160 */ |
|
161 virtual void SetSIPETagObserver( MSimpleETagObserver* aObs ) = 0; |
|
162 |
|
163 }; |
|
164 |
|
165 #endif |
|
166 |
|
167 // End of File |