1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX
23 #include <vcl/image.hxx>
25 #include <com/sun/star/sdbc/XConnection.hpp>
26 #include <com/sun/star/sdb/application/DatabaseObject.hpp>
33 struct ImageProvider_Data
;
34 /** provides images for database objects such as tables, queries, forms, reports ...
36 At the moment, this class cares for small icons only, that is, icons which can be used
37 in a tree control. On the medium term, we should extend it with support for different-sized
43 std::shared_ptr
< ImageProvider_Data
> m_pData
;
46 /** creates a semi-functional ImageProvider instance
48 The resulting instance is not able to provide any concrete object images,
49 but only default images.
53 /** creates an ImageProvider instance
56 denotes the connection to work for. Must not be <NULL/>.
59 const css::uno::Reference
< css::sdbc::XConnection
>& _rxConnection
62 /** returns the image to be used for a database object with the given name
64 @param _nDatabaseObjectType
65 the type of the object. Must be one of the css.sdb.application.DatabaseObject
68 the name of the object
70 the normal image to use for the object
72 the image to be used for the object.
75 const OUString
& _rName
,
76 const sal_Int32 _nDatabaseObjectType
,
80 /** returns the default image to be used for a database object
82 In opposite to getImages, this method does not check the concrete object
83 for its image, but returns a default image to be used for all objects of the given
86 @param _nDatabaseObjectType
87 the type of the object. Must be one of the css.sdb.application.DatabaseObject
90 the image to be used for the object type.
92 static Image
getDefaultImage(
93 sal_Int32 _nDatabaseObjectType
96 /** returns the resource ID for the default image to be used for a database object
98 In opposite to getImages, this method does not check the concrete object
99 for its image, but returns a default image to be used for all objects of the given
102 @param _nDatabaseObjectType
103 the type of the object. Must be one of the css.sdb.application.DatabaseObject
106 the resource ID image to be used for the object type. Must be fed into a
107 ModuleRes instance to actually load the image.
109 static sal_uInt16
getDefaultImageResourceID(
110 sal_Int32 _nDatabaseObjectType
113 /** retrieves the image to be used for folders of database objects
114 @param _nDatabaseObjectType
115 the type of the object. Must be one of the css.sdb.application.DatabaseObject
118 the name of the object
120 the image to be used for folders of the given type
122 static Image
getFolderImage(
123 sal_Int32 _nDatabaseObjectType
126 /** retrieves the image to be used for a database as a whole.
128 the image to be used for folders of this type
130 static Image
getDatabaseImage();
135 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_IMAGEPROVIDER_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */