File indexing completed on 2024-04-14 04:53:27

0001 /*
0002     SPDX-FileCopyrightText: 2008 Urs Wolfer <uwolfer@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef REMOTEVIEWFACTORY_H
0008 #define REMOTEVIEWFACTORY_H
0009 
0010 #include "krdccore_export.h"
0011 #include "remoteview.h"
0012 
0013 #include <KConfigGroup>
0014 #include <KPluginFactory>
0015 
0016 /**
0017  * Factory to be implemented by any plugin.
0018  */
0019 class KRDCCORE_EXPORT RemoteViewFactory : public QObject
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     /**
0025      * Deconstructor.
0026      */
0027     ~RemoteViewFactory() override;
0028 
0029     /**
0030      * Returns true if the provided @p url is supported by the current plugin.
0031      */
0032     virtual bool supportsUrl(const QUrl &url) const = 0;
0033 
0034     /**
0035      * Returns a new RemoteView implementing object.
0036      */
0037     virtual RemoteView *createView(QWidget *parent, const QUrl &url, KConfigGroup configGroup) = 0;
0038 
0039     /**
0040      * Returns a new HostPreferences implementing object or 0 if no settings are available.
0041      */
0042     virtual HostPreferences *createHostPreferences(KConfigGroup configGroup, QWidget *parent) = 0;
0043 
0044     /**
0045      * Returns the supported scheme.
0046      * @see QUrl::scheme()
0047      */
0048     virtual QString scheme() const = 0;
0049 
0050     /**
0051      * Returns the text of the action in the file menu (by default).
0052      */
0053     virtual QString connectActionText() const = 0;
0054 
0055     /**
0056      * Returns the text of the connect button on the startscreen.
0057      */
0058     virtual QString connectButtonText() const = 0;
0059 
0060     /**
0061      * Returns the tooltip next to the url navigator when the user presses
0062      * the connect action.
0063      */
0064     virtual QString connectToolTipText() const = 0;
0065 
0066 protected:
0067     /**
0068      * Protected constructor so it cannot be instantiated.
0069      */
0070     RemoteViewFactory(QObject *parent = nullptr);
0071 };
0072 
0073 #endif // REMOTEVIEWFACTORY_H