not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / applets / webbrowser / historycombobox.h
blob3262e1a534fe3e9517eaa7e476cbb290e9d49ce0
1 /*
2 * Copyright 2008 Aaron Seigo <aseigo@kde.org>
3 * Copyright 2008 Marco Martin <notmart@gmail.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef PLASMA_HISTORYCOMBOBOX_H
23 #define PLASMA_HISTORYCOMBOBOX_H
25 #include <QtGui/QGraphicsProxyWidget>
28 class KHistoryComboBox;
30 #include <KUrl>
32 namespace Plasma
35 class HistoryComboBox : public QGraphicsProxyWidget
37 Q_OBJECT
39 Q_PROPERTY(QGraphicsWidget* parentWidget READ parentWidget)
40 Q_PROPERTY(QString stylesheet READ stylesheet WRITE setStylesheet)
41 Q_PROPERTY(KHistoryComboBox* nativeWidget READ nativeWidget)
43 public:
44 explicit HistoryComboBox(QGraphicsWidget *parent = 0);
45 ~HistoryComboBox();
47 /**
48 * Sets the style sheet used to control the visual display of this TextEdit
50 * @arg stylehseet a CSS string
52 void setStylesheet(const QString &stylesheet);
54 /**
55 * @return the stylesheet currently used with this widget
57 QString stylesheet();
59 /**
60 * @return the native widget wrapped by this TextEdit
62 KHistoryComboBox* nativeWidget() const;
64 QStringList historyItems() const;
65 bool removeFromHistory(const QString &item);
66 void reset();
67 void setHistoryItems(const QStringList &items);
68 QString currentText() const;
69 void insertUrl(int index, const KUrl &url);
70 void setDuplicatesEnabled(bool enabled);
72 public Q_SLOTS:
73 void addToHistory(const QString &item);
75 Q_SIGNALS:
76 void cleared();
77 void activated(int index);
78 void returnPressed(const QString &);
79 void textChanged(const QString &);
80 void returnPressed();
82 protected:
83 void resizeEvent(QGraphicsSceneResizeEvent *event);
85 private:
86 class Private;
87 Private * const d;
90 } // namespace Plasma
92 #endif // multiple inclusion guard