windows.globalization.idl 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * Copyright 2021 Rémi Bernon for CodeWeavers
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifdef __WIDL__
  19. #pragma winrt ns_prefix
  20. #endif
  21. import "inspectable.idl";
  22. import "asyncinfo.idl";
  23. import "eventtoken.idl";
  24. import "windowscontracts.idl";
  25. import "windows.foundation.idl";
  26. namespace Windows {
  27. namespace Globalization {
  28. typedef enum DayOfWeek DayOfWeek;
  29. typedef enum LanguageLayoutDirection LanguageLayoutDirection;
  30. interface ILanguage;
  31. interface ILanguage2;
  32. interface ILanguage3;
  33. interface ILanguageExtensionSubtags;
  34. interface ILanguageFactory;
  35. interface ILanguageStatics;
  36. interface ILanguageStatics2;
  37. interface ILanguageStatics3;
  38. runtimeclass Language;
  39. }
  40. }
  41. namespace Windows {
  42. namespace Globalization {
  43. declare{
  44. interface Windows.Foundation.Collections.IIterable<Windows.Globalization.Language*>;
  45. interface Windows.Foundation.Collections.IIterator<Windows.Globalization.Language*>;
  46. interface Windows.Foundation.Collections.IVectorView<Windows.Globalization.Language*>;
  47. interface Windows.Foundation.Collections.IVector<Windows.Globalization.Language*>;
  48. }
  49. }
  50. }
  51. namespace Windows {
  52. namespace Globalization {
  53. [contract(Windows.Foundation.UniversalApiContract, 1.0)]
  54. enum DayOfWeek
  55. {
  56. Sunday = 0,
  57. Monday = 1,
  58. Tuesday = 2,
  59. Wednesday = 3,
  60. Thursday = 4,
  61. Friday = 5,
  62. Saturday = 6
  63. };
  64. [contract(Windows.Foundation.UniversalApiContract, 6.0)]
  65. enum LanguageLayoutDirection
  66. {
  67. Ltr = 0,
  68. Rtl = 1,
  69. TtbLtr = 2,
  70. TtbRtl = 3,
  71. };
  72. [
  73. contract(Windows.Foundation.UniversalApiContract, 1.0),
  74. exclusiveto(Windows.Globalization.Language),
  75. uuid(ea79a752-f7c2-4265-b1bd-c4dec4e4f080)
  76. ]
  77. interface ILanguage : IInspectable
  78. {
  79. [propget] HRESULT LanguageTag([out, retval] HSTRING *value);
  80. [propget] HRESULT DisplayName([out, retval] HSTRING *value);
  81. [propget] HRESULT NativeName([out, retval] HSTRING *value);
  82. [propget] HRESULT Script([out, retval] HSTRING *value);
  83. }
  84. [
  85. contract(Windows.Foundation.UniversalApiContract, 6.0),
  86. exclusiveto(Windows.Globalization.Language),
  87. uuid(6a47e5b5-d94d-4886-a404-a5a5b9d5b494)
  88. ]
  89. interface ILanguage2 : IInspectable
  90. {
  91. [propget] HRESULT LayoutDirection([out, retval] Windows.Globalization.LanguageLayoutDirection *value);
  92. }
  93. [
  94. contract(Windows.Foundation.UniversalApiContract, 10.0),
  95. exclusiveto(Windows.Globalization.Language),
  96. uuid(c6af3d10-641a-5ba4-bb43-5e12aed75954)
  97. ]
  98. interface ILanguage3 : IInspectable
  99. {
  100. [propget] HRESULT AbbreviatedName([out, retval] HSTRING *value);
  101. }
  102. [
  103. contract(Windows.Foundation.UniversalApiContract, 1.0),
  104. exclusiveto(Windows.Globalization.Language),
  105. uuid(7d7daf45-368d-4364-852b-dec927037b85)
  106. ]
  107. interface ILanguageExtensionSubtags : IInspectable
  108. {
  109. HRESULT GetExtensionSubtags([in] HSTRING tag, [out, retval] Windows.Foundation.Collections.IVectorView<HSTRING> **value);
  110. }
  111. [
  112. contract(Windows.Foundation.UniversalApiContract, 1.0),
  113. exclusiveto(Windows.Globalization.Language),
  114. uuid(9b0252ac-0c27-44f8-b792-9793fb66c63e)
  115. ]
  116. interface ILanguageFactory : IInspectable
  117. {
  118. HRESULT CreateLanguage([in] HSTRING tag, [out, retval] Windows.Globalization.Language **value);
  119. }
  120. [
  121. contract(Windows.Foundation.UniversalApiContract, 1.0),
  122. exclusiveto(Windows.Globalization.Language),
  123. uuid(b23cd557-0865-46d4-89b8-d59be8990f0d)
  124. ]
  125. interface ILanguageStatics : IInspectable
  126. {
  127. HRESULT IsWellFormed([in] HSTRING tag, [out, retval] BOOLEAN *result);
  128. [propget] HRESULT CurrentInputMethodLanguageTag([out, retval] HSTRING *value);
  129. }
  130. [
  131. contract(Windows.Foundation.UniversalApiContract, 1.0),
  132. exclusiveto(Windows.Globalization.Language),
  133. uuid(30199f6e-914b-4b2a-9d6e-e3b0e27dbe4f)
  134. ]
  135. interface ILanguageStatics2 : IInspectable
  136. {
  137. HRESULT TrySetInputMethodLanguageTag([in] HSTRING tag, [out, retval] BOOLEAN *result);
  138. }
  139. [
  140. contract(Windows.Foundation.UniversalApiContract, 10.0),
  141. exclusiveto(Windows.Globalization.Language),
  142. uuid(d15ecb5a-71de-5752-9542-fac5b4f27261)
  143. ]
  144. interface ILanguageStatics3 : IInspectable
  145. {
  146. HRESULT GetMuiCompatibleLanguageListFromLanguageTags([in] Windows.Foundation.Collections.IIterable<HSTRING> *tags, [out, retval] Windows.Foundation.Collections.IVector<HSTRING> **result);
  147. }
  148. [
  149. activatable(Windows.Globalization.ILanguageFactory, Windows.Foundation.UniversalApiContract, 1.0),
  150. contract(Windows.Foundation.UniversalApiContract, 1.0),
  151. marshaling_behavior(agile),
  152. static(Windows.Globalization.ILanguageStatics, Windows.Foundation.UniversalApiContract, 1.0),
  153. static(Windows.Globalization.ILanguageStatics2, Windows.Foundation.UniversalApiContract, 1.0),
  154. static(Windows.Globalization.ILanguageStatics3, Windows.Foundation.UniversalApiContract, 10.0),
  155. threading(both)
  156. ]
  157. runtimeclass Language
  158. {
  159. [contract(Windows.Foundation.UniversalApiContract, 1.0), default] interface Windows.Globalization.ILanguage;
  160. [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Globalization.ILanguageExtensionSubtags;
  161. [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Globalization.ILanguage2;
  162. [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.Globalization.ILanguage3;
  163. }
  164. }
  165. }