1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#![allow(non_camel_case_types, non_snake_case)]
use crate::co;
use crate::decl::*;
use crate::macros::*;
use crate::ole::privs::*;
use crate::prelude::*;
use crate::taskschd::vts::*;
com_interface! { ITrigger: "09941815-ea89-4b5b-89e0-2a773801fac3";
/// [`ITrigger`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nn-taskschd-itrigger)
/// COM interface.
///
/// Automatically calls
/// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
/// when the object goes out of scope.
}
impl oleaut_IDispatch for ITrigger {}
impl taskschd_ITrigger for ITrigger {}
/// This trait is enabled with the `taskschd` feature, and provides methods for
/// [`ITrigger`](crate::ITrigger).
///
/// Prefer importing this trait through the prelude:
///
/// ```no_run
/// use winsafe::prelude::*;
/// ```
pub trait taskschd_ITrigger: oleaut_IDispatch {
/// [`ITrigger::get_Enabled`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_enabled)
/// method.
#[must_use]
fn get_Enabled(&self) -> HrResult<bool> {
let mut enabled = i16::default();
HrRet(unsafe { (vt::<ITriggerVT>(self).get_Enabled)(self.ptr(), &mut enabled) })
.to_hrresult()
.map(|_| enabled != 0)
}
fn_com_bstr_get! { get_EndBoundary: ITriggerVT;
/// [`ITrigger::get_EndBoundary`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_endboundary)
/// method.
}
fn_com_bstr_get! { get_ExecutionTimeLimit: ITriggerVT;
/// [`ITrigger::get_ExecutionTimeLimit`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_executiontimelimit)
/// method.
}
fn_com_bstr_get! { get_Id: ITriggerVT;
/// [`ITrigger::get_Id`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_id)
/// method.
}
fn_com_bstr_get! { get_StartBoundary: ITriggerVT;
/// [`ITrigger::get_StartBoundary`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_startboundary)
/// method.
}
/// [`ITrigger::get_Type`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-get_type)
/// method.
#[must_use]
fn get_Type(&self) -> HrResult<co::TASK_TRIGGER_TYPE2> {
let mut ty = co::TASK_TRIGGER_TYPE2::default();
HrRet(unsafe { (vt::<ITriggerVT>(self).get_Type)(self.ptr(), ty.as_mut()) })
.to_hrresult()
.map(|_| ty)
}
/// [`ITrigger::put_Enabled`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-put_enabled)
/// method.
fn put_Enabled(&self, enabled: bool) -> HrResult<()> {
HrRet(unsafe { (vt::<ITriggerVT>(self).put_Enabled)(self.ptr(), enabled as _) })
.to_hrresult()
}
fn_com_bstr_set! { put_EndBoundary: ITriggerVT, end;
/// [`ITrigger::put_EndBoundary`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-put_endboundary)
/// method.
}
fn_com_bstr_set! { put_ExecutionTimeLimit: ITriggerVT, time_limit;
/// [`ITrigger::put_ExecutionTimeLimit`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-put_executiontimelimit)
/// method.
}
fn_com_bstr_set! { put_Id: ITriggerVT, id;
/// [`ITrigger::put_Id`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-put_id)
/// method.
}
fn_com_bstr_set! { put_StartBoundary: ITriggerVT, start;
/// [`ITrigger::put_StartBoundary`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-itrigger-put_startboundary)
/// method.
}
}