LibreOffice Module dbaccess (master) 1
imageprovider.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/graphic/XGraphic.hpp>
23#include <com/sun/star/sdbc/XConnection.hpp>
24
25namespace com::sun::star::sdb::application { class XTableUIProvider; }
26
27namespace dbaui
28{
35 class ImageProvider
36 {
37 public:
44
51 const css::uno::Reference< css::sdbc::XConnection >& _rxConnection
52 );
53
64 OUString getImageId(
65 const OUString& _rName,
66 const sal_Int32 _nDatabaseObjectType
67 );
68
69 // check whether the connection can give us an icon
70 css::uno::Reference<css::graphic::XGraphic> getXGraphic(const OUString& _rName,
71 const sal_Int32 _nDatabaseObjectType);
72
85 static OUString getDefaultImageResourceID(sal_Int32 _nDatabaseObjectType);
86
87 static OUString getFolderImageId(
88 sal_Int32 _nDatabaseObjectType
89 );
90
95 static OUString getDatabaseImage();
96 private:
98 css::uno::Reference< css::sdbc::XConnection > mxConnection;
100 css::uno::Reference< css::container::XNameAccess > mxViews;
102 css::uno::Reference< css::sdb::application::XTableUIProvider > mxTableUI;
103 };
104
105} // namespace dbaui
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OUString getFolderImageId(sal_Int32 _nDatabaseObjectType)
css::uno::Reference< css::graphic::XGraphic > getXGraphic(const OUString &_rName, const sal_Int32 _nDatabaseObjectType)
css::uno::Reference< css::sdbc::XConnection > mxConnection
the connection we work with
ImageProvider()
creates a semi-functional ImageProvider instance
css::uno::Reference< css::sdb::application::XTableUIProvider > mxTableUI
interface for providing table's UI
static OUString getDatabaseImage()
retrieves the image to be used for a database as a whole.
static OUString getDefaultImageResourceID(sal_Int32 _nDatabaseObjectType)
returns the resource ID for the default image to be used for a database object
css::uno::Reference< css::container::XNameAccess > mxViews
the views of the connection, if the DB supports views
OUString getImageId(const OUString &_rName, const sal_Int32 _nDatabaseObjectType)
returns the image to be used for a database object with the given name
ImageProvider(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
creates an ImageProvider instance