Difference between revisions of "Documentation/DevGuide/Drawings/Working with Presentation Documents"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
(Added Java syntax highlight)
Line 18: Line 18:
 
The following two examples demonstrate how to access the notes pages and the handout page of an Impress document:  
 
The following two examples demonstrate how to access the notes pages and the handout page of an Impress document:  
 
<!--[SOURCE:Drawing/PageHelper.java]-->
 
<!--[SOURCE:Drawing/PageHelper.java]-->
 
+
<source lang="java">
 
   /** in Impress documents each draw page as also each draw master page has
 
   /** in Impress documents each draw page as also each draw master page has
 
       a corresponding notes page
 
       a corresponding notes page
Line 33: Line 33:
 
           xNotesPage = xPresentationPage.getNotesPage();
 
           xNotesPage = xPresentationPage.getNotesPage();
 
       return xNotesPage;
 
       return xNotesPage;
   }
+
   }</source>
  
 
The notes master page that corresponds to a notes page can be accessed by the <idl>com.sun.star.presentation.XPresentation</idl> interface of the master page.  
 
The notes master page that corresponds to a notes page can be accessed by the <idl>com.sun.star.presentation.XPresentation</idl> interface of the master page.  
 
<!--[SOURCE:Drawing/PageHelper.java]-->
 
<!--[SOURCE:Drawing/PageHelper.java]-->
 
+
<source lang="java">
 
   /** in impress each document has one handout page */
 
   /** in impress each document has one handout page */
 
   static public XDrawPage getHandoutMasterPage(XComponent xComponent) {
 
   static public XDrawPage getHandoutMasterPage(XComponent xComponent) {
Line 44: Line 44:
 
               XHandoutMasterSupplier.class, xComponent);
 
               XHandoutMasterSupplier.class, xComponent);
 
       return aHandoutMasterSupplier.getHandoutMasterPage();
 
       return aHandoutMasterSupplier.getHandoutMasterPage();
   }
+
   }</source>
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/Drawing Documents and Presentation Documents]]
 
[[Category:Documentation/Developer's Guide/Drawing Documents and Presentation Documents]]

Revision as of 12:45, 13 January 2013



The structure of Impress documents is enhanced by a handout page per document, one notes page per draw page, and one notes master page for each master page. This means that the creation of normal draw and draw master pages automatically create corresponding notes and notes master pages. Due to this fact there are no interfaces for creation or deletion of notes or notes master pages.

The following UML diagram describes the whole page structure of Impress. The horizontal dotted line illustrates the general page structure lying beneath the dotted line, and the enhanced page structure of Impress lying above.

PresentationDocument

Calling getDrawPages() at the com.sun.star.drawing.XDrawPagesSupplier interface of a presentation document retrieves a collection of com.sun.star.presentation.DrawPage instances with presentation specific properties.

The following two examples demonstrate how to access the notes pages and the handout page of an Impress document:

  /** in Impress documents each draw page as also each draw master page has
      a corresponding notes page
   */
  static public XDrawPage getNotesPage(XDrawPage xDrawPage) {
      XDrawPage xNotesPage;
      XPresentationPage xPresentationPage = (XPresentationPage)UnoRuntime.queryInterface(
          XPresentationPage.class, xDrawPage);
      /* only Impress pages support the XPresentationPage interface,
         for all other pages the interface will be zero, so a test
         won't hurt
       */
      if (xPresentationPage != null)
          xNotesPage = xPresentationPage.getNotesPage();
      return xNotesPage;
  }

The notes master page that corresponds to a notes page can be accessed by the com.sun.star.presentation.XPresentation interface of the master page.

  /** in impress each document has one handout page */
  static public XDrawPage getHandoutMasterPage(XComponent xComponent) {
      XHandoutMasterSupplier aHandoutMasterSupplier = 
          (XHandoutMasterSupplier)UnoRuntime.queryInterface(
              XHandoutMasterSupplier.class, xComponent);
      return aHandoutMasterSupplier.getHandoutMasterPage();
  }
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages