• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
khtml_childframe.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4 * 1999-2001 Lars Knoll <knoll@kde.org>
5 * 1999-2001 Antti Koivisto <koivisto@kde.org>
6 * 2000-2001 Simon Hausmann <hausmann@kde.org>
7 * 2000-2001 Dirk Mueller <mueller@kde.org>
8 * 2000 Stefan Schimanski <1Stein@gmx.de>
9 * 2001-2005 George Staikos <staikos@kde.org>
10 * 2010 Maksim Orlovich <maksim@kde.org>
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA.
26 */
27#include "khtml_childframe_p.h"
28#include "khtmlpart_p.h"
29#include "khtml_part.h"
30
31namespace khtml {
32
33ChildFrame::ChildFrame() : QObject (0) {
34 setObjectName( "khtml_child_frame" );
35 m_jscript = 0L;
36 m_bCompleted = false; m_bPreloaded = false; m_type = Frame; m_bNotify = false;
37 m_bPendingRedirection = false;
38}
39
40ChildFrame::~ChildFrame() {
41 if (m_run)
42 m_run.data()->abort();
43 delete m_jscript;
44}
45
46const char* ChildFrame::typeString() const
47{
48 switch (m_type) {
49 case khtml::ChildFrame::Frame:
50 return "frame";
51 case khtml::ChildFrame::IFrame:
52 return "iframe";
53 case khtml::ChildFrame::Object:
54 return "object";
55 default:
56 return "HUH???";
57 }
58}
59
60static QDebug& ind(const QDebug& dbgIn, int ind)
61{
62 QDebug& dbg = const_cast<QDebug&>(dbgIn);
63
64 for (int i = 0; i < ind; ++i)
65 dbg << " ";
66 return dbg;
67}
68
69void ChildFrame::dump(int i)
70{
71 ind(qDebug(), i) << typeString() << m_name
72 << this << m_part.data()
73 << "url:" << (m_part.isNull() ?
74 QString::fromLatin1("") :
75 m_part->url().url())
76 << "el:" << (m_partContainerElement.isNull() ?
77 QString::fromLatin1("") :
78 DOM::getPrintableName(m_partContainerElement.data()->id()))
79 << "sn:" << m_serviceName << "st:" << m_serviceType
80 << "kr:" << m_run.data() << "comp:" << m_bCompleted;
81}
82
83void ChildFrame::dumpFrameTree(KHTMLPart* part)
84{
85 static int i = 0;
86
87 KHTMLPartPrivate* d = part->impl();
88
89 if (!d->m_objects.isEmpty()) {
90 ind(qDebug(), i) << "objects:";
91 i += 4;
92
93 for (QList<khtml::ChildFrame*>::Iterator io = d->m_objects.begin(); io != d->m_objects.end(); ++io) {
94 khtml::ChildFrame* cf = (*io);
95 cf->dump(i);
96 if (KHTMLPart* p = ::qobject_cast<KHTMLPart*>(cf->m_part.data())) {
97 i += 4;
98 dumpFrameTree(p);
99 i -= 4;
100 }
101 }
102 i -= 4;
103 }
104
105 if (!d->m_frames.isEmpty()) {
106 ind(qDebug(), i) << "frames:";
107 i += 4;
108
109 for (QList<khtml::ChildFrame*>::Iterator ifr = d->m_frames.begin(); ifr != d->m_frames.end(); ++ifr) {
110 khtml::ChildFrame* cf = (*ifr);
111 cf->dump(i);
112 if (KHTMLPart* p = ::qobject_cast<KHTMLPart*>(cf->m_part.data())) {
113 i += 4;
114 dumpFrameTree(p);
115 i -= 4;
116 }
117 }
118 i -= 4;
119 }
120}
121
122
123} // namespace khtml
124
125
126KHTMLFrameList::Iterator KHTMLFrameList::find( const QString &name )
127{
128 Iterator it = begin();
129 const Iterator e = end();
130
131 for (; it!=e; ++it )
132 if ( (*it)->m_name==name )
133 break;
134
135 return it;
136}
137
138// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;
KHTMLPartPrivate
Definition: khtmlpart_p.h:94
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:207
KHTMLPart::impl
KHTMLPartPrivate * impl()
Definition: khtml_part.h:1937
QList
QObject
khtml::ChildFrame
Definition: khtml_childframe_p.h:41
khtml::ChildFrame::m_bCompleted
bool m_bCompleted
Definition: khtml_childframe_p.h:61
khtml::ChildFrame::m_jscript
KJSProxy * m_jscript
Definition: khtml_childframe_p.h:60
khtml::ChildFrame::~ChildFrame
~ChildFrame()
Definition: khtml_childframe.cpp:40
khtml::ChildFrame::m_serviceType
QString m_serviceType
Definition: khtml_childframe_p.h:59
khtml::ChildFrame::m_part
QPointer< KParts::ReadOnlyPart > m_part
Definition: khtml_childframe_p.h:56
khtml::ChildFrame::ChildFrame
ChildFrame()
Definition: khtml_childframe.cpp:33
khtml::ChildFrame::m_partContainerElement
QWeakPointer< DOM::HTMLPartContainerElementImpl > m_partContainerElement
Definition: khtml_childframe_p.h:49
khtml::ChildFrame::m_run
QWeakPointer< KHTMLRun > m_run
Definition: khtml_childframe_p.h:65
khtml::ChildFrame::m_bPendingRedirection
bool m_bPendingRedirection
Definition: khtml_childframe_p.h:71
khtml::ChildFrame::dumpFrameTree
static void dumpFrameTree(KHTMLPart *part)
Definition: khtml_childframe.cpp:83
khtml::ChildFrame::typeString
const char * typeString() const
Definition: khtml_childframe.cpp:46
khtml::ChildFrame::m_bPreloaded
bool m_bPreloaded
Definition: khtml_childframe_p.h:69
khtml::ChildFrame::m_serviceName
QString m_serviceName
Definition: khtml_childframe_p.h:58
khtml::ChildFrame::dump
void dump(int indent)
Definition: khtml_childframe.cpp:69
khtml::ChildFrame::IFrame
@ IFrame
Definition: khtml_childframe_p.h:44
khtml::ChildFrame::Frame
@ Frame
Definition: khtml_childframe_p.h:44
khtml::ChildFrame::Object
@ Object
Definition: khtml_childframe_p.h:44
khtml::ChildFrame::m_type
Type m_type
Definition: khtml_childframe_p.h:67
khtml::ChildFrame::m_name
QString m_name
Definition: khtml_childframe_p.h:62
khtml::ChildFrame::m_bNotify
bool m_bNotify
Definition: khtml_childframe_p.h:70
khtml_childframe_p.h
khtml_part.h
d
#define d
Definition: khtmlfind.cpp:42
khtmlpart_p.h
name
const char * name(StandardAction id)
begin
const KShortcut & begin()
end
const KShortcut & end()
khtml
khtml::ind
static QDebug & ind(const QDebug &dbgIn, int ind)
Definition: khtml_childframe.cpp:60
KHTMLFrameList::find
Iterator find(const QString &name) KDE_NO_EXPORT
Definition: khtml_childframe.cpp:126
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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