summaryrefslogtreecommitdiffstats
path: root/src/imitatepass.h
blob: 88289f5b2a6611b97890cd1eef7afa2fc2e4ff27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef IMITATEPASS_H
#define IMITATEPASS_H

#include "pass.h"

/*!
    \class ImitatePass
    \brief Imitates pass features when pass is not enabled or available
*/
class ImitatePass : public Pass {
  Q_OBJECT

  bool removeDir(const QString &dirName);

  void executeWrapper(int id, const QString &app, const QStringList &args,
                      bool readStdout = true, bool readStderr = true);

  void executeWrapper(int id, const QString &app, const QStringList &args,
                      QString input, bool readStdout = true,
                      bool readStderr = true);

  void GitCommit(const QString &file, const QString &msg);

public:
  ImitatePass();
  virtual ~ImitatePass() {}
  virtual void GitInit() Q_DECL_OVERRIDE;
  virtual void GitPull() Q_DECL_OVERRIDE;
  virtual void GitPull_b() Q_DECL_OVERRIDE;
  virtual void GitPush() Q_DECL_OVERRIDE;
  virtual void Show(QString file) Q_DECL_OVERRIDE;
  virtual int Show_b(QString file) Q_DECL_OVERRIDE;
  virtual void Insert(QString file, QString value,
                      bool overwrite = false) Q_DECL_OVERRIDE;
  virtual void Remove(QString file, bool isDir = false) Q_DECL_OVERRIDE;
  virtual void Init(QString path, const QList<UserInfo> &list) Q_DECL_OVERRIDE;

  void reencryptPath(QString dir);
signals:
  void startReencryptPath();
  void endReencryptPath();
  void lastDecrypt(QString);
};

#endif // IMITATEPASS_H