|
1 /** |
|
2 * Copyright (c) 2010 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 "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: CUpnpTmServer class declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __UPNPTMSERVER_H__ |
|
19 #define __UPNPTMSERVER_H__ |
|
20 |
|
21 // Include Files |
|
22 #include <e32base.h> // CBase |
|
23 #include <upnptmserverdeviceinfo.h> |
|
24 #include <upnptmserverobserver.h> |
|
25 #include <upnpremotableapp.h> |
|
26 |
|
27 //Forward Declaration |
|
28 class CUpnpTmServerImpl; |
|
29 |
|
30 |
|
31 /** |
|
32 * The Main interface for the Terminal Mode Service. |
|
33 * The client of this class (Automotive Server or equivalent) is responsible |
|
34 * for registering/unregistering the remotable apps and updating the status |
|
35 * of the running apps. |
|
36 * The client should also "start" and "stop" the service through the API |
|
37 * provided in this class |
|
38 */ |
|
39 class CUpnpTmServer: public CBase |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Standard Symbian Two-phased constructor. |
|
44 * @param aDeviceInfo The IAP and device Settings that the |
|
45 * Terminal Mode Service needs to operate. |
|
46 * A valid IAP ID is mandatory. |
|
47 * @param aUpnpTmServerObserver The callback interface that the client |
|
48 * application must implement. |
|
49 */ |
|
50 IMPORT_C static CUpnpTmServer* NewL( CUpnpTmServerDeviceInfo& aDeviceInfo, |
|
51 MUpnpTmServerObserver& aUpnpTmServerObserver ); |
|
52 ~CUpnpTmServer(); |
|
53 |
|
54 public: |
|
55 /** |
|
56 * Method to register a single App (aka Remotable App ). |
|
57 * The caller must create a CUpnpRemotableApp object and |
|
58 * populate it before calling this method. |
|
59 * @param aRemotableApp A pointer to a Remotable App object. |
|
60 * "Ownership" of the object is passed. |
|
61 * Must not be NULL. |
|
62 */ |
|
63 IMPORT_C void RegisterAppL( CUpnpRemotableApp* aRemotableApp ); |
|
64 /** |
|
65 * Method to register a list of Apps (aka Remotable Apps). |
|
66 * The caller must create all the CUpnpRemotableApp objects |
|
67 * and populate them before calling this method. |
|
68 * This list of apps will be appended to existing list of |
|
69 * registered apps. |
|
70 * @param aRemotableAppList A RPointerArray of Remotable App objects. |
|
71 * "Ownership" of all the objects is passed. |
|
72 * None of the objects must be NULL. |
|
73 */ |
|
74 IMPORT_C void RegisterAppsL( const RPointerArray<CUpnpRemotableApp>& aRemotableAppList ); |
|
75 /** |
|
76 * Method to unregister a single App from the service. |
|
77 * The specified App must be registered with the |
|
78 * Terminal Mode Service. |
|
79 * @param aAppId The ID of the app to be unregistered |
|
80 */ |
|
81 IMPORT_C TInt UnRegisterApp( TUint aAppId ); |
|
82 /** |
|
83 * Method to unregister multiple Apps from the service. |
|
84 * The specified Apps must be registered with the |
|
85 * Terminal Mode Service. |
|
86 * In case of duplicate appIDs ,TM service will sort out the duplicate ones |
|
87 * and will unregister only once for a particular appID. |
|
88 * Even if a single app from the requested array is unable to get |
|
89 * un-registered the method should return KErrNotFound. |
|
90 * @param aAppIdArray The list of IDs of the apps to be unregistered |
|
91 */ |
|
92 IMPORT_C TInt UnRegisterApps( const RArray<TUint>& aAppIdArray ); |
|
93 /** |
|
94 * Method to set the XML signature of the registered apps |
|
95 * This is done as specified in XML Signature Syntax. |
|
96 * The signature value is opaque to the TM Service. |
|
97 * @param aSignature XML formatted buffer |
|
98 */ |
|
99 IMPORT_C void SetXmlSignatureL( const TDesC8& aSignature ); |
|
100 /** |
|
101 * Method to Start the Terminal Moder Server Device and its services. |
|
102 * This must be called to initiate all the UPnP related |
|
103 * activities. |
|
104 */ |
|
105 IMPORT_C void StartL(); |
|
106 /** |
|
107 * Method to Stop the Terminal Moder Server Device and its services. |
|
108 * No further UPnP related activities will occur after this. |
|
109 */ |
|
110 IMPORT_C void StopL(); |
|
111 /** |
|
112 * Method to fetch the Remotable App object by passing the |
|
113 * App ID of the same. Method is invoked by the Automotive Server |
|
114 * when it wishes to modify any of the existing remotable app. |
|
115 * @param aAppId App ID of the requested App |
|
116 * @param aErr[out] Error code |
|
117 * @return Returns reference to CUpnpRemotableApp object |
|
118 */ |
|
119 IMPORT_C CUpnpRemotableApp& GetRemotableApp( TUint aAppId, TInt& aErr ); |
|
120 /** |
|
121 * Method through which the notification of applications whose status |
|
122 * has changed is sent across to the Car Kit through the Service . |
|
123 * TM Service ignores the duplicate appIDs and sends only the list of |
|
124 * unique appIDs. |
|
125 * @param aUpdatedAppIdList List of appIDs whose status has changed |
|
126 */ |
|
127 IMPORT_C void UpdateAppStatusL( const RArray<TUint>& aUpdatedAppIdList ); |
|
128 /** |
|
129 * Method through which the notification of applications whose entries |
|
130 * in the application list have changed is sent across to the Car Kit |
|
131 * through the Service. |
|
132 * TM Service ignores the duplicate appIDs and sends only the list of |
|
133 * unique appIDs. |
|
134 * @param aUpdatedAppIdList List of appIDs whose entries haave changed |
|
135 */ |
|
136 IMPORT_C void UpdateAppListL( const RArray<TUint>& aUpdatedAppIdList ); |
|
137 /** |
|
138 * Method through which the notification of profileIDs which are not used |
|
139 * used by any Terminal Mode service hosted on the Terminal Mode device |
|
140 * is sent across to the Car Kit through the Service. |
|
141 * TM Service ignores the duplicate profileIDs and sends only the list of |
|
142 * unique profileIDs. |
|
143 * @param aUnusedProfileIdList List of profile IDs for profiles which are |
|
144 * currently not being used by any Terminal Mode service |
|
145 */ |
|
146 IMPORT_C void UpdateUnusedProfileIdsL( const RArray<TUint>& aUnusedProfileIdList ); |
|
147 |
|
148 private: |
|
149 CUpnpTmServer(); |
|
150 void ConstructL( CUpnpTmServerDeviceInfo& aDeviceInfo, |
|
151 MUpnpTmServerObserver& aUpnpRemoteServer ); |
|
152 |
|
153 private: |
|
154 // The "body"/implementation |
|
155 CUpnpTmServerImpl* iTmServerImpl; |
|
156 }; |
|
157 |
|
158 #endif // __UPNPTMSERVER_H__ |
|
159 |