merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / imageprovider.hxx
blob4d4aa78e9e833f5774a4ff656adecb47691f3e95
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imageprovider.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBACCESS_IMAGEPROVIDER_HXX
32 #define DBACCESS_IMAGEPROVIDER_HXX
34 #ifndef _SV_IMAGE_HXX
35 #include <vcl/image.hxx>
36 #endif
38 /** === begin UNO includes === **/
39 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
40 #include <com/sun/star/sdbc/XConnection.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_SDB_APPLICATION_DATABASEOBJECT_HPP_
43 #include <com/sun/star/sdb/application/DatabaseObject.hpp>
44 #endif
45 /** === end UNO includes === **/
47 #include <boost/shared_ptr.hpp>
49 //........................................................................
50 namespace dbaui
52 //........................................................................
54 // for convenience of our clients
55 namespace DatabaseObject = ::com::sun::star::sdb::application::DatabaseObject;
57 //====================================================================
58 //= ImageProvider
59 //====================================================================
60 struct ImageProvider_Data;
61 /** provides images for database objects such as tables, queries, forms, reports ...
63 At the moment, this class cares for small icons only, that is, icons which can be used
64 in a tree control. On the medium term, we should extend it with support for different-sized
65 icons.
67 class ImageProvider
69 private:
70 ::boost::shared_ptr< ImageProvider_Data > m_pData;
72 public:
73 /** creates a semi-functional ImageProvider instance
75 The resulting instance is not able to provide any concrete object images,
76 but only default images.
78 ImageProvider();
80 /** creates an ImageProvider instance
82 @param _rxConnection
83 denotes the connection to work for. Must not be <NULL/>.
85 ImageProvider(
86 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection
89 /** returns the image to be used for a database object with the given name
91 @param _nDatabaseObjectType
92 the type of the object. Must be one of the css.sdb.application.DatabaseObject
93 constants.
94 @param _rName
95 the name of the object
96 @param _out_rImage
97 the normal image to use for the object
98 @param _out_rImageHC
99 the high-contrast version of the image to use for the object
100 @return
101 the image to be used for the object.
103 void getImages(
104 const String& _rName,
105 const sal_Int32 _nDatabaseObjectType,
106 Image& _out_rImage,
107 Image& _out_rImageHC
110 /** returns the default image to be used for a database object
112 In opposite to getImages, this method does not check the concrete object
113 for its image, but returns a default image to be used for all objects of the given
114 type.
116 @param _nDatabaseObjectType
117 the type of the object. Must be one of the css.sdb.application.DatabaseObject
118 constants.
119 @param _bHighContrast
120 indicates whether High-Contrast icons should be used.
121 Note that normally, this would be some application-wide setting. However,
122 in current OOo, HC support is decided on a per-control basis, means every
123 control decides itself whether its images must be HC versions or not.
124 Thus callers need to specify this flag.
125 @return
126 the image to be used for the object type.
128 Image getDefaultImage(
129 sal_Int32 _nDatabaseObjectType,
130 bool _bHighContrast
133 /** returns the resource ID for the default image to be used for a database object
135 In opposite to getImages, this method does not check the concrete object
136 for its image, but returns a default image to be used for all objects of the given
137 type.
139 @param _nDatabaseObjectType
140 the type of the object. Must be one of the css.sdb.application.DatabaseObject
141 constants.
142 @param _bHighContrast
143 indicates whether High-Contrast icons should be used.
144 Note that normally, this would be some application-wide setting. However,
145 in current OOo, HC support is decided on a per-control basis, means every
146 control decides itself whether its images must be HC versions or not.
147 Thus callers need to specify this flag.
148 @return
149 the resource ID image to be used for the object type. Must be fed into a
150 ModuleRes instance to actually load the image.
152 USHORT getDefaultImageResourceID(
153 sal_Int32 _nDatabaseObjectType,
154 bool _bHighContrast
157 /** retrieves the image to be used for folders of database objects
158 @param _nDatabaseObjectType
159 the type of the object. Must be one of the css.sdb.application.DatabaseObject
160 constants.
161 @param _rName
162 the name of the object
163 @param _bHighContrast
164 indicates whether High-Contrast icons should be used.
165 Note that normally, this would be some application-wide setting. However,
166 in current OOo, HC support is decided on a per-control basis, means every
167 control decides itself whether its images must be HC versions or not.
168 Thus callers need to specify this flag.
169 @return
170 the image to be used for folders of the given type
172 Image getFolderImage(
173 sal_Int32 _nDatabaseObjectType,
174 bool _bHighContrast
177 /** retrieves the image to be used for a database as a whole.
178 @param _bHighContrast
179 indicates whether High-Contrast icons should be used.
180 Note that normally, this would be some application-wide setting. However,
181 in current OOo, HC support is decided on a per-control basis, means every
182 control decides itself whether its images must be HC versions or not.
183 Thus callers need to specify this flag.
184 @return
185 the image to be used for folders of this type
187 Image getDatabaseImage( bool _bHighContrast );
190 //........................................................................
191 } // namespace dbaui
192 //........................................................................
194 #endif // DBACCESS_IMAGEPROVIDER_HXX