Difference between revisions of "Documentation/DevGuide/FirstSteps/Struct"
From Apache OpenOffice Wiki
< Documentation | DevGuide
(FINAL VERSION FOR L10N) |
|||
Line 5: | Line 5: | ||
|NextPage=Documentation/DevGuide/FirstSteps/Any | |NextPage=Documentation/DevGuide/FirstSteps/Any | ||
}} | }} | ||
− | + | {{Documentation/DevGuideLanguages|Documentation/DevGuide/FirstSteps/Struct}} | |
{{DISPLAYTITLE:Struct}} | {{DISPLAYTITLE:Struct}} | ||
Structs in the {{OOo}} API are used to create compounds of other UNO types. They correspond to C structs or Java classes consisting of public member variables only. | Structs in the {{OOo}} API are used to create compounds of other UNO types. They correspond to C structs or Java classes consisting of public member variables only. |
Revision as of 06:40, 13 May 2009
Structs in the Apache OpenOffice API are used to create compounds of other UNO types. They correspond to C structs or Java classes consisting of public member variables only.
While structs do not encapsulate data, they are easier to transport as a whole, instead of marshaling get()
and set()
calls back and forth. In particular, this has advantages for remote communication.
You gain access to struct members through the . (dot) operator as in
aProperty.Name = "ReadOnly";
In Java, C++ and Apache OpenOffice Basic, the keyword new
instantiates structs. In OLE automation, use com.sun.star.reflection.CoreReflection to get a UNO struct. Do not use the service manager to create structs.
//In Java: com.sun.star.beans.PropertyValue aProperty = new com.sun.star.beans.PropertyValue();
'In OpenOffice.org Basic Dim aProperty as new com.sun.star.beans.PropertyValue
Content on this page is licensed under the Public Documentation License (PDL). |