File: DESIGN

package info (click to toggle)
kde-baseapps 4:16.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,308 kB
  • ctags: 12,389
  • sloc: cpp: 109,033; ansic: 2,197; python: 943; xml: 853; sh: 197; ruby: 112; makefile: 7
file content (106 lines) | stat: -rw-r--r-- 3,641 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Konqueror Design Document

Author:
  David Faure, faure@kde.org

Last modified: 25 September 2007

Overall design of konqueror :
=============================

The design of konqueror is based on the KParts part/mainwindow mechanism
(basically, konqueror can embed several parts, putting each one inside a view :
icon views, tree views, html views...)

The main(), including all the startup mechanism is in konq_main.*

The main window contains several "views", in order to show several URLs
at once, possibly using several modes. Each view is a KonqView.
The KonqView contains the child part, which can be any KParts::ReadOnlyPart.
For instance:
- a directory view provided by DolphinPart
- an HTML view provided by KHTMLPart
- any other KParts::ReadOnlyPart with or without BrowserExtension

Where to find those classes
===========================

src/*  : This is where konqueror is.
  konqrun.* : Re-implementation of KRun (see libkio) for konqueror.
              Responsible for finding appropriate view<->mimetype bindings.
  konqview.* : KonqView, class used by KonqMainView to handle child views
  konqframe.* : KonqFrame and KonqFrameHeader (handles view-statusbar).
  konqmain.* : The main()
  konqmainwindow.* : KonqMainWindow, the main window :)
  konqviewmanager.*: View manager. Handles view creation, activation, splitters etc.
about/* : The about part, shows the about page on startup
client/* : kfmclient, for talking to running konqueror processes
sidebar/* : The konqueror sidebar (framework+plugins)

Libs used by konqueror
======================

From kdelibs:
kdecore - mimetypes, services
kdeui - widgets
kparts - component model
khtml - HTML rendering
kio - I/O stuff, bookmarks, properties dialog

From kdebase:
libkonq - templates ("new") menu, RMB popup menu, file operations

How konqueror opens URLs
========================

KonqMainWindow:

  openFilteredURL or slotOpenURLRequest
                    |
                    |
            -----openUrl----
             |   |        |
             |   |        |
             |  KonqRun  KRun
             |   |
             |   |
           openView
               |   \----- splitView to create a new one
KonqView:      |
         changeViewMode
               |
       [switchView if different mode required]
               |
          openUrl  [emits openURLEvent (after calling openURL)]
Part:          |
               |
          openUrl [emits started, progress info, completed]
              ...


How history is implemented
==========================

From the konqueror side:

* KonqView has a list of history items. Each item contains a URL,
and a QByteArray for the view to store its stuff in the format that suits it best.
It calls saveState() at various points of time (right after starting loading the URL,
when the loading is completed, and right before loading another URL). Reason:
among other things, many views store the x and y offset of their scrollview in there.
It calls restoreState() when restoring a particular item out of the history list.

From the khtml side:

* Site with no frames: no problem, it just obeys to saveState/restoreState.

* Site with frames:
KHTMLPart saves the whole structure (all frames, and their URL) in the
history buffer (saveState/restoreState).
Every time a frame changes its URL, we want a new item in the history.
But when this happens, since it's internal to khtml, konqueror wouldn't know
about it. That's why there is the openUrlNotify() signal in browser extension
(see there for extensive docu about it).
When khtml emits it, KonqView creates a new history entry and fills it
(calling saveState).