PCManFM-Qt
view.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 PCMANFM_FOLDERVIEW_H
22 #define PCMANFM_FOLDERVIEW_H
23 
24 #include <libfm-qt/folderview.h>
25 #include <libfm-qt/core/filepath.h>
26 
27 
28 namespace Fm {
29 class FileMenu;
30 class FolderMenu;
31 }
32 
33 namespace PCManFM {
34 
35 class Settings;
36 
37 class View : public Fm::FolderView {
38  Q_OBJECT
39 public:
40 
41  explicit View(Fm::FolderView::ViewMode _mode = IconMode, QWidget* parent = 0);
42  virtual ~View();
43 
44  void updateFromSettings(Settings& settings);
45 
46  QSize getMargins() const {
47  return Fm::FolderView::getMargins();
48  }
49  void setMargins(QSize size) {
50  Fm::FolderView::setMargins(size);
51  }
52 
53 Q_SIGNALS:
54  void openDirRequested(const Fm::FilePath& path, int target);
55 
56 protected Q_SLOTS:
57  void onNewWindow();
58  void onNewTab();
59  void onOpenInTerminal();
60  void onSearch();
61 
62 protected:
63  virtual void onFileClicked(int type, const std::shared_ptr<const Fm::FileInfo>& fileInfo);
64  virtual void prepareFileMenu(Fm::FileMenu* menu);
65  virtual void prepareFolderMenu(Fm::FolderMenu* menu);
66 
67 private:
68 
69 };
70 
71 }
72 #endif // PCMANFM_FOLDERVIEW_H
PCManFM::View
Definition: view.h:37
PCManFM::Settings
Definition: settings.h:122