xref: /aoo42x/main/offapi/com/sun/star/sdb/DataSource.idl (revision c4dc0a1a)
1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdb_DataSource_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdb_DataSource_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_io_XPersistObject_idl__
27cdf0e10cSrcweir#include <com/sun/star/io/XPersistObject.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
31cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
35cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_util_XFlushable_idl__
39cdf0e10cSrcweir#include <com/sun/star/util/XFlushable.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir#ifndef __com_sun_star_util_XNumberFormatsSupplier_idl__
43cdf0e10cSrcweir#include <com/sun/star/util/XNumberFormatsSupplier.idl>
44cdf0e10cSrcweir#endif
45cdf0e10cSrcweir
46cdf0e10cSrcweir
47cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
48cdf0e10cSrcweir	 published interface XIsolatedConnection;
49cdf0e10cSrcweir	 published interface XDataSource;
50cdf0e10cSrcweir };};};};
51cdf0e10cSrcweir
52cdf0e10cSrcweir
53cdf0e10cSrcweir module com {  module sun {  module star {  module sdb {
54cdf0e10cSrcweir
55cdf0e10cSrcweir published interface XCompletedConnection;
56cdf0e10cSrcweir published interface XQueryDefinitionsSupplier;
57cdf0e10cSrcweir published interface XBookmarksSupplier;
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweir/** is a factory to establish database connections. It should be registered at
61cdf0e10cSrcweir	a <type scope="com::sun::star::uno">NamingService</type>.
62cdf0e10cSrcweir	@see com::sun::star::sdb::DatabaseContext
63cdf0e10cSrcweir */
64cdf0e10cSrcweirpublished service DataSource
65cdf0e10cSrcweir{
66cdf0e10cSrcweir	interface com::sun::star::beans::XPropertySet;
67cdf0e10cSrcweir
68cdf0e10cSrcweir
69cdf0e10cSrcweir	/** useful for establishing connections with the completion of connection parameters
70cdf0e10cSrcweir				provided during user interaction.
71cdf0e10cSrcweir	 */
72cdf0e10cSrcweir	interface XCompletedConnection;
73cdf0e10cSrcweir
74cdf0e10cSrcweir	/** useful for establishing isolated connections which are not shared among others
75cdf0e10cSrcweir		as it is the case when using <type>XCompletedConnection</type> or <type scope="com::sun::star::sdbc">XDataSource</type>.
76cdf0e10cSrcweir		@see XCompletedConnection
77cdf0e10cSrcweir		@see com::sun::star::sdbc::XDataSource
78*c4dc0a1aSJürgen Schmidt		@since OpenOffice 1.1.2
79cdf0e10cSrcweir	 */
80cdf0e10cSrcweir	interface com::sun::star::sdbc::XIsolatedConnection;
81cdf0e10cSrcweir
82cdf0e10cSrcweir
83cdf0e10cSrcweir	/** is provided to flush a DataSource within to a Database Context.
84cdf0e10cSrcweir	 */
85cdf0e10cSrcweir	interface com::sun::star::util::XFlushable;
86cdf0e10cSrcweir
87cdf0e10cSrcweir
88cdf0e10cSrcweir	/** provides the access to DataSource related queries.
89cdf0e10cSrcweir		<p>
90cdf0e10cSrcweir		The object returned by the
91cdf0e10cSrcweir		<method scope="com::sun::star::sdb">XQueryDefinitionsSupplier::getQueryDefinitions()</method>
92cdf0e10cSrcweir		supports the
93cdf0e10cSrcweir		<type scope="com::sun::star::sdb">DefinitionContainer</type>
94cdf0e10cSrcweir		service.
95cdf0e10cSrcweir		</p>
96cdf0e10cSrcweir	 */
97cdf0e10cSrcweir	interface XQueryDefinitionsSupplier;
98cdf0e10cSrcweir
99cdf0e10cSrcweir	/* useful for establishing connections and to get and set the login timeout.
100cdf0e10cSrcweir	*/
101cdf0e10cSrcweir	interface com::sun::star::sdbc::XDataSource;
102cdf0e10cSrcweir
103cdf0e10cSrcweir	/** provides access to bookmarks to documents associated with the data source
104cdf0e10cSrcweir		<p>
105cdf0e10cSrcweir		The object returned by the
106cdf0e10cSrcweir		<method scope="com::sun::star::sdb">XBookmarksSupplier::getBookmarks()</method>
107cdf0e10cSrcweir		supports the
108cdf0e10cSrcweir		<type scope="com::sun::star::sdb">DefinitionContainer</type>
109cdf0e10cSrcweir		service.
110cdf0e10cSrcweir		</p>
111cdf0e10cSrcweir	 */
112cdf0e10cSrcweir	[optional] interface XBookmarksSupplier;
113cdf0e10cSrcweir
114cdf0e10cSrcweir	/** is the name of the data source.
115cdf0e10cSrcweir
116cdf0e10cSrcweir        <p>If the data source is registered at the database context, then the <code>Name</code> property
117cdf0e10cSrcweir        denotes the registration name. Otherwise, the name property contains the URL of the file which the
118cdf0e10cSrcweir        database document associated with the data source is based on.</p>
119cdf0e10cSrcweir
120cdf0e10cSrcweir        <p>If the same data source is registered under different names, the value of the <code>Name</code>
121cdf0e10cSrcweir        property is not defined.</p>
122cdf0e10cSrcweir	 */
123cdf0e10cSrcweir	[readonly, property] string Name;
124cdf0e10cSrcweir
125cdf0e10cSrcweir
126cdf0e10cSrcweir	/** indicates a database url of the form <br>
127cdf0e10cSrcweir		<code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
128cdf0e10cSrcweir		or
129cdf0e10cSrcweir		<code>sdbc:<em>subprotocol</em>:<em>subname</em></code>
130cdf0e10cSrcweir	 */
131cdf0e10cSrcweir	[property] string URL;
132cdf0e10cSrcweir
133cdf0e10cSrcweir
134cdf0e10cSrcweir	/** is a list of arbitrary string tag/value pairs as connection arguments
135cdf0e10cSrcweir
136cdf0e10cSrcweir        <p>The <type>DataSource</type> itself does not attempt to interpret any of those values.</p>
137cdf0e10cSrcweir
138cdf0e10cSrcweir        <p>Instead, the values in this property have two use cases:
139cdf0e10cSrcweir        <ul><li>Upon creating a connection, for every value in this sequence it's checked
140cdf0e10cSrcweir                whether the <type scope="com::sun::star::sdbc">XDriver</type> which is to provide
141cdf0e10cSrcweir                the connection supports a setting with the respective name, using its
142cdf0e10cSrcweir                <member scope="com::sun::star::sdbc">XDriver::getPropertyInfo<member> method.br/>
143cdf0e10cSrcweir                If so, the settings is passed to the drivers's
144cdf0e10cSrcweir                <member scope="com::sun::star::sdbc">XDriver::connect<member> method. If not,
145cdf0e10cSrcweir                the setting is ignored.</li>
146cdf0e10cSrcweir            <li>External components may use the settings to carry arbitrary information with
147cdf0e10cSrcweir                the data source. Usually, this is used to control the behaviour of components
148cdf0e10cSrcweir                working with the data source.</li>
149cdf0e10cSrcweir        </ul>
150cdf0e10cSrcweir    */
151cdf0e10cSrcweir	[property] sequence<com::sun::star::beans::PropertyValue> Info;
152cdf0e10cSrcweir
153cdf0e10cSrcweir    /** is a convenience wrapper around the <member>Info</member> property.
154cdf0e10cSrcweir
155cdf0e10cSrcweir        <p>Since fiddling around with a sequence of property values is somewhat uncomfortable
156cdf0e10cSrcweir        in all known UNO language bindings (especially for tasks like simply changing the value
157cdf0e10cSrcweir        of an existing value), the <member>Settings</member> property wraps the <member>Info</member>
158cdf0e10cSrcweir        property for easier single-value access.</p>
159cdf0e10cSrcweir
160cdf0e10cSrcweir        <p>You should use the <member>Setting</member> property if you need to access a few properties only,
161cdf0e10cSrcweir        and the <member>Info</member> property if you need access to all existent settings at once.</p>
162cdf0e10cSrcweir
163cdf0e10cSrcweir        <p>The object represented by this property supports the <type scope="com::sun::star::beans">PropertyBag</type>
164cdf0e10cSrcweir        service. That is, you can at runtime add arbitrary new properties to the bag.</p>
165cdf0e10cSrcweir
166cdf0e10cSrcweir        <p>Additionally, the property bag supports default values of properties, and thus the
167cdf0e10cSrcweir        <type scope="com::sun::star::beans">XPropertyState</type> interface. If you add an own property to
168cdf0e10cSrcweir        the bag using <member scope="com::sun::star::beans">XPropertyContainer::addProperty</member>, you need
169cdf0e10cSrcweir        to specifiy an initial value, which is also used as default value (exceptions see below).</p>
170cdf0e10cSrcweir
171cdf0e10cSrcweir        <p>Effectively, the property bag represented by <code>Settings</code> contains two classes of properties:
172cdf0e10cSrcweir        Pre-defined ones and user-defined ones.</p>
173cdf0e10cSrcweir
174cdf0e10cSrcweir        <p><em>Pre-defined</em> properties are properties which are potentially used by the data source, the
175cdf0e10cSrcweir        application UI for the data source, or a particular backend driver employed by the data source. There's
176cdf0e10cSrcweir        a large set of such properties, no all of them are effectively used for a concrete data source, nonetheless,
177cdf0e10cSrcweir        they're all present in the <code>Settings</code>.<br/>
178cdf0e10cSrcweir        Such properties are not removeable from the bag, that is, their
179cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::REMOVEABLE</member> attribute is <em>not</em> set.<br/>
180cdf0e10cSrcweir        Usually, you'll find that all of this properties have the
181cdf0e10cSrcweir        <member scope="com::sun::star::beans::">PropertyState::PropertyState_DEFAULT_VALUE</member> state.</p>
182cdf0e10cSrcweir
183cdf0e10cSrcweir        <p><em>User-defined</em> properties are the ones which are added at runtime by any instance. They might or might
184cdf0e10cSrcweir        not be removeable, this depends on whether or not the code adding them specifies the
185cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::REMOVEABLE</member> attribute. Also, they might
186cdf0e10cSrcweir        or might not have a default value, determined by the
187cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::MAYBEDEFAULT</member> attribute at the time they're added
188cdf0e10cSrcweir        to the bag.</p>
189cdf0e10cSrcweir
190cdf0e10cSrcweir        <p>When a data source is made persistent, then properties which are not removeable (which are assumed to be the
191cdf0e10cSrcweir        pre-defined properties) are ignored when they are in <code>DEFAULT</code> state. All other properties are
192cdf0e10cSrcweir        always made persistent, except when an explicit
193cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::TRANSIENT</member> attribute prohibits this.</p>
194cdf0e10cSrcweir
195cdf0e10cSrcweir        <p>Similar, when you obtain the <member>Info</member> property of a <code>DataSource</code>, the
196cdf0e10cSrcweir        <code>Settings</code> bag is asked for all its property values, and the ones which are removeable and
197cdf0e10cSrcweir        in state default are stripped, and <em>not</em> returned in the <code>Info</code> sequence.</p>
198cdf0e10cSrcweir    */
199cdf0e10cSrcweir    [property, readonly, optional] com::sun::star::beans::XPropertySet Settings;
200cdf0e10cSrcweir
201cdf0e10cSrcweir	/** determines a users login name.
202cdf0e10cSrcweir	 */
203cdf0e10cSrcweir	[property] string User;
204cdf0e10cSrcweir
205cdf0e10cSrcweir
206cdf0e10cSrcweir	/** determines a users password. The password is not persistent.
207cdf0e10cSrcweir	 */
208cdf0e10cSrcweir	[property] string Password;
209cdf0e10cSrcweir
210cdf0e10cSrcweir
211cdf0e10cSrcweir	/** indicates that a password is always necessary.
212cdf0e10cSrcweir	 */
213cdf0e10cSrcweir	[property] boolean IsPasswordRequired;
214cdf0e10cSrcweir
215cdf0e10cSrcweir
216cdf0e10cSrcweir	/** indicates that components displaying data obtained from this
217cdf0e10cSrcweir		data source should suppress columns used for versioning.
218cdf0e10cSrcweir	 */
219cdf0e10cSrcweir	[property] boolean SuppressVersionColumns;
220cdf0e10cSrcweir
221cdf0e10cSrcweir
222cdf0e10cSrcweir	/** determines whether modifications on the data source are allowed or not.
223cdf0e10cSrcweir	 */
224cdf0e10cSrcweir	[readonly, property] boolean IsReadOnly;
225cdf0e10cSrcweir
226cdf0e10cSrcweir
227cdf0e10cSrcweir	/** provides an object for formatting numbers.
228cdf0e10cSrcweir	 */
229cdf0e10cSrcweir	[readonly, property] com::sun::star::util::XNumberFormatsSupplier
230cdf0e10cSrcweir						NumberFormatsSupplier;
231cdf0e10cSrcweir
232cdf0e10cSrcweir
233cdf0e10cSrcweir	/** defines a list of tables, on which the DataSource should have it's focus.
234cdf0e10cSrcweir		If empty, all tables are rejected.
235cdf0e10cSrcweir
236cdf0e10cSrcweir	*/
237cdf0e10cSrcweir	[property] sequence<string> TableFilter;
238cdf0e10cSrcweir
239cdf0e10cSrcweir
240cdf0e10cSrcweir	/** defines a list of table types, on which the DataSource should have it's focus.
241cdf0e10cSrcweir			 If empty, all table types are rejected.
242cdf0e10cSrcweir
243cdf0e10cSrcweir	*/
244cdf0e10cSrcweir	[property] sequence<string> TableTypeFilter;
245cdf0e10cSrcweir};
246cdf0e10cSrcweir
247cdf0e10cSrcweir//=============================================================================
248cdf0e10cSrcweir
249cdf0e10cSrcweir}; }; }; };
250cdf0e10cSrcweir
251cdf0e10cSrcweir#endif
252