Add PlasmaNamespace as PlasmaCore.Plasma

This is not beautiful, so we'll change it later on, for now, this allows
us to test enum settings.
This commit is contained in:
Sebastian Kügler 2013-02-26 01:09:50 +01:00
parent aa1940b246
commit 8131ad0abc
4 changed files with 82 additions and 0 deletions

View File

@ -21,6 +21,7 @@ set(corebindings_SRCS
# tooltip.cpp # tooltip.cpp
dataenginebindings.cpp dataenginebindings.cpp
iconitem.cpp iconitem.cpp
plasmanamespace.cpp
) )

View File

@ -42,6 +42,7 @@
#include "iconitem.h" #include "iconitem.h"
// #include "tooltip.h" // #include "tooltip.h"
// #include "dataenginebindings_p.h" // #include "dataenginebindings_p.h"
#include "plasmanamespace.h"
#include <QDebug> #include <QDebug>
@ -74,6 +75,8 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
{ {
Q_ASSERT(uri == QLatin1String("org.kde.plasma.core")); Q_ASSERT(uri == QLatin1String("org.kde.plasma.core"));
qmlRegisterUncreatableType<PlasmaNamespace>(uri, 0, 1, "Plasma", "");
qmlRegisterType<Plasma::Svg>(uri, 0, 1, "Svg"); qmlRegisterType<Plasma::Svg>(uri, 0, 1, "Svg");
qmlRegisterType<Plasma::FrameSvg>(uri, 0, 1, "FrameSvg"); qmlRegisterType<Plasma::FrameSvg>(uri, 0, 1, "FrameSvg");
qmlRegisterType<Plasma::SvgItem>(uri, 0, 1, "SvgItem"); qmlRegisterType<Plasma::SvgItem>(uri, 0, 1, "SvgItem");

View File

@ -0,0 +1,32 @@
/***************************************************************************
* Copyright 2013 Sebastian Kügler <sebas@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "plasmanamespace.h"
PlasmaNamespace::PlasmaNamespace(QObject *parent)
: QObject(parent)
{
}
PlasmaNamespace::~PlasmaNamespace()
{
}
#include "plasmanamespace.moc"

View File

@ -0,0 +1,46 @@
/***************************************************************************
* Copyright 2013 Sebastian Kügler <sebas@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef PLASMA_NAMESPACE_CORE
#define PLASMA_NAMESPACE_CORE
#include <QObject>
class PlasmaNamespace : public QObject
{
Q_OBJECT
Q_ENUMS(Location)
public:
enum Location {
Floating = 0, /**< Free floating. Neither geometry or z-ordering
is described precisely by this value. */
Desktop, /**< On the planar desktop layer, extending across
the full screen from edge to edge */
FullScreen, /**< Full screen */
TopEdge, /**< Along the top of the screen*/
BottomEdge, /**< Along the bottom of the screen*/
LeftEdge, /**< Along the left side of the screen */
RightEdge /**< Along the right side of the screen */
};
PlasmaNamespace(QObject *parent = 0);
~PlasmaNamespace();
};
#endif