Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DF8572A0 for ; Sun, 27 Nov 2011 22:51:01 +0000 (UTC) Received: (qmail 72217 invoked by uid 500); 27 Nov 2011 22:51:00 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 72179 invoked by uid 500); 27 Nov 2011 22:51:00 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 72172 invoked by uid 99); 27 Nov 2011 22:51:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Nov 2011 22:51:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Nov 2011 22:50:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8C4A02388BA2; Sun, 27 Nov 2011 22:50:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1206895 [11/12] - in /incubator/ooo/ooo-site/trunk/content/udk/common: ./ man/ man/concept/ man/draft/ man/draft/scripting/ man/draft/scripting/DesignDoc/ man/images/ man/spec/ man/tasks/ man/tutorial/ Date: Sun, 27 Nov 2011 22:50:08 -0000 To: ooo-commits@incubator.apache.org From: kschenk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111127225012.8C4A02388BA2@eris.apache.org> Added: incubator/ooo/ooo-site/trunk/content/udk/common/man/tutorial/writerdemo.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/udk/common/man/tutorial/writerdemo.html?rev=1206895&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/udk/common/man/tutorial/writerdemo.html (added) +++ incubator/ooo/ooo-site/trunk/content/udk/common/man/tutorial/writerdemo.html Sun Nov 27 22:49:46 2011 @@ -0,0 +1,164 @@ + + + + + + + + +

+'The service manager is always the starting point
+'If there is no office running then an office is started up
+Set objServiceManager= WScript.CreateObject("com.sun.star.ServiceManager")
+
+'Create the CoreReflection service that is later used to create structs
+Set objCoreReflection= objServiceManager.createInstance("com.sun.star.reflection.CoreReflection")
+
+'Create the Desktop
+Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop")
+
+'Open a new empty writer document
+Dim args()
+Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args)
+
+'Create a text object
+Set objText= objDocument.getText
+
+'Create a cursor object
+Set objCursor= objText.createTextCursor
+
+'Inserting some Text
+objText.insertString objCursor, "The first line in the newly created text document." & vbLf, false
+
+'Inserting a second line
+objText.insertString objCursor, "Now we're in the second line", false
+
+'Create instance of a text table with 4 columns and 4 rows
+Set objTable= objDocument.createInstance( "com.sun.star.text.TextTable")
+objTable.initialize 4, 4
+
+'Insert the table
+objText.insertTextContent objCursor, objTable, false
+
+'Get first row
+Set objRows= objTable.getRows
+Set objRow= objRows.getByIndex( 0)
+
+'Set the table background color
+objTable.setPropertyValue "BackTransparent", false
+objTable.setPropertyValue "BackColor", 13421823
+
+'Set a different background color for the first row
+objRow.setPropertyValue "BackTransparent", false
+objRow.setPropertyValue "BackColor", 6710932
+
+'Fill the first table row
+insertIntoCell "A1","FirstColumn", objTable
+insertIntoCell "B1","SecondColumn", objTable
+insertIntoCell "C1","ThirdColumn", objTable
+insertIntoCell "D1","SUM", objTable
+
+objTable.getCellByName("A2").setValue 22.5
+objTable.getCellByName("B2").setValue 5615.3
+objTable.getCellByName("C2").setValue -2315.7
+objTable.getCellByName("D2").setFormula"sum "
+
+objTable.getCellByName("A3").setValue 21.5
+objTable.getCellByName("B3").setValue 615.3
+objTable.getCellByName("C3").setValue -315.7
+objTable.getCellByName("D3").setFormula "sum "
+
+objTable.getCellByName("A4").setValue 121.5
+objTable.getCellByName("B4").setValue -615.3
+objTable.getCellByName("C4").setValue 415.7
+objTable.getCellByName("D4").setFormula "sum "
+
+'Change the CharColor and add a Shadow
+objCursor.setPropertyValue "CharColor", 255
+objCursor.setPropertyValue "CharShadowed", true
+
+'Create a paragraph break
+'The second argument is a com::sun::star::text::ControlCharacter::PARAGRAPH_BREAK constant
+objText.insertControlCharacter objCursor, 0 , false
+
+'Inserting colored Text.
+objText.insertString objCursor, " This is a colored Text - blue with shadow" & vbLf, false
+
+'Create a paragraph break ( ControlCharacter::PARAGRAPH_BREAK).
+objText.insertControlCharacter objCursor, 0, false
+
+'Create a TextFrame.
+Set objTextFrame= objDocument.createInstance("com.sun.star.text.TextFrame")
+
+'Create a Size struct.
+Set objSize= createStruct("com.sun.star.awt.Size")
+objSize.Width= 15000
+objSize.Height= 400
+objTextFrame.setSize( objSize)
+
+' TextContentAnchorType.AS_CHARACTER = 1
+objTextFrame.setPropertyValue "AnchorType", 1
+
+'insert the frame
+objText.insertTextContent objCursor, objTextFrame, false
+
+'Get the text object of the frame
+Set objFrameText= objTextFrame.getText
+
+'Create a cursor object
+Set objFrameTextCursor= objFrameText.createTextCursor
+
+'Inserting some Text
+objFrameText.insertString objFrameTextCursor, "The first line in the newly created text frame.", _
+ false
+objFrameText.insertString objFrameTextCursor, _
+ vbLf & "With this second line the height of the frame raises.", false
+
+'Create a paragraph break
+'The second argument is a com::sun::star::text::ControlCharacter::PARAGRAPH_BREAK constant
+objFrameText.insertControlCharacter objCursor, 0 , false
+
+'Change the CharColor and add a Shadow
+objCursor.setPropertyValue "CharColor", 65536
+objCursor.setPropertyValue "CharShadowed", false
+
+'Insert another string
+objText.insertString objCursor, " That's all for now !!", false
+
+On Error Resume Next
+  If Err Then
+  MsgBox "An error occurred"
+End If
+
+
+Sub insertIntoCell( strCellName, strText, objTable)
+   Set objCellText= objTable.getCellByName( strCellName)
+   Set objCellCursor= objCellText.createTextCursor
+   objCellCursor.setPropertyValue "CharColor",16777215
+   objCellText.insertString objCellCursor, strText, false
+End Sub
+
+Function createStruct( strTypeName)
+   Set classSize= objCoreReflection.forName( strTypeName)
+   Dim aStruct
+   classSize.createObject aStruct
+   Set createStruct= aStruct
+End Function
+

+ + \ No newline at end of file Propchange: incubator/ooo/ooo-site/trunk/content/udk/common/man/tutorial/writerdemo.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/udk/common/man/typenames.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/udk/common/man/typenames.html?rev=1206895&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/udk/common/man/typenames.html (added) +++ incubator/ooo/ooo-site/trunk/content/udk/common/man/typenames.html Sun Nov 27 22:49:46 2011 @@ -0,0 +1,298 @@ + + + + Type Names + + + + + + + +
+

Type Names

+
+ OpenOffice.org +
+ +

This document describes how core UNO types (see +UNO Type System) and related UNOIDL +entities (like typedefs, modules, and services) are named in binary UNO and in +the UNO type registry.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UNO Type tBinary UNO Type Name β(t)UNO Type Registry Name ρ(t)
VOIDvoidvoid
BOOLEANbooleanboolean
BYTEbytebyte
SHORTshortshort
UNSIGNED SHORTunsigned shortunsigned short
LONGlonglong
UNSIGNED LONGunsigned longunsigned long
HYPERhyperhyper
UNSIGNED HYPERunsigned hyperunsigned hyper
FLOATfloatfloat
DOUBLEdoubledouble
CHARcharchar
STRINGstringstring
TYPEtypetype
ANYanyany
Sequence type with component type t[]β(t′)[]ρ(t′)
Enum type with structured name n1..nk, k > 0n1..nkn1//nk
Plain struct type with structured name + n1..nk, k > 0n1..nkn1//nk
Instantiated polymorphic struct type with polymorphic struct + type template with structured name n1..nkn, kn > 0, and + type arguments ⟨t1, …, + tkt⟩, kt > + 0n1..nkn<β(t1),,β(tkt)>n1//nkn<ρ(t1),,ρ(tkt)>
Exception type with structured name n1..nk, k > 0n1..nkn1//nk
Interface type with structured name n1..nk, k > 0n1..nkn1//nk
Polymorphic struct type template with structured name + n1..nk, k > + 0n1//nk
Typedef with structured name n1..nk, k > + 0n1//nk
Module with structured name n1..nk, k > + 0n1//nk
Constant group with structured name + n1..nk, k > + 0n1//nk
Service with structured name n1..nk, k > + 0n1//nk
Singleton with structured name n1..nk, k > + 0n1//nk
+ +

Annotations:

+
    +
  • Entries given in italics denote entities that are not types of + the core UNO type system. They also have no correspondence in binary + UNO.
  • + +
  • A structured name n1..nk, k + > 0, consists of a sequence of structured name parts, + separated by full stops (.). Each structured name part must + satisfy the lexical rules +

    structured-name-part = lowercase-name / + uppercase-name
    +  lowercase-name = lowercase + *alphanum
    +  uppercase-name = uppercase *alphanum + *(_ +alphanum)
    +  alphanum = alpha / digit
    +  alpha = lowercase / uppercase
    +  lowercase = az
    +  uppercase = AZ
    +  digit = 09

    +
  • For the purposes of binary UNO and the UNO type registry, it is an error for + any enum type, plain struct type, polymorphic struct type template, + exception type, or interface type to have a name that is not a structured + name, or that is a structured name (consisting of only a single structured + name part) that is equal to any of void, boolean, + byte, short, long, + hyper, float, double, + char, string, type, or + any.
  • +
  • For the purposes of binary UNO, it is an error for any enum type, plain + struct type, polymorphic struct type template, exception type, or interface + type to have a name that is the same as the name of another enum type, plain + structure type, polymorphic struct type template, exception type, or + interface type.
  • +
  • For the purposes of the UNO type registry, it is an error for any enum type, + plain struct type, polymorphic struct type template, exception type, or + interface type to have a name that is the same as the name of another enum + type, plain structure type, polymorphic struct type template, exception + type, interface type, typedef, module, constant group, service, or + singleton.
  • + +
  • For the purposes of binary UNO and the UNO type registry, it is an error + for any polymorphic struct type template to have zero type parameters.
  • +
+ + + +
+

Author: + Stephan + Bergmann (last modification $Date: 2004/11/30 12:25:04 $). + Copyright 2004 OpenOffice.org Foundation. All rights + reserved.

+
+ + + Propchange: incubator/ooo/ooo-site/trunk/content/udk/common/man/typenames.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/udk/common/man/typesystem.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/udk/common/man/typesystem.html?rev=1206895&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/udk/common/man/typesystem.html (added) +++ incubator/ooo/ooo-site/trunk/content/udk/common/man/typesystem.html Sun Nov 27 22:49:46 2011 @@ -0,0 +1,538 @@ + + + + UNO Type System + + + + + + +
+

OpenOffice.orgUNO Type + System

+
+
+ +

The UNO Type System

+ +

This document describes the type system of core UNO, a distributed +computation model. It should not be confused with the larger type system of +UNOIDL, a description language used to notate core UNO types and related, +non–core-UNO entities like modules, typedefs, and constants.

+ +

The UNO type system comprises two kinds of entities, namely +types and polymorphic struct type templates. Each entity +has a unique name.

+ +

The names of UNO type system entities are taken from an alphabet consisting +of the Latin capital letters +“A”–“Z”, the Latin small +letters “a”–“z”, the +digits “0”–“9”, the low +line “_”, the full +stop “.”, the +comma “,”, the left square +bracket “[”, the right square +bracket “]”, the less-than +sign “<”, the greater-than +sign “>”, and the space “ ”. +The names of certain entities are built from identifiers, which are +specified by the following grammar:

+ +

 identifiersegment + (. segment)*
segmentblocks | block
blockscapital other* + (_ block)*
blockother+
othercapital | + a&ndashz | 0&ndash9
capitalA&ndashZ

+ +

(Since the names of UNO type system entities are unique, and some entities +have certain fixed names that match the grammar for identifiers, and other +entities have names that are arbitrary identifiers, it follows that those +entities of the latter kind may not have as names identifiers that are already +reserved by entities of the first kind—namely +“void”, “boolean”, +“byte”, “short”, +“long”, “hyper”, +“float”, “double”, +“char”, “string”, +“type”, and “any”.)

+ +

Each UNO type t has a non-empty set of +values Vt, and a +default value dt ∈ +Vt. Two UNO values are equal if and +only if they have the same type t and both denote the same +element of Vt.

+ +

The UNO type system consists of the following (sets of) types:

+
+
VOID
Values: {unit}. Default value: + unit. Name: “void”.
+ +
BOOLEAN
Values: {false, + true}. Default value: false. Name: + “boolean”.
+ +
BYTE
Values: [−27 … + 27 − 1]. Default value: 0. Name: + “byte”.
+ +
SHORT
Values: [−215 … + 215 − 1]. Default value: 0. Name: + “short”.
+ +
UNSIGNED SHORT
Values: [0 … + 216 − 1]. Default value: 0. Name: + “unsigned short”.
+ +
LONG
Values: [−231 … + 231 − 1]. Default value: 0. Name: + “long”.
+ +
UNSIGNED LONG
Values: [0 … + 232 − 1]. Default value: 0. Name: + “unsigned long”.
+ +
HYPER
Values: [−263 … + 263 − 1]. Default value: 0. Name: + “hyper”.
+ +
UNSIGNED HYPER
Values: [0 … + 264 − 1]. Default value: 0. Name: + “unsigned hyper”.
+ +
FLOAT
Values: IEEE-754 single precision. Default + value: 0. Name: “float”.
+ +
DOUBLE
Values: IEEE-754 double precision. Default + value: 0. Name: “double”.
+ +
CHAR
Values: individual UTF-16 code units (see + definition D28a in + The + Unicode Standard, Version 4.0; Chapter 3: + Conformance). Default value: the UTF-16 code unit 0. Name: + “char”.
+ +
STRING
Values: arbitrary-length sequences of + Unicode scalar values (see definition D28 in + The + Unicode Standard, Version 4.0; Chapter 3: + Conformance). Default value: the zero-length sequence. Name: + “string”.
+ +
TYPE
The values of this type are the disjoint union + of the following six sets of type descriptions: +
    +
  1. The set of descriptions for the simple types {void, + boolean, byte, short, + unsigned short, long, unsigned + long, hyper, unsigned hyper, + float, double, char, + string, type, any}.
  2. + +
  3. The set of descriptions for sequence types, recursively consisting + of all the values of type TYPE.
  4. + +
  5. The set of descriptions for enum types, consisting of all names of + enum types.
  6. + +
  7. The set of descriptions for struct types, consisting of all names of + struct types.
  8. + +
  9. The set of descriptions for exception types, consisting of all names + of exception types.
  10. + +
  11. The set of descriptions for interface types, consisting of all names + of interface types.
  12. +
Default value: the description for the simple type void + (taken from the first of the six sets). Name: + “type”.
+ +
ANY
The values of this type are the disjoint union + of the values of all non-any types. Default value: + dVOID. Name: + “any”.
+ A value of type ANY might be written as the tuple + ⟨tv⟩, where t is a non-any + type, and v is a value of type t.
+ +
Sequence types
For each non-void, non-exception + type t, there is a corresponding sequence type, whose values + are arbitrary-length sequences of values of the corresponding component + type t, and whose default value is the zero-length sequence. + The name of a sequence type is “[]” followed by the name of the + component type.
+ A value of the sequence type with component type t might be + written as the sequence (v1, …, + vk), where k ≥ 0 is the + length, and each vi is a value of + type t, for 0 ≤ i < k.
+ +
Enum types
For a (user-defined) enum type that contains members + of numeric values n1, …, + nk, (where k > 0, and each + ni is in the range [−231 + … 231 − 1]), the values of that type are + {n1, …, nk}. + Default value: n1. The name of an enum type is + an identifier.
+ An enum type might be written as the set {n1, … + nk}, where k > 0, and + ni ∈ [−231 … + 231 − 1], for 0 ≤ i < + k. A value of that type might be written as n ∈ + {n1, … + nk}.
+ +
Struct types
The set of struct types is partitioned into the set + of plain struct types and the set of instantiated + polymorphic struct types.
+ A (user-defined) plain struct type has an optional direct + base b, where b is a plain struct type, and + a list of direct membersm1, + …, mkm⟩, km ≥ 0, + where each mi has a name and a non-void, + non-exception type. The name of a plain struct type is an identifier.
+ A (user-defined) polymorphic struct type template has a list of + type parametersτ1, …, + τ⟩, > + 0, and a list of direct membersm1, + …, mkm⟩, km ≥ 0, + where each mi has a name and either an + explicit type (a non-void, non-exception type) or a + parameterized type (a τi + with 0 ≤ i < ). The name of a polymorphic + struct type template is an identifier.
+ An instantiated polymorphic struct type is an instantiation of a + polymorphic struct type template: Let s be a polymorphic struct + type template with type parameters ⟨τ1, + …, τ⟩, + > 0, and direct members ⟨m1, + …, mkm⟩, km ≥ 0. + Let ⟨a1, …, + a⟩, where each + ai is a non-void, non-exception type that + is not an unsigned type, be a list of type arguments. Then the + instantiated polymorphic struct type + sa1, …, + a⟩ has a list of direct + membersm1, …, + mkm⟩, where each + mi has the same name as + mi and the following type: if + mi has the explicit type t, + then mi has type t; + otherwise, if mi has the parameterized + type τj, then + mi has + type aj. (An instantiated polymorphic + struct type may not have a direct base, and may not be the direct base of a + struct type.) The name of sa1, + …, a⟩ is the name + of s, followed by “<”, + followed by the names of a1, …, + a, separated from one another + by “,”, followed + by “>”.
+ The set of members of a struct type is the union of the set of + direct members and the set of members of the optional direct base (if + present). No two different members of a given struct type may have the same + name.
+ For a struct type with a list of members + ⟨m+1, …, + m+km+⟩, + km+ ≥ 0 (containing both the direct members and the + members of an optional direct base, if present, with associated types + ti), the values of that type are + km+-tuples of values of the types + t1, …, + tkm+. The default value of that + type is ⟨dt1, …, + dtkm+⟩.
+ A struct type may not be derived from itself, and may not recursively + contain itself as a member. More formally: consider the directed + graph G, with the set of struct types as nodes, and with the + set of arcs defined as follows. For each pair of struct types + t1, t2, where + type t1 is the base of + type t2, there is a directed arc from + node t2 to node t1. + For each pair of struct types t1, + t2, where type t1 has a + member of type t2, there is a directed arc from + node t2 to + node t1. The resulting graph G + must not be cyclic.
+ A struct type might be written as the tuple ⟨t1, + …, tkm+⟩, where + km+ ≥ 0, and each + ti is a non-void, non-exception type, for 0 + ≤ i < km+. A value of that type + might be written as the tuple ⟨v1, …, + vkm+⟩, where each + vi is of + type ti, for 0 ≤ i < + km+.
+ +
Exception types
A (user-defined) exception type has an optional + direct base b, where b is an exception + type, and a list of direct members + ⟨m1, …, + mkm⟩, km ≥ 0, where each + mi has a name and a non-void, non-exception + type. The name of an exception type is an identifier. There is an + exception type named “com.sun.star.uno.Exception” + which does not have a direct base. There is also an exception type named + “com.sun.star.uno.RuntimeException” for which it is + unspecified whether it has no direct base or has + com.sun.star.uno.Exception as its base. All other exception + types have a direct base.
+ The set of members of an exception type is the union of the set + of direct members and the set of members of the optional direct base (if + present). No two different members of a given exception type may have the + same name.
+ For an exception type with a list of members + ⟨m+1, …, + m+km+⟩, + km+ ≥ 0 (containing both the direct members and the + members of an optional direct base, if present, with associated types + ti), the values of that type are + km+-tuples of values of the types + t1, …, + tkm+. The default value of that + type is ⟨dt1, …, + dtkm+⟩.
+ An exception type may not be derived from itself. More formally: consider + the directed graph G, with the set of exception types as + nodes, and with the set of arcs defined as follows. For each pair of + exception types t1, t2, where + type t1 is the base of + type t2, there is a directed arc from + node t2 to node t1. + The resulting graph G must not be cyclic.
+ An exception type might be written as the tuple + ⟨t1, …, + tkm+⟩, where + km+ ≥ 0, and each + ti is a non-void, non-exception type, for 0 + ≤ i < km+. A value of that type + might be written as the tuple ⟨v1, …, + vkm+⟩, where each + vi is of + type ti, for 0 ≤ i < + km+.
+ +
Interface types
For a (user-defined) interface type, the values + of that type are the null reference plus references to any UNO objects that + implement that interface type, and the default value is the null reference. + Each interface type has a list of direct bases + ⟨b1, …, + bkb⟩, kb ≥ 0, where each + bi is an interface type, and all the + bi are mutually different. Each interface + type has a list of direct attributes + ⟨a1, …, + aka⟩, ka ≥ 0, and a list + of direct methods, ⟨m1, …, + mkm⟩, km ≥ 0. + Collectively, the direct attributes and direct methods of an interface type + are called the direct members of that interface type.
+ The name of an interface type is an identifier. There is an interface type + named “com.sun.star.uno.XInterface”, which has an + empty list of direct bases, an empty list of direct attributes, and an empty + list of direct methods. All other interface types have a non-empty list of + direct bases.
+ Each direct attribute of an interface type has a name, a non-void, + non-exception type, and is either read–write or + read-only.
+ Each direct method of an interface type has a name, a list of arguments + ⟨r1, …, + rkr⟩, kr ≥ 0, a + non-exception return type, a list of exception types + ⟨e1, …, + eke⟩, ke ≥ 0, and is + either synchronous or one-way. Each + argument ri has a name, a non-void, + non-exception type, and is either in, out, or + in–out. No two different arguments of a given method may + have the same name. For a method that is one-way, none of the arguments may + be out or in–out, the return type must be VOID, and the + list of exception types must be empty.
+ The set of members of an interface type is the union of the set + of direct members and the set of inherited members. The set of + inherited members of an interface type is the union of the sets of members + of all its direct bases. No two different members of a given interface type + may have the same name.
+ An interface type may not be derived from itself. More formally: consider + the directed graph G, with the set of interface types as + nodes, and with the set of arcs defined as follows. For each pair of + interface types t1, t2, where + type t1 is a direct base of + type t2, there is a directed arc from + node t2 to node t1. + The resulting graph G must not be cyclic.
+ An interface type may not have as direct base a type that it also has as + indirect base. More formally: define the set of bases of an + interface type t to be the union of the set of the direct + bases of t and the sets of bases of all the direct bases + of t. Then, for any interface type t, none + of the direct bases of t must be a member of the set of + bases of any of the direct bases of t.
+
+ +

The non-void, non-exception UNO types are BOOLEAN, +BYTE, SHORT, UNSIGNED SHORT, +LONG, UNSIGNED LONG, HYPER, +UNSIGNED HYPER, FLOAT, DOUBLE, +CHAR, STRING, TYPE, ANY, the +sequence types, the enum types, the struct types, and the interface types.

+ +

The non-any UNO types are VOID, BOOLEAN, +BYTE, SHORT, UNSIGNED SHORT, +LONG, UNSIGNED LONG, HYPER, +UNSIGNED HYPER, FLOAT, DOUBLE, +CHAR, STRING, TYPE, the sequence types, +the enum types, the struct types, the exception types, and the interface +types.

+ +

The non-exception UNO types are VOID, +BOOLEAN, BYTE, SHORT, UNSIGNED +SHORT, LONG, UNSIGNED LONG, HYPER, +UNSIGNED HYPER, FLOAT, DOUBLE, +CHAR, STRING, TYPE, ANY, the +sequence types, the enum types, the struct types, and the interface types.

+ +

The basic UNO types are VOID, BOOLEAN, +BYTE, SHORT, UNSIGNED SHORT, +LONG, UNSIGNED LONG, HYPER, +UNSIGNED HYPER, FLOAT, DOUBLE, and +CHAR. + +

The simple UNO types are VOID, +BOOLEAN, BYTE, SHORT, +UNSIGNED SHORT, LONG, UNSIGNED LONG, +HYPER, UNSIGNED HYPER, FLOAT, +DOUBLE, CHAR, STRING, TYPE, +and ANY. The complex UNO types are the sequence types, +the enum types, the struct types, the exception types, and the interface +types.

+ +

The primitive UNO types are VOID, +BOOLEAN, BYTE, SHORT, +UNSIGNED SHORT, LONG, UNSIGNED LONG, +HYPER, UNSIGNED HYPER, FLOAT, +DOUBLE, CHAR, STRING, TYPE, +and the enum types. The structured UNO types are ANY, +the sequence types, the struct types, and the exception types. Note that the +interface types are considered neither primitive nor structured.

+ +

The aggregating UNO types are the struct types and the exception +types.

+ +

The fundamental UNO types are VOID, +BOOLEAN, BYTE, SHORT, UNSIGNED +SHORT, LONG, UNSIGNED LONG, HYPER, +UNSIGNED HYPER, FLOAT, DOUBLE, +CHAR, STRING, TYPE, ANY, and +the sequence types. The named UNO types are the enum types, the +struct types, the exception types, and the interface types.

+ +

The unsigned UNO types are UNSIGNED SHORT, +UNSIGNED LONG, UNSIGNED HYPER, and each sequence type +whose component type is an unsigned type.

+ +

Function Indices

+ +

Often, a mapping between the members of a given interface type and a subset +of the integers (so called function indices) is needed. In the +following, one such mapping is defined, to be consistently used wherever the +concept of function indices is needed in conjunction with UNO.

+ +

For an interface type t, define the list of direct bases +⟨b1, …, +bkb⟩, kb ≥ 0, the list of +direct attributes ⟨a1, …, +aka⟩, ka ≥ 0, and the list +of direct methods ⟨m1, …, +mkm⟩, km ≥ 0, as above. +Additionally, define the list of direct attribute functions +of t, written ⟨af1, …, +afkaf⟩, kaf ≥ 0, as the +result of substituting in the list ⟨a1, …, +aka⟩ each element +ai with either one or two new elements, +retaining the overall order. If the argument +ai is read–write, then it is replaced +with the two elements G(ai) and +S(ai), in that order; if the +argument ai is read-only, then it is replaced +with the single element G(ai). (The +attribute function G(a) represents a getter function for +the attribute a, while the attribute function +S(a) represents a setter function for a.) +Additionally, define the set of member functions of t +to be the set of members of t, but with all attributes replaced +with the respective attribute functions.

+ +

The algorithm functionIndices, to construct a bijective mapping +from function indices (a subset of the integers) to member functions of a given +interface type, in pseudo-code notation:

+ +

 type S: set of interface type
+ type M: map from integer to member function
+ function fI(t: interface type, T: + S, n: integer, μ: M): + ⟨S, integer, M
+  if tT
+   for i ← 1 … kb
+    ⟨T, n, μ⟩ + ← fI(bi, T, + n, μ)
+   for i ← 1 … kaf
+    μμ ∪ + {n + i − 1 → + afi}
+   for i ← 1 … km
+    μμ ∪ + {n + kaf + i − 1 → + mi}
+   TT ∪ {t}
+   nn + kaf + + km
+  return ⟨T, n, μ
+ function functionIndices(t: interface type): + M
+  ⟨T, n, μ⟩ ← + fI(t, ∅, 3, ∅)
+  return μ

+ +

That the function indices start at three, instead of at zero, has +historic reasons: Indices 0–2 are reserved for the three pseudo methods +of com.sun.star.uno.XInterface (queryInterface, +acquire, and release).

+ + + +
+

Author: + Stephan + Bergmann (last modification $Date: 2006/02/17 14:02:45 $). + Copyright 2003 OpenOffice.org Foundation. All rights + reserved.

+
+ + + Propchange: incubator/ooo/ooo-site/trunk/content/udk/common/man/typesystem.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/udk/common/man/uno.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/udk/common/man/uno.html?rev=1206895&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/udk/common/man/uno.html (added) +++ incubator/ooo/ooo-site/trunk/content/udk/common/man/uno.html Sun Nov 27 22:49:46 2011 @@ -0,0 +1,224 @@ + + + + + Overview: Universal Network Objects (UNO) + + + + + + + + + + + + + +
+

Overview: Universal Network Objects (UNO)

+
+ +

Overview

+ +

UNO is a component model that offers inter-operability between + different programming languages, different objects models, + different machine architectures, and different processes; either in a + LAN or via the Internet. +

+

The StarOffice and Sun ONE Webtop + products have proven the usability of UNO in complex real world + applications. Developers that want to use, extend, or modify the + functionality of one of the products will do this using UNO. +

+

UNO is not limited to the above applications. The base + libraries of UNO are independent of StarOffice and can be used as + a framework for other applications. +

+

UNO is freely available (it is distributed under the LGPL + license) and currently supports Java, C and C++ (on windows, Linux, + and Solaris). A bridge for COM OLE Automation already exists. +

+

UNO is developed by the OpenOffice.org community including the Sun + Microsystems development labs. +

+

Some technical details

+ +

UNO is interface based, as are COM and CORBA. Components implement + interfaces compliant to their interface specification. Multiple + components communicate only via their interfaces. This allows + implementing one component in a different language or to move an + implementation to another machine, without modifying the other's + components. This gives you huge flexibility and preserves earlier + invested efforts. +

+

Each component lives in a Uno + Runtime Environment (URE). + A URE is identified by the implementation language (e.g., C++, + Java, Perl, ...) and the current + process. There is no performance overhead for components, that are + instantiated within the same URE, e.g., in C++, a call from + component A to B is just a virtual call. The calls between + components from different UREs are bridged by UNO. +

+ +
Connecting Environments
+ +

In general, calls are bridged through a single dispatch + method. This method is, in general, easy to implement for + interprocess bridges or bridges to interpreting languages. There + is no generated code for stubs or + proxies. All necessary conversions are done by the generic + dispatch method. The information about the method signature is + retrieved dynamically from a type library. This + type library is reused by every bridge, so only the number of + entries in the type library grows with a growing number of types. + This reduces build time and memory consumption at runtime; + nevertheless, bridging is as fast as generated code. +

+

UNO-interfaces are specified in IDL. All UNO-interfaces must be + derived from a superinterface, that offers acquire, release, and a + queryInterface method (comparable to COM). The lifetime of + UNO-objects is controlled by global reference counting. + Exceptions are used for error handling. +

+

UNO guarantees object identity, thread + identity, and the sequence of calls. +

+
    +
  • object identity
    + Two interfaces' references can be compared for equality. UNO + guarantees, that the result is correct, no matter whether the + result is true or false. + +
  • thread identity
    + In UNO every + thread is named by a globally unique thread identifier. A thread + leaving the process via an interprocess bridge is identified when + entering the process, again, some callstack levels higher. The same + thread will execute the new call thus guaranteeing that any + thread dependent resources stay the same (such as thread local + storage, lock of mutexes, etc.). + +
  • sequence of calls
    + UNO allows declaring a method oneway + (or asynchron). Multiple, oneway calls are guaranteed to be + executed in the same sequence as they were called. + +
+

A sequence of oneway calls can be + transferred and executed extremely fast via an interprocess + connection. The UNO interprocess protocol is optimized for low + bandwidth connections. +

+

Have a look a this document, Uno Intro, + for further technical information. +

+ +

Applications built on UNO

+ +

This chapter discusses some actual use cases of UNO and the benefits +the applications derived from UNO.

+ +

StarOffice (or OpenOffice.org)

+ +

StarOffice is a fully featured office productivity suite. +

+

StarOffice mainly uses the C++ -in-process functionality of + UNO. Before UNO, the StarOffice development suffered very much from + incompatible changes (e.g., adding a new virtual method or a new + member to a class) in one of the base libraries. This forced a + complete rebuild of the product, which roughly consumed 2 days and + was done only once a week. These incompatible updates were be + reduced considerably by using UNO, and as a result the whole work became + more efficient. Please have a look at this document, + Uno the Idea, for a more complete explanation. +

+

Java components in StarOffice (e.g., the pgp-integration) use + the Java-C++ bridge to access the StarOffice API. External + developers can easily integrate their desired + functionality in StarOffice using this bridge. +

+

External developers can use the UNO-interprocess bridge to + access StarOffice-API from a different process for remote office + control. +

+ +

Sun ONE Webtop

+ +

Sun ONE Webtop is a highly distributed application. It provides + a fully featured office productivity suite via the Internet. + Office documents can be accessed via various clients + (WebBrowser-Plugins, PDAs, HTML-Clients, etc.).

+

UNO is used in the communication between the WebBrowser-Plugin + and the office application server. All outputdevice-calls (e.g., + DrawRect, DrawLine, and SetColor) necessary to paint a scene are + transmitted via the Internet connection (the necessary performance + is reached by declaring those calls oneway).

+

UNO is used to bridge between Java Server Pages + (running within the webserver) and the Universal Content Broker (a + C++ process that is responsible for data access). +

+ +

UNO, COM, CORBA, and Java RMI

+ +

It is often asked, why a new component model (UNO) has been + developed, instead of using already existing ones (such as + COM/DCOM, CORBA, or Java RMI). The main reason is that the other + object models don't provide the functionality needed for + applications such as StarOffice or Sun ONE Webtop. +

+
    +
  • COM/DCOM does not allow for use + of exceptions, which is of eminent important for advanced error + handling. +

    +
  • CORBA is only a standard for + remote communication, there is only very poor support for in + process communication (IIOP in + process), which is too slow for most applications. See also the + CORBA-UNO comparison document +

    +
  • Java RMI is only useful within a Java environment, but there + is a need for a technology for bridging between different + languages. +

    +
+

Additionally, the code generation needed, e.g., in COM or CORBA, + results in huge libraries if there are many types. For each new + bridge, new generated glue code would be necessary, which becomes + too difficult to handle. +

+ + + + + +
+ Author: Jörg + Budischewski ($Date: 2004/12/05 12:54:40 $)
Copyright + 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA + 94303 USA.
+
+ + Propchange: incubator/ooo/ooo-site/trunk/content/udk/common/man/uno.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/ooo/ooo-site/trunk/content/udk/common/man/uno_components.html URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/udk/common/man/uno_components.html?rev=1206895&view=auto ============================================================================== --- incubator/ooo/ooo-site/trunk/content/udk/common/man/uno_components.html (added) +++ incubator/ooo/ooo-site/trunk/content/udk/common/man/uno_components.html Sun Nov 27 22:49:46 2011 @@ -0,0 +1,181 @@ + + + + + C++ UNO Components + + + + + + + + + + +
+

C++ UNO Components

+
+ OpenOffice.org +
+ +

Contents

+
+ Overview
+ C++ Components
+
+ +

Overview

+ +

UNO components, normally, provide an implementation of one or + more services. A service description is written in idl. A service + describes the interaction of different interfaces to support a + special functionality. An idl description of a service specifies a + set of interfaces which supports the expected functionality. It + can also contain references to other services which are needed for + this service. A service could be implemented by more than one + component. At this time, the component which is registered last, + will be used as the default implementation for the supported + services of this component. +

+ +

It is also possible to register or revoke components at runtime. For + this it is necessary to use a registration service (com.sun.star.registry.ImplementationRegistration) + to register external components in the runtime environment of the office + suite. It should be possible to use almost any programming language to implement + a component, since only two things are necessary: first, an appropriate language + binding for the programming language used, and second, an appropriate + loader service for components implemented in this language.

+ +

C++ Components

+ +

C++ UNO components are usually implemented as shared libraries. Such a shared + library must provide a special interface which contains 4 exported + "C" functions. These functions are searched by the appropriate loader + service ("com.sun.star.loader.SharedLibrary") to register the + component or to instantiate an object providing the service.

+

The exported "C" functions are:

+ +
+

component_getDescriptionFunc
+
component_getImplementationEnvironmentFunc
+
component_writeInfo
+
component_getFactory

+
+
+
component_getDescriptionFunc
+
Syntax:
+
extern "C" const sal_Char* SAL_CALL component_getDescriptionFunc(void); +
+
This function is optional but should be supported. + The function should return an XML formatted string describing the contents + of the component. This function could be generated from a general XML + component description. Such a description contains information about + the name, the supported services, the needed services, the needed types, + and so on. For more details, see XML + Component Description. Any component + should provide such an XML description.
+
component_getImplementationEnvironmentFunc
+
Syntax:
+
extern "C" void SAL_CALL component_getImplementationEnvironmentFunc(const + sal_Char** ppEnvTypeName, uno_Environment** ppEnv );
+
Function to determine the implementation environment of the component. This + function shows the runtime environment how to use the void* + parameters of component_writeInfoFunc and component_getFactoryFunc. + A component, implemented in C++, uses the C++ environment. The UNO runtime + must map the void* parameters from the C++ environment to + the current environment. If the environment is NOT session specific, + i.e., it needs no additional context, then this function should return the + environment type name and leave ppEnv (0).
+
component_writeInfo
+
Syntax:
+
extern "C" sal_Bool SAL_CALL component_writeInfoFunc(void* + pServiceManager, void* pRegistryKey );
+
Function to write component specific + data in a reserved section in the registry, at least, the supported services + of the component. pRegistryKey refers to a reserved section in + the registry. Any component should have a unique implementation name + to specify their own subsection under this key. pServiceManager + specifies the current service manager. The service manager could be + used at this time to get information from other services which are + important for this component (this parameter is seldom used).
+
+ +
Structure + of an implementation section:
+ +
/IMPLEMENTATIONS/<implementation_name>/UNO/SERVICES/<service_name1>[/attribute_subkeys]
+                                                   /<service_name2>...
+                                                    ...
+                                     [/REGISTRY_LINKS]
+                                          (AsciiListValue)
+                                          <registry_link1>
+                                          <registry_link2>
+                                           ...
+                                     [/DATA]
+ +
Under + the reserved key ".../UNO/SERVICES" there could be one or more services + specified as a subkey with the name of the service. + Each service key could also have subkeys to specify service-specific attributes. + ".../REGISTRY_LINKS" specifies also a reserved key which is + interpreted by the registration service. This key must have an ASCII list + value. The values of these lists, specifies links which are created by the + registration service. The notation of such a link name shows where the + link is created and where the target is. If the link name begins with + '/' the link will be created under the rootkey, if not the link will be + created relative to the <implementation_name>. If the linkname contains + a unique '%', then the part after the '%' is used as the link target; otherwise, + the link target is the <implementation_name>. If a link target is + specified, it is always relative to the <implementation_name>. To specify one's + own service specific data, it is useful to create a special ".../DATA" + section.
+
+
component_getFactory
+
Syntax:
+
extern "C" void* SAL_CALL component_getFactoryFunc(const + sal_Char* pImplName, void* pServiceManager, void* pRegistryKey ); +
+
This Function returns a factory to create component instances. The first + time a component instance will be created, this function is called and + the returned factory is registered in the service manager. pImplName + specifies the name of the implementation which the factory will create. + It is possible to have more than one implementation in a shared library. + pServiceManager points to the current service manager. This service + manager should be given to the factory and later to any instances, so + that all instances created in the environment of this service manager + use this one. pRegistryKey points to the implementation key + specified by pImplName. This key should also be given to the + factory and later to every instance when there are component specific + data in the implementation section, that will later be used.
+
Example
+ +
Under Component + Tutorial, you will find a simple example of + how to create a C++ UNO component. You will also find typical implementations + of the C-functions which are necessary to support the C++ component + interface.
+
+ + + + + +
+ + Author: Jürgen Schmidt ($Date: 2004/11/30 13:11:29 $)
+ Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.
+
+ + Propchange: incubator/ooo/ooo-site/trunk/content/udk/common/man/uno_components.html ------------------------------------------------------------------------------ svn:eol-style = native