2011-02-17 02:21:45 +03:00
|
|
|
#ifndef MIRALL_FOLDER_H
|
|
|
|
#define MIRALL_FOLDER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2011-03-23 01:03:43 +03:00
|
|
|
#include <QStringList>
|
2011-02-17 02:21:45 +03:00
|
|
|
|
|
|
|
class QAction;
|
|
|
|
|
|
|
|
namespace Mirall {
|
|
|
|
|
|
|
|
class FolderWatcher;
|
|
|
|
|
|
|
|
class Folder : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Folder(const QString &path, QObject *parent = 0L);
|
|
|
|
virtual ~Folder();
|
|
|
|
|
2011-02-17 17:10:06 +03:00
|
|
|
/**
|
|
|
|
* local folder path
|
|
|
|
*/
|
|
|
|
QString path() const;
|
|
|
|
|
2011-02-17 13:27:05 +03:00
|
|
|
QAction *openAction() const;
|
2011-02-17 02:21:45 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* starts a sync operation
|
|
|
|
* requests are serialized
|
|
|
|
*/
|
2011-03-25 20:25:56 +03:00
|
|
|
virtual void startSync(const QStringList &pathList) = 0;
|
2011-02-17 02:21:45 +03:00
|
|
|
|
2011-03-23 01:03:43 +03:00
|
|
|
virtual bool isSyncing() const = 0;
|
|
|
|
|
2011-02-17 02:21:45 +03:00
|
|
|
signals:
|
|
|
|
void syncStarted();
|
|
|
|
void syncFinished();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString _path;
|
|
|
|
FolderWatcher *_watcher;
|
2011-02-17 13:27:05 +03:00
|
|
|
QAction *_openAction;
|
2011-02-17 02:21:45 +03:00
|
|
|
private slots:
|
2011-03-23 01:03:43 +03:00
|
|
|
void slotChanged(const QStringList &pathList);
|
2011-02-17 02:21:45 +03:00
|
|
|
void slotOpenFolder();
|
2011-02-17 17:10:06 +03:00
|
|
|
|
|
|
|
void slotSyncStarted();
|
|
|
|
void slotSyncFinished();
|
2011-02-17 02:21:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|