2013-01-29 21:11:45 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Marco Martin <mart@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.
|
|
|
|
*/
|
|
|
|
|
2013-09-11 11:48:37 +02:00
|
|
|
#ifndef PLASMAQUICKVIEW_H
|
|
|
|
#define PLASMAQUICKVIEW_H
|
2013-01-29 21:11:45 +01:00
|
|
|
|
|
|
|
#include <QtQuick/QQuickView>
|
|
|
|
|
2014-04-23 19:48:04 +02:00
|
|
|
#include <plasmaquick_export.h>
|
2013-02-12 14:26:34 +01:00
|
|
|
#include "plasma/corona.h"
|
2013-02-04 19:47:35 +01:00
|
|
|
#include "plasma/containment.h"
|
2013-02-01 13:20:20 +01:00
|
|
|
|
2014-02-20 11:19:50 +01:00
|
|
|
//
|
|
|
|
// W A R N I N G
|
|
|
|
// -------------
|
|
|
|
//
|
|
|
|
// This file is not part of the public Plasma API. It exists purely as an
|
|
|
|
// implementation detail. This header file may change from version to
|
|
|
|
// version without notice, or even be removed.
|
|
|
|
//
|
|
|
|
// We mean it.
|
|
|
|
//
|
2013-01-29 21:11:45 +01:00
|
|
|
|
2014-02-19 19:37:30 +01:00
|
|
|
namespace PlasmaQuick
|
|
|
|
{
|
|
|
|
|
|
|
|
class ViewPrivate;
|
|
|
|
|
|
|
|
class PLASMAQUICK_EXPORT View : public QQuickView
|
2013-01-29 21:11:45 +01:00
|
|
|
{
|
2013-02-01 13:20:20 +01:00
|
|
|
Q_OBJECT
|
2013-09-03 15:44:13 +02:00
|
|
|
Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
|
2014-02-13 11:50:49 +01:00
|
|
|
Q_PROPERTY(Plasma::Types::FormFactor formFactor READ formFactor NOTIFY formFactorChanged)
|
2013-03-22 14:39:33 +01:00
|
|
|
Q_PROPERTY(QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
|
2013-02-01 13:20:20 +01:00
|
|
|
|
2013-01-29 21:11:45 +01:00
|
|
|
public:
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @param corona the corona of this view
|
|
|
|
* @param parent the QWindow this View is parented to
|
|
|
|
**/
|
2014-02-19 19:37:30 +01:00
|
|
|
explicit View(Plasma::Corona *corona, QWindow *parent = 0);
|
|
|
|
virtual ~View();
|
2013-02-01 13:20:20 +01:00
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @return the corona of this view
|
|
|
|
**/
|
2013-02-14 21:14:04 +01:00
|
|
|
Plasma::Corona *corona() const;
|
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @return the KConfigGroup of this view
|
|
|
|
**/
|
2013-02-21 18:32:32 +01:00
|
|
|
virtual KConfigGroup config() const;
|
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* sets the containment for this view
|
|
|
|
* @param cont the containment of this view
|
|
|
|
**/
|
2013-09-11 12:18:51 +02:00
|
|
|
void setContainment(Plasma::Containment *cont);
|
2013-08-29 13:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the containment of this View
|
|
|
|
**/
|
2013-02-04 19:47:35 +01:00
|
|
|
Plasma::Containment *containment() const;
|
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @return the location of this View
|
|
|
|
**/
|
2013-09-10 21:15:09 +02:00
|
|
|
Plasma::Types::Location location() const;
|
2014-04-24 12:33:30 +02:00
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* Sets the location of the View
|
|
|
|
* @param location the location of the View
|
|
|
|
**/
|
2013-09-10 21:15:09 +02:00
|
|
|
void setLocation(Plasma::Types::Location location);
|
2013-03-22 14:39:33 +01:00
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @return the formfactor of the View
|
|
|
|
**/
|
2013-05-14 18:19:33 +02:00
|
|
|
Plasma::Types::FormFactor formFactor() const;
|
2013-02-21 17:49:52 +01:00
|
|
|
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* @return the screenGeometry of the View
|
|
|
|
**/
|
2013-03-22 14:39:33 +01:00
|
|
|
QRectF screenGeometry();
|
|
|
|
|
2013-04-26 13:00:07 +02:00
|
|
|
protected Q_SLOTS:
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* It will be called when the configuration is requested
|
|
|
|
*/
|
2013-08-27 20:25:21 +02:00
|
|
|
virtual void showConfigurationInterface(Plasma::Applet *applet);
|
2013-04-26 13:00:07 +02:00
|
|
|
|
2013-02-21 17:49:52 +01:00
|
|
|
Q_SIGNALS:
|
2013-08-29 13:59:11 +02:00
|
|
|
/**
|
|
|
|
* emitted when the location is changed
|
|
|
|
**/
|
2013-05-14 18:19:33 +02:00
|
|
|
void locationChanged(Plasma::Types::Location location);
|
2013-08-29 13:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* emitted when the formfactor is changed
|
|
|
|
**/
|
2013-05-14 18:19:33 +02:00
|
|
|
void formFactorChanged(Plasma::Types::FormFactor formFactor);
|
2013-08-29 13:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* emitted when the containment is changed
|
|
|
|
**/
|
2013-02-21 20:35:21 +01:00
|
|
|
void containmentChanged();
|
2013-08-29 13:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* emitted when the screenGeometry is changed
|
|
|
|
**/
|
2013-03-22 14:39:33 +01:00
|
|
|
void screenGeometryChanged();
|
2013-02-21 17:49:52 +01:00
|
|
|
|
2013-02-01 13:20:20 +01:00
|
|
|
private:
|
2014-02-19 19:37:30 +01:00
|
|
|
ViewPrivate *const d;
|
|
|
|
friend class ViewPrivate;
|
2013-01-29 21:11:45 +01:00
|
|
|
};
|
|
|
|
|
2014-02-19 19:37:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // View_H
|