vnote/src/vorphanfile.h
Le Tan 32a7adb8d4 support viewing external orphan file
1. Add VOrphanFile for external local file;
2. Add doc file for shortcuts;
3. Ctrl+E ? to open the shortcuts doc;
2017-04-08 21:28:25 +08:00

34 lines
882 B
C++

#ifndef VORPHANFILE_H
#define VORPHANFILE_H
#include "vfile.h"
// VOrphanFile is file not belong to any notebooks or directories.
// Given the path of the file, VNote could load its content as read-only.
class VOrphanFile : public VFile
{
Q_OBJECT
public:
VOrphanFile(const QString &p_path, QObject *p_parent);
bool open();
QString retrivePath() const;
QString retriveRelativePath() const;
QString retriveBasePath() const;
VDirectory *getDirectory();
const VDirectory *getDirectory() const;
QString getNotebookName() const;
VNotebook *getNotebook();
private:
bool save();
void convert(DocType p_curType, DocType p_targetType);
void setName(const QString &p_name);
QString retriveImagePath() const;
void setContent(const QString &p_content);
QString m_path;
friend class VDirectory;
};
#endif // VORPHANFILE_H