File indexing completed on 2024-04-28 15:29:19
0001 /* 0002 This file is part of the KDE project 0003 SPDX-FileCopyrightText: 2001 Simon Hausmann <hausmann@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef KPARTS_BROWSERINTERFACE_H 0009 #define KPARTS_BROWSERINTERFACE_H 0010 0011 #include <kparts/kparts_export.h> 0012 0013 #include <QObject> 0014 0015 class QVariant; 0016 0017 namespace KParts 0018 { 0019 /** 0020 * @class BrowserInterface browserinterface.h <KParts/BrowserInterface> 0021 * 0022 * @short The purpose of this interface is to allow a direct communication between 0023 * a KPart and the hosting browser shell (for example Konqueror) . A 0024 * shell implementing this interface can propagate it to embedded kpart 0025 * components by using the setBrowserInterface call of the part's 0026 * KParts::BrowserExtension object. 0027 * 0028 * This interface looks not very rich, but the main functionality is 0029 * implemented using the callMethod method for part->shell 0030 * communication and using Qt properties for allowing a part to 0031 * to explicitly query information from the shell. 0032 * 0033 * Konqueror in particular, as 'reference' implementation, provides 0034 * the following functionality through this interface: 0035 * 0036 * Qt properties: 0037 * Q_PROPERTY( uint historyLength READ historyLength ); 0038 * 0039 * Callable methods: 0040 * void goHistory( int ); 0041 * 0042 */ 0043 class KPARTS_EXPORT BrowserInterface : public QObject 0044 { 0045 Q_OBJECT 0046 public: 0047 explicit BrowserInterface(QObject *parent); 0048 ~BrowserInterface() override; 0049 0050 /** 0051 * Perform a dynamic invocation of a method in the BrowserInterface 0052 * implementation. Methods are to be implemented as simple Qt slots. 0053 * You should only include the method name, and not the signature, 0054 * in the name argument. 0055 */ 0056 void callMethod(const char *name, const QVariant &argument); 0057 }; 0058 0059 } 0060 0061 #endif