williamr@2: /* williamr@2: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: CSenHostletConnection offers public API for williamr@2: * applications to to provide locally, invocable williamr@2: services (identified by unique endpoint URI) williamr@2: to service consumers. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef SEN_HOSTLET_CONNECTION_H williamr@2: #define SEN_HOSTLET_CONNECTION_H williamr@2: williamr@2: // INCLUDES williamr@2: #include // for CActive williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: const TInt KErrSenEndpointReserved = -30317; williamr@2: williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSenServicePattern; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: class CSenHostletConnection : public CActive williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Constructs a new hostlet connection, utilizing the service description williamr@2: * provided by MSenHostlet::ServiceDescriptionL() callback implementation. williamr@2: * Leave codes: williamr@2: * - KErrSenEndpointReserved if the endpoint specified in hostlet williamr@2: * implementation already exists and is reserved for some other williamr@2: * use (hostlet). williamr@2: * @return a pointer to a newly created hostlet connection williamr@2: */ williamr@2: IMPORT_C static CSenHostletConnection* NewL(MSenHostlet& aProvider); williamr@2: williamr@2: /** williamr@2: * Constructs a new hostlet connection, utilizing the service description williamr@2: * provided by MSenHostlet::ServiceDescriptionL() callback implementation. williamr@2: * Leave codes: williamr@2: * - KErrSenEndpointReserved if the endpoint specified in hostlet williamr@2: * implementation already exists and is reserved for some other williamr@2: * use (hostlet). williamr@2: * @return a pointer to a newly created hostlet connection, which is also williamr@2: * left on the cleanup stack. williamr@2: */ williamr@2: IMPORT_C static CSenHostletConnection* NewLC(MSenHostlet& aProvider); williamr@2: williamr@2: /** williamr@2: * Method for responding to incoming message. This asynchronous method williamr@2: * will send a response for the request that was received by the hostlet williamr@2: * implementation in the ServiceL callback. After the response has been williamr@2: * delivered to service consumer who made the request, the following williamr@2: * callback will be invoked: williamr@2: * MSenHostlet::OnServiceCompleteL williamr@2: * @return KErrNone, if response was successfully pre-processed by williamr@2: * the hostlet connection - it does not mean, that it was yet williamr@2: * received by the consumer, as this method is asynchronous. williamr@2: * If the response cannot be processed, some system-wide error williamr@2: * code is returned. williamr@2: * KErrAlreadyExists, if response was already provided williamr@2: * for this request williamr@2: */ williamr@2: virtual TInt RespondL(MSenHostletResponse& aResponse) = 0; williamr@2: williamr@2: williamr@2: /* Getter for full, (live) service desctiption for this hostlet connection */ williamr@2: // virtual TInt ServiceDescriptionL(CSenXmlServiceDescription*& apSessionDescription) = 0; williamr@2: williamr@2: /** williamr@2: * Getter for the identifier of this connection. williamr@2: * @return the identifier as integer. williamr@2: */ williamr@2: virtual TInt Identifier() = 0; williamr@2: williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: CSenHostletConnection(); williamr@2: williamr@2: }; williamr@2: williamr@2: #endif //SEN_HOSTLET_CONNECTION_H williamr@2: williamr@2: // End of File williamr@2: