2 * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
23 namespace Tizen.System
26 /// The Feedback API provides functions to control haptic and sound.
27 /// The Feedback API provides the way to play and stop feedback, and get the information whether a specific pattern is supported.
28 /// Below is the supported pattern string:
45 /// HardwareKeyPressed
61 /// VibrationModeAbled
62 /// SilentModeDisabled
63 /// BluetoothDeviceConnected
64 /// BluetoothDeviceDisconnected
70 /// For controlling the haptic device:
71 /// http://tizen.org/privilege/haptic
72 /// For controlling the sound, privilege is not needed.
76 /// Feedback feedback = new Feedback();
77 /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
80 /// <since_tizen> 3 </since_tizen>
83 private const string LogTag = "Tizen.System.Feedback";
85 private readonly Dictionary<string, int> Pattern = new Dictionary<string, int>
88 {"SoftInputPanel", 1},
108 {"HardwareKeyPressed", 21},
109 {"HardwareKeyHold", 22},
111 {"MessageOnCall", 24},
115 {"WakeUpOnCall", 28},
117 {"ScheduleOnCall", 30},
121 {"GeneralOnCall", 34},
125 {"ChargerConnected", 38},
126 {"ChargerconnOnCall", 39},
127 {"ChargingError", 40},
128 {"ChargingErrorOnCall", 41},
129 {"FullyCharged", 42},
130 {"FullchargedOnCall", 43},
132 {"LowBattOnCall", 45},
135 {"GeometricLock", 50},
137 {"Discallconnect", 52},
138 {"OutgoingCall", 53},
139 {"Minuteminder", 54},
140 {"VibrationModeAbled", 55},
141 {"SilentModeDisabled", 56},
142 {"BluetoothDeviceConnected", 57},
143 {"BluetoothDeviceDisconnected", 58},
146 {"ScreenCapture", 61},
149 {"VolumeKeyPressed", 64},
150 {"UvProcessing", 95},
151 {"ShealthStart", 96},
152 {"ShealthPause", 97},
154 {"3rdApplication", 99},
156 {"TransitionCircular", 101},
157 {"TransitionPop", 102},
161 {"ClockSecondHand", 106},
162 {"SystemShort", 107},
163 {"SystemError", 108},
170 {"InactiveTension", 115},
171 {"InactiveFine", 116},
173 {"ShealthNotice", 118},
174 {"ShealthGentleAlert", 119},
175 {"EndEffectFine", 120},
177 {"ClickFineTrain1", 122},
179 {"ClickSlider", 124},
180 {"ClickMedium", 125},
181 {"ClickStrong", 126},
187 {"Communication", 132},
188 {"MessageStrongBuzz", 133},
189 {"EmailStrongBuzz", 134},
190 {"GeneralStrongBuzz", 135},
191 {"CommunicationStrongBuzz", 136},
192 {"ScheduleStrongBuzz", 137},
193 {"WakeupStrongBuzz", 138},
194 {"TimerStrongBuzz", 139},
195 {"RingerStrongBuzz", 140},
197 {"HeartbeatFast", 142},
203 {"Notification1", 148},
204 {"Notification1StrongBuzz", 149},
205 {"Notification2", 150},
206 {"Notification2StrongBuzz", 151},
207 {"Notification3", 152},
208 {"Notification3StrongBuzz", 153},
209 {"Notification4", 154},
210 {"Notification4StrongBuzz", 155},
211 {"Notification5", 156},
212 {"Notification5StrongBuzz", 157},
213 {"Notification6", 158},
214 {"Notification6StrongBuzz", 159},
215 {"Notification7", 160},
216 {"Notification7StrongBuzz", 161},
217 {"Notification8", 162},
218 {"Notification8StrongBuzz", 163},
219 {"Notification9", 164},
220 {"Notification9StrongBuzz", 165},
221 {"Notification10", 166},
222 {"Notification10StrongBuzz", 167},
224 {"Ring1StrongBuzz", 169},
226 {"Ring2StrongBuzz", 171},
228 {"Ring3StrongBuzz", 173},
230 {"Ring4StrongBuzz", 175},
232 {"Ring5StrongBuzz", 177},
234 {"Ring6StrongBuzz", 179},
236 {"Ring7StrongBuzz", 181},
238 {"Ring8StrongBuzz", 183},
240 {"Ring9StrongBuzz", 185},
242 {"Ring10StrongBuzz", 187},
244 {"Alarm1StrongBuzz", 189},
246 {"Alarm2StrongBuzz", 191},
248 {"Alarm3StrongBuzz", 193},
250 {"Alarm4StrongBuzz", 195},
252 {"Alarm5StrongBuzz", 197},
254 {"Alarm6StrongBuzz", 199},
256 {"Alarm7StrongBuzz", 201},
258 {"Alarm8StrongBuzz", 203},
260 {"Alarm9StrongBuzz", 205},
262 {"Alarm10StrongBuzz", 207},
264 {"PickerFinish", 209},
265 {"OnOffSwitch", 210},
269 {"HourlyAlert", 10001},
270 {"SafetyAlert", 10002},
271 {"AccidentDetect", 10003},
272 {"SendSosMessage", 10004},
273 {"EndSosMessage", 10005},
274 {"EmergencyBuzzer", 10006},
275 {"SafetyLowPower", 10007},
278 {"Notification", 10010},
282 {"Emergency", 10014},
283 {"InternalWakeup", 10015},
284 {"InternalTimer", 10016},
285 {"TemperatureWarning", 10017},
286 {"CooldownWarning1", 10018},
287 {"CooldownWarning2", 10019},
290 {"KeepThisPace", 10022},
291 {"GoalAchieved", 10023},
292 {"ExerciseCount", 10024},
294 {"HealthPace", 10026},
295 {"InactiveTime", 10027},
297 {"NfcSuccess", 10029},
298 {"MeasuringSuccess", 10030},
299 {"MeasuringFailure", 10031},
300 {"Meditation", 10032},
301 {"MeditationInternal", 10033},
302 {"FallDetection1", 10034},
303 {"FallDetection2", 10035},
304 {"SmartGesture", 10036},
305 {"BreathingExhale", 12000},
311 {"ToggleOff", 40003},
312 {"LongPressOn", 40004},
313 {"LongPressOff", 40005},
317 {"PreheatEnding", 40009},
318 {"TaskEnding", 40010},
325 {"DefaultLevel1", 40017},
336 {"TimerEnding", 40028},
337 {"BurnerDetected", 40029},
338 {"BurnerMoved", 40030},
339 {"Connected", 40031},
340 {"Disconnected", 40032},
342 {"AutoDoorOpen", 40034},
346 /// Constructor of Feedback class
348 /// <since_tizen> 3 </since_tizen>
350 /// http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
352 /// <exception cref="NotSupportedException">Thrown when failed because the devices (vibration and sound) are not supported.</exception>
353 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
354 /// <privilege>http://tizen.org/privilege/haptic</privilege>
357 /// Feedback feedback = new Feedback();
362 Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Initialize();
363 if (res != Interop.Feedback.FeedbackError.None)
365 Log.Warn(LogTag, string.Format("Failed to initialize feedback. err = {0}", res));
368 case Interop.Feedback.FeedbackError.NotSupported:
369 throw new NotSupportedException("Device is not supported");
371 throw new InvalidOperationException("Failed to initialize");
377 /// Finalizes an instance of the Feedback class.
381 Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Deinitialize();
382 if (res != Interop.Feedback.FeedbackError.None)
384 Log.Warn(LogTag, string.Format("Failed to deinitialize feedback. err = {0}", res));
389 /// Gets the supported information about a specific type and pattern.
392 /// Now, IsSupportedPattern is not working for FeedbackType.All.
393 /// This API is working for FeedbackType.Sound and FeedbackType.Vibration only.
394 /// If you use FeedbackType.All for type parameter, this API will throw ArgumentException.
395 /// To get the supported information for Vibration type, the application should have http://tizen.org/privilege/haptic privilege.
397 /// <since_tizen> 3 </since_tizen>
398 /// <param name="type">The feedback type.</param>
399 /// <param name="pattern">The feedback pattern string.</param>
401 /// http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
403 /// <returns>Information whether a pattern is supported.</returns>
404 /// <exception cref="Exception">Thrown when failed because the feedback is not initialized.</exception>
405 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
406 /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
407 /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted (No privilege).</exception>
408 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
409 /// <privilege>http://tizen.org/privilege/haptic</privilege>
412 /// Feedback feedback = new Feedback();
413 /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap");
416 public bool IsSupportedPattern(FeedbackType type, String pattern)
418 bool supported = false;
420 Interop.Feedback.FeedbackError res;
422 if (!Pattern.TryGetValue(pattern, out number))
423 throw new ArgumentException($"Not supported pattern string : {pattern}", nameof(pattern));
425 res = (Interop.Feedback.FeedbackError)Interop.Feedback.IsSupportedPattern((Interop.Feedback.FeedbackType)type, number, out supported);
427 if (res != Interop.Feedback.FeedbackError.None)
429 Log.Warn(LogTag, string.Format("Failed to get supported information. err = {0}", res));
432 case Interop.Feedback.FeedbackError.NotInitialized:
433 throw new Exception("Not initialized");
434 case Interop.Feedback.FeedbackError.InvalidParameter:
435 throw new ArgumentException("Invalid Arguments");
436 case Interop.Feedback.FeedbackError.NotSupported:
437 throw new NotSupportedException("Device is not supported");
438 case Interop.Feedback.FeedbackError.PermissionDenied:
439 throw new UnauthorizedAccessException("Access is not granted");
440 case Interop.Feedback.FeedbackError.OperationFailed:
442 throw new InvalidOperationException("Failed to get supported information");
449 /// Plays a specific feedback pattern.
452 /// To play Vibration type, app should have http://tizen.org/privilege/haptic privilege.
454 /// <since_tizen> 3 </since_tizen>
455 /// <param name="type">The feedback type.</param>
456 /// <param name="pattern">The feedback pattern string.</param>
458 /// http://tizen.org/feature/feedback.vibration for FeedbackType.Vibration
460 /// <exception cref="Exception">Thrown when failed because feedback is not initialized.</exception>
461 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
462 /// <exception cref="NotSupportedException">Thrown when failed because the device (haptic, sound) or a specific pattern is not supported.</exception>
463 /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted(No privilege)</exception>
464 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
465 /// <privilege>http://tizen.org/privilege/haptic</privilege>
468 /// Feedback feedback = new Feedback();
469 /// feedback.Play(FeedbackType.All, "Tap");
472 public void Play(FeedbackType type, String pattern)
475 Interop.Feedback.FeedbackError res;
477 if (!Pattern.TryGetValue(pattern, out number))
478 throw new ArgumentException($"Not supported pattern string : {pattern}", nameof(pattern));
480 if (type == FeedbackType.All)
481 res = (Interop.Feedback.FeedbackError)Interop.Feedback.Play(number);
483 res = (Interop.Feedback.FeedbackError)Interop.Feedback.PlayType((Interop.Feedback.FeedbackType)type, number);
485 if (res != Interop.Feedback.FeedbackError.None)
487 Log.Warn(LogTag, string.Format("Failed to play feedback. err = {0}", res));
490 case Interop.Feedback.FeedbackError.NotInitialized:
491 throw new Exception("Not initialized");
492 case Interop.Feedback.FeedbackError.InvalidParameter:
493 throw new ArgumentException("Invalid Arguments");
494 case Interop.Feedback.FeedbackError.NotSupported:
495 throw new NotSupportedException("Not supported");
496 case Interop.Feedback.FeedbackError.PermissionDenied:
497 throw new UnauthorizedAccessException("Access is not granted");
498 case Interop.Feedback.FeedbackError.OperationFailed:
500 throw new InvalidOperationException("Failed to play pattern");
506 /// Stops to play the feedback.
509 /// To stop vibration, the application should have http://tizen.org/privilege/haptic privilege.
511 /// <since_tizen> 3 </since_tizen>
513 /// http://tizen.org/feature/feedback.vibration
515 /// <exception cref="Exception">Thrown when failed because the feedback is not initialized.</exception>
516 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament</exception>
517 /// <exception cref="NotSupportedException">Thrown when failed because the device (haptic, sound) or a specific pattern is not supported.</exception>
518 /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted (No privilege).</exception>
519 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
520 /// <privilege>http://tizen.org/privilege/haptic</privilege>
523 /// Feedback Feedback1 = new Feedback();
524 /// Feedback1.Stop();
529 Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Stop();
531 if (res != Interop.Feedback.FeedbackError.None)
533 Log.Warn(LogTag, string.Format("Failed to stop feedback. err = {0}", res));
536 case Interop.Feedback.FeedbackError.NotInitialized:
537 throw new Exception("Not initialized");
538 case Interop.Feedback.FeedbackError.InvalidParameter:
539 throw new ArgumentException("Invalid Arguments");
540 case Interop.Feedback.FeedbackError.NotSupported:
541 throw new NotSupportedException("Not supported");
542 case Interop.Feedback.FeedbackError.PermissionDenied:
543 throw new UnauthorizedAccessException("Access is not granted");
544 case Interop.Feedback.FeedbackError.OperationFailed:
546 throw new InvalidOperationException("Failed to stop pattern");
552 /// Gets the count of theme can be used according to feedback type.
555 /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported.
556 /// Counts of theme range will be 1 ~ N according to conf file.
558 /// <since_tizen> 10 </since_tizen>
559 /// <param name="type">The feedback type.</param>
560 /// <returns>The counf of theme can be used according to feedback type.</returns>
561 /// <exception cref="Exception">Thrown when failed because the feedback is not initialized.</exception>
562 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
563 /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
564 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
567 /// Feedback feedback = new Feedback();
568 /// uint coundOfTheme = feedback.GetCountOfThemeInternal(FeedbackType.Sound);
571 [EditorBrowsable(EditorBrowsableState.Never)]
572 public uint GetCountOfThemeInternal(FeedbackType type)
574 uint countOfTheme = 0;
575 Interop.Feedback.FeedbackError res;
577 res = (Interop.Feedback.FeedbackError)Interop.Feedback.GetCountOfThemeInternal((Interop.Feedback.FeedbackType)type, out countOfTheme);
579 if (res != Interop.Feedback.FeedbackError.None)
581 Log.Warn(LogTag, string.Format("Failed to get count of theme internal. err = {0}", res));
584 case Interop.Feedback.FeedbackError.NotInitialized:
585 throw new Exception("Not initialized");
586 case Interop.Feedback.FeedbackError.InvalidParameter:
587 throw new ArgumentException("Invalid Arguments");
588 case Interop.Feedback.FeedbackError.NotSupported:
589 throw new NotSupportedException("Device is not supported");
590 case Interop.Feedback.FeedbackError.OperationFailed:
592 throw new InvalidOperationException("Failed to get count of theme internal");
599 /// Gets the id of theme selected.
602 /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported.
603 /// The theme id is positive value as defined in the conf file.
605 /// <since_tizen> 10 </since_tizen>
606 /// <param name="type">The feedback type.</param>
607 /// <returns>The id of theme selected as default theme according to feedback type.</returns>
608 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
609 /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
610 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
613 /// Feedback feedback = new Feedback();
614 /// uint idOfTheme = feedback.GetThemeIdInternal(FeedbackType.Sound);
617 [EditorBrowsable(EditorBrowsableState.Never)]
618 public uint GetThemeIdInternal(FeedbackType type)
620 uint countOfTheme = 0;
621 Interop.Feedback.FeedbackError res;
623 res = (Interop.Feedback.FeedbackError)Interop.Feedback.GetThemeIdInternal((Interop.Feedback.FeedbackType)type, out countOfTheme);
625 if (res != Interop.Feedback.FeedbackError.None)
627 Log.Warn(LogTag, string.Format("Failed to get id of theme internal. err = {0}", res));
630 case Interop.Feedback.FeedbackError.InvalidParameter:
631 throw new ArgumentException("Invalid Arguments");
632 case Interop.Feedback.FeedbackError.NotSupported:
633 throw new NotSupportedException("Device is not supported");
634 case Interop.Feedback.FeedbackError.OperationFailed:
636 throw new InvalidOperationException("Failed to get id of theme internal");
643 /// Sets the id of theme according to feedback type.
646 /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported.
647 /// To set the id of theme for Sound type, the application should have http://tizen.org/privilege/systemsettings.admin privilege.
648 /// The theme id is positive value as defined in the conf file.
650 /// <since_tizen> 10 </since_tizen>
651 /// <param name="type">The feedback type.</param>
652 /// <param name="idOfTheme">The id of theme will be set.</param>
653 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
654 /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
655 /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted(No privilege)</exception>
656 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
659 /// Feedback feedback = new Feedback();
660 /// uint idOfTheme = 1;
661 /// feedback.SetThemeIdInternal(FeedbackType.Sound, idOfTheme);
664 [EditorBrowsable(EditorBrowsableState.Never)]
665 public void SetThemeIdInternal(FeedbackType type, uint idOfTheme)
667 Interop.Feedback.FeedbackError res;
669 res = (Interop.Feedback.FeedbackError)Interop.Feedback.SetThemeIdInternal((Interop.Feedback.FeedbackType)type, idOfTheme);
671 if (res != Interop.Feedback.FeedbackError.None)
673 Log.Warn(LogTag, string.Format("Failed to set id of theme internal. err = {0}", res));
676 case Interop.Feedback.FeedbackError.InvalidParameter:
677 throw new ArgumentException("Invalid Arguments");
678 case Interop.Feedback.FeedbackError.NotSupported:
679 throw new NotSupportedException("Device is not supported");
680 case Interop.Feedback.FeedbackError.PermissionDenied:
681 throw new UnauthorizedAccessException("Access is not granted");
682 case Interop.Feedback.FeedbackError.OperationFailed:
684 throw new InvalidOperationException("Failed to set id of theme internal");
690 /// Stops the current feedback playing by feedback type
693 /// To stop vibration, the application should have http://tizen.org/privilege/haptic privilege.
695 /// <since_tizen> 10 </since_tizen>
696 /// <param name="type">The feedback type.</param>
697 /// <exception cref="Exception">Thrown when failed because the feedback is not initialized.</exception>
698 /// <exception cref="ArgumentException">Thrown when failed because of an invalid argument</exception>
699 /// <exception cref="NotSupportedException">Thrown when failed because the device (haptic, sound) or a specific pattern is not supported.</exception>
700 /// <exception cref="UnauthorizedAccessException">Thrown when failed because the access is not granted (No privilege).</exception>
701 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
704 /// Feedback Feedback = new Feedback();
705 /// feedback.StopTypeInternal(FeedbackType.Sound);
706 /// feedback.StopTypeInternal(FeedbackType.Vibration);
709 [EditorBrowsable(EditorBrowsableState.Never)]
710 public void StopTypeInternal(FeedbackType type)
712 Interop.Feedback.FeedbackError res;
714 res = (Interop.Feedback.FeedbackError)Interop.Feedback.StopTypeInternal((Interop.Feedback.FeedbackType)type);
716 if (res != Interop.Feedback.FeedbackError.None)
718 Log.Warn(LogTag, string.Format("Failed to Stop feedback by feedback type internal. err = {0}", res));
721 case Interop.Feedback.FeedbackError.NotInitialized:
722 throw new Exception("Not initialized");
723 case Interop.Feedback.FeedbackError.InvalidParameter:
724 throw new ArgumentException("Invalid Arguments");
725 case Interop.Feedback.FeedbackError.NotSupported:
726 throw new NotSupportedException("Not supported");
727 case Interop.Feedback.FeedbackError.PermissionDenied:
728 throw new UnauthorizedAccessException("Access is not granted");
729 case Interop.Feedback.FeedbackError.OperationFailed:
731 throw new InvalidOperationException("Failed to stop pattern by feedback type");
737 /// Gets the id array of theme supported.
740 /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported.
741 /// The theme id is positive value as defined in the conf file.
743 /// <since_tizen> 10 </since_tizen>
744 /// <param name="type">The feedback type.</param>
745 /// <returns>The array of theme id supported according to feedback type.</returns>
746 /// <exception cref="ArgumentException">Thrown when failed because of an invalid arguament.</exception>
747 /// <exception cref="NotSupportedException">Thrown when failed becuase the device (haptic, sound) is not supported.</exception>
748 /// <exception cref="InvalidOperationException">Thrown when failed because of a system error.</exception>
751 /// Feedback feedback = new Feedback();
752 /// uint[] getThemeIds = feedback.GetThemeIdsInternal(FeedbackType.Sound);
755 [EditorBrowsable(EditorBrowsableState.Never)]
756 public uint[] GetThemeIdsInternal(FeedbackType type)
758 uint countOfTheme = 0;
760 Interop.Feedback.FeedbackError res;
762 res = (Interop.Feedback.FeedbackError)Interop.Feedback.GetThemeIdsInternal((Interop.Feedback.FeedbackType)type, out countOfTheme, out getThemeIds);
763 if (res != Interop.Feedback.FeedbackError.None)
765 Log.Warn(LogTag, string.Format("Failed to get ids of theme internal. err = {0}", res));
768 case Interop.Feedback.FeedbackError.InvalidParameter:
769 throw new ArgumentException("Invalid Arguments");
770 case Interop.Feedback.FeedbackError.NotSupported:
771 throw new NotSupportedException("Device is not supported");
772 case Interop.Feedback.FeedbackError.OperationFailed:
774 throw new InvalidOperationException("Failed to get ids of theme internal");
778 uint[] themeIds = new uint[countOfTheme];
781 uint* themeIdsPointer = (uint*)getThemeIds;
783 for (index = 0; index < countOfTheme; index++) {
784 themeIds[index] = themeIdsPointer[index];
787 Marshal.FreeHGlobal(getThemeIds);