add more spacing
[personal-kdebase.git] / workspace / plasma / applets / kickoff / ui / urlitemview.h
blob77124eb7f3a005a7c2827f830c3bd549a27f582a
1 /*
2 Copyright 2007 Robert Knight <robertknight@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef URLITEMVIEW_H
21 #define URLITEMVIEW_H
23 // Qt
24 #include <QAbstractItemView>
26 namespace Kickoff
29 class ItemStateProvider;
30 class UrlItemView : public QAbstractItemView
32 Q_OBJECT
34 public:
35 UrlItemView(QWidget *parent = 0);
36 virtual ~UrlItemView();
38 void setItemStateProvider(ItemStateProvider *provider);
39 ItemStateProvider *itemStateProvider() const;
41 // reimplemented from QAbstractItemView
42 virtual QModelIndex indexAt(const QPoint& point) const;
43 virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
44 virtual QRect visualRect(const QModelIndex& index) const;
45 virtual void setModel(QAbstractItemModel *model);
46 protected:
47 // reimplemented from QAbstractItemView
48 virtual int horizontalOffset() const;
49 virtual bool isIndexHidden(const QModelIndex& index) const;
50 virtual QModelIndex moveCursor(CursorAction action, Qt::KeyboardModifiers modifiers);
51 virtual void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags);
52 virtual int verticalOffset() const;
53 virtual QRegion visualRegionForSelection(const QItemSelection& selection) const;
54 virtual void startDrag(Qt::DropActions supportedActions);
55 virtual void dragEnterEvent(QDragEnterEvent *event);
56 virtual void dragLeaveEvent(QDragLeaveEvent *event);
57 virtual void dragMoveEvent(QDragMoveEvent *event);
59 // reimplemented from QWidget
60 virtual void paintEvent(QPaintEvent *event);
61 virtual void resizeEvent(QResizeEvent *event);
62 virtual void mouseMoveEvent(QMouseEvent *event);
63 virtual void mousePressEvent(QMouseEvent *event);
64 virtual void mouseReleaseEvent(QMouseEvent *event);
65 virtual void dropEvent(QDropEvent *event);
66 virtual void leaveEvent(QEvent *event);
69 private Q_SLOTS:
70 // lays out all items in the view and sets the current index to the first
71 // selectable item
72 void updateLayout();
74 private:
75 class Private;
76 Private * const d;
81 #endif // URLITEMVIEW_H