Overall design
==============

* The document (KWDocument) has a list of framesets (KWFrameSet)
Currently the order of the framesets in the list defines the z-order (which frameset
is on top of which one), but this ought to be changed after 1.1 (with an int in the 
frameset for instance)

* Framesets include: text frameset, picture/clipart frameset, table frameset etc.

* A frameset has a list of frames, KWFrame. A KWFrame is basically a rectangle
(KoRect) with a bunch of attributes. 
The frameset contains the contents, like the text or a picture.
The frames visualize the contents of the frameset. 
Imagine a 10 pages document, with 1 text-frameset and 10 frames, because our
example author wants to have one frame per page.  This means that there is one 
text, and the frames define where on the pages this text is displayed.

* About text framesets: they hold a text document (KWTextDocument, which is
a QTextDocument from the QRichText classes - more on QRT later).

* About Tables; one table is a KWTableFrameset. This tableframeset contains
all the cells as its frames. But because the cells have a different text per
cell, we contain the cells in their own KWTextFrameset.

   KWTableFrameSet
    |           |
    |        TextFrames
  Cells               +----------+
     +--+                        |
        | ---> KWTextFrameSet    |
        |          +-> KWFrame <-+
        |                        |
        | ---> KWTextFrameSet    |
        |          +-> KWFrame <-+
        |                        |
        + ---> KWTextFrameSet    |
                   +-> KWFrame <-+


Painting
========
Here's how the painting (drawing the stuff on screen, and on printer) works:
Each frameset is responsible for drawing itself. The base class, KWFrameSet,
handles the generic code for iterating through the frames, applying the
"frame is a copy" stuff, drawing the borders, etc. So each specific frameset
class only has to implement drawFrame (exception for KWTableFrameset though).

When KWTextFrameset paints the text inside a frame, it uses QTextDocument's
draw() method, which takes care of iterating through the paragraphs etc.
Series of characters with the same formatting are drawn at once, by
QTextParag::drawParagString (reimplemented in KWTextParag, to draw the
formatting codes etc.).

Coordinate systems
==================
 
Just a quick note, to be expanded later.
 
Document (pt values, in double, KoPoint, KoRect.)
 |
 |--KWDocument::zoom*
 |
Zoomed coordinates (pixel values, in int, QPoint, QRect) 
This is also called the "Normal" coordinate system.
 |         |
 |         |--KWViewMode::normalToView
 |         V
 |    View Mode (pixels values, but e.g. pages are re-arranged)
 |    That's also the KWCanvas (scrollview)'s contents coordinates.
 |
 |
 |
 | And for text framesets, there's also :
 |
 |--KWTextFrameSet::normalToInternal
 V
Internal coordinates (pixel values for QRT)
 
This last transformation doesn't depend on the view-mode arrangement,
it's only about going from the frameset coord to the qrt internal coord,
both being "one page below another".
 
