use crate::com::{SafeDispatch, SafeVariant};
use crate::errors::SageResult;
use windows::Win32::System::Com::IDispatch;
pub struct MotifDevis {
pub(crate) dispatch: IDispatch,
}
impl MotifDevis {
fn dispatch(&self) -> SafeDispatch<'_> {
SafeDispatch::new(&self.dispatch)
}
pub fn cbmarq(&self) -> SageResult<i32> {
self.dispatch().call_method_by_name("cbMarq", &[])?.to_i32()
}
pub fn intitule(&self) -> SageResult<String> {
self.dispatch()
.call_method_by_name("Intitule", &[])?
.to_string()
}
pub fn set_intitule(&self, value: &str) -> SageResult<()> {
let param = SafeVariant::from_string(value);
self.dispatch().call_property_put("Intitule", &[param])?;
Ok(())
}
pub fn write(&self) -> SageResult<()> {
self.dispatch().call_method_by_name("Write", &[])?;
Ok(())
}
pub fn write_default(&self) -> SageResult<()> {
self.dispatch().call_method_by_name("WriteDefault", &[])?;
Ok(())
}
pub fn remove(&self) -> SageResult<()> {
self.dispatch().call_method_by_name("Remove", &[])?;
Ok(())
}
}