wxrust_base/generated/methods_s.rs
1use super::*;
2
3// wxStandardPaths
4/// This trait represents [C++ `wxStandardPaths` class](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html)'s methods and inheritance.
5///
6/// See [`StandardPathsIsOwned`] documentation for the class usage.
7pub trait StandardPathsMethods: WxRustMethods {
8 /// MSW-specific function undoing the effect of IgnoreAppSubDir() calls.
9 ///
10 /// See [C++ `wxStandardPaths::DontIgnoreAppSubDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a3348987c98140398e567ef76509400b6).
11 fn dont_ignore_app_sub_dir(&self) {
12 unsafe { ffi::wxStandardPaths_DontIgnoreAppSubDir(self.as_ptr()) }
13 }
14 /// Return the directory for the document files used by this application.
15 ///
16 /// See [C++ `wxStandardPaths::GetAppDocumentsDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#ae3a7994f9a565189daadb1544c5791e2).
17 fn get_app_documents_dir(&self) -> String {
18 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetAppDocumentsDir(self.as_ptr())).into() }
19 }
20 /// Return the directory containing the system config files.
21 ///
22 /// See [C++ `wxStandardPaths::GetConfigDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#aa89751fadd8ca041c4e0316d5008d3ca).
23 fn get_config_dir(&self) -> String {
24 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetConfigDir(self.as_ptr())).into() }
25 }
26 /// Return the location of the applications global, i.e. not user-specific, data files.
27 ///
28 /// See [C++ `wxStandardPaths::GetDataDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a07037fbc6c9d4afec0258d504a5e073e).
29 fn get_data_dir(&self) -> String {
30 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetDataDir(self.as_ptr())).into() }
31 }
32 /// Same as calling GetUserDir() with Dir_Documents parameter.
33 ///
34 /// See [C++ `wxStandardPaths::GetDocumentsDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a9f2ff127aabdba5a9ce474bd1105ad9a).
35 fn get_documents_dir(&self) -> String {
36 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetDocumentsDir(self.as_ptr())).into() }
37 }
38 /// Return the directory and the filename for the current executable.
39 ///
40 /// See [C++ `wxStandardPaths::GetExecutablePath()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#aff7a2321cd3389ae9d7c93dded616de6).
41 fn get_executable_path(&self) -> String {
42 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetExecutablePath(self.as_ptr())).into() }
43 }
44 /// Return the program installation prefix, e.g. /usr, /opt or /home/zeitlin.
45 ///
46 /// See [C++ `wxStandardPaths::GetInstallPrefix()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#ac22879eca20ea4fceca9b375f105d29d).
47 fn get_install_prefix(&self) -> String {
48 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetInstallPrefix(self.as_ptr())).into() }
49 }
50 /// Return the location for application data files which are host-specific and can't, or shouldn't, be shared with the other machines.
51 ///
52 /// See [C++ `wxStandardPaths::GetLocalDataDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a2a0ce6d61da8c28df8cd213493698697).
53 fn get_local_data_dir(&self) -> String {
54 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetLocalDataDir(self.as_ptr())).into() }
55 }
56 // NOT_SUPPORTED: fn GetLocalizedResourcesDir()
57 /// Return the directory where the loadable modules (plugins) live.
58 ///
59 /// See [C++ `wxStandardPaths::GetPluginsDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#af876b25e3fb9552e0c22b2331adfef36).
60 fn get_plugins_dir(&self) -> String {
61 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetPluginsDir(self.as_ptr())).into() }
62 }
63 /// Return the directory where the application resource files are located.
64 ///
65 /// See [C++ `wxStandardPaths::GetResourcesDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a4faa3ebe2c42f101601ead08afd561b9).
66 fn get_resources_dir(&self) -> String {
67 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetResourcesDir(self.as_ptr())).into() }
68 }
69 /// Return the directory for storing temporary files, for the current user.
70 ///
71 /// See [C++ `wxStandardPaths::GetTempDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a67e70dee83ed715db981eaad74cdf427).
72 fn get_temp_dir(&self) -> String {
73 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetTempDir(self.as_ptr())).into() }
74 }
75 /// Return the directory for the user config files.
76 ///
77 /// See [C++ `wxStandardPaths::GetUserConfigDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a0561d70f7da648e10b25bf9679309da3).
78 fn get_user_config_dir(&self) -> String {
79 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetUserConfigDir(self.as_ptr())).into() }
80 }
81 /// Return the directory for the user-dependent application data files:
82 ///
83 /// See [C++ `wxStandardPaths::GetUserDataDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a5b9d1b1addc3e4ce30ccb3817cbbe19b).
84 fn get_user_data_dir(&self) -> String {
85 unsafe { WxString::from_ptr(ffi::wxStandardPaths_GetUserDataDir(self.as_ptr())).into() }
86 }
87 // NOT_SUPPORTED: fn GetUserDir()
88 /// Return the directory for user data files which shouldn't be shared with the other machines.
89 ///
90 /// See [C++ `wxStandardPaths::GetUserLocalDataDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a7425a6e35c7fb12a0f47792b079ab05b).
91 fn get_user_local_data_dir(&self) -> String {
92 unsafe {
93 WxString::from_ptr(ffi::wxStandardPaths_GetUserLocalDataDir(self.as_ptr())).into()
94 }
95 }
96 /// MSW-specific function to customize application directory detection.
97 ///
98 /// See [C++ `wxStandardPaths::IgnoreAppSubDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#ab7534e9987d802dada6c02ab70fbaa96).
99 fn ignore_app_sub_dir(&self, subdir_pattern: &str) {
100 unsafe {
101 let subdir_pattern = WxString::from(subdir_pattern);
102 let subdir_pattern = subdir_pattern.as_ptr();
103 ffi::wxStandardPaths_IgnoreAppSubDir(self.as_ptr(), subdir_pattern)
104 }
105 }
106 /// MSW-specific function to ignore all common build directories.
107 ///
108 /// See [C++ `wxStandardPaths::IgnoreAppBuildSubDirs()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a36a497e73df7226240f8ac0f0dfa52bc).
109 fn ignore_app_build_sub_dirs(&self) {
110 unsafe { ffi::wxStandardPaths_IgnoreAppBuildSubDirs(self.as_ptr()) }
111 }
112 /// Lets wxStandardPaths know about the real program installation prefix on a Unix system.
113 ///
114 /// See [C++ `wxStandardPaths::SetInstallPrefix()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a80af124a7df05bf1a1f7bee7406d278f).
115 fn set_install_prefix(&self, prefix: &str) {
116 unsafe {
117 let prefix = WxString::from(prefix);
118 let prefix = prefix.as_ptr();
119 ffi::wxStandardPaths_SetInstallPrefix(self.as_ptr(), prefix)
120 }
121 }
122 /// Controls what application information is used when constructing paths that should be unique to this program, such as the application data directory, the plugins directory on Unix, etc.
123 ///
124 /// See [C++ `wxStandardPaths::UseAppInfo()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#ada72c782dcab502f17c348c0e5d3874c).
125 fn use_app_info(&self, info: c_int) {
126 unsafe { ffi::wxStandardPaths_UseAppInfo(self.as_ptr(), info) }
127 }
128 // NOT_SUPPORTED: fn SetFileLayout()
129 // NOT_SUPPORTED: fn GetFileLayout()
130 // NOT_SUPPORTED: fn MakeConfigFileName()
131 /// Returns reference to the unique global standard paths object.
132 ///
133 /// See [C++ `wxStandardPaths::Get()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#adcc47d33eccc3d432e40f6952d405c23).
134 fn get() -> StandardPathsIsOwned<false> {
135 unsafe { StandardPathsIsOwned::from_ptr(ffi::wxStandardPaths_Get()) }
136 }
137 /// Returns location of Windows shell special folder.
138 ///
139 /// See [C++ `wxStandardPaths::MSWGetShellDir()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_standard_paths.html#a5a523db5b6aca46154ac76d264d2bb57).
140 fn msw_get_shell_dir(csidl: c_int) -> String {
141 unsafe { WxString::from_ptr(ffi::wxStandardPaths_MSWGetShellDir(csidl)).into() }
142 }
143}