wxrust_base/generated/methods_v.rs
1use super::*;
2
3// wxVariantData
4/// This trait represents [C++ `wxVariantData` class](https://docs.wxwidgets.org/3.2/classwx_variant_data.html)'s methods and inheritance.
5///
6/// See [`VariantDataIsOwned`] documentation for the class usage.
7pub trait VariantDataMethods: ObjectRefDataMethods {
8 /// This function can be overridden to clone the data.
9 ///
10 /// See [C++ `wxVariantData::Clone()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a532ef084409dc34bab886b59d41fc7d3).
11 fn clone(&self) -> Option<VariantDataIsOwned<false>> {
12 unsafe { VariantData::option_from(ffi::wxVariantData_Clone(self.as_ptr())) }
13 }
14 /// Decreases reference count.
15 ///
16 /// See [C++ `wxVariantData::DecRef()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a5c90358b8b5d3bc99c0c3410cf565010).
17 fn dec_ref(&self) {
18 unsafe { ffi::wxVariantData_DecRef(self.as_ptr()) }
19 }
20 /// Returns true if this object is equal to data.
21 ///
22 /// See [C++ `wxVariantData::Eq()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a528c7c86af3dd554e5b72d2e5fdead6f).
23 fn eq<V: VariantDataMethods>(&self, data: &V) -> bool {
24 unsafe {
25 let data = data.as_ptr();
26 ffi::wxVariantData_Eq(self.as_ptr(), data)
27 }
28 }
29 // BLOCKED: fn GetAny()
30 /// Returns the string type of the data.
31 ///
32 /// See [C++ `wxVariantData::GetType()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a56789ab40ed58d058e655576ec1e81bc).
33 fn get_type(&self) -> String {
34 unsafe { WxString::from_ptr(ffi::wxVariantData_GetType(self.as_ptr())).into() }
35 }
36 /// If the data is a wxObject returns a pointer to the objects wxClassInfo structure, if the data isn't a wxObject the method returns NULL.
37 ///
38 /// See [C++ `wxVariantData::GetValueClassInfo()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#ae5c91c7065e3faadacb4ae2ec7cbf772).
39 fn get_value_class_info(&self) -> Option<ClassInfoIsOwned<false>> {
40 unsafe { ClassInfo::option_from(ffi::wxVariantData_GetValueClassInfo(self.as_ptr())) }
41 }
42 /// Increases reference count.
43 ///
44 /// See [C++ `wxVariantData::IncRef()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#ae25c62e3451463ed287367a7b709e51d).
45 fn inc_ref(&self) {
46 unsafe { ffi::wxVariantData_IncRef(self.as_ptr()) }
47 }
48 // BLOCKED: fn Read()
49 /// Reads the data from string.
50 ///
51 /// See [C++ `wxVariantData::Read()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a478c208420802aade488e57de371d27b).
52 fn read(&self, string: *mut c_void) -> bool {
53 unsafe { ffi::wxVariantData_Read1(self.as_ptr(), string) }
54 }
55 // BLOCKED: fn Write()
56 /// Writes the data to string.
57 ///
58 /// See [C++ `wxVariantData::Write()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_variant_data.html#a9d208924d7b652fb85db4ff6cb0b5d08).
59 fn write(&self, string: *mut c_void) -> bool {
60 unsafe { ffi::wxVariantData_Write1(self.as_ptr(), string) }
61 }
62}