File indexing completed on 2024-05-12 03:47:27

0001 /*
0002     File                 : Folder.h
0003     Project              : LabPlot
0004     Description          : Folder in a project
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2010-2020 Alexander Semke <alexander.semke@web.de>
0007     SPDX-FileCopyrightText: 2007 Tilman Benkert <thzs@gmx.net>
0008     SPDX-FileCopyrightText: 2007 Knut Franke <knut.franke@gmx.de>
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 
0012 #ifndef FOLDER_H
0013 #define FOLDER_H
0014 
0015 #include "AbstractAspect.h"
0016 
0017 class Folder : public AbstractAspect {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit Folder(const QString& name, AspectType type = AspectType::Folder);
0022 
0023     QIcon icon() const override;
0024     QMenu* createContextMenu() override;
0025 
0026     void save(QXmlStreamWriter*) const override;
0027     bool load(XmlStreamReader*, bool preview) override;
0028     void setPathesToLoad(const QStringList&);
0029     const QStringList& pathesToLoad() const;
0030 
0031     QVector<AspectType> pasteTypes() const override;
0032     bool isDraggable() const override;
0033     QVector<AspectType> dropableOn() const override;
0034     void processDropEvent(const QVector<quintptr>&) override;
0035 
0036 private:
0037     QStringList m_pathesToLoad;
0038 
0039 protected:
0040     bool readChildAspectElement(XmlStreamReader*, bool preview);
0041 };
0042 
0043 #endif // ifndef FOLDER_H