dolphin/konqueror/DESIGN
David Faure 76685da26f Updates (especially the list of directory parts for konq-process-reuse)
svn path=/trunk/KDE/kdebase/apps/; revision=741462
2007-11-25 17:58:05 +00:00

106 lines
3.6 KiB
Text

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).