4 * This file is part of CameraPlus.
6 * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef POST_CAPTURE_MODEL_H
24 #define POST_CAPTURE_MODEL_H
26 #include <QStandardItemModel>
30 class PostCaptureModel : public QStandardItemModel {
33 Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged);
34 Q_PROPERTY(QString videoPath READ videoPath WRITE setVideoPath NOTIFY videoPathChanged);
37 PostCaptureModel(QObject *parent = 0);
41 UrlRole = Qt::UserRole + 1,
42 TitleRole = Qt::UserRole + 2,
43 MimeTypeRole = Qt::UserRole + 3,
44 CreatedRole = Qt::UserRole + 4,
45 FileNameRole = Qt::UserRole + 5,
48 QString imagePath() const;
49 void setImagePath(const QString& path);
51 QString videoPath() const;
52 void setVideoPath(const QString& path);
57 void remove(const QUrl& file);
60 void imagePathChanged();
61 void videoPathChanged();
67 void loadDir(const QDir& dir, QList<QStandardItem *>& out);
70 QHash<int, QByteArray> roleNames() const;
71 void setRoleNames(const QHash<int, QByteArray>& roles);
72 QHash<int, QByteArray> m_roles;
76 #endif /* POST_CAPTURE_MODEL_H */