Debian Codegraph @

.cargo/vendor/iana-time-zone/src/Windows.rs

raw
1 // Bindings generated by `windows-bindgen` 0.51.1
2
3 #![allow(
4 non_snake_case,
5 non_upper_case_globals,
6 non_camel_case_types,
7 dead_code,
8 clippy::all
9 )]
10 pub mod Foundation {
11 pub mod Collections {
12 #[repr(transparent)]
13 pub struct IIterable<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
14 where
15 T: ::windows_core::RuntimeType + 'static;
16 impl<T: ::windows_core::RuntimeType + 'static> IIterable<T> {
17 pub fn First(&self) -> ::windows_core::Result<IIterator<T>> {
18 let this = self;
19 unsafe {
20 let mut result__ = ::std::mem::zeroed();
21 (::windows_core::Interface::vtable(this).First)(
22 ::windows_core::Interface::as_raw(this),
23 &mut result__,
24 )
25 .from_abi(result__)
26 }
27 }
28 }
29 impl<T: ::windows_core::RuntimeType + 'static>
30 ::windows_core::CanInto<::windows_core::IUnknown> for IIterable<T>
31 {
32 }
33 impl<T: ::windows_core::RuntimeType + 'static>
34 ::windows_core::CanInto<::windows_core::IInspectable> for IIterable<T>
35 {
36 }
37 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::PartialEq for IIterable<T> {
38 fn eq(&self, other: &Self) -> bool {
39 self.0 == other.0
40 }
41 }
42 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::Eq for IIterable<T> {}
43 impl<T: ::windows_core::RuntimeType + 'static> ::core::fmt::Debug for IIterable<T> {
44 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
45 f.debug_tuple("IIterable").field(&self.0).finish()
46 }
47 }
48 impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterable<T> {
49 const SIGNATURE: ::windows_core::imp::ConstBuffer = {
50 ::windows_core::imp::ConstBuffer::new()
51 .push_slice(b"pinterface(")
52 .push_slice(b"{faa585ea-6214-4217-afda-7f46de5869b3}")
53 .push_slice(b";")
54 .push_other(<T as ::windows_core::RuntimeType>::SIGNATURE)
55 .push_slice(b")")
56 };
57 }
58 impl<T: ::windows_core::RuntimeType> ::core::iter::IntoIterator for IIterable<T> {
59 type Item = T;
60 type IntoIter = IIterator<Self::Item>;
61 fn into_iter(self) -> Self::IntoIter {
62 ::core::iter::IntoIterator::into_iter(&self)
63 }
64 }
65 impl<T: ::windows_core::RuntimeType> ::core::iter::IntoIterator for &IIterable<T> {
66 type Item = T;
67 type IntoIter = IIterator<Self::Item>;
68 fn into_iter(self) -> Self::IntoIter {
69 self.First().unwrap()
70 }
71 }
72 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::Interface for IIterable<T> {
73 type Vtable = IIterable_Vtbl<T>;
74 }
75 impl<T: ::windows_core::RuntimeType + 'static> ::core::clone::Clone for IIterable<T> {
76 fn clone(&self) -> Self {
77 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
78 }
79 }
80 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::ComInterface
81 for IIterable<T>
82 {
83 const IID: ::windows_core::GUID = ::windows_core::GUID::from_signature(
84 <Self as ::windows_core::RuntimeType>::SIGNATURE,
85 );
86 }
87 #[repr(C)]
88 #[doc(hidden)]
89 pub struct IIterable_Vtbl<T>
90 where
91 T: ::windows_core::RuntimeType + 'static,
92 {
93 pub base__: ::windows_core::IInspectable_Vtbl,
94 pub First: unsafe extern "system" fn(
95 this: *mut ::core::ffi::c_void,
96 result__: *mut *mut ::core::ffi::c_void,
97 ) -> ::windows_core::HRESULT,
98 pub T: ::core::marker::PhantomData<T>,
99 }
100 #[repr(transparent)]
101 pub struct IIterator<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
102 where
103 T: ::windows_core::RuntimeType + 'static;
104 impl<T: ::windows_core::RuntimeType + 'static> IIterator<T> {
105 pub fn Current(&self) -> ::windows_core::Result<T> {
106 let this = self;
107 unsafe {
108 let mut result__ = ::std::mem::zeroed();
109 (::windows_core::Interface::vtable(this).Current)(
110 ::windows_core::Interface::as_raw(this),
111 &mut result__,
112 )
113 .from_abi(result__)
114 }
115 }
116 pub fn HasCurrent(&self) -> ::windows_core::Result<bool> {
117 let this = self;
118 unsafe {
119 let mut result__ = ::std::mem::zeroed();
120 (::windows_core::Interface::vtable(this).HasCurrent)(
121 ::windows_core::Interface::as_raw(this),
122 &mut result__,
123 )
124 .from_abi(result__)
125 }
126 }
127 pub fn MoveNext(&self) -> ::windows_core::Result<bool> {
128 let this = self;
129 unsafe {
130 let mut result__ = ::std::mem::zeroed();
131 (::windows_core::Interface::vtable(this).MoveNext)(
132 ::windows_core::Interface::as_raw(this),
133 &mut result__,
134 )
135 .from_abi(result__)
136 }
137 }
138 pub fn GetMany(
139 &self,
140 items: &mut [<T as ::windows_core::Type<T>>::Default],
141 ) -> ::windows_core::Result<u32> {
142 let this = self;
143 unsafe {
144 let mut result__ = ::std::mem::zeroed();
145 (::windows_core::Interface::vtable(this).GetMany)(
146 ::windows_core::Interface::as_raw(this),
147 items.len() as u32,
148 ::core::mem::transmute_copy(&items),
149 &mut result__,
150 )
151 .from_abi(result__)
152 }
153 }
154 }
155 impl<T: ::windows_core::RuntimeType + 'static>
156 ::windows_core::CanInto<::windows_core::IUnknown> for IIterator<T>
157 {
158 }
159 impl<T: ::windows_core::RuntimeType + 'static>
160 ::windows_core::CanInto<::windows_core::IInspectable> for IIterator<T>
161 {
162 }
163 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::PartialEq for IIterator<T> {
164 fn eq(&self, other: &Self) -> bool {
165 self.0 == other.0
166 }
167 }
168 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::Eq for IIterator<T> {}
169 impl<T: ::windows_core::RuntimeType + 'static> ::core::fmt::Debug for IIterator<T> {
170 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
171 f.debug_tuple("IIterator").field(&self.0).finish()
172 }
173 }
174 impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IIterator<T> {
175 const SIGNATURE: ::windows_core::imp::ConstBuffer = {
176 ::windows_core::imp::ConstBuffer::new()
177 .push_slice(b"pinterface(")
178 .push_slice(b"{6a79e863-4300-459a-9966-cbb660963ee1}")
179 .push_slice(b";")
180 .push_other(<T as ::windows_core::RuntimeType>::SIGNATURE)
181 .push_slice(b")")
182 };
183 }
184 impl<T: ::windows_core::RuntimeType> ::core::iter::Iterator for IIterator<T> {
185 type Item = T;
186 fn next(&mut self) -> ::core::option::Option<Self::Item> {
187 let result = self.Current().ok();
188 if result.is_some() {
189 self.MoveNext().ok()?;
190 }
191 result
192 }
193 }
194 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::Interface for IIterator<T> {
195 type Vtable = IIterator_Vtbl<T>;
196 }
197 impl<T: ::windows_core::RuntimeType + 'static> ::core::clone::Clone for IIterator<T> {
198 fn clone(&self) -> Self {
199 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
200 }
201 }
202 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::ComInterface
203 for IIterator<T>
204 {
205 const IID: ::windows_core::GUID = ::windows_core::GUID::from_signature(
206 <Self as ::windows_core::RuntimeType>::SIGNATURE,
207 );
208 }
209 #[repr(C)]
210 #[doc(hidden)]
211 pub struct IIterator_Vtbl<T>
212 where
213 T: ::windows_core::RuntimeType + 'static,
214 {
215 pub base__: ::windows_core::IInspectable_Vtbl,
216 pub Current: unsafe extern "system" fn(
217 this: *mut ::core::ffi::c_void,
218 result__: *mut ::windows_core::AbiType<T>,
219 ) -> ::windows_core::HRESULT,
220 pub HasCurrent: unsafe extern "system" fn(
221 this: *mut ::core::ffi::c_void,
222 result__: *mut bool,
223 ) -> ::windows_core::HRESULT,
224 pub MoveNext: unsafe extern "system" fn(
225 this: *mut ::core::ffi::c_void,
226 result__: *mut bool,
227 ) -> ::windows_core::HRESULT,
228 pub GetMany: unsafe extern "system" fn(
229 this: *mut ::core::ffi::c_void,
230 items_array_size: u32,
231 items: *mut ::windows_core::AbiType<T>,
232 result__: *mut u32,
233 ) -> ::windows_core::HRESULT,
234 pub T: ::core::marker::PhantomData<T>,
235 }
236 #[repr(transparent)]
237 pub struct IVectorView<T>(::windows_core::IUnknown, ::core::marker::PhantomData<T>)
238 where
239 T: ::windows_core::RuntimeType + 'static;
240 impl<T: ::windows_core::RuntimeType + 'static> IVectorView<T> {
241 pub fn GetAt(&self, index: u32) -> ::windows_core::Result<T> {
242 let this = self;
243 unsafe {
244 let mut result__ = ::std::mem::zeroed();
245 (::windows_core::Interface::vtable(this).GetAt)(
246 ::windows_core::Interface::as_raw(this),
247 index,
248 &mut result__,
249 )
250 .from_abi(result__)
251 }
252 }
253 pub fn Size(&self) -> ::windows_core::Result<u32> {
254 let this = self;
255 unsafe {
256 let mut result__ = ::std::mem::zeroed();
257 (::windows_core::Interface::vtable(this).Size)(
258 ::windows_core::Interface::as_raw(this),
259 &mut result__,
260 )
261 .from_abi(result__)
262 }
263 }
264 pub fn IndexOf<P0>(&self, value: P0, index: &mut u32) -> ::windows_core::Result<bool>
265 where
266 P0: ::windows_core::IntoParam<T>,
267 {
268 let this = self;
269 unsafe {
270 let mut result__ = ::std::mem::zeroed();
271 (::windows_core::Interface::vtable(this).IndexOf)(
272 ::windows_core::Interface::as_raw(this),
273 value.into_param().abi(),
274 index,
275 &mut result__,
276 )
277 .from_abi(result__)
278 }
279 }
280 pub fn GetMany(
281 &self,
282 startindex: u32,
283 items: &mut [<T as ::windows_core::Type<T>>::Default],
284 ) -> ::windows_core::Result<u32> {
285 let this = self;
286 unsafe {
287 let mut result__ = ::std::mem::zeroed();
288 (::windows_core::Interface::vtable(this).GetMany)(
289 ::windows_core::Interface::as_raw(this),
290 startindex,
291 items.len() as u32,
292 ::core::mem::transmute_copy(&items),
293 &mut result__,
294 )
295 .from_abi(result__)
296 }
297 }
298 pub fn First(&self) -> ::windows_core::Result<IIterator<T>> {
299 let this = &::windows_core::ComInterface::cast::<IIterable<T>>(self)?;
300 unsafe {
301 let mut result__ = ::std::mem::zeroed();
302 (::windows_core::Interface::vtable(this).First)(
303 ::windows_core::Interface::as_raw(this),
304 &mut result__,
305 )
306 .from_abi(result__)
307 }
308 }
309 }
310 impl<T: ::windows_core::RuntimeType + 'static>
311 ::windows_core::CanInto<::windows_core::IUnknown> for IVectorView<T>
312 {
313 }
314 impl<T: ::windows_core::RuntimeType + 'static>
315 ::windows_core::CanInto<::windows_core::IInspectable> for IVectorView<T>
316 {
317 }
318 impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::CanTryInto<IIterable<T>>
319 for IVectorView<T>
320 {
321 }
322 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::PartialEq for IVectorView<T> {
323 fn eq(&self, other: &Self) -> bool {
324 self.0 == other.0
325 }
326 }
327 impl<T: ::windows_core::RuntimeType + 'static> ::core::cmp::Eq for IVectorView<T> {}
328 impl<T: ::windows_core::RuntimeType + 'static> ::core::fmt::Debug for IVectorView<T> {
329 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
330 f.debug_tuple("IVectorView").field(&self.0).finish()
331 }
332 }
333 impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::RuntimeType for IVectorView<T> {
334 const SIGNATURE: ::windows_core::imp::ConstBuffer = {
335 ::windows_core::imp::ConstBuffer::new()
336 .push_slice(b"pinterface(")
337 .push_slice(b"{bbe1fa4c-b0e3-4583-baef-1f1b2e483e56}")
338 .push_slice(b";")
339 .push_other(<T as ::windows_core::RuntimeType>::SIGNATURE)
340 .push_slice(b")")
341 };
342 }
343 pub struct VectorViewIterator<T: ::windows_core::RuntimeType + 'static> {
344 vector: ::core::option::Option<IVectorView<T>>,
345 current: u32,
346 }
347 impl<T: ::windows_core::RuntimeType> VectorViewIterator<T> {
348 pub fn new(vector: ::core::option::Option<IVectorView<T>>) -> Self {
349 Self { vector, current: 0 }
350 }
351 }
352 impl<T: ::windows_core::RuntimeType> ::core::iter::Iterator for VectorViewIterator<T> {
353 type Item = T;
354 fn next(&mut self) -> ::core::option::Option<Self::Item> {
355 self.vector
356 .as_ref()
357 .and_then(|vector| vector.GetAt(self.current).ok())
358 .and_then(|result| {
359 self.current += 1;
360 Some(result)
361 })
362 }
363 }
364 impl<T: ::windows_core::RuntimeType> ::core::iter::IntoIterator for IVectorView<T> {
365 type Item = T;
366 type IntoIter = VectorViewIterator<Self::Item>;
367 fn into_iter(self) -> Self::IntoIter {
368 ::core::iter::IntoIterator::into_iter(&self)
369 }
370 }
371 impl<T: ::windows_core::RuntimeType> ::core::iter::IntoIterator for &IVectorView<T> {
372 type Item = T;
373 type IntoIter = VectorViewIterator<Self::Item>;
374 fn into_iter(self) -> Self::IntoIter {
375 VectorViewIterator::new(::core::option::Option::Some(::core::clone::Clone::clone(
376 self,
377 )))
378 }
379 }
380 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::Interface for IVectorView<T> {
381 type Vtable = IVectorView_Vtbl<T>;
382 }
383 impl<T: ::windows_core::RuntimeType + 'static> ::core::clone::Clone for IVectorView<T> {
384 fn clone(&self) -> Self {
385 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
386 }
387 }
388 unsafe impl<T: ::windows_core::RuntimeType + 'static> ::windows_core::ComInterface
389 for IVectorView<T>
390 {
391 const IID: ::windows_core::GUID = ::windows_core::GUID::from_signature(
392 <Self as ::windows_core::RuntimeType>::SIGNATURE,
393 );
394 }
395 #[repr(C)]
396 #[doc(hidden)]
397 pub struct IVectorView_Vtbl<T>
398 where
399 T: ::windows_core::RuntimeType + 'static,
400 {
401 pub base__: ::windows_core::IInspectable_Vtbl,
402 pub GetAt: unsafe extern "system" fn(
403 this: *mut ::core::ffi::c_void,
404 index: u32,
405 result__: *mut ::windows_core::AbiType<T>,
406 ) -> ::windows_core::HRESULT,
407 pub Size: unsafe extern "system" fn(
408 this: *mut ::core::ffi::c_void,
409 result__: *mut u32,
410 ) -> ::windows_core::HRESULT,
411 pub IndexOf: unsafe extern "system" fn(
412 this: *mut ::core::ffi::c_void,
413 value: ::windows_core::AbiType<T>,
414 index: *mut u32,
415 result__: *mut bool,
416 ) -> ::windows_core::HRESULT,
417 pub GetMany: unsafe extern "system" fn(
418 this: *mut ::core::ffi::c_void,
419 startindex: u32,
420 items_array_size: u32,
421 items: *mut ::windows_core::AbiType<T>,
422 result__: *mut u32,
423 ) -> ::windows_core::HRESULT,
424 pub T: ::core::marker::PhantomData<T>,
425 }
426 }
427 #[repr(C)]
428 pub struct DateTime {
429 pub UniversalTime: i64,
430 }
431 impl ::core::marker::Copy for DateTime {}
432 impl ::core::clone::Clone for DateTime {
433 fn clone(&self) -> Self {
434 *self
435 }
436 }
437 impl ::core::fmt::Debug for DateTime {
438 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
439 f.debug_struct("DateTime")
440 .field("UniversalTime", &self.UniversalTime)
441 .finish()
442 }
443 }
444 impl ::windows_core::TypeKind for DateTime {
445 type TypeKind = ::windows_core::CopyType;
446 }
447 impl ::windows_core::RuntimeType for DateTime {
448 const SIGNATURE: ::windows_core::imp::ConstBuffer =
449 ::windows_core::imp::ConstBuffer::from_slice(b"struct(Windows.Foundation.DateTime;i8)");
450 }
451 impl ::core::cmp::PartialEq for DateTime {
452 fn eq(&self, other: &Self) -> bool {
453 self.UniversalTime == other.UniversalTime
454 }
455 }
456 impl ::core::cmp::Eq for DateTime {}
457 impl ::core::default::Default for DateTime {
458 fn default() -> Self {
459 unsafe { ::core::mem::zeroed() }
460 }
461 }
462 #[repr(C)]
463 pub struct TimeSpan {
464 pub Duration: i64,
465 }
466 impl ::core::marker::Copy for TimeSpan {}
467 impl ::core::clone::Clone for TimeSpan {
468 fn clone(&self) -> Self {
469 *self
470 }
471 }
472 impl ::core::fmt::Debug for TimeSpan {
473 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
474 f.debug_struct("TimeSpan")
475 .field("Duration", &self.Duration)
476 .finish()
477 }
478 }
479 impl ::windows_core::TypeKind for TimeSpan {
480 type TypeKind = ::windows_core::CopyType;
481 }
482 impl ::windows_core::RuntimeType for TimeSpan {
483 const SIGNATURE: ::windows_core::imp::ConstBuffer =
484 ::windows_core::imp::ConstBuffer::from_slice(b"struct(Windows.Foundation.TimeSpan;i8)");
485 }
486 impl ::core::cmp::PartialEq for TimeSpan {
487 fn eq(&self, other: &Self) -> bool {
488 self.Duration == other.Duration
489 }
490 }
491 impl ::core::cmp::Eq for TimeSpan {}
492 impl ::core::default::Default for TimeSpan {
493 fn default() -> Self {
494 unsafe { ::core::mem::zeroed() }
495 }
496 }
497 impl ::core::convert::From<::core::time::Duration> for TimeSpan {
498 fn from(value: ::core::time::Duration) -> Self {
499 Self {
500 Duration: (value.as_nanos() / 100) as i64,
501 }
502 }
503 }
504 impl ::core::convert::From<TimeSpan> for ::core::time::Duration {
505 fn from(value: TimeSpan) -> Self {
506 ::core::time::Duration::from_nanos((value.Duration * 100) as u64)
507 }
508 }
509 }
510 pub mod Globalization {
511 #[doc(hidden)]
512 #[repr(transparent)]
513 pub struct ICalendar(::windows_core::IUnknown);
514 unsafe impl ::windows_core::Interface for ICalendar {
515 type Vtable = ICalendar_Vtbl;
516 }
517 impl ::core::clone::Clone for ICalendar {
518 fn clone(&self) -> Self {
519 Self(self.0.clone())
520 }
521 }
522 unsafe impl ::windows_core::ComInterface for ICalendar {
523 const IID: ::windows_core::GUID =
524 ::windows_core::GUID::from_u128(0xca30221d_86d9_40fb_a26b_d44eb7cf08ea);
525 }
526 #[repr(C)]
527 #[doc(hidden)]
528 pub struct ICalendar_Vtbl {
529 pub base__: ::windows_core::IInspectable_Vtbl,
530 pub Clone: unsafe extern "system" fn(
531 this: *mut ::core::ffi::c_void,
532 result__: *mut *mut ::core::ffi::c_void,
533 ) -> ::windows_core::HRESULT,
534 pub SetToMin:
535 unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
536 pub SetToMax:
537 unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
538 pub Languages: unsafe extern "system" fn(
539 this: *mut ::core::ffi::c_void,
540 result__: *mut *mut ::core::ffi::c_void,
541 ) -> ::windows_core::HRESULT,
542 pub NumeralSystem: unsafe extern "system" fn(
543 this: *mut ::core::ffi::c_void,
544 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
545 ) -> ::windows_core::HRESULT,
546 pub SetNumeralSystem: unsafe extern "system" fn(
547 this: *mut ::core::ffi::c_void,
548 value: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
549 ) -> ::windows_core::HRESULT,
550 pub GetCalendarSystem: unsafe extern "system" fn(
551 this: *mut ::core::ffi::c_void,
552 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
553 ) -> ::windows_core::HRESULT,
554 pub ChangeCalendarSystem: unsafe extern "system" fn(
555 this: *mut ::core::ffi::c_void,
556 value: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
557 ) -> ::windows_core::HRESULT,
558 pub GetClock: unsafe extern "system" fn(
559 this: *mut ::core::ffi::c_void,
560 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
561 ) -> ::windows_core::HRESULT,
562 pub ChangeClock: unsafe extern "system" fn(
563 this: *mut ::core::ffi::c_void,
564 value: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
565 ) -> ::windows_core::HRESULT,
566 pub GetDateTime: unsafe extern "system" fn(
567 this: *mut ::core::ffi::c_void,
568 result__: *mut super::Foundation::DateTime,
569 ) -> ::windows_core::HRESULT,
570 pub SetDateTime: unsafe extern "system" fn(
571 this: *mut ::core::ffi::c_void,
572 value: super::Foundation::DateTime,
573 ) -> ::windows_core::HRESULT,
574 pub SetToNow:
575 unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
576 pub FirstEra: unsafe extern "system" fn(
577 this: *mut ::core::ffi::c_void,
578 result__: *mut i32,
579 ) -> ::windows_core::HRESULT,
580 pub LastEra: unsafe extern "system" fn(
581 this: *mut ::core::ffi::c_void,
582 result__: *mut i32,
583 ) -> ::windows_core::HRESULT,
584 pub NumberOfEras: unsafe extern "system" fn(
585 this: *mut ::core::ffi::c_void,
586 result__: *mut i32,
587 ) -> ::windows_core::HRESULT,
588 pub Era: unsafe extern "system" fn(
589 this: *mut ::core::ffi::c_void,
590 result__: *mut i32,
591 ) -> ::windows_core::HRESULT,
592 pub SetEra: unsafe extern "system" fn(
593 this: *mut ::core::ffi::c_void,
594 value: i32,
595 ) -> ::windows_core::HRESULT,
596 pub AddEras: unsafe extern "system" fn(
597 this: *mut ::core::ffi::c_void,
598 eras: i32,
599 ) -> ::windows_core::HRESULT,
600 pub EraAsFullString: unsafe extern "system" fn(
601 this: *mut ::core::ffi::c_void,
602 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
603 ) -> ::windows_core::HRESULT,
604 pub EraAsString: unsafe extern "system" fn(
605 this: *mut ::core::ffi::c_void,
606 ideallength: i32,
607 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
608 ) -> ::windows_core::HRESULT,
609 pub FirstYearInThisEra: unsafe extern "system" fn(
610 this: *mut ::core::ffi::c_void,
611 result__: *mut i32,
612 ) -> ::windows_core::HRESULT,
613 pub LastYearInThisEra: unsafe extern "system" fn(
614 this: *mut ::core::ffi::c_void,
615 result__: *mut i32,
616 ) -> ::windows_core::HRESULT,
617 pub NumberOfYearsInThisEra: unsafe extern "system" fn(
618 this: *mut ::core::ffi::c_void,
619 result__: *mut i32,
620 ) -> ::windows_core::HRESULT,
621 pub Year: unsafe extern "system" fn(
622 this: *mut ::core::ffi::c_void,
623 result__: *mut i32,
624 ) -> ::windows_core::HRESULT,
625 pub SetYear: unsafe extern "system" fn(
626 this: *mut ::core::ffi::c_void,
627 value: i32,
628 ) -> ::windows_core::HRESULT,
629 pub AddYears: unsafe extern "system" fn(
630 this: *mut ::core::ffi::c_void,
631 years: i32,
632 ) -> ::windows_core::HRESULT,
633 pub YearAsString: unsafe extern "system" fn(
634 this: *mut ::core::ffi::c_void,
635 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
636 ) -> ::windows_core::HRESULT,
637 pub YearAsTruncatedString: unsafe extern "system" fn(
638 this: *mut ::core::ffi::c_void,
639 remainingdigits: i32,
640 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
641 ) -> ::windows_core::HRESULT,
642 pub YearAsPaddedString: unsafe extern "system" fn(
643 this: *mut ::core::ffi::c_void,
644 mindigits: i32,
645 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
646 ) -> ::windows_core::HRESULT,
647 pub FirstMonthInThisYear: unsafe extern "system" fn(
648 this: *mut ::core::ffi::c_void,
649 result__: *mut i32,
650 ) -> ::windows_core::HRESULT,
651 pub LastMonthInThisYear: unsafe extern "system" fn(
652 this: *mut ::core::ffi::c_void,
653 result__: *mut i32,
654 ) -> ::windows_core::HRESULT,
655 pub NumberOfMonthsInThisYear: unsafe extern "system" fn(
656 this: *mut ::core::ffi::c_void,
657 result__: *mut i32,
658 ) -> ::windows_core::HRESULT,
659 pub Month: unsafe extern "system" fn(
660 this: *mut ::core::ffi::c_void,
661 result__: *mut i32,
662 ) -> ::windows_core::HRESULT,
663 pub SetMonth: unsafe extern "system" fn(
664 this: *mut ::core::ffi::c_void,
665 value: i32,
666 ) -> ::windows_core::HRESULT,
667 pub AddMonths: unsafe extern "system" fn(
668 this: *mut ::core::ffi::c_void,
669 months: i32,
670 ) -> ::windows_core::HRESULT,
671 pub MonthAsFullString: unsafe extern "system" fn(
672 this: *mut ::core::ffi::c_void,
673 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
674 ) -> ::windows_core::HRESULT,
675 pub MonthAsString: unsafe extern "system" fn(
676 this: *mut ::core::ffi::c_void,
677 ideallength: i32,
678 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
679 ) -> ::windows_core::HRESULT,
680 pub MonthAsFullSoloString: unsafe extern "system" fn(
681 this: *mut ::core::ffi::c_void,
682 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
683 ) -> ::windows_core::HRESULT,
684 pub MonthAsSoloString: unsafe extern "system" fn(
685 this: *mut ::core::ffi::c_void,
686 ideallength: i32,
687 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
688 ) -> ::windows_core::HRESULT,
689 pub MonthAsNumericString: unsafe extern "system" fn(
690 this: *mut ::core::ffi::c_void,
691 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
692 ) -> ::windows_core::HRESULT,
693 pub MonthAsPaddedNumericString: unsafe extern "system" fn(
694 this: *mut ::core::ffi::c_void,
695 mindigits: i32,
696 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
697 )
698 -> ::windows_core::HRESULT,
699 pub AddWeeks: unsafe extern "system" fn(
700 this: *mut ::core::ffi::c_void,
701 weeks: i32,
702 ) -> ::windows_core::HRESULT,
703 pub FirstDayInThisMonth: unsafe extern "system" fn(
704 this: *mut ::core::ffi::c_void,
705 result__: *mut i32,
706 ) -> ::windows_core::HRESULT,
707 pub LastDayInThisMonth: unsafe extern "system" fn(
708 this: *mut ::core::ffi::c_void,
709 result__: *mut i32,
710 ) -> ::windows_core::HRESULT,
711 pub NumberOfDaysInThisMonth: unsafe extern "system" fn(
712 this: *mut ::core::ffi::c_void,
713 result__: *mut i32,
714 ) -> ::windows_core::HRESULT,
715 pub Day: unsafe extern "system" fn(
716 this: *mut ::core::ffi::c_void,
717 result__: *mut i32,
718 ) -> ::windows_core::HRESULT,
719 pub SetDay: unsafe extern "system" fn(
720 this: *mut ::core::ffi::c_void,
721 value: i32,
722 ) -> ::windows_core::HRESULT,
723 pub AddDays: unsafe extern "system" fn(
724 this: *mut ::core::ffi::c_void,
725 days: i32,
726 ) -> ::windows_core::HRESULT,
727 pub DayAsString: unsafe extern "system" fn(
728 this: *mut ::core::ffi::c_void,
729 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
730 ) -> ::windows_core::HRESULT,
731 pub DayAsPaddedString: unsafe extern "system" fn(
732 this: *mut ::core::ffi::c_void,
733 mindigits: i32,
734 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
735 ) -> ::windows_core::HRESULT,
736 pub DayOfWeek: unsafe extern "system" fn(
737 this: *mut ::core::ffi::c_void,
738 result__: *mut DayOfWeek,
739 ) -> ::windows_core::HRESULT,
740 pub DayOfWeekAsFullString: unsafe extern "system" fn(
741 this: *mut ::core::ffi::c_void,
742 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
743 ) -> ::windows_core::HRESULT,
744 pub DayOfWeekAsString: unsafe extern "system" fn(
745 this: *mut ::core::ffi::c_void,
746 ideallength: i32,
747 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
748 ) -> ::windows_core::HRESULT,
749 pub DayOfWeekAsFullSoloString: unsafe extern "system" fn(
750 this: *mut ::core::ffi::c_void,
751 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
752 )
753 -> ::windows_core::HRESULT,
754 pub DayOfWeekAsSoloString: unsafe extern "system" fn(
755 this: *mut ::core::ffi::c_void,
756 ideallength: i32,
757 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
758 ) -> ::windows_core::HRESULT,
759 pub FirstPeriodInThisDay: unsafe extern "system" fn(
760 this: *mut ::core::ffi::c_void,
761 result__: *mut i32,
762 ) -> ::windows_core::HRESULT,
763 pub LastPeriodInThisDay: unsafe extern "system" fn(
764 this: *mut ::core::ffi::c_void,
765 result__: *mut i32,
766 ) -> ::windows_core::HRESULT,
767 pub NumberOfPeriodsInThisDay: unsafe extern "system" fn(
768 this: *mut ::core::ffi::c_void,
769 result__: *mut i32,
770 ) -> ::windows_core::HRESULT,
771 pub Period: unsafe extern "system" fn(
772 this: *mut ::core::ffi::c_void,
773 result__: *mut i32,
774 ) -> ::windows_core::HRESULT,
775 pub SetPeriod: unsafe extern "system" fn(
776 this: *mut ::core::ffi::c_void,
777 value: i32,
778 ) -> ::windows_core::HRESULT,
779 pub AddPeriods: unsafe extern "system" fn(
780 this: *mut ::core::ffi::c_void,
781 periods: i32,
782 ) -> ::windows_core::HRESULT,
783 pub PeriodAsFullString: unsafe extern "system" fn(
784 this: *mut ::core::ffi::c_void,
785 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
786 ) -> ::windows_core::HRESULT,
787 pub PeriodAsString: unsafe extern "system" fn(
788 this: *mut ::core::ffi::c_void,
789 ideallength: i32,
790 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
791 ) -> ::windows_core::HRESULT,
792 pub FirstHourInThisPeriod: unsafe extern "system" fn(
793 this: *mut ::core::ffi::c_void,
794 result__: *mut i32,
795 ) -> ::windows_core::HRESULT,
796 pub LastHourInThisPeriod: unsafe extern "system" fn(
797 this: *mut ::core::ffi::c_void,
798 result__: *mut i32,
799 ) -> ::windows_core::HRESULT,
800 pub NumberOfHoursInThisPeriod: unsafe extern "system" fn(
801 this: *mut ::core::ffi::c_void,
802 result__: *mut i32,
803 )
804 -> ::windows_core::HRESULT,
805 pub Hour: unsafe extern "system" fn(
806 this: *mut ::core::ffi::c_void,
807 result__: *mut i32,
808 ) -> ::windows_core::HRESULT,
809 pub SetHour: unsafe extern "system" fn(
810 this: *mut ::core::ffi::c_void,
811 value: i32,
812 ) -> ::windows_core::HRESULT,
813 pub AddHours: unsafe extern "system" fn(
814 this: *mut ::core::ffi::c_void,
815 hours: i32,
816 ) -> ::windows_core::HRESULT,
817 pub HourAsString: unsafe extern "system" fn(
818 this: *mut ::core::ffi::c_void,
819 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
820 ) -> ::windows_core::HRESULT,
821 pub HourAsPaddedString: unsafe extern "system" fn(
822 this: *mut ::core::ffi::c_void,
823 mindigits: i32,
824 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
825 ) -> ::windows_core::HRESULT,
826 pub Minute: unsafe extern "system" fn(
827 this: *mut ::core::ffi::c_void,
828 result__: *mut i32,
829 ) -> ::windows_core::HRESULT,
830 pub SetMinute: unsafe extern "system" fn(
831 this: *mut ::core::ffi::c_void,
832 value: i32,
833 ) -> ::windows_core::HRESULT,
834 pub AddMinutes: unsafe extern "system" fn(
835 this: *mut ::core::ffi::c_void,
836 minutes: i32,
837 ) -> ::windows_core::HRESULT,
838 pub MinuteAsString: unsafe extern "system" fn(
839 this: *mut ::core::ffi::c_void,
840 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
841 ) -> ::windows_core::HRESULT,
842 pub MinuteAsPaddedString: unsafe extern "system" fn(
843 this: *mut ::core::ffi::c_void,
844 mindigits: i32,
845 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
846 ) -> ::windows_core::HRESULT,
847 pub Second: unsafe extern "system" fn(
848 this: *mut ::core::ffi::c_void,
849 result__: *mut i32,
850 ) -> ::windows_core::HRESULT,
851 pub SetSecond: unsafe extern "system" fn(
852 this: *mut ::core::ffi::c_void,
853 value: i32,
854 ) -> ::windows_core::HRESULT,
855 pub AddSeconds: unsafe extern "system" fn(
856 this: *mut ::core::ffi::c_void,
857 seconds: i32,
858 ) -> ::windows_core::HRESULT,
859 pub SecondAsString: unsafe extern "system" fn(
860 this: *mut ::core::ffi::c_void,
861 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
862 ) -> ::windows_core::HRESULT,
863 pub SecondAsPaddedString: unsafe extern "system" fn(
864 this: *mut ::core::ffi::c_void,
865 mindigits: i32,
866 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
867 ) -> ::windows_core::HRESULT,
868 pub Nanosecond: unsafe extern "system" fn(
869 this: *mut ::core::ffi::c_void,
870 result__: *mut i32,
871 ) -> ::windows_core::HRESULT,
872 pub SetNanosecond: unsafe extern "system" fn(
873 this: *mut ::core::ffi::c_void,
874 value: i32,
875 ) -> ::windows_core::HRESULT,
876 pub AddNanoseconds: unsafe extern "system" fn(
877 this: *mut ::core::ffi::c_void,
878 nanoseconds: i32,
879 ) -> ::windows_core::HRESULT,
880 pub NanosecondAsString: unsafe extern "system" fn(
881 this: *mut ::core::ffi::c_void,
882 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
883 ) -> ::windows_core::HRESULT,
884 pub NanosecondAsPaddedString: unsafe extern "system" fn(
885 this: *mut ::core::ffi::c_void,
886 mindigits: i32,
887 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
888 ) -> ::windows_core::HRESULT,
889 pub Compare: unsafe extern "system" fn(
890 this: *mut ::core::ffi::c_void,
891 other: *mut ::core::ffi::c_void,
892 result__: *mut i32,
893 ) -> ::windows_core::HRESULT,
894 pub CompareDateTime: unsafe extern "system" fn(
895 this: *mut ::core::ffi::c_void,
896 other: super::Foundation::DateTime,
897 result__: *mut i32,
898 ) -> ::windows_core::HRESULT,
899 pub CopyTo: unsafe extern "system" fn(
900 this: *mut ::core::ffi::c_void,
901 other: *mut ::core::ffi::c_void,
902 ) -> ::windows_core::HRESULT,
903 pub FirstMinuteInThisHour: unsafe extern "system" fn(
904 this: *mut ::core::ffi::c_void,
905 result__: *mut i32,
906 ) -> ::windows_core::HRESULT,
907 pub LastMinuteInThisHour: unsafe extern "system" fn(
908 this: *mut ::core::ffi::c_void,
909 result__: *mut i32,
910 ) -> ::windows_core::HRESULT,
911 pub NumberOfMinutesInThisHour: unsafe extern "system" fn(
912 this: *mut ::core::ffi::c_void,
913 result__: *mut i32,
914 )
915 -> ::windows_core::HRESULT,
916 pub FirstSecondInThisMinute: unsafe extern "system" fn(
917 this: *mut ::core::ffi::c_void,
918 result__: *mut i32,
919 ) -> ::windows_core::HRESULT,
920 pub LastSecondInThisMinute: unsafe extern "system" fn(
921 this: *mut ::core::ffi::c_void,
922 result__: *mut i32,
923 ) -> ::windows_core::HRESULT,
924 pub NumberOfSecondsInThisMinute: unsafe extern "system" fn(
925 this: *mut ::core::ffi::c_void,
926 result__: *mut i32,
927 )
928 -> ::windows_core::HRESULT,
929 pub ResolvedLanguage: unsafe extern "system" fn(
930 this: *mut ::core::ffi::c_void,
931 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
932 ) -> ::windows_core::HRESULT,
933 pub IsDaylightSavingTime: unsafe extern "system" fn(
934 this: *mut ::core::ffi::c_void,
935 result__: *mut bool,
936 ) -> ::windows_core::HRESULT,
937 }
938 #[doc(hidden)]
939 #[repr(transparent)]
940 pub struct ICalendarFactory(::windows_core::IUnknown);
941 unsafe impl ::windows_core::Interface for ICalendarFactory {
942 type Vtable = ICalendarFactory_Vtbl;
943 }
944 impl ::core::clone::Clone for ICalendarFactory {
945 fn clone(&self) -> Self {
946 Self(self.0.clone())
947 }
948 }
949 unsafe impl ::windows_core::ComInterface for ICalendarFactory {
950 const IID: ::windows_core::GUID =
951 ::windows_core::GUID::from_u128(0x83f58412_e56b_4c75_a66e_0f63d57758a6);
952 }
953 #[repr(C)]
954 #[doc(hidden)]
955 pub struct ICalendarFactory_Vtbl {
956 pub base__: ::windows_core::IInspectable_Vtbl,
957 pub CreateCalendarDefaultCalendarAndClock:
958 unsafe extern "system" fn(
959 this: *mut ::core::ffi::c_void,
960 languages: *mut ::core::ffi::c_void,
961 result__: *mut *mut ::core::ffi::c_void,
962 ) -> ::windows_core::HRESULT,
963 pub CreateCalendar: unsafe extern "system" fn(
964 this: *mut ::core::ffi::c_void,
965 languages: *mut ::core::ffi::c_void,
966 calendar: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
967 clock: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
968 result__: *mut *mut ::core::ffi::c_void,
969 ) -> ::windows_core::HRESULT,
970 }
971 #[doc(hidden)]
972 #[repr(transparent)]
973 pub struct ICalendarFactory2(::windows_core::IUnknown);
974 unsafe impl ::windows_core::Interface for ICalendarFactory2 {
975 type Vtable = ICalendarFactory2_Vtbl;
976 }
977 impl ::core::clone::Clone for ICalendarFactory2 {
978 fn clone(&self) -> Self {
979 Self(self.0.clone())
980 }
981 }
982 unsafe impl ::windows_core::ComInterface for ICalendarFactory2 {
983 const IID: ::windows_core::GUID =
984 ::windows_core::GUID::from_u128(0xb44b378c_ca7e_4590_9e72_ea2bec1a5115);
985 }
986 #[repr(C)]
987 #[doc(hidden)]
988 pub struct ICalendarFactory2_Vtbl {
989 pub base__: ::windows_core::IInspectable_Vtbl,
990 pub CreateCalendarWithTimeZone: unsafe extern "system" fn(
991 this: *mut ::core::ffi::c_void,
992 languages: *mut ::core::ffi::c_void,
993 calendar: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
994 clock: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
995 timezoneid: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
996 result__: *mut *mut ::core::ffi::c_void,
997 )
998 -> ::windows_core::HRESULT,
999 }
1000 #[doc(hidden)]
1001 #[repr(transparent)]
1002 pub struct ITimeZoneOnCalendar(::windows_core::IUnknown);
1003 unsafe impl ::windows_core::Interface for ITimeZoneOnCalendar {
1004 type Vtable = ITimeZoneOnCalendar_Vtbl;
1005 }
1006 impl ::core::clone::Clone for ITimeZoneOnCalendar {
1007 fn clone(&self) -> Self {
1008 Self(self.0.clone())
1009 }
1010 }
1011 unsafe impl ::windows_core::ComInterface for ITimeZoneOnCalendar {
1012 const IID: ::windows_core::GUID =
1013 ::windows_core::GUID::from_u128(0xbb3c25e5_46cf_4317_a3f5_02621ad54478);
1014 }
1015 #[repr(C)]
1016 #[doc(hidden)]
1017 pub struct ITimeZoneOnCalendar_Vtbl {
1018 pub base__: ::windows_core::IInspectable_Vtbl,
1019 pub GetTimeZone: unsafe extern "system" fn(
1020 this: *mut ::core::ffi::c_void,
1021 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
1022 ) -> ::windows_core::HRESULT,
1023 pub ChangeTimeZone: unsafe extern "system" fn(
1024 this: *mut ::core::ffi::c_void,
1025 timezoneid: ::std::mem::MaybeUninit<::windows_core::HSTRING>,
1026 ) -> ::windows_core::HRESULT,
1027 pub TimeZoneAsFullString: unsafe extern "system" fn(
1028 this: *mut ::core::ffi::c_void,
1029 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
1030 ) -> ::windows_core::HRESULT,
1031 pub TimeZoneAsString: unsafe extern "system" fn(
1032 this: *mut ::core::ffi::c_void,
1033 ideallength: i32,
1034 result__: *mut ::std::mem::MaybeUninit<::windows_core::HSTRING>,
1035 ) -> ::windows_core::HRESULT,
1036 }
1037 #[repr(transparent)]
1038 pub struct Calendar(::windows_core::IUnknown);
1039 impl Calendar {
1040 pub fn new() -> ::windows_core::Result<Self> {
1041 Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
1042 }
1043 fn IActivationFactory<
1044 R,
1045 F: FnOnce(&::windows_core::imp::IGenericFactory) -> ::windows_core::Result<R>,
1046 >(
1047 callback: F,
1048 ) -> ::windows_core::Result<R> {
1049 static SHARED: ::windows_core::imp::FactoryCache<
1050 Calendar,
1051 ::windows_core::imp::IGenericFactory,
1052 > = ::windows_core::imp::FactoryCache::new();
1053 SHARED.call(callback)
1054 }
1055 pub fn Clone(&self) -> ::windows_core::Result<Calendar> {
1056 let this = self;
1057 unsafe {
1058 let mut result__ = ::std::mem::zeroed();
1059 (::windows_core::Interface::vtable(this).Clone)(
1060 ::windows_core::Interface::as_raw(this),
1061 &mut result__,
1062 )
1063 .from_abi(result__)
1064 }
1065 }
1066 pub fn SetToMin(&self) -> ::windows_core::Result<()> {
1067 let this = self;
1068 unsafe {
1069 (::windows_core::Interface::vtable(this).SetToMin)(
1070 ::windows_core::Interface::as_raw(this),
1071 )
1072 .ok()
1073 }
1074 }
1075 pub fn SetToMax(&self) -> ::windows_core::Result<()> {
1076 let this = self;
1077 unsafe {
1078 (::windows_core::Interface::vtable(this).SetToMax)(
1079 ::windows_core::Interface::as_raw(this),
1080 )
1081 .ok()
1082 }
1083 }
1084 pub fn Languages(
1085 &self,
1086 ) -> ::windows_core::Result<
1087 super::Foundation::Collections::IVectorView<::windows_core::HSTRING>,
1088 > {
1089 let this = self;
1090 unsafe {
1091 let mut result__ = ::std::mem::zeroed();
1092 (::windows_core::Interface::vtable(this).Languages)(
1093 ::windows_core::Interface::as_raw(this),
1094 &mut result__,
1095 )
1096 .from_abi(result__)
1097 }
1098 }
1099 pub fn NumeralSystem(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1100 let this = self;
1101 unsafe {
1102 let mut result__ = ::std::mem::zeroed();
1103 (::windows_core::Interface::vtable(this).NumeralSystem)(
1104 ::windows_core::Interface::as_raw(this),
1105 &mut result__,
1106 )
1107 .from_abi(result__)
1108 }
1109 }
1110 pub fn SetNumeralSystem(
1111 &self,
1112 value: &::windows_core::HSTRING,
1113 ) -> ::windows_core::Result<()> {
1114 let this = self;
1115 unsafe {
1116 (::windows_core::Interface::vtable(this).SetNumeralSystem)(
1117 ::windows_core::Interface::as_raw(this),
1118 ::core::mem::transmute_copy(value),
1119 )
1120 .ok()
1121 }
1122 }
1123 pub fn GetCalendarSystem(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1124 let this = self;
1125 unsafe {
1126 let mut result__ = ::std::mem::zeroed();
1127 (::windows_core::Interface::vtable(this).GetCalendarSystem)(
1128 ::windows_core::Interface::as_raw(this),
1129 &mut result__,
1130 )
1131 .from_abi(result__)
1132 }
1133 }
1134 pub fn ChangeCalendarSystem(
1135 &self,
1136 value: &::windows_core::HSTRING,
1137 ) -> ::windows_core::Result<()> {
1138 let this = self;
1139 unsafe {
1140 (::windows_core::Interface::vtable(this).ChangeCalendarSystem)(
1141 ::windows_core::Interface::as_raw(this),
1142 ::core::mem::transmute_copy(value),
1143 )
1144 .ok()
1145 }
1146 }
1147 pub fn GetClock(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1148 let this = self;
1149 unsafe {
1150 let mut result__ = ::std::mem::zeroed();
1151 (::windows_core::Interface::vtable(this).GetClock)(
1152 ::windows_core::Interface::as_raw(this),
1153 &mut result__,
1154 )
1155 .from_abi(result__)
1156 }
1157 }
1158 pub fn ChangeClock(&self, value: &::windows_core::HSTRING) -> ::windows_core::Result<()> {
1159 let this = self;
1160 unsafe {
1161 (::windows_core::Interface::vtable(this).ChangeClock)(
1162 ::windows_core::Interface::as_raw(this),
1163 ::core::mem::transmute_copy(value),
1164 )
1165 .ok()
1166 }
1167 }
1168 pub fn GetDateTime(&self) -> ::windows_core::Result<super::Foundation::DateTime> {
1169 let this = self;
1170 unsafe {
1171 let mut result__ = ::std::mem::zeroed();
1172 (::windows_core::Interface::vtable(this).GetDateTime)(
1173 ::windows_core::Interface::as_raw(this),
1174 &mut result__,
1175 )
1176 .from_abi(result__)
1177 }
1178 }
1179 pub fn SetDateTime(
1180 &self,
1181 value: super::Foundation::DateTime,
1182 ) -> ::windows_core::Result<()> {
1183 let this = self;
1184 unsafe {
1185 (::windows_core::Interface::vtable(this).SetDateTime)(
1186 ::windows_core::Interface::as_raw(this),
1187 value,
1188 )
1189 .ok()
1190 }
1191 }
1192 pub fn SetToNow(&self) -> ::windows_core::Result<()> {
1193 let this = self;
1194 unsafe {
1195 (::windows_core::Interface::vtable(this).SetToNow)(
1196 ::windows_core::Interface::as_raw(this),
1197 )
1198 .ok()
1199 }
1200 }
1201 pub fn FirstEra(&self) -> ::windows_core::Result<i32> {
1202 let this = self;
1203 unsafe {
1204 let mut result__ = ::std::mem::zeroed();
1205 (::windows_core::Interface::vtable(this).FirstEra)(
1206 ::windows_core::Interface::as_raw(this),
1207 &mut result__,
1208 )
1209 .from_abi(result__)
1210 }
1211 }
1212 pub fn LastEra(&self) -> ::windows_core::Result<i32> {
1213 let this = self;
1214 unsafe {
1215 let mut result__ = ::std::mem::zeroed();
1216 (::windows_core::Interface::vtable(this).LastEra)(
1217 ::windows_core::Interface::as_raw(this),
1218 &mut result__,
1219 )
1220 .from_abi(result__)
1221 }
1222 }
1223 pub fn NumberOfEras(&self) -> ::windows_core::Result<i32> {
1224 let this = self;
1225 unsafe {
1226 let mut result__ = ::std::mem::zeroed();
1227 (::windows_core::Interface::vtable(this).NumberOfEras)(
1228 ::windows_core::Interface::as_raw(this),
1229 &mut result__,
1230 )
1231 .from_abi(result__)
1232 }
1233 }
1234 pub fn Era(&self) -> ::windows_core::Result<i32> {
1235 let this = self;
1236 unsafe {
1237 let mut result__ = ::std::mem::zeroed();
1238 (::windows_core::Interface::vtable(this).Era)(
1239 ::windows_core::Interface::as_raw(this),
1240 &mut result__,
1241 )
1242 .from_abi(result__)
1243 }
1244 }
1245 pub fn SetEra(&self, value: i32) -> ::windows_core::Result<()> {
1246 let this = self;
1247 unsafe {
1248 (::windows_core::Interface::vtable(this).SetEra)(
1249 ::windows_core::Interface::as_raw(this),
1250 value,
1251 )
1252 .ok()
1253 }
1254 }
1255 pub fn AddEras(&self, eras: i32) -> ::windows_core::Result<()> {
1256 let this = self;
1257 unsafe {
1258 (::windows_core::Interface::vtable(this).AddEras)(
1259 ::windows_core::Interface::as_raw(this),
1260 eras,
1261 )
1262 .ok()
1263 }
1264 }
1265 pub fn EraAsFullString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1266 let this = self;
1267 unsafe {
1268 let mut result__ = ::std::mem::zeroed();
1269 (::windows_core::Interface::vtable(this).EraAsFullString)(
1270 ::windows_core::Interface::as_raw(this),
1271 &mut result__,
1272 )
1273 .from_abi(result__)
1274 }
1275 }
1276 pub fn EraAsString(
1277 &self,
1278 ideallength: i32,
1279 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1280 let this = self;
1281 unsafe {
1282 let mut result__ = ::std::mem::zeroed();
1283 (::windows_core::Interface::vtable(this).EraAsString)(
1284 ::windows_core::Interface::as_raw(this),
1285 ideallength,
1286 &mut result__,
1287 )
1288 .from_abi(result__)
1289 }
1290 }
1291 pub fn FirstYearInThisEra(&self) -> ::windows_core::Result<i32> {
1292 let this = self;
1293 unsafe {
1294 let mut result__ = ::std::mem::zeroed();
1295 (::windows_core::Interface::vtable(this).FirstYearInThisEra)(
1296 ::windows_core::Interface::as_raw(this),
1297 &mut result__,
1298 )
1299 .from_abi(result__)
1300 }
1301 }
1302 pub fn LastYearInThisEra(&self) -> ::windows_core::Result<i32> {
1303 let this = self;
1304 unsafe {
1305 let mut result__ = ::std::mem::zeroed();
1306 (::windows_core::Interface::vtable(this).LastYearInThisEra)(
1307 ::windows_core::Interface::as_raw(this),
1308 &mut result__,
1309 )
1310 .from_abi(result__)
1311 }
1312 }
1313 pub fn NumberOfYearsInThisEra(&self) -> ::windows_core::Result<i32> {
1314 let this = self;
1315 unsafe {
1316 let mut result__ = ::std::mem::zeroed();
1317 (::windows_core::Interface::vtable(this).NumberOfYearsInThisEra)(
1318 ::windows_core::Interface::as_raw(this),
1319 &mut result__,
1320 )
1321 .from_abi(result__)
1322 }
1323 }
1324 pub fn Year(&self) -> ::windows_core::Result<i32> {
1325 let this = self;
1326 unsafe {
1327 let mut result__ = ::std::mem::zeroed();
1328 (::windows_core::Interface::vtable(this).Year)(
1329 ::windows_core::Interface::as_raw(this),
1330 &mut result__,
1331 )
1332 .from_abi(result__)
1333 }
1334 }
1335 pub fn SetYear(&self, value: i32) -> ::windows_core::Result<()> {
1336 let this = self;
1337 unsafe {
1338 (::windows_core::Interface::vtable(this).SetYear)(
1339 ::windows_core::Interface::as_raw(this),
1340 value,
1341 )
1342 .ok()
1343 }
1344 }
1345 pub fn AddYears(&self, years: i32) -> ::windows_core::Result<()> {
1346 let this = self;
1347 unsafe {
1348 (::windows_core::Interface::vtable(this).AddYears)(
1349 ::windows_core::Interface::as_raw(this),
1350 years,
1351 )
1352 .ok()
1353 }
1354 }
1355 pub fn YearAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1356 let this = self;
1357 unsafe {
1358 let mut result__ = ::std::mem::zeroed();
1359 (::windows_core::Interface::vtable(this).YearAsString)(
1360 ::windows_core::Interface::as_raw(this),
1361 &mut result__,
1362 )
1363 .from_abi(result__)
1364 }
1365 }
1366 pub fn YearAsTruncatedString(
1367 &self,
1368 remainingdigits: i32,
1369 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1370 let this = self;
1371 unsafe {
1372 let mut result__ = ::std::mem::zeroed();
1373 (::windows_core::Interface::vtable(this).YearAsTruncatedString)(
1374 ::windows_core::Interface::as_raw(this),
1375 remainingdigits,
1376 &mut result__,
1377 )
1378 .from_abi(result__)
1379 }
1380 }
1381 pub fn YearAsPaddedString(
1382 &self,
1383 mindigits: i32,
1384 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1385 let this = self;
1386 unsafe {
1387 let mut result__ = ::std::mem::zeroed();
1388 (::windows_core::Interface::vtable(this).YearAsPaddedString)(
1389 ::windows_core::Interface::as_raw(this),
1390 mindigits,
1391 &mut result__,
1392 )
1393 .from_abi(result__)
1394 }
1395 }
1396 pub fn FirstMonthInThisYear(&self) -> ::windows_core::Result<i32> {
1397 let this = self;
1398 unsafe {
1399 let mut result__ = ::std::mem::zeroed();
1400 (::windows_core::Interface::vtable(this).FirstMonthInThisYear)(
1401 ::windows_core::Interface::as_raw(this),
1402 &mut result__,
1403 )
1404 .from_abi(result__)
1405 }
1406 }
1407 pub fn LastMonthInThisYear(&self) -> ::windows_core::Result<i32> {
1408 let this = self;
1409 unsafe {
1410 let mut result__ = ::std::mem::zeroed();
1411 (::windows_core::Interface::vtable(this).LastMonthInThisYear)(
1412 ::windows_core::Interface::as_raw(this),
1413 &mut result__,
1414 )
1415 .from_abi(result__)
1416 }
1417 }
1418 pub fn NumberOfMonthsInThisYear(&self) -> ::windows_core::Result<i32> {
1419 let this = self;
1420 unsafe {
1421 let mut result__ = ::std::mem::zeroed();
1422 (::windows_core::Interface::vtable(this).NumberOfMonthsInThisYear)(
1423 ::windows_core::Interface::as_raw(this),
1424 &mut result__,
1425 )
1426 .from_abi(result__)
1427 }
1428 }
1429 pub fn Month(&self) -> ::windows_core::Result<i32> {
1430 let this = self;
1431 unsafe {
1432 let mut result__ = ::std::mem::zeroed();
1433 (::windows_core::Interface::vtable(this).Month)(
1434 ::windows_core::Interface::as_raw(this),
1435 &mut result__,
1436 )
1437 .from_abi(result__)
1438 }
1439 }
1440 pub fn SetMonth(&self, value: i32) -> ::windows_core::Result<()> {
1441 let this = self;
1442 unsafe {
1443 (::windows_core::Interface::vtable(this).SetMonth)(
1444 ::windows_core::Interface::as_raw(this),
1445 value,
1446 )
1447 .ok()
1448 }
1449 }
1450 pub fn AddMonths(&self, months: i32) -> ::windows_core::Result<()> {
1451 let this = self;
1452 unsafe {
1453 (::windows_core::Interface::vtable(this).AddMonths)(
1454 ::windows_core::Interface::as_raw(this),
1455 months,
1456 )
1457 .ok()
1458 }
1459 }
1460 pub fn MonthAsFullString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1461 let this = self;
1462 unsafe {
1463 let mut result__ = ::std::mem::zeroed();
1464 (::windows_core::Interface::vtable(this).MonthAsFullString)(
1465 ::windows_core::Interface::as_raw(this),
1466 &mut result__,
1467 )
1468 .from_abi(result__)
1469 }
1470 }
1471 pub fn MonthAsString(
1472 &self,
1473 ideallength: i32,
1474 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1475 let this = self;
1476 unsafe {
1477 let mut result__ = ::std::mem::zeroed();
1478 (::windows_core::Interface::vtable(this).MonthAsString)(
1479 ::windows_core::Interface::as_raw(this),
1480 ideallength,
1481 &mut result__,
1482 )
1483 .from_abi(result__)
1484 }
1485 }
1486 pub fn MonthAsFullSoloString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1487 let this = self;
1488 unsafe {
1489 let mut result__ = ::std::mem::zeroed();
1490 (::windows_core::Interface::vtable(this).MonthAsFullSoloString)(
1491 ::windows_core::Interface::as_raw(this),
1492 &mut result__,
1493 )
1494 .from_abi(result__)
1495 }
1496 }
1497 pub fn MonthAsSoloString(
1498 &self,
1499 ideallength: i32,
1500 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1501 let this = self;
1502 unsafe {
1503 let mut result__ = ::std::mem::zeroed();
1504 (::windows_core::Interface::vtable(this).MonthAsSoloString)(
1505 ::windows_core::Interface::as_raw(this),
1506 ideallength,
1507 &mut result__,
1508 )
1509 .from_abi(result__)
1510 }
1511 }
1512 pub fn MonthAsNumericString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1513 let this = self;
1514 unsafe {
1515 let mut result__ = ::std::mem::zeroed();
1516 (::windows_core::Interface::vtable(this).MonthAsNumericString)(
1517 ::windows_core::Interface::as_raw(this),
1518 &mut result__,
1519 )
1520 .from_abi(result__)
1521 }
1522 }
1523 pub fn MonthAsPaddedNumericString(
1524 &self,
1525 mindigits: i32,
1526 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1527 let this = self;
1528 unsafe {
1529 let mut result__ = ::std::mem::zeroed();
1530 (::windows_core::Interface::vtable(this).MonthAsPaddedNumericString)(
1531 ::windows_core::Interface::as_raw(this),
1532 mindigits,
1533 &mut result__,
1534 )
1535 .from_abi(result__)
1536 }
1537 }
1538 pub fn AddWeeks(&self, weeks: i32) -> ::windows_core::Result<()> {
1539 let this = self;
1540 unsafe {
1541 (::windows_core::Interface::vtable(this).AddWeeks)(
1542 ::windows_core::Interface::as_raw(this),
1543 weeks,
1544 )
1545 .ok()
1546 }
1547 }
1548 pub fn FirstDayInThisMonth(&self) -> ::windows_core::Result<i32> {
1549 let this = self;
1550 unsafe {
1551 let mut result__ = ::std::mem::zeroed();
1552 (::windows_core::Interface::vtable(this).FirstDayInThisMonth)(
1553 ::windows_core::Interface::as_raw(this),
1554 &mut result__,
1555 )
1556 .from_abi(result__)
1557 }
1558 }
1559 pub fn LastDayInThisMonth(&self) -> ::windows_core::Result<i32> {
1560 let this = self;
1561 unsafe {
1562 let mut result__ = ::std::mem::zeroed();
1563 (::windows_core::Interface::vtable(this).LastDayInThisMonth)(
1564 ::windows_core::Interface::as_raw(this),
1565 &mut result__,
1566 )
1567 .from_abi(result__)
1568 }
1569 }
1570 pub fn NumberOfDaysInThisMonth(&self) -> ::windows_core::Result<i32> {
1571 let this = self;
1572 unsafe {
1573 let mut result__ = ::std::mem::zeroed();
1574 (::windows_core::Interface::vtable(this).NumberOfDaysInThisMonth)(
1575 ::windows_core::Interface::as_raw(this),
1576 &mut result__,
1577 )
1578 .from_abi(result__)
1579 }
1580 }
1581 pub fn Day(&self) -> ::windows_core::Result<i32> {
1582 let this = self;
1583 unsafe {
1584 let mut result__ = ::std::mem::zeroed();
1585 (::windows_core::Interface::vtable(this).Day)(
1586 ::windows_core::Interface::as_raw(this),
1587 &mut result__,
1588 )
1589 .from_abi(result__)
1590 }
1591 }
1592 pub fn SetDay(&self, value: i32) -> ::windows_core::Result<()> {
1593 let this = self;
1594 unsafe {
1595 (::windows_core::Interface::vtable(this).SetDay)(
1596 ::windows_core::Interface::as_raw(this),
1597 value,
1598 )
1599 .ok()
1600 }
1601 }
1602 pub fn AddDays(&self, days: i32) -> ::windows_core::Result<()> {
1603 let this = self;
1604 unsafe {
1605 (::windows_core::Interface::vtable(this).AddDays)(
1606 ::windows_core::Interface::as_raw(this),
1607 days,
1608 )
1609 .ok()
1610 }
1611 }
1612 pub fn DayAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1613 let this = self;
1614 unsafe {
1615 let mut result__ = ::std::mem::zeroed();
1616 (::windows_core::Interface::vtable(this).DayAsString)(
1617 ::windows_core::Interface::as_raw(this),
1618 &mut result__,
1619 )
1620 .from_abi(result__)
1621 }
1622 }
1623 pub fn DayAsPaddedString(
1624 &self,
1625 mindigits: i32,
1626 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1627 let this = self;
1628 unsafe {
1629 let mut result__ = ::std::mem::zeroed();
1630 (::windows_core::Interface::vtable(this).DayAsPaddedString)(
1631 ::windows_core::Interface::as_raw(this),
1632 mindigits,
1633 &mut result__,
1634 )
1635 .from_abi(result__)
1636 }
1637 }
1638 pub fn DayOfWeek(&self) -> ::windows_core::Result<DayOfWeek> {
1639 let this = self;
1640 unsafe {
1641 let mut result__ = ::std::mem::zeroed();
1642 (::windows_core::Interface::vtable(this).DayOfWeek)(
1643 ::windows_core::Interface::as_raw(this),
1644 &mut result__,
1645 )
1646 .from_abi(result__)
1647 }
1648 }
1649 pub fn DayOfWeekAsFullString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1650 let this = self;
1651 unsafe {
1652 let mut result__ = ::std::mem::zeroed();
1653 (::windows_core::Interface::vtable(this).DayOfWeekAsFullString)(
1654 ::windows_core::Interface::as_raw(this),
1655 &mut result__,
1656 )
1657 .from_abi(result__)
1658 }
1659 }
1660 pub fn DayOfWeekAsString(
1661 &self,
1662 ideallength: i32,
1663 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1664 let this = self;
1665 unsafe {
1666 let mut result__ = ::std::mem::zeroed();
1667 (::windows_core::Interface::vtable(this).DayOfWeekAsString)(
1668 ::windows_core::Interface::as_raw(this),
1669 ideallength,
1670 &mut result__,
1671 )
1672 .from_abi(result__)
1673 }
1674 }
1675 pub fn DayOfWeekAsFullSoloString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1676 let this = self;
1677 unsafe {
1678 let mut result__ = ::std::mem::zeroed();
1679 (::windows_core::Interface::vtable(this).DayOfWeekAsFullSoloString)(
1680 ::windows_core::Interface::as_raw(this),
1681 &mut result__,
1682 )
1683 .from_abi(result__)
1684 }
1685 }
1686 pub fn DayOfWeekAsSoloString(
1687 &self,
1688 ideallength: i32,
1689 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1690 let this = self;
1691 unsafe {
1692 let mut result__ = ::std::mem::zeroed();
1693 (::windows_core::Interface::vtable(this).DayOfWeekAsSoloString)(
1694 ::windows_core::Interface::as_raw(this),
1695 ideallength,
1696 &mut result__,
1697 )
1698 .from_abi(result__)
1699 }
1700 }
1701 pub fn FirstPeriodInThisDay(&self) -> ::windows_core::Result<i32> {
1702 let this = self;
1703 unsafe {
1704 let mut result__ = ::std::mem::zeroed();
1705 (::windows_core::Interface::vtable(this).FirstPeriodInThisDay)(
1706 ::windows_core::Interface::as_raw(this),
1707 &mut result__,
1708 )
1709 .from_abi(result__)
1710 }
1711 }
1712 pub fn LastPeriodInThisDay(&self) -> ::windows_core::Result<i32> {
1713 let this = self;
1714 unsafe {
1715 let mut result__ = ::std::mem::zeroed();
1716 (::windows_core::Interface::vtable(this).LastPeriodInThisDay)(
1717 ::windows_core::Interface::as_raw(this),
1718 &mut result__,
1719 )
1720 .from_abi(result__)
1721 }
1722 }
1723 pub fn NumberOfPeriodsInThisDay(&self) -> ::windows_core::Result<i32> {
1724 let this = self;
1725 unsafe {
1726 let mut result__ = ::std::mem::zeroed();
1727 (::windows_core::Interface::vtable(this).NumberOfPeriodsInThisDay)(
1728 ::windows_core::Interface::as_raw(this),
1729 &mut result__,
1730 )
1731 .from_abi(result__)
1732 }
1733 }
1734 pub fn Period(&self) -> ::windows_core::Result<i32> {
1735 let this = self;
1736 unsafe {
1737 let mut result__ = ::std::mem::zeroed();
1738 (::windows_core::Interface::vtable(this).Period)(
1739 ::windows_core::Interface::as_raw(this),
1740 &mut result__,
1741 )
1742 .from_abi(result__)
1743 }
1744 }
1745 pub fn SetPeriod(&self, value: i32) -> ::windows_core::Result<()> {
1746 let this = self;
1747 unsafe {
1748 (::windows_core::Interface::vtable(this).SetPeriod)(
1749 ::windows_core::Interface::as_raw(this),
1750 value,
1751 )
1752 .ok()
1753 }
1754 }
1755 pub fn AddPeriods(&self, periods: i32) -> ::windows_core::Result<()> {
1756 let this = self;
1757 unsafe {
1758 (::windows_core::Interface::vtable(this).AddPeriods)(
1759 ::windows_core::Interface::as_raw(this),
1760 periods,
1761 )
1762 .ok()
1763 }
1764 }
1765 pub fn PeriodAsFullString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1766 let this = self;
1767 unsafe {
1768 let mut result__ = ::std::mem::zeroed();
1769 (::windows_core::Interface::vtable(this).PeriodAsFullString)(
1770 ::windows_core::Interface::as_raw(this),
1771 &mut result__,
1772 )
1773 .from_abi(result__)
1774 }
1775 }
1776 pub fn PeriodAsString(
1777 &self,
1778 ideallength: i32,
1779 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1780 let this = self;
1781 unsafe {
1782 let mut result__ = ::std::mem::zeroed();
1783 (::windows_core::Interface::vtable(this).PeriodAsString)(
1784 ::windows_core::Interface::as_raw(this),
1785 ideallength,
1786 &mut result__,
1787 )
1788 .from_abi(result__)
1789 }
1790 }
1791 pub fn FirstHourInThisPeriod(&self) -> ::windows_core::Result<i32> {
1792 let this = self;
1793 unsafe {
1794 let mut result__ = ::std::mem::zeroed();
1795 (::windows_core::Interface::vtable(this).FirstHourInThisPeriod)(
1796 ::windows_core::Interface::as_raw(this),
1797 &mut result__,
1798 )
1799 .from_abi(result__)
1800 }
1801 }
1802 pub fn LastHourInThisPeriod(&self) -> ::windows_core::Result<i32> {
1803 let this = self;
1804 unsafe {
1805 let mut result__ = ::std::mem::zeroed();
1806 (::windows_core::Interface::vtable(this).LastHourInThisPeriod)(
1807 ::windows_core::Interface::as_raw(this),
1808 &mut result__,
1809 )
1810 .from_abi(result__)
1811 }
1812 }
1813 pub fn NumberOfHoursInThisPeriod(&self) -> ::windows_core::Result<i32> {
1814 let this = self;
1815 unsafe {
1816 let mut result__ = ::std::mem::zeroed();
1817 (::windows_core::Interface::vtable(this).NumberOfHoursInThisPeriod)(
1818 ::windows_core::Interface::as_raw(this),
1819 &mut result__,
1820 )
1821 .from_abi(result__)
1822 }
1823 }
1824 pub fn Hour(&self) -> ::windows_core::Result<i32> {
1825 let this = self;
1826 unsafe {
1827 let mut result__ = ::std::mem::zeroed();
1828 (::windows_core::Interface::vtable(this).Hour)(
1829 ::windows_core::Interface::as_raw(this),
1830 &mut result__,
1831 )
1832 .from_abi(result__)
1833 }
1834 }
1835 pub fn SetHour(&self, value: i32) -> ::windows_core::Result<()> {
1836 let this = self;
1837 unsafe {
1838 (::windows_core::Interface::vtable(this).SetHour)(
1839 ::windows_core::Interface::as_raw(this),
1840 value,
1841 )
1842 .ok()
1843 }
1844 }
1845 pub fn AddHours(&self, hours: i32) -> ::windows_core::Result<()> {
1846 let this = self;
1847 unsafe {
1848 (::windows_core::Interface::vtable(this).AddHours)(
1849 ::windows_core::Interface::as_raw(this),
1850 hours,
1851 )
1852 .ok()
1853 }
1854 }
1855 pub fn HourAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1856 let this = self;
1857 unsafe {
1858 let mut result__ = ::std::mem::zeroed();
1859 (::windows_core::Interface::vtable(this).HourAsString)(
1860 ::windows_core::Interface::as_raw(this),
1861 &mut result__,
1862 )
1863 .from_abi(result__)
1864 }
1865 }
1866 pub fn HourAsPaddedString(
1867 &self,
1868 mindigits: i32,
1869 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1870 let this = self;
1871 unsafe {
1872 let mut result__ = ::std::mem::zeroed();
1873 (::windows_core::Interface::vtable(this).HourAsPaddedString)(
1874 ::windows_core::Interface::as_raw(this),
1875 mindigits,
1876 &mut result__,
1877 )
1878 .from_abi(result__)
1879 }
1880 }
1881 pub fn Minute(&self) -> ::windows_core::Result<i32> {
1882 let this = self;
1883 unsafe {
1884 let mut result__ = ::std::mem::zeroed();
1885 (::windows_core::Interface::vtable(this).Minute)(
1886 ::windows_core::Interface::as_raw(this),
1887 &mut result__,
1888 )
1889 .from_abi(result__)
1890 }
1891 }
1892 pub fn SetMinute(&self, value: i32) -> ::windows_core::Result<()> {
1893 let this = self;
1894 unsafe {
1895 (::windows_core::Interface::vtable(this).SetMinute)(
1896 ::windows_core::Interface::as_raw(this),
1897 value,
1898 )
1899 .ok()
1900 }
1901 }
1902 pub fn AddMinutes(&self, minutes: i32) -> ::windows_core::Result<()> {
1903 let this = self;
1904 unsafe {
1905 (::windows_core::Interface::vtable(this).AddMinutes)(
1906 ::windows_core::Interface::as_raw(this),
1907 minutes,
1908 )
1909 .ok()
1910 }
1911 }
1912 pub fn MinuteAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1913 let this = self;
1914 unsafe {
1915 let mut result__ = ::std::mem::zeroed();
1916 (::windows_core::Interface::vtable(this).MinuteAsString)(
1917 ::windows_core::Interface::as_raw(this),
1918 &mut result__,
1919 )
1920 .from_abi(result__)
1921 }
1922 }
1923 pub fn MinuteAsPaddedString(
1924 &self,
1925 mindigits: i32,
1926 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1927 let this = self;
1928 unsafe {
1929 let mut result__ = ::std::mem::zeroed();
1930 (::windows_core::Interface::vtable(this).MinuteAsPaddedString)(
1931 ::windows_core::Interface::as_raw(this),
1932 mindigits,
1933 &mut result__,
1934 )
1935 .from_abi(result__)
1936 }
1937 }
1938 pub fn Second(&self) -> ::windows_core::Result<i32> {
1939 let this = self;
1940 unsafe {
1941 let mut result__ = ::std::mem::zeroed();
1942 (::windows_core::Interface::vtable(this).Second)(
1943 ::windows_core::Interface::as_raw(this),
1944 &mut result__,
1945 )
1946 .from_abi(result__)
1947 }
1948 }
1949 pub fn SetSecond(&self, value: i32) -> ::windows_core::Result<()> {
1950 let this = self;
1951 unsafe {
1952 (::windows_core::Interface::vtable(this).SetSecond)(
1953 ::windows_core::Interface::as_raw(this),
1954 value,
1955 )
1956 .ok()
1957 }
1958 }
1959 pub fn AddSeconds(&self, seconds: i32) -> ::windows_core::Result<()> {
1960 let this = self;
1961 unsafe {
1962 (::windows_core::Interface::vtable(this).AddSeconds)(
1963 ::windows_core::Interface::as_raw(this),
1964 seconds,
1965 )
1966 .ok()
1967 }
1968 }
1969 pub fn SecondAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
1970 let this = self;
1971 unsafe {
1972 let mut result__ = ::std::mem::zeroed();
1973 (::windows_core::Interface::vtable(this).SecondAsString)(
1974 ::windows_core::Interface::as_raw(this),
1975 &mut result__,
1976 )
1977 .from_abi(result__)
1978 }
1979 }
1980 pub fn SecondAsPaddedString(
1981 &self,
1982 mindigits: i32,
1983 ) -> ::windows_core::Result<::windows_core::HSTRING> {
1984 let this = self;
1985 unsafe {
1986 let mut result__ = ::std::mem::zeroed();
1987 (::windows_core::Interface::vtable(this).SecondAsPaddedString)(
1988 ::windows_core::Interface::as_raw(this),
1989 mindigits,
1990 &mut result__,
1991 )
1992 .from_abi(result__)
1993 }
1994 }
1995 pub fn Nanosecond(&self) -> ::windows_core::Result<i32> {
1996 let this = self;
1997 unsafe {
1998 let mut result__ = ::std::mem::zeroed();
1999 (::windows_core::Interface::vtable(this).Nanosecond)(
2000 ::windows_core::Interface::as_raw(this),
2001 &mut result__,
2002 )
2003 .from_abi(result__)
2004 }
2005 }
2006 pub fn SetNanosecond(&self, value: i32) -> ::windows_core::Result<()> {
2007 let this = self;
2008 unsafe {
2009 (::windows_core::Interface::vtable(this).SetNanosecond)(
2010 ::windows_core::Interface::as_raw(this),
2011 value,
2012 )
2013 .ok()
2014 }
2015 }
2016 pub fn AddNanoseconds(&self, nanoseconds: i32) -> ::windows_core::Result<()> {
2017 let this = self;
2018 unsafe {
2019 (::windows_core::Interface::vtable(this).AddNanoseconds)(
2020 ::windows_core::Interface::as_raw(this),
2021 nanoseconds,
2022 )
2023 .ok()
2024 }
2025 }
2026 pub fn NanosecondAsString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
2027 let this = self;
2028 unsafe {
2029 let mut result__ = ::std::mem::zeroed();
2030 (::windows_core::Interface::vtable(this).NanosecondAsString)(
2031 ::windows_core::Interface::as_raw(this),
2032 &mut result__,
2033 )
2034 .from_abi(result__)
2035 }
2036 }
2037 pub fn NanosecondAsPaddedString(
2038 &self,
2039 mindigits: i32,
2040 ) -> ::windows_core::Result<::windows_core::HSTRING> {
2041 let this = self;
2042 unsafe {
2043 let mut result__ = ::std::mem::zeroed();
2044 (::windows_core::Interface::vtable(this).NanosecondAsPaddedString)(
2045 ::windows_core::Interface::as_raw(this),
2046 mindigits,
2047 &mut result__,
2048 )
2049 .from_abi(result__)
2050 }
2051 }
2052 pub fn Compare<P0>(&self, other: P0) -> ::windows_core::Result<i32>
2053 where
2054 P0: ::windows_core::IntoParam<Calendar>,
2055 {
2056 let this = self;
2057 unsafe {
2058 let mut result__ = ::std::mem::zeroed();
2059 (::windows_core::Interface::vtable(this).Compare)(
2060 ::windows_core::Interface::as_raw(this),
2061 other.into_param().abi(),
2062 &mut result__,
2063 )
2064 .from_abi(result__)
2065 }
2066 }
2067 pub fn CompareDateTime(
2068 &self,
2069 other: super::Foundation::DateTime,
2070 ) -> ::windows_core::Result<i32> {
2071 let this = self;
2072 unsafe {
2073 let mut result__ = ::std::mem::zeroed();
2074 (::windows_core::Interface::vtable(this).CompareDateTime)(
2075 ::windows_core::Interface::as_raw(this),
2076 other,
2077 &mut result__,
2078 )
2079 .from_abi(result__)
2080 }
2081 }
2082 pub fn CopyTo<P0>(&self, other: P0) -> ::windows_core::Result<()>
2083 where
2084 P0: ::windows_core::IntoParam<Calendar>,
2085 {
2086 let this = self;
2087 unsafe {
2088 (::windows_core::Interface::vtable(this).CopyTo)(
2089 ::windows_core::Interface::as_raw(this),
2090 other.into_param().abi(),
2091 )
2092 .ok()
2093 }
2094 }
2095 pub fn FirstMinuteInThisHour(&self) -> ::windows_core::Result<i32> {
2096 let this = self;
2097 unsafe {
2098 let mut result__ = ::std::mem::zeroed();
2099 (::windows_core::Interface::vtable(this).FirstMinuteInThisHour)(
2100 ::windows_core::Interface::as_raw(this),
2101 &mut result__,
2102 )
2103 .from_abi(result__)
2104 }
2105 }
2106 pub fn LastMinuteInThisHour(&self) -> ::windows_core::Result<i32> {
2107 let this = self;
2108 unsafe {
2109 let mut result__ = ::std::mem::zeroed();
2110 (::windows_core::Interface::vtable(this).LastMinuteInThisHour)(
2111 ::windows_core::Interface::as_raw(this),
2112 &mut result__,
2113 )
2114 .from_abi(result__)
2115 }
2116 }
2117 pub fn NumberOfMinutesInThisHour(&self) -> ::windows_core::Result<i32> {
2118 let this = self;
2119 unsafe {
2120 let mut result__ = ::std::mem::zeroed();
2121 (::windows_core::Interface::vtable(this).NumberOfMinutesInThisHour)(
2122 ::windows_core::Interface::as_raw(this),
2123 &mut result__,
2124 )
2125 .from_abi(result__)
2126 }
2127 }
2128 pub fn FirstSecondInThisMinute(&self) -> ::windows_core::Result<i32> {
2129 let this = self;
2130 unsafe {
2131 let mut result__ = ::std::mem::zeroed();
2132 (::windows_core::Interface::vtable(this).FirstSecondInThisMinute)(
2133 ::windows_core::Interface::as_raw(this),
2134 &mut result__,
2135 )
2136 .from_abi(result__)
2137 }
2138 }
2139 pub fn LastSecondInThisMinute(&self) -> ::windows_core::Result<i32> {
2140 let this = self;
2141 unsafe {
2142 let mut result__ = ::std::mem::zeroed();
2143 (::windows_core::Interface::vtable(this).LastSecondInThisMinute)(
2144 ::windows_core::Interface::as_raw(this),
2145 &mut result__,
2146 )
2147 .from_abi(result__)
2148 }
2149 }
2150 pub fn NumberOfSecondsInThisMinute(&self) -> ::windows_core::Result<i32> {
2151 let this = self;
2152 unsafe {
2153 let mut result__ = ::std::mem::zeroed();
2154 (::windows_core::Interface::vtable(this).NumberOfSecondsInThisMinute)(
2155 ::windows_core::Interface::as_raw(this),
2156 &mut result__,
2157 )
2158 .from_abi(result__)
2159 }
2160 }
2161 pub fn ResolvedLanguage(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
2162 let this = self;
2163 unsafe {
2164 let mut result__ = ::std::mem::zeroed();
2165 (::windows_core::Interface::vtable(this).ResolvedLanguage)(
2166 ::windows_core::Interface::as_raw(this),
2167 &mut result__,
2168 )
2169 .from_abi(result__)
2170 }
2171 }
2172 pub fn IsDaylightSavingTime(&self) -> ::windows_core::Result<bool> {
2173 let this = self;
2174 unsafe {
2175 let mut result__ = ::std::mem::zeroed();
2176 (::windows_core::Interface::vtable(this).IsDaylightSavingTime)(
2177 ::windows_core::Interface::as_raw(this),
2178 &mut result__,
2179 )
2180 .from_abi(result__)
2181 }
2182 }
2183 pub fn CreateCalendarDefaultCalendarAndClock<P0>(
2184 languages: P0,
2185 ) -> ::windows_core::Result<Calendar>
2186 where
2187 P0: ::windows_core::TryIntoParam<
2188 super::Foundation::Collections::IIterable<::windows_core::HSTRING>,
2189 >,
2190 {
2191 Self::ICalendarFactory(|this| unsafe {
2192 let mut result__ = ::std::mem::zeroed();
2193 (::windows_core::Interface::vtable(this).CreateCalendarDefaultCalendarAndClock)(
2194 ::windows_core::Interface::as_raw(this),
2195 languages.try_into_param()?.abi(),
2196 &mut result__,
2197 )
2198 .from_abi(result__)
2199 })
2200 }
2201 pub fn CreateCalendar<P0>(
2202 languages: P0,
2203 calendar: &::windows_core::HSTRING,
2204 clock: &::windows_core::HSTRING,
2205 ) -> ::windows_core::Result<Calendar>
2206 where
2207 P0: ::windows_core::TryIntoParam<
2208 super::Foundation::Collections::IIterable<::windows_core::HSTRING>,
2209 >,
2210 {
2211 Self::ICalendarFactory(|this| unsafe {
2212 let mut result__ = ::std::mem::zeroed();
2213 (::windows_core::Interface::vtable(this).CreateCalendar)(
2214 ::windows_core::Interface::as_raw(this),
2215 languages.try_into_param()?.abi(),
2216 ::core::mem::transmute_copy(calendar),
2217 ::core::mem::transmute_copy(clock),
2218 &mut result__,
2219 )
2220 .from_abi(result__)
2221 })
2222 }
2223 pub fn CreateCalendarWithTimeZone<P0>(
2224 languages: P0,
2225 calendar: &::windows_core::HSTRING,
2226 clock: &::windows_core::HSTRING,
2227 timezoneid: &::windows_core::HSTRING,
2228 ) -> ::windows_core::Result<Calendar>
2229 where
2230 P0: ::windows_core::TryIntoParam<
2231 super::Foundation::Collections::IIterable<::windows_core::HSTRING>,
2232 >,
2233 {
2234 Self::ICalendarFactory2(|this| unsafe {
2235 let mut result__ = ::std::mem::zeroed();
2236 (::windows_core::Interface::vtable(this).CreateCalendarWithTimeZone)(
2237 ::windows_core::Interface::as_raw(this),
2238 languages.try_into_param()?.abi(),
2239 ::core::mem::transmute_copy(calendar),
2240 ::core::mem::transmute_copy(clock),
2241 ::core::mem::transmute_copy(timezoneid),
2242 &mut result__,
2243 )
2244 .from_abi(result__)
2245 })
2246 }
2247 pub fn GetTimeZone(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
2248 let this = &::windows_core::ComInterface::cast::<ITimeZoneOnCalendar>(self)?;
2249 unsafe {
2250 let mut result__ = ::std::mem::zeroed();
2251 (::windows_core::Interface::vtable(this).GetTimeZone)(
2252 ::windows_core::Interface::as_raw(this),
2253 &mut result__,
2254 )
2255 .from_abi(result__)
2256 }
2257 }
2258 pub fn ChangeTimeZone(
2259 &self,
2260 timezoneid: &::windows_core::HSTRING,
2261 ) -> ::windows_core::Result<()> {
2262 let this = &::windows_core::ComInterface::cast::<ITimeZoneOnCalendar>(self)?;
2263 unsafe {
2264 (::windows_core::Interface::vtable(this).ChangeTimeZone)(
2265 ::windows_core::Interface::as_raw(this),
2266 ::core::mem::transmute_copy(timezoneid),
2267 )
2268 .ok()
2269 }
2270 }
2271 pub fn TimeZoneAsFullString(&self) -> ::windows_core::Result<::windows_core::HSTRING> {
2272 let this = &::windows_core::ComInterface::cast::<ITimeZoneOnCalendar>(self)?;
2273 unsafe {
2274 let mut result__ = ::std::mem::zeroed();
2275 (::windows_core::Interface::vtable(this).TimeZoneAsFullString)(
2276 ::windows_core::Interface::as_raw(this),
2277 &mut result__,
2278 )
2279 .from_abi(result__)
2280 }
2281 }
2282 pub fn TimeZoneAsString(
2283 &self,
2284 ideallength: i32,
2285 ) -> ::windows_core::Result<::windows_core::HSTRING> {
2286 let this = &::windows_core::ComInterface::cast::<ITimeZoneOnCalendar>(self)?;
2287 unsafe {
2288 let mut result__ = ::std::mem::zeroed();
2289 (::windows_core::Interface::vtable(this).TimeZoneAsString)(
2290 ::windows_core::Interface::as_raw(this),
2291 ideallength,
2292 &mut result__,
2293 )
2294 .from_abi(result__)
2295 }
2296 }
2297 #[doc(hidden)]
2298 pub fn ICalendarFactory<R, F: FnOnce(&ICalendarFactory) -> ::windows_core::Result<R>>(
2299 callback: F,
2300 ) -> ::windows_core::Result<R> {
2301 static SHARED: ::windows_core::imp::FactoryCache<Calendar, ICalendarFactory> =
2302 ::windows_core::imp::FactoryCache::new();
2303 SHARED.call(callback)
2304 }
2305 #[doc(hidden)]
2306 pub fn ICalendarFactory2<R, F: FnOnce(&ICalendarFactory2) -> ::windows_core::Result<R>>(
2307 callback: F,
2308 ) -> ::windows_core::Result<R> {
2309 static SHARED: ::windows_core::imp::FactoryCache<Calendar, ICalendarFactory2> =
2310 ::windows_core::imp::FactoryCache::new();
2311 SHARED.call(callback)
2312 }
2313 }
2314 impl ::core::cmp::PartialEq for Calendar {
2315 fn eq(&self, other: &Self) -> bool {
2316 self.0 == other.0
2317 }
2318 }
2319 impl ::core::cmp::Eq for Calendar {}
2320 impl ::core::fmt::Debug for Calendar {
2321 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2322 f.debug_tuple("Calendar").field(&self.0).finish()
2323 }
2324 }
2325 impl ::windows_core::RuntimeType for Calendar {
2326 const SIGNATURE: ::windows_core::imp::ConstBuffer =
2327 ::windows_core::imp::ConstBuffer::from_slice(
2328 b"rc(Windows.Globalization.Calendar;{ca30221d-86d9-40fb-a26b-d44eb7cf08ea})",
2329 );
2330 }
2331 impl ::core::clone::Clone for Calendar {
2332 fn clone(&self) -> Self {
2333 Self(self.0.clone())
2334 }
2335 }
2336 unsafe impl ::windows_core::Interface for Calendar {
2337 type Vtable = ICalendar_Vtbl;
2338 }
2339 unsafe impl ::windows_core::ComInterface for Calendar {
2340 const IID: ::windows_core::GUID = <ICalendar as ::windows_core::ComInterface>::IID;
2341 }
2342 impl ::windows_core::RuntimeName for Calendar {
2343 const NAME: &'static str = "Windows.Globalization.Calendar";
2344 }
2345 ::windows_core::imp::interface_hierarchy!(
2346 Calendar,
2347 ::windows_core::IUnknown,
2348 ::windows_core::IInspectable
2349 );
2350 unsafe impl ::core::marker::Send for Calendar {}
2351 unsafe impl ::core::marker::Sync for Calendar {}
2352 #[repr(transparent)]
2353 #[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
2354 pub struct DayOfWeek(pub i32);
2355 impl DayOfWeek {
2356 pub const Sunday: Self = Self(0i32);
2357 pub const Monday: Self = Self(1i32);
2358 pub const Tuesday: Self = Self(2i32);
2359 pub const Wednesday: Self = Self(3i32);
2360 pub const Thursday: Self = Self(4i32);
2361 pub const Friday: Self = Self(5i32);
2362 pub const Saturday: Self = Self(6i32);
2363 }
2364 impl ::core::marker::Copy for DayOfWeek {}
2365 impl ::core::clone::Clone for DayOfWeek {
2366 fn clone(&self) -> Self {
2367 *self
2368 }
2369 }
2370 impl ::core::default::Default for DayOfWeek {
2371 fn default() -> Self {
2372 Self(0)
2373 }
2374 }
2375 impl ::windows_core::TypeKind for DayOfWeek {
2376 type TypeKind = ::windows_core::CopyType;
2377 }
2378 impl ::core::fmt::Debug for DayOfWeek {
2379 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2380 f.debug_tuple("DayOfWeek").field(&self.0).finish()
2381 }
2382 }
2383 impl ::windows_core::RuntimeType for DayOfWeek {
2384 const SIGNATURE: ::windows_core::imp::ConstBuffer =
2385 ::windows_core::imp::ConstBuffer::from_slice(
2386 b"enum(Windows.Globalization.DayOfWeek;i4)",
2387 );
2388 }
2389 }