• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

webview.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2006-2007 Aaron Seigo <aseigo@kde.org>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_WEBVIEW_H
00021 #define PLASMA_WEBVIEW_H
00022 
00023 #include <plasma/plasma_export.h>
00024 #include <QtGui/QGraphicsWidget>
00025 
00026 #include <kurl.h>
00027 
00028 class QWebPage;
00029 class QWebFrame;
00030 class QKeyEvent;
00031 class QGraphicsSceneDragDropEvent;
00032 class QGraphicsSceneMouseEvent;
00033 class QGraphicsSceneWheelEvent;
00034 class QRect;
00035 
00036 namespace Plasma
00037 {
00038 
00039 class WebViewPrivate;
00040 
00046 class PLASMA_EXPORT WebView : public QGraphicsWidget
00047 {
00048     Q_OBJECT
00049 
00050     Q_PROPERTY(KUrl url READ url WRITE setUrl)
00051     Q_PROPERTY(QString html READ html WRITE setHtml)
00052     Q_PROPERTY(bool dragToScroll READ dragToScroll WRITE setDragToScroll)
00053 
00054     public:
00055         explicit WebView(QGraphicsItem *parent = 0);
00056         ~WebView();
00057 
00063         void setUrl(const KUrl &url);
00064 
00068         KUrl url() const;
00069 
00077         void setHtml(const QByteArray &html, const KUrl &baseUrl = KUrl());
00078 
00082         QString html() const;
00083 
00091         void setHtml(const QString &html, const KUrl &baseUrl = KUrl());
00092 
00096         QRectF geometry() const;
00097 
00105         void setPage(QWebPage *page);
00106 
00111         QWebPage *page() const;
00112 
00116         QWebFrame *mainFrame() const;
00117 
00122         void setDragToScroll(bool drag);
00123 
00128         bool dragToScroll();
00129 
00133         void setGeometry(const QRectF &geometry);
00134 
00135     Q_SIGNALS:
00142         void loadProgress(int percent);
00143 
00150         void loadFinished(bool success);
00151 
00152     protected:
00156         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00157         void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00158         void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
00159         void mousePressEvent(QGraphicsSceneMouseEvent *event);
00160         void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
00161         void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00162         void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
00163         void wheelEvent(QGraphicsSceneWheelEvent *event);
00164         void keyPressEvent(QKeyEvent * event);
00165         void keyReleaseEvent(QKeyEvent * event);
00166         void focusInEvent(QFocusEvent * event);
00167         void focusOutEvent(QFocusEvent * event);
00168         void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
00169         void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
00170         void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
00171         void dropEvent(QGraphicsSceneDragDropEvent * event);
00172 
00173     private:
00174         Q_PRIVATE_SLOT(d, void loadingFinished(bool success))
00175         Q_PRIVATE_SLOT(d, void updateRequested(const QRect& dirtyRect))
00176         Q_PRIVATE_SLOT(d, void scrollRequested(int dx, int dy, const QRect &scrollRect))
00177         Q_PRIVATE_SLOT(d, void dragTimeoutExpired())
00178 
00179         WebViewPrivate * const d;
00180         friend class WebViewPrivate;
00181 };
00182 
00183 } // namespace Plasma
00184 
00185 #endif // Multiple incluson guard
00186 

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal