xtd 0.2.0
file_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "common_dialog.h"
6 #include <xtd/forms/open_file_name_flags>
7 #include <vector>
8 
10 namespace xtd {
12  namespace forms {
14  class open_file_dialog;
15  class save_file_dialog;
17 
43  class forms_export_ file_dialog : public common_dialog {
44  struct data;
45 
46  public:
48 
51  file_dialog();
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 }
A Help button appears in the color dialog box.
Displays a dialog box from which the user can select a file.
Definition: file_dialog.h:43
Whether the dialog box displays a warning if the user specifies a file name that does not exist...
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
Whether the dialog box supports displaying and saving files that have multiple file name extensions...
Contains xtd::forms::common_dialog class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Whether the dialog box restores the directory to the previously selected directory before closing...
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Prompts the user to select a location for saving a file. This class cannot be inherited.
Definition: save_file_dialog.h:28
Whether preview file is displayed in the file dialog box.
Whether hidden files are 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.h:28
Whether the dialog box accepts only valid file names.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Whether the dialog box returns the location of the file referenced by the shortcut (...
Specifies the base class used for displaying dialog boxes on the screen.
Definition: common_dialog.h:32