<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Finterface_overview</id>
	<title>EN/documentation/basic guide/interface overview - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Finterface_overview"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/interface_overview&amp;action=history"/>
	<updated>2026-11-11T13:49:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/interface_overview&amp;diff=15915&amp;oldid=prev</id>
		<title>Sancho at 11:35, 2 September 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/interface_overview&amp;diff=15915&amp;oldid=prev"/>
		<updated>2011-09-02T11:35:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 11:35, 2 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Overview of Some Central Interfaces&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Overview of Some Central Interfaces&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Documentation/BASICGuideTOC&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Documentation/BASICGuideTOC&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 8:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|api=block&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|api=block&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;__NOTOC__&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some interfaces of {{OOo}} can be found in many parts of the {{OOo}} API. They define sets of methods for abstract tasks which can be applied to various problems. Here, you will find an overview of the most common of these interfaces.  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Some interfaces of {{OOo}} can be found in many parts of the {{OOo}} API. They define sets of methods for abstract tasks which can be applied to various problems. Here, you will find an overview of the most common of these interfaces.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/interface_overview&amp;diff=15914&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/interface_overview&amp;diff=15914&amp;oldid=prev"/>
		<updated>2011-09-02T11:34:51Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Overview of Some Central Interfaces&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/uno_tools&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/documents&lt;br /&gt;
|api=block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
Some interfaces of {{OOo}} can be found in many parts of the {{OOo}} API. They define sets of methods for abstract tasks which can be applied to various problems. Here, you will find an overview of the most common of these interfaces. &lt;br /&gt;
&lt;br /&gt;
The origin of the objects is explained at a later point in this guide. At this point, only some of the abstract aspects of objects, for which the {{OOo}} API provides some central interfaces, are discussed.&lt;br /&gt;
&lt;br /&gt;
== Creating Context-Dependent Objects ==&lt;br /&gt;
&lt;br /&gt;
The {{OOo}} API provides two options for creating objects. One can be found in the &amp;lt;tt&amp;gt;createUnoService&amp;lt;/tt&amp;gt; function mentioned at the start of this chapter. &amp;lt;tt&amp;gt;createUnoService&amp;lt;/tt&amp;gt; creates an object which can be used universally. Such objects and services are also known as context-independent services. &lt;br /&gt;
&lt;br /&gt;
In addition to context-independent services, there are also context-dependent services whose objects are only useful when used in conjunction with another object. A drawing object for a spreadsheet document, for example, can therefore only exist in conjunction with this one document.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.lang.XMultiServiceFactory&amp;lt;/tt&amp;gt; Interface ===&lt;br /&gt;
&lt;br /&gt;
Context-dependent objects are usually created by means of an object method, on which the object depends. The &amp;lt;tt&amp;gt;createInstance&amp;lt;/tt&amp;gt; method, which is defined in the &amp;lt;tt&amp;gt;XMultiServiceFactory&amp;lt;/tt&amp;gt; interface, is used in particular in the document objects. &lt;br /&gt;
&lt;br /&gt;
The drawing object can, for example, be created as follows using a spreadsheet object: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim RectangleShape As Object&lt;br /&gt;
RectangleShape = _&lt;br /&gt;
  Spreadsheet.createInstance(&amp;quot;com.sun.star.drawing.RectangleShape&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A paragraph template in a text document is created in the same way: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Style as Object&lt;br /&gt;
Style = Textdocument.createInstance(&amp;quot;com.sun.star.style.ParagraphStyle&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Named Access to Subordinate Objects ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XNameAccess&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;XNameContainer&amp;lt;/tt&amp;gt; interfaces are used in objects that contain subordinate objects, which can be addressed using a natural language name. &lt;br /&gt;
&lt;br /&gt;
While &amp;lt;tt&amp;gt;XNameAccess&amp;lt;/tt&amp;gt; permits access to the individual objects, &amp;lt;tt&amp;gt;XNameContainer&amp;lt;/tt&amp;gt; takes on the insertion, modification and deletion of elements.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.container.XNameAccess&amp;lt;/tt&amp;gt; Interface ===&lt;br /&gt;
&lt;br /&gt;
An example of the use of &amp;lt;tt&amp;gt;XNameAccess&amp;lt;/tt&amp;gt; is provided by the &amp;lt;tt&amp;gt;sheets&amp;lt;/tt&amp;gt; object of a spreadsheet. It combines all the pages within the spreadsheet. The individual pages are accessed from the &amp;lt;tt&amp;gt;sheets&amp;lt;/tt&amp;gt; object, by using the &amp;lt;tt&amp;gt;getByName&amp;lt;/tt&amp;gt; method from &amp;lt;tt&amp;gt;XNameAccess&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Sheets As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
&lt;br /&gt;
Sheets = Spreadsheet.Sheets&lt;br /&gt;
Sheet = Sheets.getByName(&amp;quot;Sheet1&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;getElementNames&amp;lt;/tt&amp;gt; method provides an overview of the names of all elements. As a result, it returns a data field containing the names. The following example shows how all element names of a spreadsheet can thereby be determined and displayed in a loop: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Sheets As Object&lt;br /&gt;
Dim SheetNames&lt;br /&gt;
Dim I As Integer&lt;br /&gt;
&lt;br /&gt;
Sheets = Spreadsheet.Sheets&lt;br /&gt;
SheetNames = Sheets.getElementNames&lt;br /&gt;
&lt;br /&gt;
For I=LBound(SheetNames) To UBound(SheetNames)&lt;br /&gt;
  MsgBox SheetNames(I)&lt;br /&gt;
Next I&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;hasByName&amp;lt;/tt&amp;gt; method of the &amp;lt;tt&amp;gt;XNameAccess&amp;lt;/tt&amp;gt; interface reveals whether a subordinate object with a particular name exists within the basic object. The following example therefore displays a message that informs the user whether the &amp;lt;tt&amp;gt;Spreadsheet&amp;lt;/tt&amp;gt; object contains a page of the name &amp;lt;tt&amp;gt;Sheet1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Sheets As Object&lt;br /&gt;
&lt;br /&gt;
Sheets = Spreadsheet.Sheets&lt;br /&gt;
If Sheets.HasByName(&amp;quot;Sheet1&amp;quot;) Then&lt;br /&gt;
  MsgBox &amp;quot; Sheet1 available&amp;quot;&lt;br /&gt;
Else&lt;br /&gt;
  MsgBox &amp;quot;Sheet1 not available&amp;quot;&lt;br /&gt;
End If&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.container.XNameContainer&amp;lt;/tt&amp;gt; Interface ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XNameContainer&amp;lt;/tt&amp;gt; interface takes on the insertion, deletion and modification of subordinate elements in a basic object. The functions responsible are &amp;lt;tt&amp;gt;insertByName&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;removeByName&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;replaceByName&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The following is a practical example of this. It calls a text document, which contains a &amp;lt;tt&amp;gt;StyleFamilies&amp;lt;/tt&amp;gt; object and uses this to in turn make the paragraph templates (ParagraphStyles) of the document available. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim StyleFamilies As Object&lt;br /&gt;
Dim ParagraphStyles As Object&lt;br /&gt;
Dim NewStyle As Object   &lt;br /&gt;
&lt;br /&gt;
StyleFamilies = Textdoc.StyleFamilies&lt;br /&gt;
ParagraphStyles = StyleFamilies.getByName(&amp;quot;ParagraphStyles&amp;quot;)&lt;br /&gt;
ParagraphStyles.insertByName(&amp;quot;NewStyle&amp;quot;, NewStyle)      &lt;br /&gt;
ParagraphStyles.replaceByName(&amp;quot;ChangingStyle&amp;quot;, NewStyle)   &lt;br /&gt;
ParagraphStyles.removeByName(&amp;quot;OldStyle&amp;quot;)            &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;insertByName&amp;lt;/tt&amp;gt; line inserts the &amp;lt;tt&amp;gt;NewStyle&amp;lt;/tt&amp;gt; style under the name of the same name in the &amp;lt;tt&amp;gt;ParagraphStyles&amp;lt;/tt&amp;gt; object. The &amp;lt;tt&amp;gt;replaceByName&amp;lt;/tt&amp;gt; line changes the object behind &amp;lt;tt&amp;gt;ChangingStyle&amp;lt;/tt&amp;gt; into &amp;lt;tt&amp;gt;NewStyle&amp;lt;/tt&amp;gt;. Finally, the &amp;lt;tt&amp;gt;removeByName&amp;lt;/tt&amp;gt; call removes the object behind &amp;lt;tt&amp;gt;OldStyle&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;ParagraphStyles&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Index-Based Access to Subordinate Objects ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XIndexAccess&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;XIndexContainer&amp;lt;/tt&amp;gt; interfaces are used in objects which contain subordinate objects and which can be addressed using an index. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;XIndexAccess&amp;lt;/tt&amp;gt; provides the methods for accessing individual objects. &amp;lt;tt&amp;gt;XIndexContainer&amp;lt;/tt&amp;gt; provides methods for inserting and removing elements.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.container.XIndexAccess&amp;lt;/tt&amp;gt; Interface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;XIndexAccess&amp;lt;/tt&amp;gt; provides the &amp;lt;tt&amp;gt;getByIndex&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;getCount&amp;lt;/tt&amp;gt; methods for calling the subordinate objects. &amp;lt;tt&amp;gt;getByIndex&amp;lt;/tt&amp;gt; provides an object with a particular index. &amp;lt;tt&amp;gt;getCount&amp;lt;/tt&amp;gt; returns how many objects are available. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Sheets As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim I As Integer&lt;br /&gt;
&lt;br /&gt;
Sheets = Spreadsheet.Sheets&lt;br /&gt;
&lt;br /&gt;
For I = 0 to Sheets.getCount() - 1&lt;br /&gt;
  Sheet = Sheets.getByIndex(I)&lt;br /&gt;
  ' Editing sheet&lt;br /&gt;
Next I&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example shows a loop that runs through all sheet elements one after another and saves a reference to each in the &amp;lt;tt&amp;gt;Sheet&amp;lt;/tt&amp;gt; object variable. When working with the indexes, note that &amp;lt;tt&amp;gt;getCount&amp;lt;/tt&amp;gt; returns the number of elements. The elements in &amp;lt;tt&amp;gt;getByIndex&amp;lt;/tt&amp;gt; however are numbered beginning with 0. The counting variable of the loop therefore runs from 0 to &amp;lt;tt&amp;gt;getCount()-1&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.container.XIndexContainer&amp;lt;/tt&amp;gt; Interface ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;XIndexContainer&amp;lt;/tt&amp;gt; interface provides the &amp;lt;tt&amp;gt;insertByIndex&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;removeByIndex&amp;lt;/tt&amp;gt; functions. The parameters are structured in the same way as the corresponding functions in &amp;lt;tt&amp;gt;XNameContainer&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Iterative Access to Subordinate Objects ==&lt;br /&gt;
&lt;br /&gt;
In some instances, an object may contain a list of subordinate objects that cannot be addressed by either a name or an index. In these situations, the &amp;lt;tt&amp;gt;XEnumeration&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;XenumerationAccess&amp;lt;/tt&amp;gt; interfaces are appropriate. They provide a mechanism through which all subordinate elements of an objects can be passed, step by step, without having to use direct addressing. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;com.sun.star.container.XEnumeration&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;XenumerationAccess&amp;lt;/tt&amp;gt; Interfaces ===&lt;br /&gt;
&lt;br /&gt;
The basic object must provide the &amp;lt;tt&amp;gt;XEnumerationAccess&amp;lt;/tt&amp;gt; interface, which contains only a &amp;lt;tt&amp;gt;createEnumeration&amp;lt;/tt&amp;gt; method. This returns an auxiliary object, which in turn provides the &amp;lt;tt&amp;gt;XEnumeration&amp;lt;/tt&amp;gt; interface with the &amp;lt;tt&amp;gt;hasMoreElements&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;nextElement&amp;lt;/tt&amp;gt; methods. Through these, you then have access to the subordinate objects. &lt;br /&gt;
&lt;br /&gt;
The following example steps through all the paragraphs of a text:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim ParagraphEnumeration As Object&lt;br /&gt;
Dim Paragraph As Object&lt;br /&gt;
&lt;br /&gt;
ParagraphEnumeration = Textdoc.Text.createEnumeration&lt;br /&gt;
&lt;br /&gt;
While ParagraphEnumeration.hasMoreElements()&lt;br /&gt;
  Paragraph = ParagraphEnumeration.nextElement()&lt;br /&gt;
Wend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example first creates a &amp;lt;tt&amp;gt;ParagraphEnumeration&amp;lt;/tt&amp;gt; auxiliary object. This gradually returns the individual paragraphs of the text in a loop. The loop is terminated as soon as the &amp;lt;tt&amp;gt;hasMoreElements&amp;lt;/tt&amp;gt; method returns the &amp;lt;tt&amp;gt;False&amp;lt;/tt&amp;gt; value, signaling that the end of the text has been reached.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>