You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by "Rony G. Flatscher (Apache)" <ro...@apache.org> on 2012/10/30 14:48:18 UTC

Questions ad simpress infos/code examples ...

While researching quite some time back- and forward, I have still not managed to track down the
needed APIs

  * to get access to Impress' collection of Master Page Layouts (shown in the Tsaks pane under the
    name "Master Pages", "Available for Use", probably populated from the template folder); if
    anyone has some C++ or Java code snippet to demonstrate how to change the master page for a
    slide from the default to one of the available ones, it would be great!

  * to get access to Impress' collection of "Layouts" (shown in the Tasks pane under the name
    "Layouts"); although in this case it was possible for me to learn about the numeric values for
    each of the available layouts and assign them to a XDrawPage (property named "Layout"), I found
    no way to get a collection of the available layouts to use to fetch the index value from; any
    code snippets or hints about APIs to employ would be great!

  * to individually format the paragraphs (indenting, outdenting) programmatically in a
    "com.sun.star.presentation.OutlinerShape" which is used to add text to; as far as I can tell the
    optional XParagraphCursor, XWordCursor etc. are not available, just an XTextCursor;

TIA for any hints, ideas, code-snippets.

---rony


How to individually format paragraphs in an OutlinerShape (impress) ? ( Re: Questions ad simpress infos/code examples ...

Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
On 30.10.2012 20:58, Bernard Marcelly wrote:
> Message de Rony G. Flatscher  date 2012-10-30 18:59 :
>> On 30.10.2012 16:46, Andreas Säger wrote:
>> The problem is that from the API documentation (and MRI object inspector for that matter) one is (at
>> least I am) not able to figure out how to get access to:
>>
>>    * the available Master pages (as depicted in the Tasks pane),
>>    * the available Layouts (as depicted in the Tasks pane),
>>    * how to individually format paragraphs in an OutlinerShape.
>>
>
> Three different questions in the same message. The recipe for a long and unreadable thread.
Bernard, you are right, hence splitting up into three separate messages.

>
> Question 3
> Just like you format a text in Writer.
> The shape gives direct access to the TextRange, and to the method createTextCursor() and others.
> MRI should show you this.
Hmm,  even using MRI I cannot identify/see which properties or interfaces would allow me to use a
XTextCursor to step through the paragraphs and learn at which level they are indented, nor how I
could indent/outdent a specific paragraph in an XText of type OutlineShpae in impress.

Usually, I would expect to use a paragraph cursor to step through paragraphs and set the properties
accordingly, but simpress' XTextCursor does not have the other (optional) cursors defined/available.

As Impress is able to do that there must be a way. Maybe I am worn out for too much experiments to
overlook the obvious?

---rony


Getting access to the group of available layouts in impress ( Re: Questions ad simpress infos/code examples ...

Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
On 30.10.2012 20:58, Bernard Marcelly wrote:
> Message de Rony G. Flatscher  date 2012-10-30 18:59 :
>> On 30.10.2012 16:46, Andreas Säger wrote:
>> The problem is that from the API documentation (and MRI object inspector for that matter) one is (at
>> least I am) not able to figure out how to get access to:
>>
>>    * the available Master pages (as depicted in the Tasks pane),
>>    * the available Layouts (as depicted in the Tasks pane),
>>    * how to individually format paragraphs in an OutlinerShape.
>>
>
> Three different questions in the same message. The recipe for a long and unreadable thread.
Bernard, you are right, hence splitting up into three separate messages.

> Question 2
> I have never seen any API related to layout slides. Maybe it is not accessible from API.
Hmm, the GUI of impress seems to be able (unless, of course, it is hardcoded).

---rony

Howto get access to the families of master pages (impress) ? (Re: Questions ad simpress infos/code examples ...

Posted by "Rony G. Flatscher (Apache)" <ro...@apache.org>.
On 30.10.2012 20:58, Bernard Marcelly wrote:
> Message de Rony G. Flatscher  date 2012-10-30 18:59 :
>> On 30.10.2012 16:46, Andreas Säger wrote:
>> The problem is that from the API documentation (and MRI object inspector for that matter) one is (at
>> least I am) not able to figure out how to get access to:
>>
>>    * the available Master pages (as depicted in the Tasks pane),
>>    * the available Layouts (as depicted in the Tasks pane),
>>    * how to individually format paragraphs in an OutlinerShape.
>>
>
> Three different questions in the same message. The recipe for a long and unreadable thread.
Bernard, you are right, hence splitting up into three separate messages.

> Question 1
> How to access the MasterPage(s) is described in the Developer's Guide
> <http://wiki.openoffice.org/wiki/Documentation/DevGuide/Drawings/Working_with_Drawing_Documents>
First of all: thank you very much for your efforts and this pointer (which I had conslted already) !

Maybe I was unclear in my question/problem description:

  * problem: creating a new impress document and wishing to switch the default master page to one of
    those master pages that in the GUI-interface are listed on the right hand side in what is called
    "Task pane" (menu: "View -> Task Pane"), section entitled "Master Pages".

So far I have not found/seen a way to get at that information that the presentation GUI is able to
get to. (I can get at the default master page assigned to a newly created impress document.)

The idea is to become able to switch the "master page family" programmatically by enumerating those
"master page famliles" that the presentation GUI displays in the task pane.

TIA,

---rony


Re: Questions ad simpress infos/code examples ...

Posted by Bernard Marcelly <ma...@club-internet.fr>.
Message de Rony G. Flatscher  date 2012-10-30 18:59 :
> On 30.10.2012 16:46, Andreas Säger wrote:
> The problem is that from the API documentation (and MRI object inspector for that matter) one is (at
> least I am) not able to figure out how to get access to:
>
>    * the available Master pages (as depicted in the Tasks pane),
>    * the available Layouts (as depicted in the Tasks pane),
>    * how to individually format paragraphs in an OutlinerShape.
>

Three different questions in the same message. The recipe for a long and 
unreadable thread.

Question 1
How to access the MasterPage(s) is described in the Developer's Guide
<http://wiki.openoffice.org/wiki/Documentation/DevGuide/Drawings/Working_with_Drawing_Documents>

Question 2
I have never seen any API related to layout slides. Maybe it is not accessible 
from API.

Question 3
Just like you format a text in Writer.
The shape gives direct access to the TextRange, and to the method 
createTextCursor() and others. MRI should show you this.


Regards
   Bernard

Re: Questions ad simpress infos/code examples ...

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
On 30.10.2012 16:46, Andreas Säger wrote:
> Am 30.10.2012 14:48, Rony G. Flatscher (Apache) wrote:
>> While researching quite some time back- and forward, I have still not managed to track down the
>> needed APIs
>> TIA for any hints, ideas, code-snippets.
>>
>> ---rony
>>
>>
> Hi,
> The MRI object inspector extension generates code snippets while you are
> browsing the object hierarchy with it. Pull up the bottom border of the
> MRI window and select the programming language from the menu.
>
> There are hundreds of snippets on oooforum.org but that site seems to be
> going down the drain. Someone has a backup of this huge collection of
> API related topics.
>
> http://forum.openoffice.org/en/forum/viewforum.php?f=21 has at least one
> Impress snippet in its snippets section but you might find more on that
> forum.
>
> A presentation or drawing document consists of draw pages. Other
> document models have draw pages as well. A spreadsheet has one draw page
> per sheet, a text has one draw page. Many snippets referring to the draw
> pages of other components apply to presentations as well.
Hi Andreas,

thank you for your hints and links!

Unfortunately, they do not help solve the original three questions/tasks.

The problem is that from the API documentation (and MRI object inspector for that matter) one is (at
least I am) not able to figure out how to get access to:

  * the available Master pages (as depicted in the Tasks pane),
  * the available Layouts (as depicted in the Tasks pane),
  * how to individually format paragraphs in an OutlinerShape.

---rony






Re: Questions ad simpress infos/code examples ...

Posted by Andreas Säger <vi...@t-online.de>.
Am 30.10.2012 14:48, Rony G. Flatscher (Apache) wrote:
> While researching quite some time back- and forward, I have still not managed to track down the
> needed APIs

> TIA for any hints, ideas, code-snippets.
> 
> ---rony
> 
> 

Hi,
The MRI object inspector extension generates code snippets while you are
browsing the object hierarchy with it. Pull up the bottom border of the
MRI window and select the programming language from the menu.

There are hundreds of snippets on oooforum.org but that site seems to be
going down the drain. Someone has a backup of this huge collection of
API related topics.

http://forum.openoffice.org/en/forum/viewforum.php?f=21 has at least one
Impress snippet in its snippets section but you might find more on that
forum.

A presentation or drawing document consists of draw pages. Other
document models have draw pages as well. A spreadsheet has one draw page
per sheet, a text has one draw page. Many snippets referring to the draw
pages of other components apply to presentations as well.
Hope that helps,
A.S.


Re: Questions ad simpress infos/code examples ...

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Andre,

thank you *very* much for these valuable pointers.

For interested readers here the URLs to opengrok:

  * http://opengrok.adfinis-sygroup.org/source/xref/aoo-AOO34/main/sd/source/ui/inc/TemplateScanner.hxx
  * http://opengrok.adfinis-sygroup.org/source/xref/aoo-AOO34/main/sd/source/ui/dlg/TemplateScanner.cxx
  * http://opengrok.adfinis-sygroup.org/source/xref/aoo-AOO34/main/sd/source/ui/toolpanel/LayoutMenu.hxx
  * http://opengrok.adfinis-sygroup.org/source/xref/aoo-AOO34/main/sd/source/ui/toolpanel/LayoutMenu.cxx

Will study them and trying to exploit them to become able to programmatically switching master page
"famliles".

---rony



Re: Questions ad simpress infos/code examples ...

Posted by Andre Fischer <aw...@gmail.com>.
On 30.10.2012 14:48, Rony G. Flatscher (Apache) wrote:
> While researching quite some time back- and forward, I have still not managed to track down the
> needed APIs
>
>    * to get access to Impress' collection of Master Page Layouts (shown in the Tsaks pane under the
>      name "Master Pages", "Available for Use", probably populated from the template folder); if
>      anyone has some C++ or Java code snippet to demonstrate how to change the master page for a
>      slide from the default to one of the available ones, it would be great!

It has been some time since I last wrote or even used the code but I 
think this is what you are looking for:

The TemplateScanner class is doing the iterating over the Impress 
templates (in different folders) and extracts master pages.

sd/source/ui/inc/TemplateScanner.cxx
sd/source/ui/dlg/TemplateScanner.cxx

It is typically run "in the background"--timer based one step at a 
time--and therefore a little hard to read.
It is used by the MasterPageContainerFiller class:

sd/source/ui/toolpanel/controls/MasterPageContainerFiller.cxx /.hxx

>
>    * to get access to Impress' collection of "Layouts" (shown in the Tasks pane under the name
>      "Layouts"); although in this case it was possible for me to learn about the numeric values for
>      each of the available layouts and assign them to a XDrawPage (property named "Layout"), I found
>      no way to get a collection of the available layouts to use to fetch the index value from; any
>      code snippets or hints about APIs to employ would be great!

Look at sd/source/ui/toolpanel/LayoutMenu.cxx

The LayoutMenu::Fill() method iterates over the layouts and uses icons 
and AutoLayout objects for each layout.

>
>    * to individually format the paragraphs (indenting, outdenting) programmatically in a
>      "com.sun.star.presentation.OutlinerShape" which is used to add text to; as far as I can tell the
>      optional XParagraphCursor, XWordCursor etc. are not available, just an XTextCursor;

I can not help you there.


-Andre