merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / sdb / tools / XConnectionTools.idl
blobe6db3283f375a1ba005d5ad3e675833091477fb6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XConnectionTools.idl,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__
32 #define __com_sun_star_sdb_tools_XConnectionTools_idl__
34 #ifndef __com_sun_star_uno_XInterface_idl__
35 #include <com/sun/star/uno/XInterface.idl>
36 #endif
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include <com/sun/star/sdbc/SQLException.idl>
39 #endif
41 module com { module sun { module star {
42 module container {
43 interface XNameAccess;
45 module lang {
46 interface XComponent;
48 };};};
49 //=============================================================================
50 module com { module sun { module star { module sdb {
51 interface XSingleSelectQueryComposer;
52 module tools {
53 //=============================================================================
55 interface XTableName;
56 interface XObjectNames;
57 interface XDataSourceMetaData;
59 //-----------------------------------------------------------------------------
60 /** encapsulates various useful functionality around a
61 <type scope="com::sun::star::sdb">Connection</type>
63 <p>Most of the functionality provided here is meaningful only relative to
64 a given database connection. For instance, for quoting table names, you need
65 the meta data instance of the connection. Thus, the entry point for obtaining
66 a <type>XConnectionTools</type> instance is the
67 <type scope="com::sun::star::sdb">Connection</type> service.</p>
69 <p>Note that nearly all functionality provided by this interface is also
70 available by other means, it's only provided here for convenience purposes.</p>
72 @since OOo 2.0.4
74 interface XConnectionTools
76 /** creates an instance supporting the <type>XTableName</type> interface,
77 which can be used to manipulate table names for various purposes.
79 <p>The returned object is guanrateed to not be <NULL/>.</p>
81 XTableName createTableName();
83 /** returns an instance supporting the <type>XObjectNames</type> interface,
84 which provides access to functionality around table and query names.
86 <p>The returned object is guanrateed to not be <NULL/>.</p>
88 XObjectNames getObjectNames();
90 /** provides access to the application-level data source meta data
92 XDataSourceMetaData
93 getDataSourceMetaData();
95 /** get fields for a result set given by a "command descriptor"
97 <p>A command descriptor here means:
98 <ul><li>a SDB-level connection (<type scope="com.sun.star.sdb">Connection</type></li>
99 <li>a string specifying the name of an object relative to the connection</li>
100 <li>a <type scope="com.sun.star.sdb">CommandType</type> value specifying the type
101 of the object</type></li>
102 </ul>
103 </p>
105 @param commandType
106 the type of the object
108 @param command
109 the object. This may be a table name, a query name, or an SQL statement, depending on the value
110 of <arg>_nCommandType</arg>
112 @param _rxCollectionOner
113 If (and only if) <arg>CommandType</arg> is CommandType.COMMAND, the fields collection which is returned
114 by this function here is a temporary object. It is kept alive by another object, which is to be
115 created temporarily, too. To ensure that the fields you get are valid as long as you need them,
116 the owner which controls their life time is transfered to this parameter upon return.<br/>
118 Your fields live as long as this component lives.<br/>
120 Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore.
121 It depends on the connection's implementation if this is necessary, but the is no guarantee, so to
122 be on the safe side with respect to resource leaks, you should dispose the component.
124 @return
125 the container of the columns (aka fields) of the object
127 ::com::sun::star::container::XNameAccess getFieldsByCommandDescriptor( [in] long commandType,
128 [in] string command,
129 [out] ::com::sun::star::lang::XComponent keepFieldsAlive
130 ) raises( com::sun::star::sdbc::SQLException );
132 /** get the composer initialized with a command and command type.
133 @param commandType
134 the type of the object
136 @param command
137 the object. This may be a table name, a query name, or an SQL statement, depending on the value
138 of <arg>_nCommandType</arg>
139 @return
140 the composer filled with command and command type.
142 ::com::sun::star::sdb::XSingleSelectQueryComposer getComposer([in] long commandType,[in] string command);
145 //=============================================================================
146 }; }; }; }; };
147 //=============================================================================
149 #endif