1 /***************************************************************************
2 * Copyright (C) 2008 by Marco Martin <notmart@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, 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 General Public License *
15 * 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 . *
18 ***************************************************************************/
23 #include <Plasma/PopupApplet>
24 #include <Plasma/DataEngine>
26 #include "ui_webbrowserconfig.h"
28 class QGraphicsLinearLayout
;
29 class QStandardItemModel
;
32 class KUrlPixmapProvider
;
35 class KBookmarkManager
;
39 class BookmarksDelegate
;
46 class HistoryComboBox
;
52 class WebBrowser
: public Plasma::PopupApplet
56 WebBrowser(QObject
*parent
, const QVariantList
&args
);
59 QGraphicsWidget
*graphicsWidget();
61 //TODO: put in a separate file
64 UrlRole
= Qt::UserRole
+1,
65 BookmarkRole
= Qt::UserRole
+2
69 void dataUpdated(const QString
&source
, const Plasma::DataEngine::Data
&data
);
72 void saveState(KConfigGroup
&cg
) const;
73 Plasma::IconWidget
*addTool(const QString
&iconString
, QGraphicsLinearLayout
*layout
);
74 void createConfigurationInterface(KConfigDialog
*parent
);
81 void urlChanged(const QUrl
&url
);
82 void comboTextChanged(const QString
&string
);
84 void removeBookmark(const QModelIndex
&index
);
85 void removeBookmark();
86 void bookmarksToggle();
87 void bookmarkClicked(const QModelIndex
&index
);
89 void loadProgress(int progress
);
90 void bookmarksModelInit();
91 void configAccepted();
94 void fillGroup(BookmarkItem
*parentItem
, const KBookmarkGroup
&group
);
96 QGraphicsLinearLayout
*m_layout
;
97 QGraphicsLinearLayout
*m_toolbarLayout
;
98 QGraphicsLinearLayout
*m_statusbarLayout
;
99 Plasma::WebView
*m_browser
;
101 int m_verticalScrollValue
;
102 int m_horizontalScrollValue
;
103 KUrlPixmapProvider
*m_pixmapProvider
;
104 KCompletion
*m_completion
;
105 KBookmarkManager
*m_bookmarkManager
;
106 QStandardItemModel
*m_bookmarkModel
;
107 Plasma::TreeView
*m_bookmarksView
;
109 QTimer
*m_autoRefreshTimer
;
111 int m_autoRefreshInterval
;
113 QGraphicsWidget
*m_graphicsWidget
;
115 Plasma::HistoryComboBox
*m_historyCombo
;
116 BookmarksDelegate
*m_bookmarksDelegate
;
118 Plasma::IconWidget
*m_back
;
119 Plasma::IconWidget
*m_forward
;
121 Plasma::IconWidget
*m_go
;
123 QAction
*m_reloadAction
;
125 Plasma::IconWidget
*m_addBookmark
;
126 QAction
*m_addBookmarkAction
;
127 QAction
*m_removeBookmarkAction
;
129 Plasma::IconWidget
*m_organizeBookmarks
;
130 Plasma::IconWidget
*m_stop
;
131 Plasma::Meter
*m_progress
;
132 Plasma::Slider
*m_zoom
;
134 Ui::WebBrowserConfig ui
;
137 K_EXPORT_PLASMA_APPLET(webbrowser
, WebBrowser
)