xref: /trunk/main/ucb/source/ucp/file/filrow.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _FILROW_HXX_
28 #define _FILROW_HXX_
29 
30 #include <ucbhelper/macros.hxx>
31 
32 #include "osl/mutex.hxx"
33 #include <cppuhelper/weak.hxx>
34 #include <com/sun/star/sdbc/XRow.hpp>
35 #include <com/sun/star/script/XTypeConverter.hpp>
36 #include <com/sun/star/lang/XTypeProvider.hpp>
37 #include <com/sun/star/ucb/XContentProvider.hpp>
38 
39 namespace fileaccess {
40 
41     class shell;
42 
43     class XRow_impl:
44         public cppu::OWeakObject,
45         public com::sun::star::lang::XTypeProvider,
46         public com::sun::star::sdbc::XRow
47     {
48     public:
49         XRow_impl( shell* pShell,const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& __m_aValueMap );
50         ~XRow_impl();
51 
52         virtual com::sun::star::uno::Any SAL_CALL
53         queryInterface(
54             const com::sun::star::uno::Type& aType )
55             throw( com::sun::star::uno::RuntimeException);
56 
57         virtual void SAL_CALL
58         acquire(
59             void )
60             throw();
61 
62         virtual void SAL_CALL
63         release(
64             void )
65             throw();
66 
67         // XTypeProvider
68 
69         XTYPEPROVIDER_DECL()
70 
71         virtual sal_Bool SAL_CALL
72         wasNull(
73             void )
74             throw( com::sun::star::sdbc::SQLException,
75                    com::sun::star::uno::RuntimeException );
76 
77         virtual rtl::OUString SAL_CALL
78         getString(
79             sal_Int32 columnIndex )
80             throw( com::sun::star::sdbc::SQLException,
81                    com::sun::star::uno::RuntimeException);
82 
83         virtual sal_Bool SAL_CALL
84         getBoolean(
85             sal_Int32 columnIndex )
86             throw( com::sun::star::sdbc::SQLException,
87                    com::sun::star::uno::RuntimeException);
88 
89         virtual sal_Int8 SAL_CALL
90         getByte(
91             sal_Int32 columnIndex )
92             throw( com::sun::star::sdbc::SQLException,
93                    com::sun::star::uno::RuntimeException);
94 
95         virtual sal_Int16 SAL_CALL
96         getShort(
97             sal_Int32 columnIndex )
98             throw(
99                 com::sun::star::sdbc::SQLException,
100                 com::sun::star::uno::RuntimeException );
101 
102         virtual sal_Int32 SAL_CALL
103         getInt(
104             sal_Int32 columnIndex )
105             throw( com::sun::star::sdbc::SQLException,
106                    com::sun::star::uno::RuntimeException );
107 
108         virtual sal_Int64 SAL_CALL
109         getLong(
110             sal_Int32 columnIndex )
111             throw( com::sun::star::sdbc::SQLException,
112                    com::sun::star::uno::RuntimeException );
113 
114         virtual float SAL_CALL
115         getFloat(
116             sal_Int32 columnIndex )
117             throw( com::sun::star::sdbc::SQLException,
118                    com::sun::star::uno::RuntimeException);
119 
120         virtual double SAL_CALL
121         getDouble(
122             sal_Int32 columnIndex )
123             throw( com::sun::star::sdbc::SQLException,
124                    com::sun::star::uno::RuntimeException);
125 
126         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
127         getBytes(
128             sal_Int32 columnIndex )
129             throw( com::sun::star::sdbc::SQLException,
130                    com::sun::star::uno::RuntimeException);
131 
132         virtual com::sun::star::util::Date SAL_CALL
133         getDate(
134             sal_Int32 columnIndex )
135             throw( com::sun::star::sdbc::SQLException,
136                    com::sun::star::uno::RuntimeException);
137 
138         virtual com::sun::star::util::Time SAL_CALL
139         getTime(
140             sal_Int32 columnIndex )
141             throw( com::sun::star::sdbc::SQLException,
142                    com::sun::star::uno::RuntimeException);
143 
144         virtual com::sun::star::util::DateTime SAL_CALL
145         getTimestamp(
146             sal_Int32 columnIndex )
147             throw( com::sun::star::sdbc::SQLException,
148                    com::sun::star::uno::RuntimeException);
149 
150         virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
151         getBinaryStream(
152             sal_Int32 columnIndex )
153             throw( com::sun::star::sdbc::SQLException,
154                    com::sun::star::uno::RuntimeException);
155 
156         virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
157         getCharacterStream(
158             sal_Int32 columnIndex )
159             throw( com::sun::star::sdbc::SQLException,
160                    com::sun::star::uno::RuntimeException);
161 
162         virtual com::sun::star::uno::Any SAL_CALL
163         getObject(
164             sal_Int32 columnIndex,
165             const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& typeMap )
166             throw( com::sun::star::sdbc::SQLException,
167                    com::sun::star::uno::RuntimeException);
168 
169         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRef > SAL_CALL
170         getRef(
171             sal_Int32 columnIndex )
172             throw( com::sun::star::sdbc::SQLException,
173                    com::sun::star::uno::RuntimeException);
174 
175         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XBlob > SAL_CALL
176         getBlob(
177             sal_Int32 columnIndex )
178             throw( com::sun::star::sdbc::SQLException,
179                    com::sun::star::uno::RuntimeException);
180 
181         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XClob > SAL_CALL
182         getClob(
183             sal_Int32 columnIndex )
184             throw( com::sun::star::sdbc::SQLException,
185                    com::sun::star::uno::RuntimeException);
186 
187         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XArray > SAL_CALL
188         getArray(
189             sal_Int32 columnIndex )
190             throw( com::sun::star::sdbc::SQLException,
191                    com::sun::star::uno::RuntimeException);
192 
193     private:
194         osl::Mutex                                                              m_aMutex;
195         com::sun::star::uno::Sequence< com::sun::star::uno::Any >                m_aValueMap;
196         sal_Bool                                                                 m_nWasNull;
197         shell*                                                                   m_pMyShell;
198         com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >  m_xProvider;
199         com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > m_xTypeConverter;
200     };
201 
202 } // end namespace fileaccess
203 
204 #endif
205