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 .
22 #include <com/sun/star/graphic/XGraphic.hpp>
23 #include <com/sun/star/sdbc/XConnection.hpp>
30 struct ImageProvider_Data
;
31 /** provides images for database objects such as tables, queries, forms, reports ...
33 At the moment, this class cares for small icons only, that is, icons which can be used
34 in a tree control. On the medium term, we should extend it with support for different-sized
40 std::shared_ptr
< ImageProvider_Data
> m_pData
;
43 /** creates a semi-functional ImageProvider instance
45 The resulting instance is not able to provide any concrete object images,
46 but only default images.
50 /** creates an ImageProvider instance
53 denotes the connection to work for. Must not be <NULL/>.
56 const css::uno::Reference
< css::sdbc::XConnection
>& _rxConnection
59 /** returns the image to be used for a database object with the given name
61 @param _nDatabaseObjectType
62 the type of the object. Must be one of the css.sdb.application.DatabaseObject
65 the name of the object
67 the name of the image to be used for the object.
70 const OUString
& _rName
,
71 const sal_Int32 _nDatabaseObjectType
74 // check whether the connection can give us an icon
75 css::uno::Reference
<css::graphic::XGraphic
> getXGraphic(const OUString
& _rName
,
76 const sal_Int32 _nDatabaseObjectType
);
78 /** returns the resource ID for the default image to be used for a database object
80 In opposite to getImageId, this method does not check the concrete object
81 for its image, but returns a default image to be used for all objects of the given
84 @param _nDatabaseObjectType
85 the type of the object. Must be one of the css.sdb.application.DatabaseObject
88 the resource image name to be used for the object type.
90 static OUString
getDefaultImageResourceID(sal_Int32 _nDatabaseObjectType
);
92 static OUString
getFolderImageId(
93 sal_Int32 _nDatabaseObjectType
96 /** retrieves the image to be used for a database as a whole.
98 the image to be used for folders of this type
100 static OUString
getDatabaseImage();
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */