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