34#include <NDEVR/QCustomStackedWidget.h>
35#include <NDEVR/File.h>
36#include <NDEVR/FileFormat.h>
37#include <NDEVR/Buffer.h>
38#include <NDEVR/UUID.h>
39#include <NDEVR/INIInterface.h>
45#if NDEVR_SUPPORTS_THREADING
53 class QCustomTableWidget;
57 class QCustomLineEdit;
58 class QCustomComboBox;
59 class QCustomMessageBox;
60 class FolderCreatorWidget;
68 QPointer<QCustomTableWidget>
table;
82#if NDEVR_SUPPORTS_THREADING
83 friend class ImageCacheThread;
165 void contextMenu(
const QPoint &pos);
166 void browsingFinished();
167 void updateFilesSlot();
174 QIcon _getIconCallback(
const File& file);
176 void _setCurrentDirectory(
const File& dir);
177 void onUserReadyToFinish(
bool was_browsing);
179 void setFileIcon(
File file, QIcon icon);
182 virtual void getINI(
INIFactory& factory)
override;
183 bool getSelectedFilters(QString & selected_filter, QString & default_suffix);
185 void resolveIcon(
const File& file);
193 File m_current_directory;
194 File m_fallback_directory;
195 String m_current_file_name;
196 String m_current_file_extension;
199 QHBoxLayout* m_top_layout;
202 bool m_show_recents =
true;
203 bool m_touch_prefer_gallery =
true;
204 bool m_desktop_prefer_gallery =
false;
205 bool m_show_hidden =
false;
206 bool m_show_extensions =
true;
207 bool m_show_favorites;
209 FolderCreatorWidget* m_folder_creation_widget;
215 Button* m_database_button;
218 Button* m_new_folder_button;
219 Button* m_up_level_button;
220 Button* m_favorites_button;
221 QWidget* m_navigation_buttons;
222 QWidget* m_bottom_buttons;
223 QWidget* m_favorites_panel;
231 QIcon m_loading_icon;
232 QWidget* m_popup_dialog;
233 QWidget* m_settings_dialog;
238#if NDEVR_SUPPORTS_THREADING
239 QThread* m_icon_thread =
nullptr;
241 QWidget* m_native_parent =
nullptr;
243 std::function<bool(
const FileFormat&,
const File&)> m_can_read_callback;
248 bool m_neeeds_to_update =
false;
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Definition FileChooserDialog.h:79
void setAdditionalFavorites(Buffer< File > favorites)
void showFileSize(bool show_modified_time)
void setActionName(const TranslatedString &action_name)
void addToRecents(const Buffer< File > &files)
void removeFromRecents(File item)
void setSaveContent(const Buffer< UUID > &save_content)
Definition FileChooserDialog.h:105
FileFormat getFileFormat(const File &file)
TranslatedString windowTitle() const
void setCurrentFileName(const String &name)
void setAllowAny(bool allow_any)
Definition FileChooserDialog.h:101
QWidget * createRequestWidget(File item)
QSize sizeHint() const override
void addItem(ButtonGallery *gallery, QCustomTableWidget *table, uint04 index, const File &item)
const Buffer< FileRequest > & getSelectedRequests() const
void autoShowDialog(PopupInfo info=PopupInfo())
FileFormat currentSelectedFormat() const
bool isFolderBrowser() const
void updateGallery(Button *b)
bool showFavorites() const
bool isSaveDialog() const
Definition FileChooserDialog.h:102
void setCurrentFile(const File &file)
FileFormat getFileFormat(const QString &file, const QString &string) const
void onFileChosen(File file)
DisplayMode
Definition FileChooserDialog.h:86
TranslatedString actionName() const
void autoSelectFavoritesItem()
void setIconProvider(const std::function< String(const FileRequest &)> &icon_provider)
FileChooserDialog(bool save_dialog=false, QWidget *parent=nullptr)
Buffer< File > getSelected() const
bool m_allow_any
Definition FileChooserDialog.h:246
void prepareForINI(INIFactory &factory) override
void finishReadingINI(INIFactory &factory) override
void onFileChoosenSignal()
QWidget * settingsDialog()
bool event(QEvent *e) override
void setCurrentExtension(const String &extension, bool update_format_to_first_match)
void updateTableIconSize(QCustomTableWidget *table)
QWidget * createBottomPanel()
void updateBrowserWidgets()
String extensionsString(const String &delimiter=";;") const
void setFallbackDirectory(const File &file)
const Buffer< File > favoriteFiles() const
QWidget * createNavigationButtons()
void addToRecents(const File &file)
const File & currentDirectory() const
Definition FileChooserDialog.h:131
Buffer< FileRequest > m_selected_files
Definition FileChooserDialog.h:245
QWidget * createfavoritesPanel()
void setNativeParent(QWidget *native_parent)
void setIsFileChooser(bool is_file_chooser)
Buffer< File > filterFiles(const Buffer< File > &all_files) const
void browseFile(PopupInfo popup_origin=PopupInfo())
bool checkFileAgainstFilter(const File &file, const FileFormat &selected_format) const
void setCanReadCallback(const std::function< bool(const FileFormat &, const File &)> &callback)
void setCurrentDirectory(const File ¤t_directory)
void selectFileNameField()
void autoHideDialog(PopupInfo info=PopupInfo())
void setShowRecents(bool show_recent)
bool showRecents() const
Definition FileChooserDialog.h:116
const Buffer< UUID > & saveContent() const
Definition FileChooserDialog.h:106
const Buffer< File > & currentDirectoryFiles() const
void showAccessedTime(bool show_accessed_time)
FileChooserDialog(const File &ini_location, bool save_dialog=false, QWidget *parent=nullptr)
FileFormat getFileFormatFromExtension(const String &ext) const
void showModifiedTime(bool show_modified_time)
void setOptions(const Buffer< FileFormat > &extensions, bool save_dialog)
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:68
Contains methods for easily reading and writing to an INI file including.
Definition INIInterface.h:45
A compact way to present a list of options to the user.
Definition QCustomCombobox.h:53
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition QCustomLineEdit.h:56
A message box displays a primary text to alert the user to a situation, an informative text to furthe...
Definition QCustomMessageBox.h:61
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
A FileRequest bundles format data as well as a particular file.
Definition FileFormat.h:75