xtd 1.0.0
Loading...
Searching...
No Matches
file_dialog.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "common_dialog.hpp"
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
46 struct data;
47
48 public:
50
55
57
61 [[nodiscard]] virtual auto add_extension() const noexcept -> bool;
65 virtual auto add_extension(bool value) -> file_dialog&;
66
71 [[nodiscard]] virtual auto auto_upgrade_enabled() const noexcept -> bool;
77 virtual auto auto_upgrade_enabled(bool value) -> file_dialog&;
78
82 [[nodiscard]] virtual auto check_file_exists() const noexcept -> bool;
87 virtual auto check_file_exists(bool value) -> file_dialog&;
88
91 [[nodiscard]] virtual auto check_path_exists() const noexcept -> bool;
95 virtual auto check_path_exists(bool value) -> file_dialog&;
96
100 [[nodiscard]] virtual auto default_ext() const noexcept -> const xtd::string&;
105 virtual auto default_ext(const xtd::string& value) -> file_dialog&;
106
109 [[nodiscard]] virtual auto dereference_link() const noexcept -> bool;
113 virtual auto dereference_link(bool value) -> file_dialog&;
114
120 [[nodiscard]] virtual auto file_name() const noexcept -> const xtd::string&;
127 virtual auto file_name(const xtd::string& value) -> file_dialog&;
128
132 [[nodiscard]] virtual auto file_names() const noexcept -> xtd::array<xtd::string>;
133
142 [[nodiscard]] virtual auto filter() const noexcept -> const xtd::string&;
152 virtual auto filter(const xtd::string& value) -> file_dialog&;
153
158 [[nodiscard]] virtual auto filter_index() const noexcept -> xtd::usize;
164 virtual auto filter_index(xtd::usize value) -> file_dialog&;
165
173 [[nodiscard]] virtual auto initial_directory() const noexcept -> const xtd::string&;
182 virtual auto initial_directory(const xtd::string& value) -> file_dialog&;
183
187 [[nodiscard]] auto options() const noexcept -> xtd::usize;
188
191 [[nodiscard]] virtual auto restore_directory() const noexcept -> bool;
195 virtual auto restore_directory(bool value) -> file_dialog&;
196
200 [[nodiscard]] virtual auto show_help() const noexcept -> bool;
205 virtual auto show_help(bool value) -> file_dialog&;
206
209 [[nodiscard]] virtual auto show_hidden_files() const noexcept -> bool;
213 virtual auto show_hidden_files(bool value) -> file_dialog&;
214
217 [[nodiscard]] virtual auto show_preview() const noexcept -> bool;
221 virtual auto show_preview(bool value) -> file_dialog&;
222
227 [[nodiscard]] virtual auto support_multi_dotted_extensions() const noexcept -> bool;
233 virtual auto support_multi_dotted_extensions(bool value) -> file_dialog&;
234
238 [[nodiscard]] virtual auto title() const noexcept -> const xtd::string&;
243 virtual auto title(const xtd::string& value) -> file_dialog&;
244
248 [[nodiscard]] virtual auto validate_names() const noexcept -> bool;
253 virtual auto validate_names(bool value) -> file_dialog&;
255
257
261 auto reset() noexcept -> void override;
262
265 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
267
268 protected:
270
276 [[nodiscard]] auto run_dialog(xtd::intptr hwnd_owner) -> bool override;
279 auto run_sheet(xtd::intptr hwnd_owner) -> void override;
281
283 [[nodiscard]] auto get_option(xtd::usize flag) const noexcept -> bool;
284 auto set_option(xtd::usize flag, bool value) -> void;
286
287 private:
288 friend class open_file_dialog;
289 friend class save_file_dialog;
290 virtual auto run_file_dialog(intptr hwnd_owner) -> bool = 0;
291 virtual auto run_file_sheet(intptr hwnd_owner) -> void = 0;
292
293 xtd::sptr<data> data_;
294 };
295 }
296}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Specifies the base class used for displaying dialog boxes on the screen.
Definition common_dialog.hpp:34
virtual auto support_multi_dotted_extensions() const noexcept -> bool
Gets whether the dialog box supports displaying and saving files that have multiple file name extensi...
auto reset() noexcept -> void override
Resets all properties to their default values.
virtual auto check_path_exists() const noexcept -> bool
Gets a value indicating whether the dialog box displays a warning if the user specifies a path that d...
virtual auto title() const noexcept -> const xtd::string &
Gets the file dialog box title.
virtual auto default_ext() const noexcept -> const xtd::string &
Gets the default file name extension.
virtual auto file_names() const noexcept -> xtd::array< xtd::string >
Gets the file names of all selected files in the dialog box.
virtual auto dereference_link() const noexcept -> bool
Gets a value indicating whether the dialog box returns the location of the file referenced by the sho...
virtual auto filter() const noexcept -> const xtd::string &
Gets the current file name filter string, which determines the choices that appear in the "Save as fi...
virtual auto file_name() const noexcept -> const xtd::string &
Gets a string containing the file name selected in the file dialog box.
virtual auto show_hidden_files() const noexcept -> bool
Gets a value indicating whether hidden files are displayed in the file dialog box.
virtual auto show_preview() const noexcept -> bool
Gets a value indicating whether preview file is displayed in the file dialog box.
auto run_dialog(xtd::intptr hwnd_owner) -> bool override
Runs file dialog box.
virtual auto initial_directory() const noexcept -> const xtd::string &
Gets the initial directory displayed by the file dialog box.
virtual auto filter_index() const noexcept -> xtd::usize
Gets the index of the filter currently selected in the file dialog box.
auto to_string() const noexcept -> xtd::string override
Provides a string version of this object.
auto run_sheet(xtd::intptr hwnd_owner) -> void override
Runs file dialog box in sheet mode.
file_dialog()
Initializes a new instance of the common_dialog class.
virtual auto validate_names() const noexcept -> bool
Gets a value indicating whether the dialog box accepts only valid file names.
auto options() const noexcept -> xtd::usize
Gets values to initialize the file_dialog.
virtual auto add_extension() const noexcept -> bool
Gets a value indicating whether the dialog box automatically adds an extension to a file name if the ...
virtual auto restore_directory() const noexcept -> bool
Gets a value indicating whether the dialog box restores the directory to the previously selected dire...
virtual auto check_file_exists() const noexcept -> bool
Gets a value indicating whether the dialog box displays a warning if the user specifies a file name t...
virtual auto auto_upgrade_enabled() const noexcept -> bool
Gets a value indicating whether this file_dialog instance should automatically upgrade appearance and...
virtual auto show_help() const noexcept -> bool
Gets a value indicating whether the Help button is displayed in the file dialog box.
Displays a standard dialog box that prompts the user to open a file. This class cannot be inherited.
Definition open_file_dialog.hpp:30
Prompts the user to select a location for saving a file. This class cannot be inherited.
Definition save_file_dialog.hpp:30
Contains xtd::forms::common_dialog class.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197