Wasabi ExpressPlay SDK for Desktop Systems
1.10
Main Page
Modules
Data Structures
Files
File List
Globals
Client
ThirdParty
Sushi
Source
Core
Interface
ShiEngine.h
Go to the documentation of this file.
1
/*****************************************************************
2
|
3
| Sushi - DRM Engine
4
|
5
| $Id: ShiEngine.h 7930 2014-06-25 11:05:10Z jebaseelir $
6
| Original author: Gilles Boccon-Gibod
7
|
8
| This software is provided to you pursuant to your agreement
9
| with Intertrust Technologies Corporation ("Intertrust").
10
| This software may be used only in accordance with the terms
11
| of the agreement.
12
|
13
| Copyright (c) 2005-2014 by Intertrust. All rights reserved.
14
|
15
****************************************************************/
21
#ifndef _SHI_ENGINE_H_
22
#define _SHI_ENGINE_H_
23
24
/*----------------------------------------------------------------------
25
| includes
26
+---------------------------------------------------------------------*/
27
#include "
ShiResults.h
"
28
#include "
ShiTypes.h
"
29
#include "
ShiInterfaces.h
"
30
#include "
ShiList.h
"
31
#include "ShiLicense.h"
32
#include "
ShiService.h
"
33
#include "
ShiProperties.h
"
34
35
/*----------------------------------------------------------------------
36
| error codes
37
+---------------------------------------------------------------------*/
38
#define SHI_ERROR_ENGINE_NOT_PERSONALIZED (SHI_ERROR_BASE_API_ENGINE - 0)
39
#define SHI_ERROR_ENGINE_INVALID_TEMPLATE (SHI_ERROR_BASE_API_ENGINE - 1)
40
#define SHI_ERROR_ENGINE_POST_VACUUM (SHI_ERROR_BASE_API_ENGINE - 2)
41
#define SHI_ERROR_ENGINE_NO_CONFIG_TOKEN (SHI_ERROR_BASE_API_ENGINE - 3)
42
#define SHI_ERROR_ENGINE_ALREADY_PERSONALIZED (SHI_ERROR_BASE_API_ENGINE - 4)
43
44
/*----------------------------------------------------------------------
45
| constants
46
+---------------------------------------------------------------------*/
53
#define SHI_ENGINE_PROP_VERSION "Version"
54
#define SHI_ENGINE_PROP_BUILD_DATE "BuildDate"
55
#define SHI_ENGINE_PROP_IS_PERSONALIZED "IsPersonalized"
56
#define SHI_ENGINE_PROP_PERSONALITY "Personality"
57
#define SHI_ENGINE_PROP_HTTP_PROXY_HOST_NAME "HttpProxyHostname"
58
#define SHI_ENGINE_PROP_HTTP_PROXY_PORT "HttpProxyPort"
59
#define SHI_ENGINE_PROP_HTTP_PROXY_ENABLED "HttpProxyEnabled"
60
#define SHI_ENGINE_PROP_HTTP_PROXY_SYSTEM_DEFAULT "HttpProxySystemDefault"
61
#define SHI_ENGINE_PROP_HTTPS_PROXY_HOST_NAME "HttpsProxyHostname"
62
#define SHI_ENGINE_PROP_HTTPS_PROXY_PORT "HttpsProxyPort"
63
#define SHI_ENGINE_PROP_HTTP_CONNECTION_TIMEOUT "HttpConnectionTimeout"
64
#define SHI_ENGINE_PROP_HTTP_IO_TIMEOUT "HttpIOTimeout"
65
#define SHI_ENGINE_PROP_PREFERRED_LANGUAGES "PreferredLanguages"
66
#define SHI_ENGINE_PROP_CACHE_POLICY "CachePolicy"
67
#define SHI_ENGINE_PROP_NEMO "Nemo"
72
typedef enum {
73
SHI_ENGINE_CACHE_CACHE_LINKS
,
74
SHI_ENGINE_CACHE_RELOAD_LINKS
75
}
SHI_EngineCachePolicy
;
76
80
#define SHI_ENGINE_VACUUM_FLAG_NODES (1)
81
#define SHI_ENGINE_VACUUM_FLAG_LINKS (2)
82
#define SHI_ENGINE_VACUUM_FLAG_SEASHELL (4)
83
#define SHI_ENGINE_VACUUM_FLAG_DONT_SAVE_RECENT_LINK (8)
84
#define SHI_ENGINE_VACUUM_FLAG_WIPE (16)
86
/*----------------------------------------------------------------------
87
| types
88
+---------------------------------------------------------------------*/
89
92
typedef
enum
{
93
SHI_ENGINE_EVENT_SERVICE_ADDED
,
94
SHI_ENGINE_EVENT_SERVICE_REMOVED
,
95
SHI_ENGINE_EVENT_SERVICE_CHANGED
,
96
SHI_ENGINE_EVENT_SERVICE_USER_ADDED
,
97
SHI_ENGINE_EVENT_SERVICE_USER_REMOVED
,
98
SHI_ENGINE_EVENT_SERVICE_USER_CHANGED
,
99
SHI_ENGINE_EVENT_TRANSACTION_BEGIN
,
100
SHI_ENGINE_EVENT_TRANSACTION_END
,
101
SHI_ENGINE_EVENT_TRANSACTION_PROGRESS
,
102
SHI_ENGINE_EVENT_LICENSE_DATA_RECEIVED
103
}
SHI_EngineEventType
;
104
108
typedef
struct
{
109
const
char
*
name
;
110
SHI_DataType
type
;
111
SHI_DataValue
value
;
112
}
SHI_EngineEventInfoItem
;
113
117
typedef
struct
{
118
SHI_Cardinal
item_count
;
119
const
SHI_EngineEventInfoItem
*
items
;
120
}
SHI_EngineEventInfoItems
;
121
126
typedef
struct
{
132
const
void
*
cookie
;
133
142
SHI_EngineEventInfoItems
*
info
;
143
}
SHI_EngineEvent
;
144
152
typedef
struct
{
153
SHI_EngineEvent
base
;
154
const
void
*
data
;
155
SHI_Size
size
;
156
}
SHI_LicenseDataReceivedEvent
;
157
158
typedef
struct
SHI_EngineListenerInstance
SHI_EngineListenerInstance
;
159
typedef
struct
SHI_EngineListenerInterface
SHI_EngineListenerInterface
;
160
164
typedef
struct
{
165
const
SHI_EngineListenerInterface
*
iface
;
166
SHI_EngineListenerInstance
*
instance
;
167
}
SHI_EngineListener
;
168
173
struct
SHI_EngineListenerInterface
{
185
void (*
OnEvent
)(
SHI_EngineListener
self
,
186
SHI_EngineEventType
type,
187
const
SHI_EngineEvent
* event);
188
};
189
195
typedef
struct
{
196
SHI_Flags
flags
;
197
SHI_EngineListener
listener
;
198
}
SHI_EngineConfig
;
199
205
typedef
struct
SHI_RegistrationDataManager
{
211
SHI_Result
(*
GetPersonality
) (
SHI_Data
** perso_data);
218
SHI_Result
(*
GetNode
) (
const
char
* node_id,
219
SHI_Data
** node_data);
230
SHI_Result
(*
SaveNode
) (
const
char
* node_id,
231
const
char
* node_type,
232
const
char
* node_name,
233
const
char
* service_id,
234
const
char
* data,
235
SHI_UInt32
data_size);
244
SHI_Result
(*
SaveLink
) (
const
char
* link_id,
245
const
char
* context,
246
const
char
* data,
247
SHI_UInt32
data_size);
248
SHI_UInt32
reference_count
;
249
}
SHI_RegistrationDataManager
;
250
251
/*----------------------------------------------------------------------
252
| interfaces
253
+---------------------------------------------------------------------*/
254
#if defined(__cplusplus)
255
extern
"C"
{
256
#endif
257
269
typedef
struct
SHI_Engine
SHI_Engine
;
270
281
SHI_PUBLIC_API
282
void
*
283
SHI_Engine_GetInterface
(
SHI_Engine
*
self
,
SHI_InterfaceId
iface_id);
284
293
SHI_PUBLIC_API
294
SHI_Result
295
SHI_Engine_Destroy
(
SHI_Engine
*
self
);
296
304
SHI_PUBLIC_API
305
SHI_Boolean
306
SHI_Engine_IsPersonalized
(
SHI_Engine
*
self
);
307
338
SHI_PUBLIC_API
339
SHI_Result
340
SHI_Engine_Personalize
(
SHI_Engine
*
self
,
341
const
char
* token,
342
SHI_Size
token_size,
343
const
void
* cookie);
344
370
SHI_PUBLIC_API
371
SHI_Result
372
SHI_Engine_UpdatePersonality
(
SHI_Engine
*
self
,
373
const
char
* token,
374
SHI_Size
token_size,
375
const
void
* cookie);
376
385
SHI_PUBLIC_API
386
SHI_Result
387
SHI_Engine_GetTrustedTime
(
SHI_Engine
*
self
,
SHI_DateTime
* now);
388
410
SHI_PUBLIC_API
411
SHI_Result
412
SHI_Engine_ProcessServiceToken
(
SHI_Engine
*
self
,
413
const
char
* token,
414
SHI_Size
token_size,
415
const
void
* cookie);
416
444
SHI_PUBLIC_API
445
SHI_Result
446
SHI_Engine_ProcessServiceTokenEx
(
SHI_Engine
*
self
,
447
const
char
* token,
448
SHI_Size
token_size,
449
const
void
* cookie,
450
SHI_RegistrationDataManager
* registration_data_manager);
451
462
SHI_PUBLIC_API
463
SHI_Result
464
SHI_Engine_EnumerateServices
(
SHI_Engine
*
self
,
SHI_List
** services);
465
478
SHI_PUBLIC_API
479
SHI_Result
480
SHI_Engine_EnumerateServiceUsers
(
SHI_Engine
*
self
,
481
const
char
* service_id,
482
SHI_List
** users);
483
499
SHI_PUBLIC_API
500
SHI_Result
501
SHI_Engine_EnumerateServiceSubscriptions
(
SHI_Engine
*
self
,
502
const
char
* service_id,
503
const
char
* user_id,
504
SHI_List
** subscriptions);
505
517
SHI_PUBLIC_API
518
SHI_Result
519
SHI_Engine_CreateLicense
(
SHI_Engine
*
self
, SHI_License** license);
520
536
SHI_PUBLIC_API
537
SHI_Result
538
SHI_Engine_UpdateSecurityData
(
SHI_Engine
*
self
,
539
const
char
* service_id,
540
SHI_UInt32
last_update,
541
const
void
* cookie);
542
554
SHI_PUBLIC_API
555
SHI_Result
556
SHI_Engine_VacuumData
(
SHI_Engine
*
self
,
557
SHI_Flags
vacuum_options);
558
572
SHI_PUBLIC_API
573
SHI_Result
574
SHI_Engine_GetObjectDetails
(
SHI_Engine
*
self
,
575
const
char
* object_id,
576
SHI_Attribute
** details);
577
586
SHI_PUBLIC_API
587
SHI_Result
588
SHI_Engine_DeleteObject
(
SHI_Engine
*
self
,
589
const
char
* object_id);
590
600
SHI_PUBLIC_API
601
SHI_Result
602
SHI_Engine_GetLinkIds
(
SHI_Engine
*
self
,
603
SHI_Data
** id_array);
604
614
SHI_PUBLIC_API
615
SHI_Result
616
SHI_Engine_GetNodeIds
(
SHI_Engine
*
self
,
617
SHI_Data
** id_array);
618
630
SHI_PUBLIC_API
631
SHI_Result
632
SHI_Engine_TransformURITemplate
(
SHI_Engine
*
self
,
633
const
char
* uri_template,
634
SHI_Data
** uri);
635
648
SHI_PUBLIC_API
649
SHI_Result
650
SHI_Engine_Create
(
const
SHI_EngineConfig
* config,
SHI_Engine
** engine);
651
653
#if defined(__cplusplus)
654
}
655
#endif
656
657
#endif
/* _SHI_ENGINE_H_ */