wxrust_base/generated/
methods_c.rs

1use super::*;
2
3// wxClassInfo
4/// This trait represents [C++ `wxClassInfo` class](https://docs.wxwidgets.org/3.2/classwx_class_info.html)'s methods and inheritance.
5///
6/// See [`ClassInfoIsOwned`] documentation for the class usage.
7pub trait ClassInfoMethods: WxRustMethods {
8    /// Creates an object of the appropriate kind.
9    ///
10    /// See [C++ `wxClassInfo::CreateObject()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#a99df2fd7d0ec6b0f90790ffaeac872ca).
11    fn create_object(&self) -> Option<ObjectIsOwned<false>> {
12        unsafe { Object::option_from(ffi::wxClassInfo_CreateObject(self.as_ptr())) }
13    }
14    /// Returns the name of the first base class (NULL if none).
15    ///
16    /// See [C++ `wxClassInfo::GetBaseClassName1()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#a18260d1a19bc5213a016dc3b18738ee9).
17    fn get_base_class_name1(&self) -> *const c_void {
18        unsafe { ffi::wxClassInfo_GetBaseClassName1(self.as_ptr()) }
19    }
20    /// Returns the name of the second base class (NULL if none).
21    ///
22    /// See [C++ `wxClassInfo::GetBaseClassName2()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#ab4c6f02564990a01d986cfe770192834).
23    fn get_base_class_name2(&self) -> *const c_void {
24        unsafe { ffi::wxClassInfo_GetBaseClassName2(self.as_ptr()) }
25    }
26    /// Returns the string form of the class name.
27    ///
28    /// See [C++ `wxClassInfo::GetClassName()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#a470a32e5eb6f3a804ea7eb4556e3b480).
29    fn get_class_name(&self) -> *const c_void {
30        unsafe { ffi::wxClassInfo_GetClassName(self.as_ptr()) }
31    }
32    /// Returns the size of the class.
33    ///
34    /// See [C++ `wxClassInfo::GetSize()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#aa88c7e3bfebf06787d9d4e3bb457bca6).
35    fn get_size(&self) -> c_int {
36        unsafe { ffi::wxClassInfo_GetSize(self.as_ptr()) }
37    }
38    /// Returns true if this class info can create objects of the associated class.
39    ///
40    /// See [C++ `wxClassInfo::IsDynamic()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#affa753a570e48b53243944974f9014e7).
41    fn is_dynamic(&self) -> bool {
42        unsafe { ffi::wxClassInfo_IsDynamic(self.as_ptr()) }
43    }
44    /// Returns true if this class is a kind of (inherits from) the given class.
45    ///
46    /// See [C++ `wxClassInfo::IsKindOf()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#a13f3f381e570e04b31f574e425c6f446).
47    fn is_kind_of<C: ClassInfoMethods>(&self, info: Option<&C>) -> bool {
48        unsafe {
49            let info = match info {
50                Some(r) => r.as_ptr(),
51                None => ptr::null_mut(),
52            };
53            ffi::wxClassInfo_IsKindOf(self.as_ptr(), info)
54        }
55    }
56    /// Finds the wxClassInfo object for a class with the given name.
57    ///
58    /// See [C++ `wxClassInfo::FindClass()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_class_info.html#a57553434bc28e74412b58d368702301d).
59    fn find_class(class_name: &str) -> Option<ClassInfoIsOwned<false>> {
60        unsafe {
61            let class_name = WxString::from(class_name);
62            let class_name = class_name.as_ptr();
63            ClassInfo::option_from(ffi::wxClassInfo_FindClass(class_name))
64        }
65    }
66}
67
68// wxClientData
69/// This trait represents [C++ `wxClientData` class](https://docs.wxwidgets.org/3.2/classwx_client_data.html)'s methods and inheritance.
70///
71/// See [`ClientDataIsOwned`] documentation for the class usage.
72pub trait ClientDataMethods: WxRustMethods {
73    // DTOR: fn ~wxClientData()
74}