File indexing completed on 2025-01-26 05:24:23

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2007 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_ABSTRACTVIEW_HPP
0010 #define KASTEN_ABSTRACTVIEW_HPP
0011 
0012 // lib
0013 #include "kastengui_export.hpp"
0014 // Kasten core
0015 #include <Kasten/AbstractDocument>
0016 
0017 class QWidget;
0018 
0019 namespace Kasten {
0020 
0021 // TODO: is there a common base for view and document?
0022 class KASTENGUI_EXPORT AbstractView : public AbstractModel
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit AbstractView(AbstractModel* baseModel = nullptr);
0028     ~AbstractView() override;
0029 
0030 public: // API to be implemented
0031     virtual void setFocus() = 0;
0032 
0033     virtual QWidget* widget() const = 0;
0034     virtual bool hasFocus() const = 0;
0035 
0036 Q_SIGNALS:
0037     // view has focus in the window
0038     void focusChanged(bool hasFocus);
0039 };
0040 
0041 }
0042 
0043 #endif