PCManFM-Qt
foldermenu.h
1 /*
2 
3  Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program 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
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 
21 #ifndef FM_FOLDERMENU_H
22 #define FM_FOLDERMENU_H
23 
24 #include "libfmqtglobals.h"
25 #include <QMenu>
26 #include <libfm/fm.h>
27 #include "foldermodel.h"
28 
29 class QAction;
30 
31 namespace Fm {
32 
33 class FolderView;
34 
35 class LIBFM_QT_API FolderMenu : public QMenu {
36 Q_OBJECT
37 
38 public:
39  explicit FolderMenu(FolderView* view, QWidget* parent = 0);
40  virtual ~FolderMenu();
41 
42  QAction* createAction() {
43  return createAction_;
44  }
45 
46  QAction* separator1() {
47  return separator1_;
48  }
49 
50  QAction* pasteAction() {
51  return pasteAction_;
52  }
53 
54  QAction* separator2() {
55  return separator2_;
56  }
57 
58  QAction* selectAllAction() {
59  return selectAllAction_;
60  }
61 
62  QAction* invertSelectionAction() {
63  return invertSelectionAction_;
64  }
65 
66  QAction* separator3() {
67  return separator3_;
68  }
69 
70  QAction* sortAction() {
71  return sortAction_;
72  }
73 
74  QAction* showHiddenAction() {
75  return showHiddenAction_;
76  }
77 
78  QAction* separator4() {
79  return separator4_;
80  }
81 
82  QAction* propertiesAction() {
83  return propertiesAction_;
84  }
85 
86  FolderView* view() {
87  return view_;
88  }
89 
90 protected Q_SLOTS:
91  void onPasteActionTriggered();
92  void onSelectAllActionTriggered();
93  void onInvertSelectionActionTriggered();
94  void onSortActionTriggered(bool checked);
95  void onSortOrderActionTriggered(bool checked);
96  void onShowHiddenActionTriggered(bool checked);
97  void onCaseSensitiveActionTriggered(bool checked);
98  void onFolderFirstActionTriggered(bool checked);
99  void onPropertiesActionTriggered();
100 
101 private:
102  void createSortMenu();
103  void addSortMenuItem(QString title, int id);
104 
105 private:
106  FolderView* view_;
107  QAction* createAction_;
108  QAction* separator1_;
109  QAction* pasteAction_;
110  QAction* separator2_;
111  QAction* selectAllAction_;
112  QAction* invertSelectionAction_;
113  QAction* separator3_;
114  QAction* sortAction_;
115  QActionGroup* sortActionGroup_;
116  QMenu* sortMenu_;
117  QAction* sortActions_[FolderModel::NumOfColumns];
118  QAction* actionAscending_;
119  QAction* actionDescending_;
120  QAction* showHiddenAction_;
121  QAction* separator4_;
122  QAction* propertiesAction_;
123 };
124 
125 }
126 
127 #endif // FM_FOLDERMENU_H
Definition: appchoosercombobox.cpp:26
Definition: foldermenu.h:35
Definition: folderview.h:42