PCManFM-Qt
appchooserdialog.h
1 /*
2  * Copyright 2010-2014 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
3  * Copyright 2012-2013 Andriy Grytsenko (LStranger) <andrej@rep.kiev.ua>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  */
20 
21 #ifndef FM_APPCHOOSERDIALOG_H
22 #define FM_APPCHOOSERDIALOG_H
23 
24 #include <QDialog>
25 #include "libfmqtglobals.h"
26 #include <libfm/fm.h>
27 
28 namespace Ui {
29  class AppChooserDialog;
30 }
31 
32 namespace Fm {
33 
34 class LIBFM_QT_API AppChooserDialog : public QDialog {
35  Q_OBJECT
36 public:
37  explicit AppChooserDialog(FmMimeType* mimeType, QWidget* parent = NULL, Qt::WindowFlags f = 0);
39 
40  virtual void accept();
41 
42  void setMimeType(FmMimeType* mimeType);
43  FmMimeType* mimeType() {
44  return mimeType_;
45  }
46 
47  void setCanSetDefault(bool value);
48  bool canSetDefault() {
49  return canSetDefault_;
50  }
51 
52  GAppInfo* selectedApp() {
53  return G_APP_INFO(g_object_ref(selectedApp_));
54  }
55 
56  bool isSetDefault();
57 
58 private:
59  GAppInfo* customCommandToApp();
60 
61 private Q_SLOTS:
62  void onSelectionChanged();
63  void onTabChanged(int index);
64 
65 private:
66  Ui::AppChooserDialog* ui;
67  FmMimeType* mimeType_;
68  bool canSetDefault_;
69  GAppInfo* selectedApp_;
70 };
71 
72 }
73 
74 #endif // FM_APPCHOOSERDIALOG_H
Definition: appchoosercombobox.cpp:26
Definition: appchooserdialog.h:28
Definition: appchooserdialog.h:34