File indexing completed on 2024-04-28 15:29:19
0001 /* 0002 This file is part of the KDE project 0003 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org> 0004 SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef __kparts_browserhostextension_h__ 0010 #define __kparts_browserhostextension_h__ 0011 0012 #include <kparts/kparts_export.h> 0013 0014 #if KPARTS_ENABLE_DEPRECATED_SINCE(5, 78) 0015 0016 #include <QObject> 0017 #include <memory> 0018 0019 class QStringList; 0020 class QString; 0021 template<typename T> 0022 class QList; 0023 0024 namespace KParts 0025 { 0026 class ReadOnlyPart; 0027 class OpenUrlArguments; 0028 struct BrowserArguments; 0029 class BrowserHostExtensionPrivate; 0030 0031 /** 0032 * @class BrowserHostExtension browserhostextension.h <KParts/BrowserHostExtension> 0033 * 0034 * @short An extension class for container parts, i.e. parts that contain 0035 * other parts. 0036 * For instance a KHTMLPart hosts one part per frame. 0037 * @deprecated since 5.78 for lack of usage 0038 */ 0039 class KPARTS_EXPORT BrowserHostExtension : public QObject 0040 { 0041 Q_OBJECT 0042 public: 0043 KPARTS_DEPRECATED_VERSION(5, 78, "Deprecated for lack of usage") 0044 BrowserHostExtension(KParts::ReadOnlyPart *parent); 0045 0046 ~BrowserHostExtension() override; 0047 0048 /** 0049 * Returns a list of the names of all hosted child objects. 0050 * 0051 * Note that this method does not query the child objects recursively. 0052 */ 0053 virtual QStringList frameNames() const; 0054 0055 /** 0056 * Returns a list of pointers to all hosted child objects. 0057 * 0058 * Note that this method does not query the child objects recursively. 0059 */ 0060 virtual const QList<KParts::ReadOnlyPart *> frames() const; 0061 0062 /** 0063 * Returns the part that contains @p frame and that may be accessed 0064 * by @p callingPart 0065 */ 0066 virtual BrowserHostExtension *findFrameParent(KParts::ReadOnlyPart *callingPart, const QString &frame); 0067 0068 /** 0069 * Opens the given url in a hosted child frame. The frame name is specified in the 0070 * frameName variable in the @p browserArguments parameter (see KParts::BrowserArguments ) . 0071 */ 0072 virtual bool openUrlInFrame(const QUrl &url, const KParts::OpenUrlArguments &arguments, const KParts::BrowserArguments &browserArguments); 0073 0074 /** 0075 * Queries @p obj for a child object which inherits from this 0076 * BrowserHostExtension class. Convenience method. 0077 */ 0078 static BrowserHostExtension *childObject(QObject *obj); 0079 0080 private: 0081 std::unique_ptr<BrowserHostExtensionPrivate> const d; 0082 }; 0083 0084 } 0085 0086 #endif 0087 #endif