7#include <xtd/forms/open_file_name_flags.h>
14 class open_file_dialog;
15 class save_file_dialog;
48 virtual bool add_extension()
const {
return get_option(OFN_ADDEXTENSION);}
53 set_option(OFN_ADDEXTENSION, value);
68 auto_upgrade_enabled_ = value;
81 set_option(OFN_FILEMUSTEXIST, value);
92 set_option(OFN_PATHMUSTEXIST, value);
105 default_ext_ = value;
116 set_option(OFN_NODEREFERENCELINKS, !value);
140 virtual const std::vector<xtd::ustring>
file_names()
const {
return file_names_;}
176 filter_index_ = value;
197 initial_directory_ = value;
213 set_option(OFN_NOCHANGEDIR, value);
220 virtual bool show_help()
const {
return !get_option(OFN_SHOWHELP);}
226 set_option(OFN_SHOWHELP, value);
237 set_option(OFN_FORCESHOWHIDDEN, value);
243 virtual bool show_preview()
const {
return !get_option(OFN_SHOWPREVIEW);}
248 set_option(OFN_SHOWPREVIEW, value);
263 support_multi_dotted_extensions_ = value;
289 set_option(OFN_NOVALIDATE, !value);
300 return ustring::format(
"{}: title: {}, filename: {}", ustring::full_class_name(*
this), title_, file_name_);
305 return os << dialog.to_string();
320 bool get_option(
size_t flag)
const {
return (options_ & flag) == flag;}
321 void set_option(
size_t flag,
bool value) {options_ = value ? options_ | flag : options_ & ~flag;}
323 bool auto_upgrade_enabled_ =
true;
326 std::vector<xtd::ustring> file_names_;
328 size_t filter_index_ = 1;
330 size_t options_ = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_ADDEXTENSION;
331 bool support_multi_dotted_extensions_ =
true;
336 friend class open_file_dialog;
337 friend class save_file_dialog;
338 virtual bool run_file_dialog(intptr_t hwnd_owner) = 0;
339 virtual void run_file_sheet(intptr_t hwnd_owner) = 0;
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::forms::common_dialog class.
#define forms_export_
Define shared library export.
Definition: forms_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17