2013-02-14 14:39:46 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2013 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 PANELVIEW_H
|
|
|
|
#define PANELVIEW_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "view.h"
|
2013-03-19 22:06:06 +01:00
|
|
|
#include "panelconfigview.h"
|
|
|
|
#include <QtCore/qpointer.h>
|
2013-02-14 14:39:46 +01:00
|
|
|
|
2013-05-08 13:52:40 +02:00
|
|
|
class DesktopCorona;
|
2013-02-14 14:39:46 +01:00
|
|
|
|
|
|
|
class PanelView : public View
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-03-22 14:39:33 +01:00
|
|
|
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
|
2013-03-19 22:06:06 +01:00
|
|
|
Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged)
|
2013-03-22 16:13:12 +01:00
|
|
|
Q_PROPERTY(int thickness READ thickness WRITE setThickness NOTIFY thicknessChanged)
|
2013-05-08 11:16:38 +02:00
|
|
|
Q_PROPERTY(int maximumLength READ maximumLength WRITE setMaximumLength NOTIFY maximumLengthChanged)
|
|
|
|
Q_PROPERTY(int minimumLength READ minimumLength WRITE setMinimumLength NOTIFY minimumLengthChanged)
|
2013-02-14 14:39:46 +01:00
|
|
|
|
|
|
|
public:
|
2013-05-08 13:52:40 +02:00
|
|
|
explicit PanelView(DesktopCorona *corona, QWindow *parent = 0);
|
2013-02-14 14:39:46 +01:00
|
|
|
virtual ~PanelView();
|
|
|
|
|
2013-02-21 18:32:32 +01:00
|
|
|
virtual KConfigGroup config() const;
|
|
|
|
|
2013-02-14 21:14:04 +01:00
|
|
|
virtual void init();
|
2013-02-21 17:49:52 +01:00
|
|
|
|
2013-03-07 17:39:10 +01:00
|
|
|
Qt::Alignment alignment() const;
|
|
|
|
void setAlignment(Qt::Alignment alignment);
|
|
|
|
|
2013-03-07 17:56:57 +01:00
|
|
|
int offset() const;
|
|
|
|
void setOffset(int offset);
|
|
|
|
|
2013-03-22 16:13:12 +01:00
|
|
|
int thickness() const;
|
|
|
|
void setThickness(int thickness);
|
|
|
|
|
2013-05-08 11:16:38 +02:00
|
|
|
int maximumLength() const;
|
|
|
|
void setMaximumLength(int length);
|
|
|
|
|
|
|
|
int minimumLength() const;
|
|
|
|
void setMinimumLength(int length);
|
|
|
|
|
2013-03-19 22:06:06 +01:00
|
|
|
Q_SIGNALS:
|
2013-03-22 14:39:33 +01:00
|
|
|
void alignmentChanged();
|
2013-03-19 22:06:06 +01:00
|
|
|
void offsetChanged();
|
2013-03-22 14:39:33 +01:00
|
|
|
void screenGeometryChanged();
|
2013-03-22 16:13:12 +01:00
|
|
|
void thicknessChanged();
|
2013-05-08 11:16:38 +02:00
|
|
|
void maximumLengthChanged();
|
|
|
|
void minimumLengthChanged();
|
2013-03-19 22:06:06 +01:00
|
|
|
|
2013-02-21 17:49:52 +01:00
|
|
|
private Q_SLOTS:
|
|
|
|
void positionPanel();
|
2013-02-21 20:35:21 +01:00
|
|
|
void restore();
|
2013-02-21 17:49:52 +01:00
|
|
|
|
2013-02-14 14:39:46 +01:00
|
|
|
private:
|
2013-02-21 20:35:21 +01:00
|
|
|
int m_offset;
|
|
|
|
int m_maxLength;
|
|
|
|
int m_minLength;
|
2013-02-21 21:12:12 +01:00
|
|
|
Qt::Alignment m_alignment;
|
2013-03-19 22:06:06 +01:00
|
|
|
QPointer<PanelConfigView> m_panelConfigView;
|
2013-05-08 13:52:40 +02:00
|
|
|
DesktopCorona *m_corona;
|
2013-02-14 14:39:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PANELVIEW_H
|