QGCMobileFileDialogController.h 1.47 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
Don Gagne's avatar
Don Gagne committed
9 10 11 12 13 14 15


#ifndef QGCMobileFileDialogController_H
#define QGCMobileFileDialogController_H

#include <QObject>

Don Gagne's avatar
Don Gagne committed
16 17 18 19
#include "QGCLoggingCategory.h"

Q_DECLARE_LOGGING_CATEGORY(QGCMobileFileDialogControllerLog)

Don Gagne's avatar
Don Gagne committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
class QGCMobileFileDialogController : public QObject
{
    Q_OBJECT

public:
    /// Return all file in Documents location which match the specified extension
    Q_INVOKABLE QStringList getFiles(const QString& fileExtension);

    /// Return the full path for specified file in the Documents location
    ///     @param filename File name, not fully qualified, may not have extension
    ///     @param fileExtension Expected file extension, added if needed
    Q_INVOKABLE QString fullPath(const QString& filename, const QString& fileExtension);

    /// Check for file existance
    ///     @param filename File name, not fully qualified, may not have extension
    ///     @param fileExtension Expected file extension, added if needed
    /// @return true: File exists at Documents location
    Q_INVOKABLE bool fileExists(const QString& filename, const QString& fileExtension);
Don Gagne's avatar
Don Gagne committed
38 39 40
    
private:
    QString _getSaveLocation(void);
Don Gagne's avatar
Don Gagne committed
41 42 43
};

#endif