File indexing completed on 2025-02-23 05:27:20

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2007, 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_IF_DATASELECTABLE_HPP
0010 #define KASTEN_IF_DATASELECTABLE_HPP
0011 
0012 // Qt
0013 #include <QtPlugin>
0014 
0015 class QMimeData;
0016 
0017 namespace Kasten {
0018 
0019 class AbstractModelSelection;
0020 
0021 namespace If {
0022 
0023 // TODO: this interface is strongly related to the selecteddatawriteable interface
0024 class DataSelectable
0025 {
0026 public:
0027     virtual ~DataSelectable();
0028 
0029 public: // set
0030     virtual void selectAllData(bool selectAll) = 0;
0031 
0032 public: // get
0033     virtual bool hasSelectedData() const = 0;
0034     virtual QMimeData* copySelectedData() const = 0; // TODO: move into AbstractModelSelection
0035     virtual const AbstractModelSelection* modelSelection() const = 0;
0036 
0037 public: // signal
0038     /// emitted if there is a change in whether selected data is available or not
0039     virtual void hasSelectedDataChanged(bool hasSelectedData) = 0;
0040     /// emitted if the selection changes, to other data or none
0041     virtual void selectedDataChanged(const AbstractModelSelection* modelSelection) = 0;
0042 };
0043 
0044 inline DataSelectable::~DataSelectable() = default;
0045 
0046 }
0047 }
0048 
0049 Q_DECLARE_INTERFACE(Kasten::If::DataSelectable, "org.kde.kasten.if.dataselectable/1.0")
0050 
0051 #endif