[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Clarification: Relationship between KoDocument and QTextDocument
From:       Thomas Zander <zander () kde ! org>
Date:       2010-01-12 8:06:13
Message-ID: 201001120906.14141.zander () kde ! org
[Download RAW message or body]

On Tuesday 12. January 2010 03.23.51 Ben Martin wrote:
> Hi,
>   Sorry for another newbie post :| Though as the
> setResource()/resoruce() methods tend to obscure up the relations
> between classes, it would be wonderful to clarify things a little.
> 
>   It seems there is a one to many relationship between K?Document
> and QTextDocument. The QTextDocuments are available through the
> FrameSets of the KWDocument. 

Yes, see kword/part/frames/DESIGN and libs/kotext/Mainpage.dox for the boring 
details.
In short; each frameset in kword is one QTextDocument which you can use 
KoTextDocument on to get more info.

The text documents are flakes and therefore completely unaware of the broader 
koffice structures like KoDocument.

The request for a KoDocument is a difficult one for the following reason; the 
'main' lib (which has KoDocument etc) is dependent on flake. This means that in 
flake we can't access the KoDocument class as we'd get a cyclic dependency.

In the KoCanvasBase (which you can get access to by reimplementing the 
KoCanvasObserver interface in your docker) you have access to the 
KoShapeController which is equivalent to a KoDocument for many applications.

As a TODO for me I want to provide a DocumentResourceManager on the 
shapeController just like we have a CanvasResourceManager right now. Document 
wide data objects will be stored there.
Think about things like the KoStyleManager but also things like the url of the 
document and the document itself; likely as a KoOdfDocument instance.

So until I did that work you can't really access the kodocument without 
hacks...
-- 
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic