File indexing completed on 2025-03-09 04:23:15

0001 #pragma once
0002 
0003 #include <QDateTime>
0004 #include <QIODevice>
0005 #include <QString>
0006 
0007 class WebDAVClient;
0008 class WebDAVReply;
0009 
0010 /**
0011  * @brief Represents an item in a remote cloud location
0012  */
0013 class WebDAVItem
0014 {
0015  public:
0016    /**
0017     * @brief
0018     */
0019   WebDAVItem(WebDAVClient* webdavClient, QString href, QString creationDate,
0020              QString lastModified, QString displayName, QString contentType,
0021              QString contentLength, bool isCollection);
0022 
0023   /**
0024     * @brief
0025     */
0026   bool isCollection();
0027   
0028   /**
0029     * @brief
0030     */
0031   bool isFile();
0032 
0033   /**
0034     * @brief
0035     */
0036   WebDAVReply* download();
0037   
0038   /**
0039     * @brief
0040     */
0041   WebDAVReply* listDir();
0042   
0043   /**
0044     * @brief
0045     */
0046   WebDAVReply* upload(QString filename, QIODevice* file);
0047   
0048   /**
0049     * @brief
0050     */
0051   WebDAVReply* createDir(QString dirName);
0052   
0053   /**
0054     * @brief
0055     */
0056   WebDAVReply* copy(QString destination);
0057   
0058   /**
0059     * @brief
0060     */
0061   WebDAVReply* move(QString destination, bool overwrite = false);
0062   
0063   /**
0064     * @brief
0065     */
0066   WebDAVReply* remove();
0067 
0068   /**
0069     * @brief
0070     */
0071   QString toString();
0072 
0073   /**
0074     * @brief
0075     */
0076   QString getHref();
0077   
0078   /**
0079     * @brief
0080     */
0081   QDateTime getCreationDate();
0082   
0083   /**
0084     * @brief
0085     */
0086   QString getLastModified();
0087   
0088   /**
0089     * @brief
0090     */
0091   QString getDisplayName();
0092   
0093   /**
0094     * @brief
0095     */
0096   QString getContentType();
0097   
0098   /**
0099     * @brief
0100     */
0101   int getContentLength();
0102 
0103  private:
0104   WebDAVClient* webdavClient;
0105   QString href;
0106   QDateTime creationDate;
0107   QString lastModified;
0108   QString displayName;
0109   QString contentType;
0110   int contentLength;
0111 
0112   bool flagIsCollection;
0113 };
0114