@@ -6,10 +6,10 @@ Date: Fri Sep 6 12:49:05 2024 +0530
6
6
7
7
diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h
8
8
new file mode 100755
9
- index 0000000..4adda17
9
+ index 0000000..bd7ea1f
10
10
--- /dev/null
11
11
+++ b/interfaces/IUserSettings.h
12
- @@ -0,0 +1,353 @@
12
+ @@ -0,0 +1,414 @@
13
13
+ /*
14
14
+ * If not stated otherwise in this file or this component's LICENSE file the
15
15
+ * following copyright and licenses apply:
@@ -33,57 +33,58 @@ index 0000000..4adda17
33
33
+
34
34
+ #include "Module.h"
35
35
+
36
+ + // @stubgen:include <com/IIteratorType.h>
36
37
+ namespace WPEFramework {
37
38
+ namespace Exchange {
38
39
+
39
- + // @json @text:keep
40
+ + // @json @text:keep
40
41
+ struct EXTERNAL IUserSettings : virtual public Core::IUnknown
41
42
+ {
42
- + enum { ID = ID_USER_SETTINGS };
43
+ + enum { ID = ID_USER_SETTINGS };
43
44
+
44
- + // @event
45
+ + // @event
45
46
+ struct EXTERNAL INotification : virtual public Core::IUnknown
46
47
+ {
47
- + enum { ID = ID_USER_SETTINGS_NOTIFICATION };
48
+ + enum { ID = ID_USER_SETTINGS_NOTIFICATION };
48
49
+
49
- + // Constructor
50
- + INotification() {};
50
+ + // Constructor
51
+ + INotification() {};
51
52
+
52
- + // Destructor
53
- + virtual ~INotification() {};
53
+ + // Destructor
54
+ + virtual ~INotification() {};
54
55
+
55
- + // copy constructor
56
- + INotification & operator=(const INotification &) = delete;
56
+ + // copy constructor
57
+ + INotification & operator=(const INotification &) = delete;
57
58
+
58
- + // @text onAudioDescriptionChanged
59
- + // @brief The AudioDescription setting has changed.
60
- + // @param enabled: Enabled/Disabled.
59
+ + // @text onAudioDescriptionChanged
60
+ + // @brief The AudioDescription setting has changed.
61
+ + // @param enabled: audioDescription enabled or not
61
62
+ virtual void OnAudioDescriptionChanged(const bool enabled) {};
62
63
+
63
- + // @text onPreferredAudioLanguagesChanged
64
- + // @brief The preferredLanguages setting has changed.
65
- + // @param preferredLanguages: PreferredLanguages .
64
+ + // @text onPreferredAudioLanguagesChanged
65
+ + // @brief The preferredLanguages setting has changed.
66
+ + // @param preferredLanguages: the changed preferredLanguages .
66
67
+ virtual void OnPreferredAudioLanguagesChanged(const string& preferredLanguages /* @text preferredLanguages */) {};
67
68
+
68
- + // @text onPresentationLanguageChanged
69
- + // @brief The PresentationLanguages setting has changed.
70
- + // @param presentationLanguage: PresentationLanguage .
69
+ + // @text onPresentationLanguageChanged
70
+ + // @brief The PresentationLanguages setting has changed.
71
+ + // @param presentationLanguage: the changed presentationLanguage .
71
72
+ virtual void OnPresentationLanguageChanged(const string& presentationLanguage /* @text presentationLanguage */) {};
72
73
+
73
- + // @text onCaptionsChanged
74
- + // @brief The Captions setting has changed.
75
- + // @param enabled: Enabled/Disabled .
74
+ + // @text onCaptionsChanged
75
+ + // @brief The Captions setting has changed.
76
+ + // @param enabled: Captions enabled or not .
76
77
+ virtual void OnCaptionsChanged(const bool enabled) {};
77
78
+
78
- + // @text onPreferredCaptionsLanguagesChanged
79
- + // @brief The PreferredCaptionsLanguages setting has changed.
80
- + // @param preferredLanguages: PreferredLanguages .
79
+ + // @text onPreferredCaptionsLanguagesChanged
80
+ + // @brief The PreferredCaptionsLanguages setting has changed.
81
+ + // @param preferredLanguages: the changed preferredLanguages .
81
82
+ virtual void OnPreferredCaptionsLanguagesChanged(const string& preferredLanguages /* @text preferredLanguages */) {};
82
83
+
83
- + // @text onPreferredClosedCaptionServiceChanged
84
+ + // @text onPreferredClosedCaptionServiceChanged
84
85
+ // @brief The PreferredClosedCaptionService setting has changed.Eg: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]".
85
86
+ // @param service: the changed preferredClosedCaptionService.
86
- + virtual void OnPreferredClosedCaptionServiceChanged(const string& service) {};
87
+ + virtual void OnPreferredClosedCaptionServiceChanged(const string& service) {};
87
88
+
88
89
+ // @text onPrivacyModeChanged
89
90
+ // @brief The PrivacyMode setting has changed.
@@ -193,7 +194,7 @@ index 0000000..4adda17
193
194
+ // of this state while a playback is active.
194
195
+ // When media players start playback, they should also call the GetCaptions method to retrieve the current enabled state.
195
196
+ // This holds true for media players that utilize TextTrack render sessions for text track decode-display and also for media
196
- + // players or apps that decode-display internally
197
+ + // players or apps that decode-display internally
197
198
+ // @param enabled: Sets the state
198
199
+ virtual uint32_t SetCaptions(const bool enabled /* @in */) = 0;
199
200
+
@@ -208,7 +209,7 @@ index 0000000..4adda17
208
209
+ // expressed as a comma separated lists of languages of zero of more elements.
209
210
+ // The players will pick the subtitle track that has the best match compared with
210
211
+ // this list. In the absence of a matching track, the player should by best
211
- + // effort select the preferred subtitle track.
212
+ + // effort select the preferred subtitle track.
212
213
+ // @param preferredLanguages: Is the list to set (e.g. "eng,fra")
213
214
+ virtual uint32_t SetPreferredCaptionsLanguages(const string& preferredLanguages /* @in @text preferredLanguages */) = 0;
214
215
+
@@ -220,7 +221,7 @@ index 0000000..4adda17
220
221
+ // @text setPreferredClosedCaptionService
221
222
+ // @brief Sets the PreferredClosedCaptionService.
222
223
+ // @details The setting should be honored by the player. The behaviour of AUTO may be player specific.
223
- + // Valid input for service is "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]"
224
+ + // Valid input for service is "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]"
224
225
+ // @param service: Identifies the service to display e.g. "CC3".
225
226
+ virtual uint32_t SetPreferredClosedCaptionService(const string& service /* @in */) = 0;
226
227
+
@@ -268,7 +269,7 @@ index 0000000..4adda17
268
269
+ // restrictions are to be applied, if applicable for the project
269
270
+ // @param viewingRestrictionsWindow: A project-specific representation of the time interval.Eg: "ALWAYS"
270
271
+ virtual uint32_t SetViewingRestrictionsWindow(const string &viewingRestrictionsWindow /* @in @text viewingRestrictionsWindow */) = 0;
271
- +
272
+ +
272
273
+ // @text getViewingRestrictionsWindow
273
274
+ // @brief Gets the current ViewingRestrictionsWindow.
274
275
+ // @param viewingRestrictionsWindow: A project-specific representation of the time interval.Eg: "ALWAYS"
@@ -360,22 +361,86 @@ index 0000000..4adda17
360
361
+
361
362
+ };
362
363
+
364
+ + /**
365
+ + * If a setting was owned by an other component prior to being migrated into UserSettings,
366
+ + * we require the ability to detect when this migration has completed.
367
+ + * The component which was the previous owner of a given setting has the responsibility
368
+ + * to always set the setting on UserSettings interface (During migration AND during first time install).
369
+ + * Until this is done the setting is not considered valid, meaning the the MigrationState will contain requiresMigration=true
370
+ + * All settings not requiring migration would immediately be valid.
371
+ + */
372
+ +
373
+ + /* @json 1.0.0 @text:keep */
374
+ + struct EXTERNAL IUserSettingsInspector : virtual public Core::IUnknown
375
+ + {
376
+ + enum { ID = ID_USER_SETTINGS_INSPECTOR };
377
+ +
378
+ + ~IUserSettingsInspector() override = default;
379
+ +
380
+ + enum SettingsKey : uint32_t
381
+ + {
382
+ + PREFERRED_AUDIO_LANGUAGES = 1,
383
+ + AUDIO_DESCRIPTION = 2,
384
+ + CAPTIONS = 3,
385
+ + PREFERRED_CAPTIONS_LANGUAGES = 4,
386
+ + PREFERRED_CLOSED_CAPTION_SERVICE = 5,
387
+ + PRESENTATION_LANGUAGE = 6,
388
+ + HIGH_CONTRAST = 7,
389
+ + PIN_CONTROL = 8,
390
+ + VIEWING_RESTRICTIONS = 9,
391
+ + VIEWING_RESTRICTIONS_WINDOW = 10,
392
+ + LIVE_WATERSHED = 11,
393
+ + PLAYBACK_WATERSHED = 12,
394
+ + BLOCK_NOT_RATED_CONTENT = 13,
395
+ + PIN_ON_PURCHASE = 14,
396
+ + VOICE_GUIDANCE = 15,
397
+ + VOICE_GUIDANCE_RATE = 16,
398
+ + VOICE_GUIDANCE_HINTS = 17
399
+ + };
400
+ +
401
+ + struct SettingsMigrationState
402
+ + {
403
+ + SettingsKey key /* @text key which needs the migration information */ ;
404
+ + bool requiresMigration /* @text whether the key requires migration or not */;
405
+ + };
406
+ +
407
+ + using IUserSettingsMigrationStateIterator = RPC::IIteratorType<SettingsMigrationState, ID_USER_SETTINGS_MIGRATION_STATE_ITERATOR>;
408
+ +
409
+ + /** Get the migration state of the respective key */
410
+ + // @text getMigrationState
411
+ + // @brief Get the migration state of the respective key
412
+ + // @param key: one of UserSettingsKey
413
+ + // @param migrationState: key and it's migration state.
414
+ + virtual Core::hresult GetMigrationState(const SettingsKey key, bool &requiresMigration /* @out */) const = 0;
415
+ +
416
+ + /** Get the migration state of all the defined keys */
417
+ + // @text getMigrationStates
418
+ + // @brief Get the migration state of all the defined keys
419
+ + // @param states: array of migration status.
420
+ + virtual Core::hresult GetMigrationStates(IUserSettingsMigrationStateIterator*& states /* @out */) const = 0;
421
+ +
422
+ + };
423
+ +
363
424
+ } // namespace Exchange
364
425
+ } // namespace WPEFramework
365
426
+
366
427
diff --git a/interfaces/Ids.h b/interfaces/Ids.h
367
- index a37db24..293dd73 100644
428
+ index 64151cf..9f28fe0 100644
368
429
--- a/interfaces/Ids.h
369
430
+++ b/interfaces/Ids.h
370
- @@ -354 ,7 +354,10 @@ namespace Exchange {
431
+ @@ -360 ,7 +360,14 @@ namespace Exchange {
371
432
ID_SCRIPT_ENGINE_NOTIFICATION = ID_SCRIPT_ENGINE + 1,
372
433
373
434
ID_TEXT_TO_SPEECH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4C0,
374
435
- ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1
375
436
+ ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1,
376
437
+
377
438
+ ID_USER_SETTINGS = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4D0,
378
- + ID_USER_SETTINGS_NOTIFICATION = ID_USER_SETTINGS + 1
439
+ + ID_USER_SETTINGS_NOTIFICATION = ID_USER_SETTINGS + 1,
440
+ + ID_USER_SETTINGS_INSPECTOR = ID_USER_SETTINGS + 2,
441
+ + ID_USER_SETTINGS_MIGRATION_STATE_ITERATOR = ID_USER_SETTINGS + 3,
442
+ +
443
+ +
379
444
};
380
445
}
381
446
}
0 commit comments