plasma-framework/src/plasmaquick/plasmaquickview.h

122 lines
3.2 KiB
C
Raw Normal View History

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>
#include <plasmaquick/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
2013-09-11 11:48:37 +02:00
class PlasmaQuickViewPrivate;
2013-01-29 21:11:45 +01:00
2013-09-11 11:48:37 +02:00
class PLASMAQUICK_EXPORT PlasmaQuickView : public QQuickView
2013-01-29 21:11:45 +01:00
{
2013-02-01 13:20:20 +01:00
Q_OBJECT
Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
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
**/
2013-09-11 11:48:37 +02:00
explicit PlasmaQuickView(Plasma::Corona *corona, QWindow *parent = 0);
virtual ~PlasmaQuickView();
2013-02-01 13:20:20 +01:00
2013-08-29 13:59:11 +02:00
/**
* @return the corona of this view
**/
Plasma::Corona *corona() const;
2013-08-29 13:59:11 +02:00
/**
* @return the KConfigGroup of this view
**/
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-08-27 20:25:21 +02:00
virtual 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;
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-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-08-29 13:59:11 +02:00
/**
* @return the screenGeometry of the View
**/
QRectF screenGeometry();
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);
private Q_SLOTS:
void coronaPackageChanged(const Plasma::Package &package);
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
**/
void containmentChanged();
2013-08-29 13:59:11 +02:00
/**
* emitted when the screenGeometry is changed
**/
void screenGeometryChanged();
2013-02-01 13:20:20 +01:00
private:
2013-09-11 11:48:37 +02:00
PlasmaQuickViewPrivate *const d;
friend class PlasmaQuickViewPrivate;
2013-01-29 21:11:45 +01:00
};
2013-09-11 11:48:37 +02:00
#endif // PLASMAQUICKVIEW_H