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

#include <tabletree.hxx>

Inheritance diagram for dbaui::OTableTreeListBox:
[legend]
Collaboration diagram for dbaui::OTableTreeListBox:
[legend]

Public Types

typedef std::pair< OUString, bool > TTableViewName
 
typedef std::vector< TTableViewNameTNames
 

Public Member Functions

 OTableTreeListBox (std::unique_ptr< weld::TreeView > xTreeView, bool bShowToggles)
 
void init ()
 
void SuppressEmptyFolders ()
 
bool isFolderEntry (const weld::TreeIter &rEntry) const
 determines whether the given entry denotes a tables folder More...
 
void UpdateTableList (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
 fill the table list with the tables belonging to the connection described by the parameters More...
 
void UpdateTableList (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Sequence< OUString > &_rTables, const css::uno::Sequence< OUString > &_rViews)
 fill the table list with the tables and views determined by the two given containers. More...
 
std::unique_ptr< weld::TreeIteraddedTable (const OUString &_rName)
 to be used if a foreign instance added a table More...
 
void removedTable (const OUString &_rName)
 to be used if a foreign instance removed a table More...
 
std::unique_ptr< weld::TreeItergetAllObjectsEntry () const
 
void checkWildcard (const weld::TreeIter &rEntry)
 does a wildcard check of the given entry More...
 
bool isWildcardChecked (const weld::TreeIter &rEntry)
 determine if the given entry is 'wildcard checked' More...
 
void CheckButtons ()
 
void checkedButton_noBroadcast (const weld::TreeIter &rEntry)
 
void UpdateTableList (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const TNames &_rTables)
 fill the table list with the tables and views determined by the two given containers More...
 
css::sdb::application::NamedDatabaseObject describeObject (const weld::TreeIter &rEntry)
 returns a NamedDatabaseObject record which describes the given entry More...
 
OUString getQualifiedTableName (const weld::TreeIter &rEntry) const
 returns the fully qualified name of a table entry More...
 
std::unique_ptr< weld::TreeItergetEntryByQualifiedName (const OUString &rName)
 
- Public Member Functions inherited from dbaui::TreeListBox
 TreeListBox (std::unique_ptr< weld::TreeView > xTreeView, bool bSQLType)
 
virtual ~TreeListBox ()
 
std::unique_ptr< weld::TreeIterGetEntryPosByName (std::u16string_view rName, const weld::TreeIter *pStart=nullptr, const IEntryFilter *pFilter=nullptr) const
 
std::unique_ptr< weld::TreeIterGetRootLevelParent (const weld::TreeIter *pEntry) const
 
void setControlActionListener (IControlActionListener *pListener)
 
void setContextMenuProvider (IContextMenuProvider *pContextMenuProvider)
 
weld::TreeViewGetWidget ()
 
const weld::TreeViewGetWidget () const
 
TransferDataContainerGetDataTransfer ()
 
sal_Int8 AcceptDrop (const AcceptDropEvent &rEvt)
 
sal_Int8 ExecuteDrop (const ExecuteDropEvent &rEvt)
 
void SetSelChangeHdl (const Link< LinkParamNone *, void > &_rHdl)
 
void setCopyHandler (const Link< LinkParamNone *, void > &_rHdl)
 
void setPasteHandler (const Link< LinkParamNone *, void > &_rHdl)
 
void setDeleteHandler (const Link< LinkParamNone *, void > &_rHdl)
 

Private Member Functions

TriState implDetermineState (const weld::TreeIter &rEntry)
 
void implEmphasize (const weld::TreeIter &rEntry, bool _bChecked, bool _bUpdateDescendants=true, bool _bUpdateAncestors=true)
 
std::unique_ptr< weld::TreeIterimplAddEntry (const css::uno::Reference< css::sdbc::XDatabaseMetaData > &_rxMeta, const OUString &_rTableName, bool _bCheckName=true)
 adds the given entry to our list @precond our image provider must already have been reset to the connection to which the meta data belong. More...
 
void implOnNewConnection (const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
 
bool impl_getAndAssertMetaData (css::uno::Reference< css::sdbc::XDatabaseMetaData > &_out_rMetaData) const
 
bool haveVirtualRoot () const
 

Private Attributes

css::uno::Reference< css::sdbc::XConnection > m_xConnection
 
std::unique_ptr< ImageProvider > m_xImageProvider
 
bool m_bVirtualRoot
 
bool m_bNoEmptyFolders
 
bool m_bShowToggles
 

Additional Inherited Members

- Protected Member Functions inherited from dbaui::TreeListBox
 DECL_LINK (KeyInputHdl, const KeyEvent &, bool)
 
 DECL_LINK (SelectHdl, weld::TreeView &, void)
 
 DECL_LINK (QueryTooltipHdl, const weld::TreeIter &, OUString)
 
 DECL_LINK (CommandHdl, const CommandEvent &, bool)
 
 DECL_LINK (DragBeginHdl, bool &, bool)
 
void implStopSelectionTimer ()
 
void implStartSelectionTimer ()
 
virtual bool DoChildKeyInput (const KeyEvent &rKEvt)
 
- Protected Attributes inherited from dbaui::TreeListBox
std::unique_ptr< weld::TreeViewm_xTreeView
 
TreeListBoxDropTarget m_aDropTargetHelper
 
std::unique_ptr< weld::TreeIterm_xDragedEntry
 
IControlActionListenerm_pActionListener
 
IContextMenuProviderm_pContextMenuProvider
 

Detailed Description

Definition at line 34 of file tabletree.hxx.

Member Typedef Documentation

◆ TNames

Definition at line 50 of file tabletree.hxx.

◆ TTableViewName

typedef std::pair< OUString, bool > dbaui::OTableTreeListBox::TTableViewName

Definition at line 49 of file tabletree.hxx.

Constructor & Destructor Documentation

◆ OTableTreeListBox()

dbaui::OTableTreeListBox::OTableTreeListBox ( std::unique_ptr< weld::TreeView xTreeView,
bool  bShowToggles 
)

Definition at line 55 of file tabletree.cxx.

References weld::Check, m_bShowToggles, and dbaui::TreeListBox::m_xTreeView.

Member Function Documentation

◆ addedTable()

std::unique_ptr< weld::TreeIter > dbaui::OTableTreeListBox::addedTable ( const OUString &  _rName)

to be used if a foreign instance added a table

Definition at line 491 of file tabletree.cxx.

References DBG_UNHANDLED_EXCEPTION, and Exception.

◆ CheckButtons()

void dbaui::OTableTreeListBox::CheckButtons ( )

Definition at line 613 of file tabletree.cxx.

◆ checkedButton_noBroadcast()

void dbaui::OTableTreeListBox::checkedButton_noBroadcast ( const weld::TreeIter rEntry)

Definition at line 295 of file tabletree.cxx.

References m_bShowToggles, dbaui::TreeListBox::m_xTreeView, and TRISTATE_INDET.

Referenced by checkWildcard().

◆ checkWildcard()

void dbaui::OTableTreeListBox::checkWildcard ( const weld::TreeIter rEntry)

does a wildcard check of the given entry

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.

Definition at line 277 of file tabletree.cxx.

References checkedButton_noBroadcast(), m_bShowToggles, dbaui::TreeListBox::m_xTreeView, and TRISTATE_TRUE.

◆ describeObject()

NamedDatabaseObject dbaui::OTableTreeListBox::describeObject ( const weld::TreeIter rEntry)

returns a NamedDatabaseObject record which describes the given entry

Definition at line 466 of file tabletree.cxx.

References dbaccess::TABLE.

Referenced by dbaui::OAppDetailPageHelper::describeCurrentSelectionForType().

◆ getAllObjectsEntry()

std::unique_ptr< weld::TreeIter > dbaui::OTableTreeListBox::getAllObjectsEntry ( ) const

Definition at line 285 of file tabletree.cxx.

References haveVirtualRoot(), and dbaui::TreeListBox::m_xTreeView.

◆ getEntryByQualifiedName()

std::unique_ptr< weld::TreeIter > dbaui::OTableTreeListBox::getEntryByQualifiedName ( const OUString &  rName)

◆ getQualifiedTableName()

OUString dbaui::OTableTreeListBox::getQualifiedTableName ( const weld::TreeIter rEntry) const

returns the fully qualified name of a table entry

Parameters
_pEntrythe entry whose name is to be obtained. Must not denote a folder entry.

Definition at line 514 of file tabletree.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, sCatalog, and sSchema.

Referenced by dbaui::OAppDetailPageHelper::getQualifiedName().

◆ haveVirtualRoot()

bool dbaui::OTableTreeListBox::haveVirtualRoot ( ) const
inlineprivate

Definition at line 126 of file tabletree.hxx.

References m_bVirtualRoot.

Referenced by getAllObjectsEntry().

◆ impl_getAndAssertMetaData()

bool dbaui::OTableTreeListBox::impl_getAndAssertMetaData ( css::uno::Reference< css::sdbc::XDatabaseMetaData > &  _out_rMetaData) const
private

Definition at line 506 of file tabletree.cxx.

References m_xConnection.

◆ implAddEntry()

std::unique_ptr< weld::TreeIter > dbaui::OTableTreeListBox::implAddEntry ( const css::uno::Reference< css::sdbc::XDatabaseMetaData > &  _rxMeta,
const OUString &  _rTableName,
bool  _bCheckName = true 
)
private

adds the given entry to our list @precond our image provider must already have been reset to the connection to which the meta data belong.

Definition at line 376 of file tabletree.cxx.

References qualifiedNameComponents(), sCatalog, sId, sName, sSchema, dbaccess::TABLE, and TRISTATE_FALSE.

◆ implDetermineState()

TriState dbaui::OTableTreeListBox::implDetermineState ( const weld::TreeIter rEntry)
private

Definition at line 628 of file tabletree.cxx.

References TRISTATE_FALSE, TRISTATE_INDET, and TRISTATE_TRUE.

◆ implEmphasize()

void dbaui::OTableTreeListBox::implEmphasize ( const weld::TreeIter rEntry,
bool  _bChecked,
bool  _bUpdateDescendants = true,
bool  _bUpdateAncestors = true 
)
private

Definition at line 343 of file tabletree.cxx.

◆ implOnNewConnection()

void dbaui::OTableTreeListBox::implOnNewConnection ( const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection)
private

Definition at line 74 of file tabletree.cxx.

References m_xConnection, and m_xImageProvider.

◆ init()

void dbaui::OTableTreeListBox::init ( )
inline

Definition at line 47 of file tabletree.hxx.

References m_bVirtualRoot.

◆ isFolderEntry()

bool dbaui::OTableTreeListBox::isFolderEntry ( const weld::TreeIter rEntry) const

determines whether the given entry denotes a tables folder

Definition at line 66 of file tabletree.cxx.

References dbaui::TreeListBox::m_xTreeView.

◆ isWildcardChecked()

bool dbaui::OTableTreeListBox::isWildcardChecked ( const weld::TreeIter rEntry)

determine if the given entry is 'wildcard checked'

See also
checkWildcard

Definition at line 272 of file tabletree.cxx.

References dbaui::TreeListBox::m_xTreeView.

◆ removedTable()

void dbaui::OTableTreeListBox::removedTable ( const OUString &  _rName)

to be used if a foreign instance removed a table

Definition at line 599 of file tabletree.cxx.

References DBG_UNHANDLED_EXCEPTION, and Exception.

◆ SuppressEmptyFolders()

void dbaui::OTableTreeListBox::SuppressEmptyFolders ( )
inline

Definition at line 52 of file tabletree.hxx.

References m_bNoEmptyFolders.

◆ UpdateTableList() [1/3]

void dbaui::OTableTreeListBox::UpdateTableList ( const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection)

fill the table list with the tables belonging to the connection described by the parameters

Parameters
_rxConnectionthe connection, which must support the service com.sun.star.sdb.Connection
Exceptions
<typescope="css::sdbc">SQLException</type> if no connection could be created

◆ UpdateTableList() [2/3]

void dbaui::OTableTreeListBox::UpdateTableList ( const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection,
const css::uno::Sequence< OUString > &  _rTables,
const css::uno::Sequence< OUString > &  _rViews 
)

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.

Parameters
_rxConnectionthe connection where you got the object names from. Must not be NULL. Used to split the full qualified names into its parts.
_rTablestable/view sequence
_rViewsview sequence

◆ UpdateTableList() [3/3]

void dbaui::OTableTreeListBox::UpdateTableList ( const css::uno::Reference< css::sdbc::XConnection > &  _rxConnection,
const TNames _rTables 
)

fill the table list with the tables and views determined by the two given containers

Parameters
_rxConnectionthe connection where you got the object names from. Must not be NULL. Used to split the full qualified names into its parts.
_rTablestable/view sequence, the second argument is <TRUE> if it is a table, otherwise it is a view.

Member Data Documentation

◆ m_bNoEmptyFolders

bool dbaui::OTableTreeListBox::m_bNoEmptyFolders
private

Definition at line 41 of file tabletree.hxx.

Referenced by SuppressEmptyFolders().

◆ m_bShowToggles

bool dbaui::OTableTreeListBox::m_bShowToggles
private

Definition at line 42 of file tabletree.hxx.

Referenced by checkedButton_noBroadcast(), checkWildcard(), and OTableTreeListBox().

◆ m_bVirtualRoot

bool dbaui::OTableTreeListBox::m_bVirtualRoot
private

Definition at line 40 of file tabletree.hxx.

Referenced by haveVirtualRoot(), and init().

◆ m_xConnection

css::uno::Reference< css::sdbc::XConnection > dbaui::OTableTreeListBox::m_xConnection
private

Definition at line 37 of file tabletree.hxx.

Referenced by implOnNewConnection().

◆ m_xImageProvider

std::unique_ptr< ImageProvider > dbaui::OTableTreeListBox::m_xImageProvider
private

Definition at line 39 of file tabletree.hxx.

Referenced by implOnNewConnection().


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