MauiKit File Browsing
fmstatic.h
27 * @brief The FMStatic class is a group of static file management methods, this class has a constructor only as a way to register it to QML, however all methods in here are static.
168 * @brief The map set of the supported mime types for the FM classes. This structure maps the `FILTER_TYPE` to the associated list of mime types.
169 * * For example `SUPPORTED_MIMETYPES[FILTER_TYPE::AUDIO]` would return a list of mimetypes associated to the FILTER_TYPE::AUDIO, such as `"audio/mpeg", "audio/mp4", "audio/flac", "audio/ogg", "audio/wav"`.
171 inline static const QMap<FILTER_TYPE, QStringList> SUPPORTED_MIMETYPES {{FILTER_TYPE::AUDIO, AUDIO_MIMETYPES},
180 * @brief Given a FILTER_TYPE and its associated mime-types, return a list of all the supported file extension suffixes.
182 * @param cb a callback function to modify the gathered suffix extension. This function will receive the supported suffix and it can return a new string of a modified suffix or the same one. This is optional.
185 inline static QStringList getMimeTypeSuffixes(const FILTER_TYPE &type, QString (*cb)(QString) = nullptr)
211 * The values make use of the regex wildcard operator [*] meant for filtering a directory contents, for example.
212 * `FILTER_LIST[FILTER_TYPE::AUDIO]` could possible return something alike `["*.mp3", "*.mp4", "*.mpeg", "*.wav"]` etc.
251 /** * @brief The different location types supported. Most of them need of KDE KIO framework to be fully operational. */
331 * For example `PATHTYPE_SCHEME[PATHTYPE_KEY::TRASH_PATH] = "trash"`, `PATHTYPE_SCHEME[PATHTYPE_KEY::PLACES_PATH] = "file"`
333 inline static const QHash<PATHTYPE_KEY, QString> PATHTYPE_SCHEME = {{PATHTYPE_KEY::PLACES_PATH, QStringLiteral("file")},
351 inline static const QHash<QString, PATHTYPE_KEY> PATHTYPE_SCHEME_NAME = {{PATHTYPE_SCHEME[PATHTYPE_KEY::PLACES_PATH], PATHTYPE_KEY::PLACES_PATH},
367 * For example `PATHTYPE_URIE[PATHTYPE_KEY::TRASH_PATH] = "trash://"`, `PATHTYPE_URI[PLACES_PATH] = "file://"`
369 inline static const QHash<PATHTYPE_KEY, QString> PATHTYPE_URI = {{PATHTYPE_KEY::PLACES_PATH, PATHTYPE_SCHEME[PATHTYPE_KEY::PLACES_PATH] + QStringLiteral("://")},
370 {PATHTYPE_KEY::BOOKMARKS_PATH, PATHTYPE_SCHEME[PATHTYPE_KEY::BOOKMARKS_PATH] + QStringLiteral("://")},
371 {PATHTYPE_KEY::DRIVES_PATH, PATHTYPE_SCHEME[PATHTYPE_KEY::DRIVES_PATH] + QStringLiteral("://")},
373 {PATHTYPE_KEY::REMOTE_PATH, PATHTYPE_SCHEME[PATHTYPE_KEY::REMOTE_PATH] + QStringLiteral("://")},
374 {PATHTYPE_KEY::REMOVABLE_PATH, PATHTYPE_SCHEME[PATHTYPE_KEY::REMOVABLE_PATH] + QStringLiteral("://")},
375 {PATHTYPE_KEY::UNKNOWN_TYPE, PATHTYPE_SCHEME[PATHTYPE_KEY::UNKNOWN_TYPE] + QStringLiteral("://")},
386 * @warning This is a user visible and translatable string, so it should not be used as a key anywhere
392 inline static const QString DataPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
395 inline static const QString ConfigPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)).toString();
401 inline static const QString DesktopPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString();
404 inline static const QString AppsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).toString();
413 inline static const QString MusicPath = QUrl::fromLocalFile(MAUIAndroid::getStandardPath(QStandardPaths::MusicLocation)).toString();
414 inline static const QString PicturesPath = QUrl::fromLocalFile(MAUIAndroid::getStandardPath(QStandardPaths::PicturesLocation)).toString();
415 inline static const QString DownloadsPath = QUrl::fromLocalFile(MAUIAndroid::getStandardPath(QStandardPaths::DownloadLocation)).toString();
416 inline static const QString DocumentsPath = QUrl::fromLocalFile(MAUIAndroid::getStandardPath(QStandardPaths::DocumentsLocation)).toString();
417 inline static const QString VideosPath = QUrl::fromLocalFile(MAUIAndroid::getStandardPath(QStandardPaths::MoviesLocation)).toString();
430 inline static const QString HomePath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)).toString();
431 inline static const QString MusicPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).toString();
432 inline static const QString PicturesPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)).toString();
433 inline static const QString DownloadsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString();
434 inline static const QString DocumentsPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString();
435 inline static const QString VideosPath = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)).toString();
457 inline static const QMap<QString, QString> folderIcon {{PicturesPath, QStringLiteral("folder-pictures")},
477 static FMH::MODEL_LIST search(const QString &query, const QUrl &path, const bool &hidden = false, const bool &onlyDirs = false, const QStringList &filters = QStringList());
486 * @brief A model list of the default paths in most systems, such as Home, Pictures, Video, Downloads, Music and Documents folders
494 * @param type the type of the list of URLs, such as local, remote etc. This value is inserted with the key `FMH::MODEL_KEY::TYPE`
517 * @brief Perform a move/cut of a list of files to a destination. This function also moves the associated tags.
531 * @brief List of files to be removed completely. This function also removes the associated tags to the files.
600 static void setDirConf(const QUrl &path, const QString &group, const QString &key, const QVariant &value);
603 * @brief Checks if a mime-type belongs to a file type, for example, whether `image/jpg` belongs to the type `FMH::FILTER_TYPE`
612 * @brief Moves to the trashcan the provided file URLs. The associated tags are kept in case the files are restored.
The FMStatic class is a group of static file management methods, this class has a constructor only as...
Definition fmstatic.h:30
static QStringList getMimeTypeSuffixes(const FILTER_TYPE &type, QString(*cb)(QString)=nullptr)
Given a FILTER_TYPE and its associated mime-types, return a list of all the supported file extension ...
Definition fmstatic.h:185
PATHTYPE_KEY
The different location types supported. Most of them need of KDE KIO framework to be fully operationa...
Definition fmstatic.h:252
static QString homePath()
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
suffixes
Q_SLOTSQ_SLOTS
GenericDataLocation
QString writableLocation(StandardLocation type)
QUrl fromLocalFile(const QString &localFile)
QString toString(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.