21 #ifndef FM_FILELAUNCHER_H
22 #define FM_FILELAUNCHER_H
24 #include "libfmqtglobals.h"
35 bool launchFiles(QWidget* parent, FmFileInfoList* file_infos) {
36 GList* fileList = fm_file_info_list_peek_head_link(file_infos);
37 return Fm::FileLauncher::launchFiles(parent, fileList);
39 bool launchPaths(QWidget* parent, FmPathList* paths) {
40 GList* pathList = fm_path_list_peek_head_link(paths);
41 return Fm::FileLauncher::launchPaths(parent, pathList);
44 bool launchFiles(QWidget* parent, GList* file_infos);
45 bool launchPaths(QWidget* parent, GList* paths);
49 virtual GAppInfo* getApp(GList* file_infos, FmMimeType* mime_type, GError** err);
50 virtual bool openFolder(GAppLaunchContext* ctx, GList* folder_infos, GError** err);
51 virtual FmFileLauncherExecAction execFile(FmFileInfo* file);
52 virtual bool error(GAppLaunchContext* ctx, GError* err, FmPath* path);
53 virtual int ask(
const char* msg,
char*
const* btn_labels,
int default_btn);
56 static GAppInfo* _getApp(GList* file_infos, FmMimeType* mime_type, gpointer user_data, GError** err) {
57 return reinterpret_cast<FileLauncher*
>(user_data)->getApp(file_infos, mime_type, err);
59 static gboolean _openFolder(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data, GError** err) {
60 return reinterpret_cast<FileLauncher*
>(user_data)->openFolder(ctx, folder_infos, err);
62 static FmFileLauncherExecAction _execFile(FmFileInfo* file, gpointer user_data) {
63 return reinterpret_cast<FileLauncher*
>(user_data)->execFile(file);
65 static gboolean _error(GAppLaunchContext* ctx, GError* err, FmPath* file, gpointer user_data) {
66 return reinterpret_cast<FileLauncher*
>(user_data)->error(ctx, err, file);
68 static int _ask(
const char* msg,
char*
const* btn_labels,
int default_btn, gpointer user_data) {
69 return reinterpret_cast<FileLauncher*
>(user_data)->ask(msg, btn_labels, default_btn);
73 static FmFileLauncher funcs;
78 #endif // FM_FILELAUNCHER_H
Definition: appchoosercombobox.cpp:26
Definition: filelauncher.h:30