summaryrefslogtreecommitdiff
path: root/src/qdeclarativefolderlistmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdeclarativefolderlistmodel.h')
-rw-r--r--src/qdeclarativefolderlistmodel.h132
1 files changed, 0 insertions, 132 deletions
diff --git a/src/qdeclarativefolderlistmodel.h b/src/qdeclarativefolderlistmodel.h
deleted file mode 100644
index d26003cd..00000000
--- a/src/qdeclarativefolderlistmodel.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Components project.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEFOLDERLISTMODEL_H
-#define QDECLARATIVEFOLDERLISTMODEL_H
-
-#include <qqml.h>
-#include <QStringList>
-#include <QUrl>
-#include <QAbstractListModel>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeContext;
-class QModelIndex;
-
-class QDeclarativeFolderListModelPrivate;
-
-class QDeclarativeFolderListModel : public QAbstractListModel, public QQmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QQmlParserStatus)
-
- Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged)
- Q_PROPERTY(QUrl parentFolder READ parentFolder NOTIFY folderChanged)
- Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters)
- Q_PROPERTY(SortField sortField READ sortField WRITE setSortField)
- Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed)
- Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs)
- Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot)
- Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable)
- Q_PROPERTY(int count READ count NOTIFY countChanged)
-public:
- QDeclarativeFolderListModel(QObject *parent = 0);
- ~QDeclarativeFolderListModel();
-
- enum Roles { FileNameRole = Qt::UserRole+1, FilePathRole = Qt::UserRole+2, FileSizeRole = Qt::UserRole+3 };
-
- int rowCount(const QModelIndex &parent) const;
- QVariant data(const QModelIndex &index, int role) const;
-
- int count() const { return rowCount(QModelIndex()); }
-
- QUrl folder() const;
- void setFolder(const QUrl &folder);
-
- QUrl parentFolder() const;
-
- QStringList nameFilters() const;
- void setNameFilters(const QStringList &filters);
-
- enum SortField { Unsorted, Name, Time, Size, Type };
- SortField sortField() const;
- void setSortField(SortField field);
- Q_ENUMS(SortField)
-
- bool sortReversed() const;
- void setSortReversed(bool rev);
-
- bool showDirs() const;
- void setShowDirs(bool);
- bool showDotAndDotDot() const;
- void setShowDotAndDotDot(bool);
- bool showOnlyReadable() const;
- void setShowOnlyReadable(bool);
- Q_INVOKABLE bool isFolder(int index) const;
- virtual void classBegin();
- virtual void componentComplete();
-
-Q_SIGNALS:
- void folderChanged();
- void countChanged();
-
-private Q_SLOTS:
- void refresh();
- void inserted(const QModelIndex &index, int start, int end);
- void removed(const QModelIndex &index, int start, int end);
- void handleDataChanged(const QModelIndex &start, const QModelIndex &end);
-
-private:
- Q_DISABLE_COPY(QDeclarativeFolderListModel)
- QDeclarativeFolderListModelPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeFolderListModel)
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEFOLDERLISTMODEL_H