2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: CSenHostletConnection offers public API for
15 * applications to to provide locally, invocable
16 services (identified by unique endpoint URI)
28 #ifndef SEN_HOSTLET_CONNECTION_H
29 #define SEN_HOSTLET_CONNECTION_H
32 #include <e32base.h> // for CActive
34 #include <MSenHostlet.h>
35 #include <MSenServiceDescription.h>
36 #include <SenServiceConnection.h>
37 #include <SenSoapEnvelope.h>
38 #include <SenFragment.h>
42 const TInt KErrSenEndpointReserved = -30317;
45 // FORWARD DECLARATIONS
46 class CSenServicePattern;
49 class CSenHostletConnection : public CActive
51 public: // Constructors and destructor
54 * Constructs a new hostlet connection, utilizing the service description
55 * provided by MSenHostlet::ServiceDescriptionL() callback implementation.
57 * - KErrSenEndpointReserved if the endpoint specified in hostlet
58 * implementation already exists and is reserved for some other
60 * @return a pointer to a newly created hostlet connection
62 IMPORT_C static CSenHostletConnection* NewL(MSenHostlet& aProvider);
65 * Constructs a new hostlet connection, utilizing the service description
66 * provided by MSenHostlet::ServiceDescriptionL() callback implementation.
68 * - KErrSenEndpointReserved if the endpoint specified in hostlet
69 * implementation already exists and is reserved for some other
71 * @return a pointer to a newly created hostlet connection, which is also
72 * left on the cleanup stack.
74 IMPORT_C static CSenHostletConnection* NewLC(MSenHostlet& aProvider);
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
88 * KErrAlreadyExists, if response was already provided
91 virtual TInt RespondL(MSenHostletResponse& aResponse) = 0;
94 /* Getter for full, (live) service desctiption for this hostlet connection */
95 // virtual TInt ServiceDescriptionL(CSenXmlServiceDescription*& apSessionDescription) = 0;
98 * Getter for the identifier of this connection.
99 * @return the identifier as integer.
101 virtual TInt Identifier() = 0;
106 * C++ default constructor.
108 CSenHostletConnection();
112 #endif //SEN_HOSTLET_CONNECTION_H