AAOO

 

 

 

AAOOAccessibility Add-on of OpenOffice.org

Developer’s Guide 

 

 

 

 

 

 

 

 

 

 

 

 

This documentation is distributed under new BSD licenses restricting.

 

Copyright (c) 2006, Benjamin B King

All rights reserved.

 


 

 

Content

 

 

 

Reader's Guide. 3

What This Manual Covers. 3

How This Book is Organized. 3

AAOO Version History. 3

Related documentation. 3

Project Framework. 4

Framework. 4

The package aaoo.gui 4

The package aaoo.core. 5

The package aaoo.bottom.. 5

Main functions. 5

How to connect to a running OpenOffice.org in this project 5

How to get all te picture-resources in the odt document 6

How to get a property of a picture object. 6

How to modify a property of a picture object. 7

 


Reader's Guide

 

What This Manual Covers

This manual describes the frameworks of the AAOO project. If you want perfect the function of AAOO, you may find some usefull information in this manual. Or, as a user, there is another manual ‘User’s Guide’ for you.

How This Book is Organized

1.         The framework of this project.

2.         The main function of the project.

1)        How to connect to a running OpenOffice.org in this project.

2)        How to get all te picture-resources in the odt document.

3)        How to get a property of a picture object.

4)        How to modify a property of a picture object.

 

AAOO Version History

This is the first version of AAOO. It’s very simple and some function is uncompleted.

Related documentation

AAOO User’s Guide

It tells you how to build the environment of AAOO and how to configure the NetBeans. I very suggest you read this manual at first.

OpenOffice.org 2.0 Developer’s Guide

You can get many useful and important knowledge of UNO.

API reference of UNO and OpenOffice.org

 

Project Framework

Framework

There are 3 package in the project. They are:

aaoo.gui

The Graphic User Interface.

aaoo.core

The core level of the project, and also the bridge of aaoo.gui and aaoo.bottom.

aaoo.bottom

The bottom level of the project, it connect to the OpenOffice and operating the document via NUO API.

The package aaoo.gui

There are 3 main windows in the project, and there are 3 classes in the package aaoo.gui.

The package aaoo.core

There are 3 main classes in this package, and cImgInfoOffer extends the class cInfoOffer.

The package aaoo.bottom

There is 1 main class in this package at present, and it does do many many works.

Main functions

How to connect to a running OpenOffice.org in this project

Note. Reference the code aaoo.bottom.bConDoc.java.

Note. Reference the book UNO Developer’s Guide.

First, see the code come form aaoo.bootom.bConDoc.java follow:

try {

            locale = new aaoo.core.cI18N();

           // bootstrap UNO and get the remote component context. The context can

           // be used to get the service manager

           xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();

           System.out.println(locale.getString("Connected"));

          

           xMCF = xContext.getServiceManager(); 

xDesktop = (com.sun.star.frame.XDesktop)

               UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,

                   xMCF.createInstanceWithContext("com.sun.star.frame.Desktop",

                                                  xContext ) );

             xCompLoader =(com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface(

                   com.sun.star.frame.XComponentLoader.class, xDesktop);

           

           xComponent1= xDesktop.getCurrentComponent();

}   

    catch ( java.lang.Exception e ) {

       e.printStackTrace(System.err);

       System.exit(1);

    }

UNO (pronounced ['ju:nou]) stands for Universal Network Objects and is the base component technology for OpenOffice.org. You can utilize and write components that interact across languages, component technologies, computer platforms, and networks. Currently, UNO is available on Linux, Solaris, Windows, Power PC, FreeBSD and Mac OS X. Other ports are still being developed at OpenOffice.org. The supported programming languages are  Java, C++ and OpenOffice.org Basic. As well, UNO is available through the component technology Microsoft COM for many other languages. On OpenOffice.org there is also a language binding for Python available.

With OpenOffice.org 2.0, UNO is also programmable with .NET languages using the new Common Language Infrastructure binding. In addition, the new scripting framework offers the use of the API through several scripting languages, such as Javascript, Beanshell or Jython.

You can connect to a local or remote instance of OpenOffice.org from C++, Java and COM/DCOM. C++ and Java Desktop applications, Java servlets, Java Server Pages, JScript and VBScript, and languages, such as Delphi, Visual Basic and many others can use OpenOffice.org to work with Office documents.

UNO introduces the concept of service managers, which can be considered as “factories” that  create services. For now, it is sufficient to see services as UNO objects that can be used to perform specific tasks. Later on we will give a more precise definition for the term service.

The follow Illustration show how to use the desktop, which is the central management instance for the OpenOffice.org application framework. All OpenOffice.org application windows are organized in a hierarchy of frames that contain viewable components. The desktop is the root frame for this hierarchy. From the desktop you can load viewable components, access frames and components, terminate the office, traverse the frame hierarchy and dispatch command requests.

 

How to get all te picture-resources in the odt document

First, see the code come form aaoo.bootom.bConDoc.java follow:

xTGOS1 =(com.sun.star.text.XTextGraphicObjectsSupplier)

          UnoRuntime.queryInterface(com.sun.star.text.XTextGraphicObjectsSupplier.class,

                            xComponent1);

          

            xNAss1 =  xTGOS1.getGraphicObjects();

             ENs =  xNAss1.getElementNames();

 

 

How to get a property of a picture object.

First, see the code come form aaoo.bootom.bConDoc.java follow:

String AttrText = null ;

        try {

            xPS1 = ( com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(

                       com.sun.star.beans.XPropertySet.class,xNAss1.getByName(ENs[index]));

           

           

            AttrText = xPS1.getPropertyValue("AlternativeText").toString();

        } catch (java.lang.Exception ex) {

            ex.printStackTrace();

        }

 

How to modify a property of a picture object.

First, see the code come form aaoo.bootom.bConDoc.java follow:

try {

            xPS1 = ( com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(

                       com.sun.star.beans.XPropertySet.class,xNAss1.getByName(ENs[index]));

 

             xPS1.setPropertyValue("AlternativeText",AttrText);

        } catch (java.lang.Exception ex) {

            ex.printStackTrace();

        }