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