Files
libreoffice/dbaccess/source/ui/inc/tabletree.hxx

183 lines
7.6 KiB
C++
Raw Normal View History

2000-10-05 09:09:48 +00:00
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
2000-10-05 09:09:48 +00:00
*
* $RCSfile: tabletree.hxx,v $
2000-10-05 09:09:48 +00:00
*
* $Revision: 1.14 $
2000-10-05 09:09:48 +00:00
*
* last change: $Author: rt $ $Date: 2005-09-08 16:04:35 $
2000-10-05 09:09:48 +00:00
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
2000-10-05 09:09:48 +00:00
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
2000-10-05 09:09:48 +00:00
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
2000-10-05 09:09:48 +00:00
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
2000-10-05 09:09:48 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
2000-10-05 09:09:48 +00:00
*
************************************************************************/
#ifndef _DBAUI_TABLETREE_HXX_
#define _DBAUI_TABLETREE_HXX_
#ifndef _DBAUI_MARKTREE_HXX_
#include "marktree.hxx"
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
#include <com/sun/star/beans/PropertyValue.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XDRIVER_HPP_
#include <com/sun/star/sdbc/XDriver.hpp>
#endif
2000-10-05 09:09:48 +00:00
//.........................................................................
namespace dbaui
{
//.........................................................................
//========================================================================
//= OTableTreeListBox
//========================================================================
class OTableTreeListBox : public OMarkableTreeListBox
{
protected:
Image m_aTableImage;
Image m_aViewImage;
2001-08-14 11:00:23 +00:00
sal_Bool m_bVirtualRoot; // should the first entry be visible
2000-10-05 09:09:48 +00:00
public:
OTableTreeListBox( Window* pParent
,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
,sal_Bool _bHiContrast,WinBits nWinStyle = NULL,sal_Bool _bVirtualRoot=sal_True );
OTableTreeListBox( Window* pParent
,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
, const ResId& rResId,sal_Bool _bHiContrast,sal_Bool _bVirtualRoot=sal_True );
typedef ::std::pair< ::rtl::OUString,sal_Bool> TTableViewName;
typedef ::std::vector< TTableViewName > TNames;
2002-04-29 07:19:08 +00:00
/** call when HiContrast change.
*/
virtual void notifyHiContrastChanged();
2000-10-05 09:09:48 +00:00
/** fill the table list with the tables belonging to the connection described by the parameters
@param _xConnection
the connection, which must support the service com.sun.star.sdb.Connection
@throws
<type scope="com::sun::star::sdbc">SQLException</type> if no connection could be created
2000-10-05 09:09:48 +00:00
*/
void
2001-08-14 11:00:23 +00:00
UpdateTableList(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection
2001-08-14 11:00:23 +00:00
) throw(::com::sun::star::sdbc::SQLException);
2000-10-05 09:09:48 +00:00
/** fill the table list with the tables and views determined by the two given containers.
The views sequence is used to determine which table is of type view.
2000-10-05 09:09:48 +00:00
@param _rxConnMetaData meta data describing the connection where you got the object names from. Must not be NULL.
Used to split the full qualified names into it's parts.
@param _rTables table/view sequence
@param _rViews view sequence
2000-10-05 09:09:48 +00:00
*/
2001-08-14 11:00:23 +00:00
void UpdateTableList(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxConnMetaData,
const ::com::sun::star::uno::Sequence< ::rtl::OUString>& _rTables,
const ::com::sun::star::uno::Sequence< ::rtl::OUString>& _rViews
2001-08-14 11:00:23 +00:00
);
/** to be used if a foreign instance added a table
*/
SvLBoxEntry* addedTable(
2001-08-14 11:00:23 +00:00
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn,
const ::rtl::OUString& _rName,
const ::com::sun::star::uno::Any& _rObject
);
/** to be used if a foreign instance removed a table
*/
void removedTable(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn,
const ::rtl::OUString& _rName
);
2000-10-05 09:09:48 +00:00
SvLBoxEntry* getEntryByQualifiedName(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn,
const ::rtl::OUString& _rName
);
2001-01-30 07:29:43 +00:00
SvLBoxEntry* getAllObjectsEntry() const;
/** does a wildcard check of the given entry
<p>There are two different 'checked' states: If the user checks all children of an entry, this is different
from checking the entry itself. The second is called 'wildcard' checking, 'cause in the resulting
table filter it's represented by a wildcard.</p>
*/
void checkWildcard(SvLBoxEntry* _pEntry);
/** determine if the given entry is 'wildcard checked'
@see checkWildcard
*/
sal_Bool isWildcardChecked(SvLBoxEntry* _pEntry) const;
2000-10-05 09:09:48 +00:00
protected:
2001-01-30 07:29:43 +00:00
virtual void InitEntry(SvLBoxEntry* _pEntry, const XubString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap);
virtual void checkedButton_noBroadcast(SvLBoxEntry* _pEntry);
void implEmphasize(SvLBoxEntry* _pEntry, sal_Bool _bChecked, sal_Bool _bUpdateDescendants = sal_True, sal_Bool _bUpdateAncestors = sal_True);
2001-08-14 11:00:23 +00:00
SvLBoxEntry* implAddEntry(
2001-08-14 11:00:23 +00:00
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxConnMetaData,
const ::rtl::OUString& _rTableName,
const Image& _rImage,
2002-04-29 07:19:08 +00:00
SvLBoxEntry* _pParentEntry,
sal_Int32 _nType,
sal_Bool _bCheckName = sal_True
2001-08-14 11:00:23 +00:00
);
sal_Bool haveVirtualRoot() const { return m_bVirtualRoot; }
/** fill the table list with the tables and views determined by the two given containers
@param _rxConnMetaData meta data describing the connection where you got the object names from. Must not be NULL.
Used to split the full qualified names into it's parts.
@param _rTables table/view sequence, the second argument is <TRUE/> if it is a table, otherwise it is a view.
*/
void UpdateTableList(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxConnMetaData,
const TNames& _rTables
);
2000-10-05 09:09:48 +00:00
};
//.........................................................................
} // namespace dbaui
//.........................................................................
#endif // _DBAUI_TABLETREE_HXX_