1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
#ifndef MALIIT_PLUGINS_ABSTRACTSURFACE_H
16
#define MALIIT_PLUGINS_ABSTRACTSURFACE_H
18
#include <QSharedPointer>
26
/*! \ingroup pluginapi
27
* \brief The AbstractSurface class provides a window abstraction for rendering the plugin.
34
* \brief The Option enum describes the postioning and type of a surface
39
PositionOverlay = 0x1,
40
PositionCenterBottom = 0x2,
41
PositionLeftBottom = 0x4,
42
PositionRightBottom = 0x8,
45
TypeGraphicsView = 0x200,
50
Q_DECLARE_FLAGS(Options, Option)
53
* \brief ~AbstractSurface
55
virtual ~AbstractSurface();
58
* \brief shows the surface.
60
virtual void show() = 0;
62
* \brief hides the surface and its children.
64
virtual void hide() = 0;
67
* \brief returns the real size of the surface
68
* \return the surface's real size
70
virtual QSize size() const = 0;
72
* \brief sets the size of the surface
73
* \param size the requested surface size
75
virtual void setSize(const QSize &size) = 0;
78
* \brief returns the position of the surface relative to its parent
79
* \return the surface's position relative to its parent
81
virtual QPoint relativePosition() const = 0;
84
* \brief sets the surface's position relative to its parent (for a PositionOverlay surface)
85
* \param position the requested relative position
87
virtual void setRelativePosition(const QPoint &position) = 0;
90
* \brief returns the parent of a surface
91
* \return the surface's parent
93
virtual QSharedPointer<AbstractSurface> parent() const = 0;
96
* \brief translates the coordinates of an event into the surfaces coordinate system
97
* \param eventPosition the coordinates of the event
98
* \param eventSurface the surface where the event occured (by default this)
99
* \return the event coordinates translated to the surface coordinate system
101
virtual QPoint translateEventPosition(const QPoint &eventPosition,
102
const QSharedPointer<AbstractSurface> &eventSurface = QSharedPointer<AbstractSurface>()) const = 0;
105
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractSurface::Options)
107
} // namespace Plugins
108
} // namespace Maliit
110
#endif // MALIIT_PLUGINS_ABSTRACTSURFACE_H