xref: /trunk/main/ucb/source/ucp/file/filrow.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 
52         virtual void SAL_CALL
53         acquire(
54             void )
55             throw();
56 
57         virtual void SAL_CALL
58         release(
59             void )
60             throw();
61 
62         // XTypeProvider
63 
64         XTYPEPROVIDER_DECL()
65 
66         virtual sal_Bool SAL_CALL
67         wasNull(
68             void );
69 
70         virtual rtl::OUString SAL_CALL
71         getString(
72             sal_Int32 columnIndex );
73 
74         virtual sal_Bool SAL_CALL
75         getBoolean(
76             sal_Int32 columnIndex );
77 
78         virtual sal_Int8 SAL_CALL
79         getByte(
80             sal_Int32 columnIndex );
81 
82         virtual sal_Int16 SAL_CALL
83         getShort(
84             sal_Int32 columnIndex );
85 
86         virtual sal_Int32 SAL_CALL
87         getInt(
88             sal_Int32 columnIndex );
89 
90         virtual sal_Int64 SAL_CALL
91         getLong(
92             sal_Int32 columnIndex );
93 
94         virtual float SAL_CALL
95         getFloat(
96             sal_Int32 columnIndex );
97 
98         virtual double SAL_CALL
99         getDouble(
100             sal_Int32 columnIndex );
101 
102         virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
103         getBytes(
104             sal_Int32 columnIndex );
105 
106         virtual com::sun::star::util::Date SAL_CALL
107         getDate(
108             sal_Int32 columnIndex );
109 
110         virtual com::sun::star::util::Time SAL_CALL
111         getTime(
112             sal_Int32 columnIndex );
113 
114         virtual com::sun::star::util::DateTime SAL_CALL
115         getTimestamp(
116             sal_Int32 columnIndex );
117 
118         virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
119         getBinaryStream(
120             sal_Int32 columnIndex );
121 
122         virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL
123         getCharacterStream(
124             sal_Int32 columnIndex );
125 
126         virtual com::sun::star::uno::Any SAL_CALL
127         getObject(
128             sal_Int32 columnIndex,
129             const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& typeMap );
130 
131         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRef > SAL_CALL
132         getRef(
133             sal_Int32 columnIndex );
134 
135         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XBlob > SAL_CALL
136         getBlob(
137             sal_Int32 columnIndex );
138 
139         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XClob > SAL_CALL
140         getClob(
141             sal_Int32 columnIndex );
142 
143         virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XArray > SAL_CALL
144         getArray(
145             sal_Int32 columnIndex );
146 
147     private:
148         osl::Mutex                                                              m_aMutex;
149         com::sun::star::uno::Sequence< com::sun::star::uno::Any >                m_aValueMap;
150         sal_Bool                                                                 m_nWasNull;
151         shell*                                                                   m_pMyShell;
152         com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >  m_xProvider;
153         com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter > m_xTypeConverter;
154     };
155 
156 } // end namespace fileaccess
157 
158 #endif
159