2016-12-25 09:25:27 +02: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 .
*/
# ifndef PLASMAQUICKVIEW_H
# define PLASMAQUICKVIEW_H
# include <QtQuick/QQuickView>
# include "plasma/corona.h"
# include "plasma/containment.h"
//
// 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.
//
namespace PlasmaQuick {
class ViewPrivate ;
2018-07-03 22:15:45 +03:00
class View : public QQuickView
{
2016-12-25 09:25:27 +02:00
Q_OBJECT
Q_PROPERTY ( Plasma : : Types : : Location location READ location WRITE setLocation NOTIFY locationChanged )
Q_PROPERTY ( Plasma : : Types : : FormFactor formFactor READ formFactor NOTIFY formFactorChanged )
Q_PROPERTY ( QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged )
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
public :
/**
* @ param corona the corona of this view
* @ param parent the QWindow this View is parented to
* */
explicit View ( Plasma : : Corona * corona , QWindow * parent = 0 ) ;
~ View ( ) override ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the corona of this view
* */
Plasma : : Corona * corona ( ) const ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the KConfigGroup of this view
* */
virtual KConfigGroup config ( ) const ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* sets the containment for this view
* @ param cont the containment of this view
* */
void setContainment ( Plasma : : Containment * cont ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the containment of this View
* */
Plasma : : Containment * containment ( ) const ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the location of this View
* */
Plasma : : Types : : Location location ( ) const ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* Sets the location of the View
* @ param location the location of the View
* */
void setLocation ( Plasma : : Types : : Location location ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the formfactor of the View
* */
Plasma : : Types : : FormFactor formFactor ( ) const ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* @ return the screenGeometry of the View
* */
QRectF screenGeometry ( ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
protected Q_SLOTS :
/**
* It will be called when the configuration is requested
*/
virtual void showConfigurationInterface ( Plasma : : Applet * applet ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
Q_SIGNALS :
/**
* emitted when the location is changed
* */
void locationChanged ( Plasma : : Types : : Location location ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* emitted when the formfactor is changed
* */
void formFactorChanged ( Plasma : : Types : : FormFactor formFactor ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* emitted when the containment is changed
* */
void containmentChanged ( ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
/**
* emitted when the screenGeometry is changed
* */
void screenGeometryChanged ( ) ;
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
private :
ViewPrivate * const d ;
friend class ViewPrivate ;
} ;
}
# endif // View_H