xtd 0.2.0
Loading...
Searching...
No Matches
file_dialog.h
Go to the documentation of this file.
1
4#pragma once
5#include "common_dialog.h"
6#include <xtd/forms/open_file_name_flags>
7#include <vector>
8
10namespace xtd {
12 namespace forms {
14 class open_file_dialog;
15 class save_file_dialog;
17
44 struct data;
45
46 public:
48
53
55
59 virtual bool add_extension() const noexcept;
63 virtual file_dialog& add_extension(bool value);
64
69 virtual bool auto_upgrade_enabled() const noexcept;
75 virtual file_dialog& auto_upgrade_enabled(bool value);
76
80 virtual bool check_file_exists() const noexcept;
85 virtual file_dialog& check_file_exists(bool value);
86
89 virtual bool check_path_exists() const noexcept;
93 virtual file_dialog& check_path_exists(bool value);
94
98 virtual const xtd::ustring& default_ext() const noexcept;
103 virtual file_dialog& default_ext(const xtd::ustring& value);
104
107 virtual bool dereference_link() const noexcept;
111 virtual file_dialog& dereference_link(bool value);
112
118 virtual const xtd::ustring& file_name() const noexcept;
125 virtual file_dialog& file_name(const xtd::ustring& value);
126
130 virtual const std::vector<xtd::ustring> file_names() const noexcept;
131
140 virtual const xtd::ustring& filter() const noexcept;
150 virtual file_dialog& filter(const xtd::ustring& value);
151
156 virtual size_t filter_index() const noexcept;
162 virtual file_dialog& filter_index(size_t value);
163
171 virtual const xtd::ustring& initial_directory() const noexcept;
180 virtual file_dialog& initial_directory(const xtd::ustring& value);
181
185 size_t options() const noexcept;
186
189 virtual bool restore_directory() const noexcept;
193 virtual file_dialog& restore_directory(bool value);
194
198 virtual bool show_help() const noexcept;
203 virtual file_dialog& show_help(bool value);
204
207 virtual bool show_hidden_files() const noexcept;
211 virtual file_dialog& show_hidden_files(bool value);
212
215 virtual bool show_preview() const noexcept;
219 virtual file_dialog& show_preview(bool value);
220
225 virtual bool support_multi_dotted_extensions() const noexcept;
231 virtual file_dialog& support_multi_dotted_extensions(bool value);
232
236 virtual const xtd::ustring& title() const noexcept;
241 virtual file_dialog& title(const xtd::ustring& value);
242
246 virtual bool validate_names() const noexcept;
251 virtual file_dialog& validate_names(bool value);
253
255
259 void reset() noexcept override;
260
263 xtd::ustring to_string() const noexcept override;
265
266 protected:
268
274 bool run_dialog(intptr hwnd_owner) override;
277 void run_sheet(intptr hwnd_owner) override;
279
281 bool get_option(size_t flag) const noexcept;
282 void set_option(size_t flag, bool value);
284
285 private:
286 friend class open_file_dialog;
287 friend class save_file_dialog;
288 virtual bool run_file_dialog(intptr hwnd_owner) = 0;
289 virtual void run_file_sheet(intptr hwnd_owner) = 0;
290
291 std::shared_ptr<data> data_;
292 };
293 }
294}
Specifies the base class used for displaying dialog boxes on the screen.
Definition common_dialog.h:32
Displays a dialog box from which the user can select a file.
Definition file_dialog.h:43
virtual bool add_extension() const noexcept
Gets a value indicating whether the dialog box automatically adds an extension to a file name if the ...
file_dialog()
Initializes a new instance of the common_dialog class.
Displays a standard dialog box that prompts the user to open a file. This class cannot be inherited.
Definition open_file_dialog.h:28
Prompts the user to select a location for saving a file. This class cannot be inherited.
Definition save_file_dialog.h:28
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::forms::common_dialog class.
#define forms_export_
Define shared library export.
Definition forms_export.h:13
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10