File indexing completed on 2024-05-12 16:34:24

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
0003  *
0004  * Contact: Vidhyapria  Arunkumar <vidhyapria.arunkumar@nokia.com>
0005  * Contact: Amit Aggarwal <amit.5.aggarwal@nokia.com>
0006  * Contact: Manikandaprasad N C <manikandaprasad.chandrasekar@nokia.com>
0007 
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Library General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2 of the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Library General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Library General Public License
0019  * along with this library; see the file COPYING.LIB.  If not, write to
0020  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021  * Boston, MA 02110-1301, USA.
0022  */
0023 
0024 #include "PluginShapeFactory.h"
0025 
0026 #include "PluginShape.h"
0027 
0028 #include <KoXmlNS.h>
0029 #include <KoShapeLoadingContext.h>
0030 #include "KoShapeBasedDocumentBase.h"
0031 
0032 #include <klocalizedstring.h>
0033 
0034 PluginShapeFactory::PluginShapeFactory()
0035     : KoShapeFactoryBase(PLUGINSHAPEID, i18n("Plugin Placeholder"))
0036 {
0037     setToolTip(i18n("Plugin Placeholder, embedded or fullscreen"));
0038     //setIcon("video-x-generic");
0039     setXmlElementNames(KoXmlNS::draw, QStringList("plugin"));
0040     setLoadingPriority(1);
0041     setHidden(true);
0042 }
0043 
0044 KoShape *PluginShapeFactory::createDefaultShape(KoDocumentResourceManager *documentResources) const
0045 {
0046     Q_UNUSED(documentResources);
0047     PluginShape *defaultShape = new PluginShape();
0048     defaultShape->setShapeId(PLUGINSHAPEID);
0049     return defaultShape;
0050 }
0051 
0052 bool PluginShapeFactory::supports(const KoXmlElement &e, KoShapeLoadingContext &context) const
0053 {
0054     Q_UNUSED(context);
0055     return e.localName() == "plugin" && e.namespaceURI() == KoXmlNS::draw;
0056 }
0057 
0058