File indexing completed on 2025-02-09 07:11:31
0001 /* 0002 This file is part of the Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 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_ABSTRACTVIEWAREA_HPP 0010 #define KASTEN_ABSTRACTVIEWAREA_HPP 0011 0012 // lib 0013 #include "kastengui_export.hpp" 0014 // Qt 0015 #include <QObject> 0016 // Std 0017 #include <memory> 0018 0019 class QWidget; 0020 0021 namespace Kasten { 0022 0023 class AbstractViewAreaPrivate; 0024 0025 // TODO: rename abstractdocumentviewarea? 0026 class KASTENGUI_EXPORT AbstractViewArea : public QObject 0027 { 0028 Q_OBJECT 0029 0030 protected: 0031 AbstractViewArea(); 0032 KASTENGUI_NO_EXPORT explicit AbstractViewArea(AbstractViewAreaPrivate* d); 0033 0034 public: 0035 ~AbstractViewArea() override; 0036 0037 public: // API to be implemented 0038 virtual void setFocus() = 0; 0039 0040 virtual QWidget* widget() const = 0; 0041 // virtual QString title() const = 0; 0042 // virtual AbstractTool* tool() const = 0; 0043 virtual bool hasFocus() const = 0; 0044 0045 Q_SIGNALS: 0046 // area has focus in the window 0047 void focusChanged(bool hasFocus); 0048 0049 protected: 0050 const std::unique_ptr<AbstractViewAreaPrivate> d_ptr; 0051 0052 private: 0053 Q_DECLARE_PRIVATE(AbstractViewArea) 0054 }; 0055 0056 } 0057 0058 #endif