1 senhostletconnection.h |
1 /* |
|
2 * Copyright (c) 2002-2005 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CSenHostletConnection offers public API for |
|
15 * applications to to provide locally, invocable |
|
16 services (identified by unique endpoint URI) |
|
17 to service consumers. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 #ifndef SEN_HOSTLET_CONNECTION_H |
|
29 #define SEN_HOSTLET_CONNECTION_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> // for CActive |
|
33 |
|
34 #include <MSenHostlet.h> |
|
35 #include <MSenServiceDescription.h> |
|
36 #include <SenServiceConnection.h> |
|
37 #include <SenSoapEnvelope.h> |
|
38 #include <SenFragment.h> |
|
39 |
|
40 // CONSTANTS |
|
41 |
|
42 const TInt KErrSenEndpointReserved = -30317; |
|
43 |
|
44 |
|
45 // FORWARD DECLARATIONS |
|
46 class CSenServicePattern; |
|
47 |
|
48 // CLASS DECLARATION |
|
49 class CSenHostletConnection : public CActive |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Constructs a new hostlet connection, utilizing the service description |
|
55 * provided by MSenHostlet::ServiceDescriptionL() callback implementation. |
|
56 * Leave codes: |
|
57 * - KErrSenEndpointReserved if the endpoint specified in hostlet |
|
58 * implementation already exists and is reserved for some other |
|
59 * use (hostlet). |
|
60 * @return a pointer to a newly created hostlet connection |
|
61 */ |
|
62 IMPORT_C static CSenHostletConnection* NewL(MSenHostlet& aProvider); |
|
63 |
|
64 /** |
|
65 * Constructs a new hostlet connection, utilizing the service description |
|
66 * provided by MSenHostlet::ServiceDescriptionL() callback implementation. |
|
67 * Leave codes: |
|
68 * - KErrSenEndpointReserved if the endpoint specified in hostlet |
|
69 * implementation already exists and is reserved for some other |
|
70 * use (hostlet). |
|
71 * @return a pointer to a newly created hostlet connection, which is also |
|
72 * left on the cleanup stack. |
|
73 */ |
|
74 IMPORT_C static CSenHostletConnection* NewLC(MSenHostlet& aProvider); |
|
75 |
|
76 /** |
|
77 * Method for responding to incoming message. This asynchronous method |
|
78 * will send a response for the request that was received by the hostlet |
|
79 * implementation in the ServiceL callback. After the response has been |
|
80 * delivered to service consumer who made the request, the following |
|
81 * callback will be invoked: |
|
82 * MSenHostlet::OnServiceCompleteL |
|
83 * @return KErrNone, if response was successfully pre-processed by |
|
84 * the hostlet connection - it does not mean, that it was yet |
|
85 * received by the consumer, as this method is asynchronous. |
|
86 * If the response cannot be processed, some system-wide error |
|
87 * code is returned. |
|
88 * KErrAlreadyExists, if response was already provided |
|
89 * for this request |
|
90 */ |
|
91 virtual TInt RespondL(MSenHostletResponse& aResponse) = 0; |
|
92 |
|
93 |
|
94 /* Getter for full, (live) service desctiption for this hostlet connection */ |
|
95 // virtual TInt ServiceDescriptionL(CSenXmlServiceDescription*& apSessionDescription) = 0; |
|
96 |
|
97 /** |
|
98 * Getter for the identifier of this connection. |
|
99 * @return the identifier as integer. |
|
100 */ |
|
101 virtual TInt Identifier() = 0; |
|
102 |
|
103 |
|
104 protected: |
|
105 /** |
|
106 * C++ default constructor. |
|
107 */ |
|
108 CSenHostletConnection(); |
|
109 |
|
110 }; |
|
111 |
|
112 #endif //SEN_HOSTLET_CONNECTION_H |
|
113 |
|
114 // End of File |
|
115 |