xtd 0.2.0
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 virtual bool add_extension() const noexcept;
65 virtual file_dialog& add_extension(bool value);
66
71 virtual bool auto_upgrade_enabled() const noexcept;
77 virtual file_dialog& auto_upgrade_enabled(bool value);
78
82 virtual bool check_file_exists() const noexcept;
87 virtual file_dialog& check_file_exists(bool value);
88
91 virtual bool check_path_exists() const noexcept;
95 virtual file_dialog& check_path_exists(bool value);
96
100 virtual const xtd::string& default_ext() const noexcept;
105 virtual file_dialog& default_ext(const xtd::string& value);
106
109 virtual bool dereference_link() const noexcept;
113 virtual file_dialog& dereference_link(bool value);
114
120 virtual const xtd::string& file_name() const noexcept;
127 virtual file_dialog& file_name(const xtd::string& value);
128
132 virtual xtd::array<xtd::string> file_names() const noexcept;
133
142 virtual const xtd::string& filter() const noexcept;
152 virtual file_dialog& filter(const xtd::string& value);
153
158 virtual size_t filter_index() const noexcept;
164 virtual file_dialog& filter_index(size_t value);
165
173 virtual const xtd::string& initial_directory() const noexcept;
182 virtual file_dialog& initial_directory(const xtd::string& value);
183
187 size_t options() const noexcept;
188
191 virtual bool restore_directory() const noexcept;
195 virtual file_dialog& restore_directory(bool value);
196
200 virtual bool show_help() const noexcept;
205 virtual file_dialog& show_help(bool value);
206
209 virtual bool show_hidden_files() const noexcept;
213 virtual file_dialog& show_hidden_files(bool value);
214
217 virtual bool show_preview() const noexcept;
221 virtual file_dialog& show_preview(bool value);
222
227 virtual bool support_multi_dotted_extensions() const noexcept;
234
238 virtual const xtd::string& title() const noexcept;
243 virtual file_dialog& title(const xtd::string& value);
244
248 virtual bool validate_names() const noexcept;
253 virtual file_dialog& validate_names(bool value);
255
257
261 void reset() noexcept override;
262
265 xtd::string to_string() const noexcept override;
267
268 protected:
270
276 bool run_dialog(intptr hwnd_owner) override;
279 void run_sheet(intptr hwnd_owner) override;
281
283 bool get_option(size_t flag) const noexcept;
284 void set_option(size_t flag, bool value);
286
287 private:
288 friend class open_file_dialog;
289 friend class save_file_dialog;
290 virtual bool run_file_dialog(intptr hwnd_owner) = 0;
291 virtual void run_file_sheet(intptr hwnd_owner) = 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:61
common_dialog()
Initializes a new instance of the common_dialog class.
virtual bool restore_directory() const noexcept
Gets a value indicating whether the dialog box restores the directory to the previously selected dire...
xtd::string to_string() const noexcept override
Provides a string version of this object.
bool run_dialog(intptr hwnd_owner) override
Runs file dialog box.
virtual const xtd::string & filter() const noexcept
Gets the current file name filter string, which determines the choices that appear in the "Save as fi...
virtual const xtd::string & title() const noexcept
Gets the file dialog box title.
size_t options() const noexcept
Gets values to initialize the file_dialog.
virtual xtd::array< xtd::string > file_names() const noexcept
Gets the file names of all selected files in the dialog box.
virtual bool auto_upgrade_enabled() const noexcept
Gets a value indicating whether this file_dialog instance should automatically upgrade appearance and...
virtual bool support_multi_dotted_extensions() const noexcept
Gets whether the dialog box supports displaying and saving files that have multiple file name extensi...
virtual bool add_extension() const noexcept
Gets a value indicating whether the dialog box automatically adds an extension to a file name if the ...
virtual const xtd::string & file_name() const noexcept
Gets a string containing the file name selected in the file dialog box.
virtual bool show_help() const noexcept
Gets a value indicating whether the Help button is displayed in the file dialog box.
virtual size_t filter_index() const noexcept
Gets the index of the filter currently selected in the file dialog box.
virtual const xtd::string & initial_directory() const noexcept
Gets the initial directory displayed by the file dialog box.
virtual bool show_hidden_files() const noexcept
Gets a value indicating whether hidden files are displayed in the file dialog box.
virtual bool check_file_exists() const noexcept
Gets a value indicating whether the dialog box displays a warning if the user specifies a file name t...
void reset() noexcept override
Resets all properties to their default values.
virtual const xtd::string & default_ext() const noexcept
Gets the default file name extension.
file_dialog()
Initializes a new instance of the common_dialog class.
virtual bool validate_names() const noexcept
Gets a value indicating whether the dialog box accepts only valid file names.
virtual bool check_path_exists() const noexcept
Gets a value indicating whether the dialog box displays a warning if the user specifies a path that d...
void run_sheet(intptr hwnd_owner) override
Runs file dialog box in sheet mode.
virtual bool dereference_link() const noexcept
Gets a value indicating whether the dialog box returns the location of the file referenced by the sho...
virtual bool show_preview() const noexcept
Gets a value indicating whether preview file 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
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
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 const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201