LibreOffice Module dbaccess (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
dbaui::ImageProvider Class Reference

provides images for database objects such as tables, queries, forms, reports ... More...

#include <imageprovider.hxx>

Public Member Functions

 ImageProvider ()
 creates a semi-functional ImageProvider instance More...
 
 ImageProvider (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
 creates an ImageProvider instance More...
 
OUString getImageId (const OUString &_rName, const sal_Int32 _nDatabaseObjectType)
 returns the image to be used for a database object with the given name More...
 
css::uno::Reference< css::graphic::XGraphic > getXGraphic (const OUString &_rName, const sal_Int32 _nDatabaseObjectType)
 

Static Public Member Functions

static OUString getDefaultImageResourceID (sal_Int32 _nDatabaseObjectType)
 returns the resource ID for the default image to be used for a database object More...
 
static OUString getFolderImageId (sal_Int32 _nDatabaseObjectType)
 
static OUString getDatabaseImage ()
 retrieves the image to be used for a database as a whole. More...
 

Private Attributes

css::uno::Reference< css::sdbc::XConnection > mxConnection
 the connection we work with More...
 
css::uno::Reference< css::container::XNameAccess > mxViews
 the views of the connection, if the DB supports views More...
 
css::uno::Reference< css::sdb::application::XTableUIProvider > mxTableUI
 interface for providing table's UI More...
 

Detailed Description

provides images for database objects such as tables, queries, forms, reports ...

At the moment, this class cares for small icons only, that is, icons which can be used in a tree control. On the medium term, we should extend it with support for different-sized icons.

Definition at line 35 of file imageprovider.hxx.

Constructor & Destructor Documentation

◆ ImageProvider() [1/2]

dbaui::ImageProvider::ImageProvider ( )

creates a semi-functional ImageProvider instance

The resulting instance is not able to provide any concrete object images, but only default images.

Definition at line 88 of file imageprovider.cxx.

◆ ImageProvider() [2/2]

dbaui::ImageProvider::ImageProvider ( const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection)

creates an ImageProvider instance

Parameters
_rxConnectiondenotes the connection to work for. Must not be <NULL>.

References getDatabaseImage(), getDefaultImageResourceID(), getFolderImageId(), getImageId(), and getXGraphic().

Member Function Documentation

◆ getDatabaseImage()

OUString dbaui::ImageProvider::getDatabaseImage ( )
static

retrieves the image to be used for a database as a whole.

Returns
the image to be used for folders of this type

Definition at line 185 of file imageprovider.cxx.

Referenced by ImageProvider().

◆ getDefaultImageResourceID()

OUString dbaui::ImageProvider::getDefaultImageResourceID ( sal_Int32  _nDatabaseObjectType)
static

returns the resource ID for the default image to be used for a database object

In opposite to getImageId, this method does not check the concrete object for its image, but returns a default image to be used for all objects of the given type.

Parameters
_nDatabaseObjectTypethe type of the object. Must be one of the css.sdb.application.DatabaseObject constants.
Returns
the resource image name to be used for the object type.

Definition at line 136 of file imageprovider.cxx.

References dbaccess::QUERY, dbaccess::REPORT, and dbaccess::TABLE.

Referenced by ImageProvider().

◆ getFolderImageId()

OUString dbaui::ImageProvider::getFolderImageId ( sal_Int32  _nDatabaseObjectType)
static

Definition at line 160 of file imageprovider.cxx.

References dbaccess::QUERY, dbaccess::REPORT, and dbaccess::TABLE.

Referenced by ImageProvider().

◆ getImageId()

OUString dbaui::ImageProvider::getImageId ( const OUString &  _rName,
const sal_Int32  _nDatabaseObjectType 
)

returns the image to be used for a database object with the given name

Parameters
_nDatabaseObjectTypethe type of the object. Must be one of the css.sdb.application.DatabaseObject constants.
_rNamethe name of the object
Returns
the name of the image to be used for the object.

Definition at line 109 of file imageprovider.cxx.

References dbaccess::TABLE.

Referenced by ImageProvider().

◆ getXGraphic()

Reference< XGraphic > dbaui::ImageProvider::getXGraphic ( const OUString &  _rName,
const sal_Int32  _nDatabaseObjectType 
)

Definition at line 125 of file imageprovider.cxx.

References dbaccess::TABLE.

Referenced by ImageProvider().

Member Data Documentation

◆ mxConnection

css::uno::Reference< css::sdbc::XConnection > dbaui::ImageProvider::mxConnection
private

the connection we work with

Definition at line 98 of file imageprovider.hxx.

◆ mxTableUI

css::uno::Reference< css::sdb::application::XTableUIProvider > dbaui::ImageProvider::mxTableUI
private

interface for providing table's UI

Definition at line 102 of file imageprovider.hxx.

◆ mxViews

css::uno::Reference< css::container::XNameAccess > dbaui::ImageProvider::mxViews
private

the views of the connection, if the DB supports views

Definition at line 100 of file imageprovider.hxx.


The documentation for this class was generated from the following files: