wxrust_base/generated/
class_d.rs1use super::*;
2
3wxwidgets! {
5 #[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 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 pub const Gregorian: c_int = 0;
75 pub const Julian: c_int = 0 + 1;
76
77 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 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 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 pub const Name_Full: c_int = 0x01;
119 pub const Name_Abbr: c_int = 0x02;
120
121 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 pub fn new() -> DateTimeIsOwned<OWNED> {
130 unsafe { DateTimeIsOwned(ffi::wxDateTime_new()) }
131 }
132 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 pub fn new_with_double(jdn: c_double) -> DateTimeIsOwned<OWNED> {
147 unsafe { DateTimeIsOwned(ffi::wxDateTime_new4(jdn)) }
148 }
149 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}