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
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 const std::vector<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;
233 virtual file_dialog& support_multi_dotted_extensions(bool value);
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}
Specifies the base class used for displaying dialog boxes on the screen.
Definition common_dialog.h:34
Displays a dialog box from which the user can select a file.
Definition file_dialog.h:45
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:30
Prompts the user to select a location for saving a file. This class cannot be inherited.
Definition save_file_dialog.h:30
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 intptr.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
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