Warning, /network/konqueror/DESIGN is written in an unsupported language. File is not indexed.

0001 Konqueror Design Document
0002 
0003 Author:
0004   David Faure, faure@kde.org
0005 
0006 Last modified: 25 September 2007
0007 
0008 Overall design of konqueror :
0009 =============================
0010 
0011 The design of konqueror is based on the KParts part/mainwindow mechanism
0012 (basically, konqueror can embed several parts, putting each one inside a view :
0013 icon views, tree views, html views...)
0014 
0015 The main(), including all the startup mechanism is in konq_main.*
0016 
0017 The main window contains several "views", in order to show several URLs
0018 at once, possibly using several modes. Each view is a KonqView.
0019 The KonqView contains the child part, which can be any KParts::ReadOnlyPart.
0020 For instance:
0021 - a directory view provided by DolphinPart
0022 - an HTML view provided by KHTMLPart
0023 - any other KParts::ReadOnlyPart with or without BrowserExtension
0024 
0025 Where to find those classes
0026 ===========================
0027 
0028 src/*  : This is where konqueror is.
0029   konqrun.* : Re-implementation of KRun (see libkio) for konqueror.
0030               Responsible for finding appropriate view<->mimetype bindings.
0031   konqview.* : KonqView, class used by KonqMainView to handle child views
0032   konqframe.* : KonqFrame and KonqFrameHeader (handles view-statusbar).
0033   konqmain.* : The main()
0034   konqmainwindow.* : KonqMainWindow, the main window :)
0035   konqviewmanager.*: View manager. Handles view creation, activation, splitters etc.
0036 about/* : The about part, shows the about page on startup
0037 client/* : kfmclient, for talking to running konqueror processes
0038 sidebar/* : The konqueror sidebar (framework+plugins)
0039 
0040 Libs used by konqueror
0041 ======================
0042 
0043 From kdelibs:
0044 kdecore - mimetypes, services
0045 kdeui - widgets
0046 kparts - component model
0047 khtml - HTML rendering
0048 kio - I/O stuff, bookmarks, properties dialog
0049 
0050 From kdebase:
0051 libkonq - templates ("new") menu, RMB popup menu, file operations
0052 
0053 How konqueror opens URLs
0054 ========================
0055 
0056 KonqMainWindow:
0057 
0058   openFilteredURL or slotOpenURLRequest
0059                     |
0060                     |
0061             -----openUrl----
0062              |   |        |
0063              |   |        |
0064              |  KonqRun  KRun
0065              |   |
0066              |   |
0067            openView
0068                |   \----- splitView to create a new one
0069 KonqView:      |
0070          changeViewMode
0071                |
0072        [switchView if different mode required]
0073                |
0074           openUrl  [emits openURLEvent (after calling openURL)]
0075 Part:          |
0076                |
0077           openUrl [emits started, progress info, completed]
0078               ...
0079 
0080 
0081 How history is implemented
0082 ==========================
0083 
0084 From the konqueror side:
0085 
0086 * KonqView has a list of history items. Each item contains a URL,
0087 and a QByteArray for the view to store its stuff in the format that suits it best.
0088 It calls saveState() at various points of time (right after starting loading the URL,
0089 when the loading is completed, and right before loading another URL). Reason:
0090 among other things, many views store the x and y offset of their scrollview in there.
0091 It calls restoreState() when restoring a particular item out of the history list.
0092 
0093 From the khtml side:
0094 
0095 * Site with no frames: no problem, it just obeys to saveState/restoreState.
0096 
0097 * Site with frames:
0098 KHTMLPart saves the whole structure (all frames, and their URL) in the
0099 history buffer (saveState/restoreState).
0100 Every time a frame changes its URL, we want a new item in the history.
0101 But when this happens, since it's internal to khtml, konqueror wouldn't know
0102 about it. That's why there is the openUrlNotify() signal in browser extension
0103 (see there for extensive docu about it).
0104 When khtml emits it, KonqView creates a new history entry and fills it
0105 (calling saveState).
0106