xref: /aoo4110/main/ucb/source/ucp/file/filrow.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _FILROW_HXX_
24 #define _FILROW_HXX_
25 
26 #include <ucbhelper/macros.hxx>
27 
28 #include "osl/mutex.hxx"
29 #include <cppuhelper/weak.hxx>
30 #include <com/sun/star/sdbc/XRow.hpp>
31 #include <com/sun/star/script/XTypeConverter.hpp>
32 #include <com/sun/star/lang/XTypeProvider.hpp>
33 #include <com/sun/star/ucb/XContentProvider.hpp>
34 
35 namespace fileaccess {
36 
37 	class shell;
38 
39 	class XRow_impl:
40 		public cppu::OWeakObject,
41 		public com::sun::star::lang::XTypeProvider,
42 		public com::sun::star::sdbc::XRow
43 	{
44 	public:
45 		XRow_impl( shell* pShell,const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& __m_aValueMap );
46 		~XRow_impl();
47 
48 		virtual com::sun::star::uno::Any SAL_CALL
49 		queryInterface(
50 			const com::sun::star::uno::Type& aType )
51 			throw( com::sun::star::uno::RuntimeException);
52 
53 		virtual void SAL_CALL
54 		acquire(
55 			void )
56 			throw();
57 
58 		virtual void SAL_CALL
59 		release(
60 			void )
61 			throw();
62 
63 		// XTypeProvider
64 
65 		XTYPEPROVIDER_DECL()
66 
67 		virtual sal_Bool SAL_CALL
68 		wasNull(
69 			void )
70 			throw( com::sun::star::sdbc::SQLException,
71 				   com::sun::star::uno::RuntimeException );
72 
73 		virtual rtl::OUString SAL_CALL
74 		getString(
75 			sal_Int32 columnIndex )
76 			throw( com::sun::star::sdbc::SQLException,
77 				   com::sun::star::uno::RuntimeException);
78 
79 		virtual sal_Bool SAL_CALL
80 		getBoolean(
81 			sal_Int32 columnIndex )
82 			throw( com::sun::star::sdbc::SQLException,
83 				   com::sun::star::uno::RuntimeException);
84 
85 		virtual sal_Int8 SAL_CALL
86 		getByte(
87 			sal_Int32 columnIndex )
88 			throw( com::sun::star::sdbc::SQLException,
89 				   com::sun::star::uno::RuntimeException);
90 
91 		virtual sal_Int16 SAL_CALL
92 		getShort(
93 			sal_Int32 columnIndex )
94 			throw(
95 				com::sun::star::sdbc::SQLException,
96 				com::sun::star::uno::RuntimeException );
97 
98 		virtual sal_Int32 SAL_CALL
99 		getInt(
100 			sal_Int32 columnIndex )
101 			throw( com::sun::star::sdbc::SQLException,
102 				   com::sun::star::uno::RuntimeException );
103 
104 		virtual sal_Int64 SAL_CALL
105 		getLong(
106 			sal_Int32 columnIndex )
107 			throw( com::sun::star::sdbc::SQLException,
108 				   com::sun::star::uno::RuntimeException );
109 
110 		virtual float SAL_CALL
111 		getFloat(
112 			sal_Int32 columnIndex )
113 			throw( com::sun::star::sdbc::SQLException,
114 				   com::sun::star::uno::RuntimeException);
115 
116 		virtual double SAL_CALL
117 		getDouble(
118 			sal_Int32 columnIndex )
119 			throw( com::sun::star::sdbc::SQLException,
120 				   com::sun::star::uno::RuntimeException);
121 
122 		virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
123 		getBytes(
124 			sal_Int32 columnIndex )
125 			throw( com::sun::star::sdbc::SQLException,
126 				   com::sun::star::uno::RuntimeException);
127 
128 		virtual com::sun::star::util::Date SAL_CALL
129 		getDate(
130 			sal_Int32 columnIndex )
131 			throw( com::sun::star::sdbc::SQLException,
132 				   com::sun::star::uno::RuntimeException);
133 
134 		virtual com::sun::star::util::Time SAL_CALL
135 		getTime(
136 			sal_Int32 columnIndex )
137 			throw( com::sun::star::sdbc::SQLException,
138 				   com::sun::star::uno::RuntimeException);
139 
140 		virtual com::sun::star::util::DateTime SAL_CALL
141 		getTimestamp(
142 			sal_Int32 columnIndex )
143 			throw( com::sun::star::sdbc::SQLException,
144 				   com::sun::star::uno::RuntimeException);
145 
146 		virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
147 		getBinaryStream(
148 			sal_Int32 columnIndex )
149 			throw( com::sun::star::sdbc::SQLException,
150 				   com::sun::star::uno::RuntimeException);
151 
152 		virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
153 		getCharacterStream(
154 			sal_Int32 columnIndex )
155 			throw( com::sun::star::sdbc::SQLException,
156 				   com::sun::star::uno::RuntimeException);
157 
158 		virtual com::sun::star::uno::Any SAL_CALL
159 		getObject(
160 			sal_Int32 columnIndex,
161 			const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& typeMap )
162 			throw( com::sun::star::sdbc::SQLException,
163 				   com::sun::star::uno::RuntimeException);
164 
165 		virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRef > SAL_CALL
166 		getRef(
167 			sal_Int32 columnIndex )
168 			throw( com::sun::star::sdbc::SQLException,
169 				   com::sun::star::uno::RuntimeException);
170 
171 		virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XBlob > SAL_CALL
172 		getBlob(
173 			sal_Int32 columnIndex )
174 			throw( com::sun::star::sdbc::SQLException,
175 				   com::sun::star::uno::RuntimeException);
176 
177 		virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XClob > SAL_CALL
178 		getClob(
179 			sal_Int32 columnIndex )
180 			throw( com::sun::star::sdbc::SQLException,
181 				   com::sun::star::uno::RuntimeException);
182 
183 		virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XArray > SAL_CALL
184 		getArray(
185 			sal_Int32 columnIndex )
186 			throw( com::sun::star::sdbc::SQLException,
187 				   com::sun::star::uno::RuntimeException);
188 
189 	private:
190 		osl::Mutex                                                              m_aMutex;
191 		com::sun::star::uno::Sequence< com::sun::star::uno::Any >                m_aValueMap;
192 		sal_Bool                                                                 m_nWasNull;
193 		shell*                                                                   m_pMyShell;
194 		com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >  m_xProvider;
195 		com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > m_xTypeConverter;
196 	};
197 
198 } // end namespace fileaccess
199 
200 #endif
201