File indexing completed on 2024-06-16 04:16:18

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2010 Matus Talcik <matus.talcik@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #include "SnapshotPlugin.h"
0007 
0008 
0009 #include <kpluginfactory.h>
0010 #include <klocalizedstring.h>
0011 
0012 #include <KoDockFactoryBase.h>
0013 #include <KoDockRegistry.h>
0014 
0015 #include "SnapshotDocker.h"
0016 
0017 K_PLUGIN_FACTORY_WITH_JSON(SnapshotPluginFactory, "kritasnapshotdocker.json", registerPlugin<SnapshotPlugin>();)
0018 
0019 class SnapshotDockFactory : public KoDockFactoryBase
0020 {
0021 public:
0022     SnapshotDockFactory() {
0023     }
0024 
0025     QString id() const override {
0026         return QString("Snapshot");
0027     }
0028 
0029     virtual Qt::DockWidgetArea defaultDockWidgetArea() const {
0030         return Qt::RightDockWidgetArea;
0031     }
0032 
0033     QDockWidget *createDockWidget() override {
0034         SnapshotDocker *dockWidget = new SnapshotDocker();
0035         dockWidget->setObjectName(id());
0036 
0037         return dockWidget;
0038     }
0039 
0040     DockPosition defaultDockPosition() const override {
0041         return DockMinimized;
0042     }
0043 };
0044 
0045 
0046 SnapshotPlugin::SnapshotPlugin(QObject *parent, const QVariantList &)
0047         : QObject(parent)
0048 {
0049 
0050     KoDockRegistry::instance()->add(new SnapshotDockFactory());
0051 }
0052 
0053 SnapshotPlugin::~SnapshotPlugin()
0054 {
0055 }
0056 
0057 #include "SnapshotPlugin.moc"