2007-03-04 21:35:37 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 by Alexander Wiedenbruch <mail@wiedenbruch.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation
|
|
|
|
*
|
|
|
|
* 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 Library 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 LINEEDIT_H
|
|
|
|
#define LINEEDIT_H
|
|
|
|
|
2007-05-25 04:27:33 +02:00
|
|
|
#include <QtCore/QObject>
|
2007-04-22 11:35:04 +02:00
|
|
|
#include <QtGui/QGraphicsTextItem>
|
2007-03-04 21:35:37 +01:00
|
|
|
|
|
|
|
#include <kdemacros.h>
|
|
|
|
|
2007-05-25 04:27:33 +02:00
|
|
|
#include <dataengine.h>
|
2007-05-28 07:52:56 +02:00
|
|
|
#include <widgets/layoutitem.h>
|
2007-03-04 21:35:37 +01:00
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2007-05-20 18:25:07 +02:00
|
|
|
/**
|
|
|
|
* Class that emulates a QLineEdit inside plasma
|
|
|
|
*/
|
2007-05-28 07:52:56 +02:00
|
|
|
class KDE_EXPORT LineEdit : public QGraphicsTextItem, public LayoutItem
|
2007-03-04 21:35:37 +01:00
|
|
|
{
|
2007-05-23 05:08:47 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-03-04 21:35:37 +01:00
|
|
|
public:
|
2007-05-21 16:28:03 +02:00
|
|
|
explicit LineEdit(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);
|
2007-03-04 21:35:37 +01:00
|
|
|
~LineEdit();
|
|
|
|
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
|
|
|
2007-05-28 07:52:56 +02:00
|
|
|
Qt::Orientations expandingDirections() const;
|
|
|
|
|
|
|
|
QSizeF minimumSize() const;
|
|
|
|
QSizeF maximumSize() const;
|
|
|
|
|
|
|
|
bool hasHeightForWidth() const;
|
|
|
|
qreal heightForWidth(qreal w) const;
|
|
|
|
|
|
|
|
bool hasWidthForHeight() const;
|
|
|
|
qreal widthForHeight(qreal h) const;
|
|
|
|
|
|
|
|
QRectF geometry() const;
|
|
|
|
void setGeometry(const QRectF& geometry);
|
|
|
|
QSizeF sizeHint() const;
|
|
|
|
|
|
|
|
|
2007-03-04 21:35:37 +01:00
|
|
|
public Q_SLOTS:
|
2007-05-23 05:08:47 +02:00
|
|
|
void updated(const QString&, const Plasma::DataEngine::Data&);
|
2007-05-24 21:36:05 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
Private* const d;
|
2007-03-04 21:35:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Plasma
|
|
|
|
|
|
|
|
#endif
|