|
1 /* |
|
2 * Copyright (c) 2007 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 "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: Liw Device binding |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __DEVICE_BINDING_H__ |
|
20 #define __DEVICE_BINDING_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <object.h> |
|
24 #include <protect.h> |
|
25 |
|
26 namespace KJS |
|
27 { |
|
28 class ServiceEventHandler; |
|
29 |
|
30 //Device peer holds platform-specific per-service object state |
|
31 class MDevicePeer |
|
32 { |
|
33 public: |
|
34 virtual ~MDevicePeer() {}; |
|
35 virtual UString toString( ExecState* exec ) = 0; |
|
36 virtual void InstallCallback( ServiceEventHandler* callback ) = 0; |
|
37 }; |
|
38 |
|
39 //Device binding holds common platform-specific state |
|
40 class MDeviceBinding |
|
41 { |
|
42 public: |
|
43 virtual ~MDeviceBinding() {}; |
|
44 virtual TInt LoadServiceProvider( |
|
45 ExecState* exec, const List& args ) = 0; |
|
46 virtual void UnloadServiceProvider(const TDesC8& aServiceName, const TDesC8& aInterfaceName) = 0; |
|
47 virtual MDevicePeer* ServiceObjectPeer( |
|
48 ExecState* exec, const List& args ) = 0; |
|
49 virtual JSValue* InvokeOp( ExecState* exec, const Identifier& prop, |
|
50 const List& args, MDevicePeer* peer ) = 0; |
|
51 virtual JSValue* CreateInterface( ExecState* exec, |
|
52 HBufC8* serviceName, |
|
53 const Identifier& prop ) = 0; |
|
54 virtual JSValue* ListProviders( ExecState* exec, const List& args ) = 0; |
|
55 virtual void SetUid ( const TUint& aValue) = 0; |
|
56 }; |
|
57 } |
|
58 |
|
59 #endif |