2
* Copyright 2008 Aaron Seigo <aseigo@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License as
6
* published by the Free Software Foundation; either version 2, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details
14
* You should have received a copy of the GNU Library General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef BROWSERHISTORYCOMBOBOX_H
21
#define BROWSERHISTORYCOMBOBOX_H
23
#include <QtGui/QGraphicsProxyWidget>
30
class ComboBoxPrivate;
33
* @class ComboBox plasma/widgets/combobox.h <Plasma/Widgets/ComboBox>
35
* @short Provides a Plasma-themed combo box.
37
class BrowserHistoryComboBox : public QGraphicsProxyWidget
41
Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
42
Q_PROPERTY(QString text READ text NOTIFY textChanged)
43
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
44
Q_PROPERTY(KComboBox *nativeWidget READ nativeWidget WRITE setNativeWidget)
46
Q_PROPERTY(qreal animationUpdate READ animationUpdate WRITE setAnimationUpdate)
49
explicit BrowserHistoryComboBox(QGraphicsWidget *parent = 0);
50
~BrowserHistoryComboBox();
53
* @return the display text
58
* Sets the stylesheet used to control the visual display of this ComboBox
60
* @arg stylesheet a CSS string
62
void setStyleSheet(const QString &stylesheet);
65
* @return the stylesheet currently used with this widget
70
* Sets the combo box wrapped by this ComboBox (widget must inherit KComboBox), ownership is transferred to the ComboBox
72
* @arg combo box that will be wrapped by this ComboBox
75
void setNativeWidget(KComboBox *nativeWidget);
78
* @return the native widget wrapped by this ComboBox
80
KComboBox *nativeWidget() const;
83
* Adds an item to the combo box with the given text. The
84
* item is appended to the list of existing items.
86
void addItem(const QString &text);
88
void setProgressValue(int value);
90
void setDisplayProgress(bool enable);
97
* This signal is sent when the user chooses an item in the combobox.
98
* The item's text is passed.
100
void activated(const QString &text);
103
* This signal is sent whenever the currentIndex in the combobox changes
104
* either through user interaction or programmatically.
105
* The item's text is passed.
107
void textChanged(const QString &text);
110
void resizeEvent(QGraphicsSceneResizeEvent *event);
111
void paint(QPainter *painter,
112
const QStyleOptionGraphicsItem *option,
114
void focusInEvent(QFocusEvent *event);
115
void focusOutEvent(QFocusEvent *event);
116
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
117
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
118
void changeEvent(QEvent *event);
121
void setAnimationUpdate(qreal progress);
122
qreal animationUpdate() const;
125
ComboBoxPrivate * const d;
127
friend class ComboBoxPrivate;
128
Q_PRIVATE_SLOT(d, void syncBorders())
131
} // namespace Plasma
133
#endif // multiple inclusion guard