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

List:       koffice-devel
Subject:    Re: Text tool plug-ins
From:       Thomas Zander <zander () kde ! org>
Date:       2007-06-18 17:13:10
Message-ID: 200706181913.13533.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


First of all; please look at this page I wrote for this specific subject;
http://techbase.kde.org/Development/Tutorials/KOffice_Overview

On Monday 18 June 2007 17:28:19 Tomas Mecir wrote:
> 2. inherit from KoTextEditingPlugin. Again, the trader queries and
> such are already implemented, but the problem here (apart from being
> limited to KoText only, which is probably not avoidable in any case)
> is that the KoTextEditingPlugin seems to be aimed for plug-ins that
> need real-time updates about the status of the text. The plug-ins done
> in this project do not need this functionality, though, for the most
> part (the word count one does, but that's it).
[]

> Or is there some other solution possible, that I am not seeing ?
>
> By the way, for the reference, the list of plug-ins that the SoC
> project entails looks like this:
> * Bookmarks plugin

Bookmarks seems to be a core thing that I agree should not become a 
plugin. Adding the public APIs in KoText and the widgets etc in the 
shapes/text plugin seems to be the way to go.

> * Uppercase Text (change text to all lowercase, title cased, or
> capitalized) 

IIRC this widget requires;
1) access to the current (text) selection
2) access to the document to alter the selection-text.
3) a way to show itself in the GUI.

The first is a bit of a disappointment in that I expected the selection to 
be stored in a QTextCursor in the active KoCanvasResourceProvider. Alas, 
a QTextCursor can't be stored in a QVariant.   I guess we need to add 
several fields or a custom made struct for this purpose instead.
For 2 the same issue goes; we need to store the current shape and use a 
dynamic_cast to fetch the KoShapeData from the user object which will 
then give the QTextDocument we change.

For 3, yeah, I guess my explanation in the docs wasn't clear enough. Sorry 
for that :)
If you run KWord and press the right mouse button while the text tool is 
active you'll see the 'Autocorrect' menu option.   This will execute the 
code in /koffice/plugins/autocorrection/Autocorrection::checkSection()
See the api docs for KoTextEditingFactory::showInMenu()

> * Text replacement: Use thesaurus to do text replacement 
> for similar words, another example is text replacement by texting
> language. 

Similar to the previous one.

> * Colorization plugin 

Same thing.

> * An optional plugin that shows a word count in a docker

This one should use the Docker plugin structure, I think.

> I hope there is some easy answer to all this that I just don't see :)

Let me know if there are any problems left!
-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
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