• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messageviewer

  • sources
  • kde-4.12
  • kdepim
  • messageviewer
  • adblock
webpage.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013 Montel Laurent <montel@kde.org>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #include "webpage.h"
19 #include "networkaccessmanager.h"
20 #include "adblockmanager.h"
21 
22 using namespace MessageViewer;
23 
24 WebPage::WebPage(QWidget *parent)
25  : KWebPage(parent)
26 {
27  MessageViewer::MyNetworkAccessManager *manager = new MessageViewer::MyNetworkAccessManager(this);
28  manager->setEmitReadyReadOnMetaDataChange(true);
29  manager->setCache(0);
30  QWidget* window = parent ? parent->window() : 0;
31  if (window) {
32  manager->setWindow(window);
33  }
34  setNetworkAccessManager(manager);
35  connect(this, SIGNAL(frameCreated(QWebFrame*)), AdBlockManager::self(), SLOT(applyHidingRules(QWebFrame*)));
36 }
37 
38 WebPage::~WebPage()
39 {
40 }
41 
42 KUrl WebPage::loadingUrl() const
43 {
44  return mLoadingUrl;
45 }
46 
47 bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
48 {
49  const bool isMainFrameRequest = (frame == mainFrame());
50  if (isMainFrameRequest) {
51  mLoadingUrl = request.url();
52  }
53  return QWebPage::acceptNavigationRequest(frame, request, type);
54 }
55 #include "webpage.moc"
MessageViewer::WebPage::loadingUrl
KUrl loadingUrl() const
Definition: webpage.cpp:42
QWidget
adblockmanager.h
MessageViewer::WebPage::acceptNavigationRequest
bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
Definition: webpage.cpp:47
MessageViewer::WebPage::WebPage
WebPage(QWidget *parent=0)
Definition: webpage.cpp:24
networkaccessmanager.h
webpage.h
MessageViewer::MyNetworkAccessManager
Re-implemented for internal reasons.
Definition: networkaccessmanager.h:35
MessageViewer::AdBlockManager::self
static AdBlockManager * self()
Entry point.
Definition: adblockmanager.cpp:55
type
const char * type
Definition: bodypartformatter.cpp:192
KWebPage
MessageViewer::WebPage::~WebPage
~WebPage()
Definition: webpage.cpp:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal