1 /**************************************************************************
2 ** This file is part of LiteIDE
3 **
4 ** Copyright (c) 2011-2019 LiteIDE. All rights reserved.
5 **
6 ** This library is free software; you can redistribute it and/or
7 ** modify it under the terms of the GNU Lesser General Public
8 ** License as published by the Free Software Foundation; either
9 ** version 2.1 of the License, or (at your option) any later version.
10 **
11 ** This library is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ** Lesser General Public License for more details.
15 **
16 ** In addition, as a special exception,  that plugins developed for LiteIDE,
17 ** are allowed to remain closed sourced and can be distributed under any license .
18 ** These rights are included in the file LGPL_EXCEPTION.txt in this package.
19 **
20 **************************************************************************/
21 // Module: folderlistview.h
22 // Creator: visualfc <visualfc@gmail.com>
23 
24 #ifndef FOLDERLISTVIEW_H
25 #define FOLDERLISTVIEW_H
26 
27 #include "basefoldeview.h"
28 #include "folderlistmodel.h"
29 #include <QFileInfo>
30 
31 class QSortFilterProxyModel;
32 class FolderListView : public BaseFolderView
33 {
34     Q_OBJECT
35 public:
36     explicit FolderListView(bool proxyMode, LiteApi::IApplication *app, QWidget *parent = 0);
37     void setFilter(QDir::Filters filters);
38     QDir::Filters filter() const;
39     QFileInfo fileInfo(const QModelIndex &index) const;
40 public:
41     bool addRootPath(const QString &path);
42     void setRootPathList(const QStringList &pathList);
43     QStringList rootPathList() const;
44     void clear();
45     void expandFolder(const QString &path, bool expand);
46     QList<QModelIndex> indexForPath(const QString &path) const;
47 public slots:
48     void customContextMenuRequested(const QPoint &pos);
49     virtual void removeFolder();
50     virtual void removeFile();
51     virtual void openFolder();
52     virtual void closeFolder();
53     virtual void reloadFolder();
54     virtual void closeAllFolders();
55 protected:
56     QSortFilterProxyModel *m_proxy;
57     FolderListModel *m_model;
58 };
59 
60 #endif // FOLDERLISTVIEW_H
61