wxrust_base/generated/
class_d.rs

1use super::*;
2
3// wxDateTime
4wxwidgets! {
5    /// wxDateTime class represents an absolute moment in time.
6    /// - [`DateTime`] represents a C++ `wxDateTime` class instance which your code has ownership, [`DateTimeIsOwned`]`<false>` represents one which don't own.
7    /// - Use [`DateTime`]'s `new()` to create an instance of this class.
8    /// - See [C++ `wxDateTime` class's documentation](https://docs.wxwidgets.org/3.2/classwx_date_time.html) for more details.
9    #[doc(alias = "wxDateTime")]
10    #[doc(alias = "DateTime")]
11    class DateTime
12        = DateTimeIsOwned<true>(wxDateTime) impl
13        DateTimeMethods
14}
15impl<const OWNED: bool> DateTimeIsOwned<OWNED> {
16    //  ENUM: TZ
17    pub const Local: c_int = 0;
18    pub const GMT_12: c_int = 0 + 1;
19    pub const GMT_11: c_int = 0 + 2;
20    pub const GMT_10: c_int = 0 + 3;
21    pub const GMT_9: c_int = 0 + 4;
22    pub const GMT_8: c_int = 0 + 5;
23    pub const GMT_7: c_int = 0 + 6;
24    pub const GMT_6: c_int = 0 + 7;
25    pub const GMT_5: c_int = 0 + 8;
26    pub const GMT_4: c_int = 0 + 9;
27    pub const GMT_3: c_int = 0 + 10;
28    pub const GMT_2: c_int = 0 + 11;
29    pub const GMT_1: c_int = 0 + 12;
30    pub const GMT0: c_int = 0 + 13;
31    pub const GMT1: c_int = 0 + 14;
32    pub const GMT2: c_int = 0 + 15;
33    pub const GMT3: c_int = 0 + 16;
34    pub const GMT4: c_int = 0 + 17;
35    pub const GMT5: c_int = 0 + 18;
36    pub const GMT6: c_int = 0 + 19;
37    pub const GMT7: c_int = 0 + 20;
38    pub const GMT8: c_int = 0 + 21;
39    pub const GMT9: c_int = 0 + 22;
40    pub const GMT10: c_int = 0 + 23;
41    pub const GMT11: c_int = 0 + 24;
42    pub const GMT12: c_int = 0 + 25;
43    pub const GMT13: c_int = 0 + 26;
44    //  SKIP: WET
45    //  SKIP: WEST
46    //  SKIP: CET
47    //  SKIP: CEST
48    //  SKIP: EET
49    //  SKIP: EEST
50    //  SKIP: MSK
51    //  SKIP: MSD
52    //  SKIP: AST
53    //  SKIP: ADT
54    //  SKIP: EST
55    //  SKIP: EDT
56    //  SKIP: CST
57    //  SKIP: CDT
58    //  SKIP: MST
59    //  SKIP: MDT
60    //  SKIP: PST
61    //  SKIP: PDT
62    //  SKIP: HST
63    //  SKIP: AKST
64    //  SKIP: AKDT
65    //  SKIP: A_WST
66    //  SKIP: A_CST
67    //  SKIP: A_EST
68    //  SKIP: A_ESST
69    //  SKIP: NZST
70    //  SKIP: NZDT
71    //  SKIP: UTC
72
73    //  ENUM: Calendar
74    pub const Gregorian: c_int = 0;
75    pub const Julian: c_int = 0 + 1;
76
77    //  ENUM: Country
78    pub const Country_Unknown: c_int = 0;
79    pub const Country_Default: c_int = 0 + 1;
80    pub const Country_WesternEurope_Start: c_int = 0 + 2;
81    //  SKIP: Country_EEC
82    //  SKIP: France
83    //  SKIP: Germany
84    //  SKIP: UK
85    //  SKIP: Country_WesternEurope_End
86    //  SKIP: Russia
87    //  SKIP: USA
88
89    //  ENUM: Month
90    pub const Jan: c_int = 0;
91    pub const Feb: c_int = 0 + 1;
92    pub const Mar: c_int = 0 + 2;
93    pub const Apr: c_int = 0 + 3;
94    pub const May: c_int = 0 + 4;
95    pub const Jun: c_int = 0 + 5;
96    pub const Jul: c_int = 0 + 6;
97    pub const Aug: c_int = 0 + 7;
98    pub const Sep: c_int = 0 + 8;
99    pub const Oct: c_int = 0 + 9;
100    pub const Nov: c_int = 0 + 10;
101    pub const Dec: c_int = 0 + 11;
102    pub const Inv_Month: c_int = 0 + 12;
103
104    //  ENUM: WeekDay
105    pub const Sun: c_int = 0;
106    pub const Mon: c_int = 0 + 1;
107    pub const Tue: c_int = 0 + 2;
108    pub const Wed: c_int = 0 + 3;
109    pub const Thu: c_int = 0 + 4;
110    pub const Fri: c_int = 0 + 5;
111    pub const Sat: c_int = 0 + 6;
112    pub const Inv_WeekDay: c_int = 0 + 7;
113
114    //  ENUM: Year
115    //  SKIP: Inv_Year
116
117    //  ENUM: NameFlags
118    pub const Name_Full: c_int = 0x01;
119    pub const Name_Abbr: c_int = 0x02;
120
121    //  ENUM: WeekFlags
122    pub const Default_First: c_int = 0;
123    pub const Monday_First: c_int = 0 + 1;
124    pub const Sunday_First: c_int = 0 + 2;
125
126    /// Default constructor.
127    ///
128    /// See [C++ `wxDateTime::wxDateTime()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_date_time.html#a4cc372429453a21632d64f34f635d853).
129    pub fn new() -> DateTimeIsOwned<OWNED> {
130        unsafe { DateTimeIsOwned(ffi::wxDateTime_new()) }
131    }
132    /// Copy constructor.
133    ///
134    /// See [C++ `wxDateTime::wxDateTime()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_date_time.html#aca2bc3b942d920e01e496841bd759001).
135    pub fn new_with_datetime<D: DateTimeMethods>(date: &D) -> DateTimeIsOwned<OWNED> {
136        unsafe {
137            let date = date.as_ptr();
138            DateTimeIsOwned(ffi::wxDateTime_new1(date))
139        }
140    }
141    // NOT_SUPPORTED: fn wxDateTime2()
142    // BLOCKED: fn wxDateTime3()
143    /// Same as Set().
144    ///
145    /// See [C++ `wxDateTime::wxDateTime()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_date_time.html#aa2c38922eafec2a94fb5ee9221c0f6b9).
146    pub fn new_with_double(jdn: c_double) -> DateTimeIsOwned<OWNED> {
147        unsafe { DateTimeIsOwned(ffi::wxDateTime_new4(jdn)) }
148    }
149    // NOT_SUPPORTED: fn wxDateTime5()
150    // NOT_SUPPORTED: fn wxDateTime6()
151    // BLOCKED: fn wxDateTime7()
152    pub fn none() -> Option<&'static Self> {
153        None
154    }
155}
156impl Clone for DateTimeIsOwned<false> {
157    fn clone(&self) -> Self {
158        Self(self.0)
159    }
160}
161impl<const OWNED: bool> Drop for DateTimeIsOwned<OWNED> {
162    fn drop(&mut self) {
163        if OWNED {
164            unsafe { ffi::wxDateTime_delete(self.0) }
165        }
166    }
167}