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_sdbcx_XRowLocate_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdbcx_XRowLocate_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_SQLException_idl__
35*cdf0e10cSrcweir#include <com/sun/star/sdbc/SQLException.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir module com {  module sun {  module star {  module sdbcx {
39*cdf0e10cSrcweir
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir/** is used to identify rows within a result set and to find rows by a bookmark.
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir	<p>
45*cdf0e10cSrcweir	Bookmarks are only valid in the scope of the current result set and
46*cdf0e10cSrcweir	are not interchangeable between result sets. A bookmark could be a complex data
47*cdf0e10cSrcweir	structure, so it could not be compared in a safe way. Because of that, a provider
48*cdf0e10cSrcweir	has to implement the compare method for bookmarks.
49*cdf0e10cSrcweir	</p>
50*cdf0e10cSrcweir */
51*cdf0e10cSrcweirpublished interface XRowLocate: com::sun::star::uno::XInterface
52*cdf0e10cSrcweir{
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir	/** returns the bookmark of the current row of a result set.
55*cdf0e10cSrcweir		@returns
56*cdf0e10cSrcweir			the current bookmark
57*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
58*cdf0e10cSrcweir			if a database access error occurs.
59*cdf0e10cSrcweir	 */
60*cdf0e10cSrcweir	any getBookmark() raises (com::sun::star::sdbc::SQLException);
61*cdf0e10cSrcweir	//-------------------------------------------------------------------------
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir	/** moves the cursor to the row identified by an valid bookmark.
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir		<p>
66*cdf0e10cSrcweir		If the bookmark could not be located, a result set will be positioned
67*cdf0e10cSrcweir		after the last record.
68*cdf0e10cSrcweir		<br/>
69*cdf0e10cSrcweir		If the bookmark is invalid, or not generated by the current result set, then
70*cdf0e10cSrcweir		the behaviour is not defined, even an abnormal termination is possible.
71*cdf0e10cSrcweir		</p>
72*cdf0e10cSrcweir		@param bookmark
73*cdf0e10cSrcweir			the bookmark where to move
74*cdf0e10cSrcweir		@returns
75*cdf0e10cSrcweir			<TRUE/> if successful
76*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
77*cdf0e10cSrcweir			if a database access error occurs.
78*cdf0e10cSrcweir	 */
79*cdf0e10cSrcweir	boolean moveToBookmark([in]any bookmark) raises (com::sun::star::sdbc::SQLException);
80*cdf0e10cSrcweir    //-------------------------------------------------------------------------
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir	/** moves the cursor a relative number of rows, either positive or negative
83*cdf0e10cSrcweir		starting at a given bookmark position.
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir		<p>
87*cdf0e10cSrcweir		If the bookmark could not be located, a result set will be positioned
88*cdf0e10cSrcweir		after the last record.
89*cdf0e10cSrcweir		<br/>
90*cdf0e10cSrcweir		If the bookmark is invalid, or not generated by the current result set, then
91*cdf0e10cSrcweir		the behaviour is not defined, even an abnormal termination is possible.
92*cdf0e10cSrcweir		</p>
93*cdf0e10cSrcweir		@param bookmark
94*cdf0e10cSrcweir			the bookmark where to move
95*cdf0e10cSrcweir		@param rows
96*cdf0e10cSrcweir			count of rows move relative to the bookmark
97*cdf0e10cSrcweir		@returns
98*cdf0e10cSrcweir			<TRUE/> if successful
99*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
100*cdf0e10cSrcweir			if a database access error occurs.
101*cdf0e10cSrcweir	 */
102*cdf0e10cSrcweir	boolean moveRelativeToBookmark([in]any bookmark, [in]long rows)
103*cdf0e10cSrcweir		raises (com::sun::star::sdbc::SQLException);
104*cdf0e10cSrcweir	//-------------------------------------------------------------------------
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir	/** compares two bookmarks and returns an indication of their relative values.
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir		<p>
109*cdf0e10cSrcweir		The bookmarks must apply to the same ResultSet. You cannot reliably
110*cdf0e10cSrcweir		compare bookmarks from different ResultSets, even if they were created from
111*cdf0e10cSrcweir		the same source or statement.
112*cdf0e10cSrcweir		<br/>
113*cdf0e10cSrcweir		A bookmark that is not valid, or incorrectly formed, will cause an exception.
114*cdf0e10cSrcweir		</p>
115*cdf0e10cSrcweir		@param first
116*cdf0e10cSrcweir			the first bookmark
117*cdf0e10cSrcweir		@param second
118*cdf0e10cSrcweir			the second bookmark
119*cdf0e10cSrcweir		@returns
120*cdf0e10cSrcweir			a value of <type scope="com::sun::star::sdbcx">CompareBookmark</type>
121*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
122*cdf0e10cSrcweir			if a database access error occurs.
123*cdf0e10cSrcweir
124*cdf0e10cSrcweir		@see com::sun::star::sdbcx::CompareBookmark
125*cdf0e10cSrcweir
126*cdf0e10cSrcweir	 */
127*cdf0e10cSrcweir	long compareBookmarks([in]any first, [in]any second)
128*cdf0e10cSrcweir		raises (com::sun::star::sdbc::SQLException);
129*cdf0e10cSrcweir    //-------------------------------------------------------------------------
130*cdf0e10cSrcweir
131*cdf0e10cSrcweir	/** determines whether the bookmarks of a result set are ordered or not.
132*cdf0e10cSrcweir		@returns
133*cdf0e10cSrcweir			<TRUE/> if so
134*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
135*cdf0e10cSrcweir			if a database access error occurs.
136*cdf0e10cSrcweir		@see com::sun::star::sdbcx::CompareBookmark
137*cdf0e10cSrcweir	 */
138*cdf0e10cSrcweir	boolean hasOrderedBookmarks() raises (com::sun::star::sdbc::SQLException);
139*cdf0e10cSrcweir    //-------------------------------------------------------------------------
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir	/** returns the hash value for a specified bookmark.
142*cdf0e10cSrcweir		@param bookmark
143*cdf0e10cSrcweir			the bookmark to hash
144*cdf0e10cSrcweir		@returns
145*cdf0e10cSrcweir			the hashed value
146*cdf0e10cSrcweir		@throws com::sun::star::sdbc::SQLException
147*cdf0e10cSrcweir			if a database access error occurs.
148*cdf0e10cSrcweir	 */
149*cdf0e10cSrcweir	long hashBookmark([in]any bookmark) raises (com::sun::star::sdbc::SQLException);
150*cdf0e10cSrcweir};
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir//=============================================================================
153*cdf0e10cSrcweir
154*cdf0e10cSrcweir}; }; }; };
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir/*===========================================================================
157*cdf0e10cSrcweir===========================================================================*/
158*cdf0e10cSrcweir#endif
159