The internals of OpenOffice.org are based on Universal Network Objects (UNO). This chapter introduces the subroutines and functions supported by OpenOffice.org Basic that are related to UNO. This chapter covers methods that create and inspect objects that are vital to the internals of OpenOffice.org. Extra attention is given to the topic of UNO listeners.
Up to this point, I've mostly dealt with OOo capabilities that relate to handling text, and numbers , and manipulating things visible and familiar. The programming constructs I've presented also share a lot of commonality with other environments. Of course I dealt with the soffice library, because it is required to begin to use OOo Basic. I also dealt with DDE and Shell, which was my first opportunity to talk about what's "behind the scenes." In those cases, I was describing techniques for using functions provided by the operating system or external environment to supplement OOo Basic. Now I'll go further and deeper into OOo. In this chapter, I'll begin to discuss things related to the actual implementation of OOo-things that will allow you to exploit the real capabilities of OOo, using OOo Basic. You'll also begin to see more details about how OOo is implemented-which you need to build the really cool stuff that sets OOo apart as a really great programming environment.
The Universal Network Object (UNO) is a component model that offers interoperability between different programming languages, object models, machine architectures, and processes. In other words, it allows data to be passed between different computers; the computer scientists should note that this is similar to COM in functionality. OpenOffice.org is based on UNO. You use UNO to manipulate the internal workings of OOo using OOo's Application Programming Interface (API). Table 1 lists the OOo Basic functions used to deal with UNO.
Function | Description |
---|---|
BasicLibraries | Access document Basic libraries |
CreateUnoDialog() | Create an existing dialog |
CreateUnoListener() | Create a listener |
CreateUnoService() | Create a Universal Network Object Service |
CreateUnoStruct() | Create a Universal Network Object |
CreateUnoValue() | Create a Universal Network Object value |
DialogLibraries | Document dialog libraries |
EqualUNOObjects() | Are these the same? |
FindObject() | Find object |
FindObjectProperty() | Find object property |
GetDefaultContext() | Get a copy of the default context |
GetProcessServiceManager() | Get service manager |
GlobalScope | Application-level libraries |
HasUnoInterfaces() | Does it support these? |
IsUnoStruct() | Is this variable a Universal Network Object? |
ThisComponent | Special variable representing the current document |
Understanding Universal Network Objects is important because most of the internals of OpenOffice.org are implemented using UNO. For example, the variable ThisComponent, which refers to the current document, is a Universal Network Object.