X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fimports.h;fp=src%2Fimports.h;h=ffab41850784faa64efbf5bd54e2f8b8ede7a0a2;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/imports.h b/src/imports.h new file mode 100644 index 0000000..ffab418 --- /dev/null +++ b/src/imports.h @@ -0,0 +1,55 @@ +#ifndef IMPORTS_H +#define IMPORTS_H + +#include +#include +#include +#include + +#include "settings.h" + +class VymModel; +class BranchItem; + +/////////////////////////////////////////////////////////////////////// + +class ImportBase { + public: + ImportBase(); + ImportBase(VymModel *m); + virtual ~ImportBase(); + void init(); + virtual void setDir(const QString &); + virtual void setFile(const QString &); + virtual bool transform(); + virtual QString getTransformedFile(); + + protected: + VymModel *model; + QDir tmpDir; + QString inputDir; + QString inputFile; + QString transformedFile; +}; + +/////////////////////////////////////////////////////////////////////// +class ImportFirefoxBookmarks : public ImportBase { + public: + enum ParseMode {countBookmarks, buildMap}; + ImportFirefoxBookmarks(VymModel *m); + bool transform(); + private: + QProgressDialog progressDialog; + bool parseJson(QJsonValue jsval, ParseMode mode, BranchItem *selbi = NULL); + + uint totalBookmarks; + uint currentBookmarks; +}; + +/////////////////////////////////////////////////////////////////////// +class ImportMM : public ImportBase { + public: + bool transform(); +}; + +#endif