1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_ucb_ContentResultSet_idl__
24cdf0e10cSrcweir#define __com_sun_star_ucb_ContentResultSet_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
27cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.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_sdbc_XResultSet_idl__
35cdf0e10cSrcweir#include <com/sun/star/sdbc/XResultSet.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XResultSetMetaDataSupplier_idl__
39cdf0e10cSrcweir#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XRow_idl__
43cdf0e10cSrcweir#include <com/sun/star/sdbc/XRow.idl>
44cdf0e10cSrcweir#endif
45cdf0e10cSrcweir
46cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_XCloseable_idl__
47cdf0e10cSrcweir#include <com/sun/star/sdbc/XCloseable.idl>
48cdf0e10cSrcweir#endif
49cdf0e10cSrcweir
50cdf0e10cSrcweir#ifndef __com_sun_star_ucb_XContentAccess_idl__
51cdf0e10cSrcweir#include <com/sun/star/ucb/XContentAccess.idl>
52cdf0e10cSrcweir#endif
53cdf0e10cSrcweir
54cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_ResultSet_idl__
55cdf0e10cSrcweir#include <com/sun/star/sdbc/ResultSet.idl>
56cdf0e10cSrcweir#endif
57cdf0e10cSrcweir
58cdf0e10cSrcweir//=============================================================================
59cdf0e10cSrcweir
60cdf0e10cSrcweirmodule com { module sun { module star { module ucb {
61cdf0e10cSrcweir
62cdf0e10cSrcweir//=============================================================================
63cdf0e10cSrcweir/** provides access to the children of a folder content.
64cdf0e10cSrcweir
65cdf0e10cSrcweir    <p>It can be understand as a table containing a row for	each child. The
66cdf0e10cSrcweir	table columns may contain values of properties of the children.
67cdf0e10cSrcweir*/
68cdf0e10cSrcweirpublished service ContentResultSet
69cdf0e10cSrcweir{
70cdf0e10cSrcweir	//-------------------------------------------------------------------------
71cdf0e10cSrcweir	/** must be implemented to make it possible to resolve cyclic object
72cdf0e10cSrcweir	    references ( i.e. between an implementation of
73cdf0e10cSrcweir		<type scope="com::sun::star::beans">XPropertySet</type>
74cdf0e10cSrcweir		- which may	hold property change listeners - and
75cdf0e10cSrcweir		<type scope="com::sun::star::beans">XPropertyChangeListener</type>
76cdf0e10cSrcweir		- which may hold the property set ).
77cdf0e10cSrcweir
78cdf0e10cSrcweir		<p>This interface is required.
79cdf0e10cSrcweir	 */
80cdf0e10cSrcweir	interface com::sun::star::lang::XComponent;
81cdf0e10cSrcweir
82cdf0e10cSrcweir	/** provides access to the result set meta data. Meta data are for
83cdf0e10cSrcweir	    example the number of columns of the result set, information
84cdf0e10cSrcweir		on the data types of columns, column names, and more.
85cdf0e10cSrcweir
86cdf0e10cSrcweir		<p>This interface is required.
87cdf0e10cSrcweir	 */
88cdf0e10cSrcweir	interface com::sun::star::sdbc::XResultSetMetaDataSupplier;
89cdf0e10cSrcweir
90cdf0e10cSrcweir	//-------------------------------------------------------------------------
91cdf0e10cSrcweir	/** enables travelling through the result set members ( the contents ).
92cdf0e10cSrcweir		This interface mainly provides a cursor for the result set.
93cdf0e10cSrcweir
94cdf0e10cSrcweir		<p>Note that every method of this interface implementation additionally
95cdf0e10cSrcweir		may throw a	<type>ResultSetException</type> ( which is derived from
96cdf0e10cSrcweir		<type scope="com::sun::star::sdbc">SQLException</type> to be compatible
97cdf0e10cSrcweir		to that interface ). The new exception transports another exception,
98cdf0e10cSrcweir		which indicates the reason for the failure of the method call.
99cdf0e10cSrcweir
100cdf0e10cSrcweir		<p>This interface is required.
101cdf0e10cSrcweir	 */
102cdf0e10cSrcweir	interface com::sun::star::sdbc::XResultSet;
103cdf0e10cSrcweir
104cdf0e10cSrcweir	//-------------------------------------------------------------------------
105cdf0e10cSrcweir	/**	provides access to data of the content the cursor is pointing to.
106cdf0e10cSrcweir
107cdf0e10cSrcweir		<p>Note that every method of this interface implementation additionally
108cdf0e10cSrcweir		may throw a	<type>ResultSetException</type> ( which is derived from
109cdf0e10cSrcweir		<type scope="com::sun::star::sdbc">SQLException</type> to be compatible
110cdf0e10cSrcweir		to that interface ). The new exception transports another exception,
111cdf0e10cSrcweir		which indicates the reason for the failure of the method call.
112cdf0e10cSrcweir
113cdf0e10cSrcweir		<p>This interface is required.
114cdf0e10cSrcweir	 */
115cdf0e10cSrcweir	interface com::sun::star::sdbc::XRow;
116cdf0e10cSrcweir
117cdf0e10cSrcweir	//-------------------------------------------------------------------------
118cdf0e10cSrcweir	/** makes it possible to abort running activities ( i.e. to cancel
119cdf0e10cSrcweir	    retrieving data from a server ).
120cdf0e10cSrcweir
121cdf0e10cSrcweir		<p>Note that every method of this interface implementation additionally
122cdf0e10cSrcweir		may throw a	<type>ResultSetException</type> ( which is derived from
123cdf0e10cSrcweir		<type scope="com::sun::star::sdbc">SQLException</type> to be compatible
124cdf0e10cSrcweir		to that interface ). The new exception transports another exception,
125cdf0e10cSrcweir		which indicates the reason for the failure of the method call.
126cdf0e10cSrcweir
127cdf0e10cSrcweir		<p>This interface is required.
128cdf0e10cSrcweir	 */
129cdf0e10cSrcweir	interface com::sun::star::sdbc::XCloseable;
130cdf0e10cSrcweir
131cdf0e10cSrcweir	//-------------------------------------------------------------------------
132cdf0e10cSrcweir	/** holds properties of the resultset.
133cdf0e10cSrcweir
134cdf0e10cSrcweir		<p>This interface is required.
135cdf0e10cSrcweir	 */
136cdf0e10cSrcweir	interface com::sun::star::beans::XPropertySet;
137cdf0e10cSrcweir
138cdf0e10cSrcweir	//-------------------------------------------------------------------------
139cdf0e10cSrcweir	/** controls the travel mode of the resultset cursor.
140cdf0e10cSrcweir
141cdf0e10cSrcweir		<p>There are two possible travel modes:
142cdf0e10cSrcweir
143cdf0e10cSrcweir		<p><table border=1>
144cdf0e10cSrcweir		<tr><td><member>CursorTravelMode::BLOCKING</member></td>
145cdf0e10cSrcweir			<td>Each travel method of the resultset will not return until the
146cdf0e10cSrcweir			    data for the new position were retrieved.</td></tr>
147cdf0e10cSrcweir		<tr><td><member>CursorTravelMode::NONBLOCKING</member></td>
148cdf0e10cSrcweir			<td>The implementation will throw a
149cdf0e10cSrcweir				<code>CursorWouldBlockException</code>, if the data for the new
150cdf0e10cSrcweir				position are not retrieved yet.</td></tr>
151cdf0e10cSrcweir		</table>
152cdf0e10cSrcweir
153cdf0e10cSrcweir		<p>The following pseudo-code illustrates the usage of a non-blocking
154cdf0e10cSrcweir		cursor:
155cdf0e10cSrcweir
156cdf0e10cSrcweir		<p><pre>
157cdf0e10cSrcweir    	bProcessedAllRows = false
158cdf0e10cSrcweir    	while ( !bProcessedAllRows )
159cdf0e10cSrcweir    	{
160cdf0e10cSrcweir        	cursor.setPropertyValue( "CursorTravelMode", BLOCKING )
161cdf0e10cSrcweir
162cdf0e10cSrcweir        	cursor.travelSomeWhere()
163cdf0e10cSrcweir        	collectRowData()
164cdf0e10cSrcweir
165cdf0e10cSrcweir        	cursor.setPropertyValue( "CursorTravelMode", NONBLOCKING )
166cdf0e10cSrcweir
167cdf0e10cSrcweir        	bGoOn = true;
168cdf0e10cSrcweir        	while ( bGoOn )
169cdf0e10cSrcweir        	{
170cdf0e10cSrcweir            	try
171cdf0e10cSrcweir            	{
172cdf0e10cSrcweir                	cursor.travelSomeWhere()
173cdf0e10cSrcweir                	collectRowData()
174cdf0e10cSrcweir            	}
175cdf0e10cSrcweir            	catch ( CursorWouldBlockException )
176cdf0e10cSrcweir            	{
177cdf0e10cSrcweir                	// No more data at the moment.
178cdf0e10cSrcweir               	bGoOn = false
179cdf0e10cSrcweir            	}
180cdf0e10cSrcweir        	}
181cdf0e10cSrcweir
182cdf0e10cSrcweir        	doSomethingWithCollectedRowData()
183cdf0e10cSrcweir
184cdf0e10cSrcweir        	bProcessedAllRows = ...
185cdf0e10cSrcweir    	}
186cdf0e10cSrcweir		</pre>
187cdf0e10cSrcweir
188cdf0e10cSrcweir		<p>
189cdf0e10cSrcweir	 	If this property is not supported, the implementation needs to provide
190cdf0e10cSrcweir		a blocking cursor.
191cdf0e10cSrcweir		</p>
192cdf0e10cSrcweir
193cdf0e10cSrcweir		<p>
194cdf0e10cSrcweir		The implementation initially needs to set the value of this property
195cdf0e10cSrcweir		to <member>CursorTravelMode::BLOCKING</member>.
196cdf0e10cSrcweir		</p>
197cdf0e10cSrcweir
198cdf0e10cSrcweir		@see CursorTravelMode
199cdf0e10cSrcweir	 */
200cdf0e10cSrcweir	[optional, property] long CursorTravelMode;
201cdf0e10cSrcweir
202cdf0e10cSrcweir	/** contains the number of rows obtained (so far) from the data source. */
203cdf0e10cSrcweir	[readonly, property] long RowCount;
204cdf0e10cSrcweir
205cdf0e10cSrcweir	/** indicates that all rows of te resultset have been obtained. */
206cdf0e10cSrcweir	[readonly, property] boolean IsRowCountFinal;
207cdf0e10cSrcweir
208cdf0e10cSrcweir	//-------------------------------------------------------------------------
209cdf0e10cSrcweir	/**	provides access to the content identifier and the content object
210cdf0e10cSrcweir		itself.
211cdf0e10cSrcweir
212cdf0e10cSrcweir		<p>This interface is required.
213cdf0e10cSrcweir	 */
214cdf0e10cSrcweir	interface XContentAccess;
215cdf0e10cSrcweir
216cdf0e10cSrcweir	//-------------------------------------------------------------------------
217cdf0e10cSrcweir	/** can be implemented to provide a complete JDBC conform result set
218cdf0e10cSrcweir		interface for the implementation of this service.
219cdf0e10cSrcweir
220cdf0e10cSrcweir		<p>The implememtation of this service is optional.
221cdf0e10cSrcweir	 */
222cdf0e10cSrcweir	service com::sun::star::sdbc::ResultSet;
223cdf0e10cSrcweir};
224cdf0e10cSrcweir
225cdf0e10cSrcweir//=============================================================================
226cdf0e10cSrcweir
227cdf0e10cSrcweir}; }; }; };
228cdf0e10cSrcweir
229cdf0e10cSrcweir#endif
230