summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/inc/tabletree.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/inc/tabletree.hxx')
-rw-r--r--dbaccess/source/ui/inc/tabletree.hxx57
1 files changed, 55 insertions, 2 deletions
diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx
index 179fce227f75..97b1ba7cc666 100644
--- a/dbaccess/source/ui/inc/tabletree.hxx
+++ b/dbaccess/source/ui/inc/tabletree.hxx
@@ -36,18 +36,26 @@ namespace dbaui
class OTableTreeListBox final : public DBTreeListBox
{
std::unique_ptr<SvLBoxButtonData> m_pCheckButton;
+ Link<void*,void> m_aCheckButtonHandler;
+
css::uno::Reference< css::sdbc::XConnection >
m_xConnection; // the connection we're working for, set in implOnNewConnection, called by UpdateTableList
std::unique_ptr< ImageProvider >
m_xImageProvider; // provider for our images
+ bool m_bVirtualRoot; // should the first entry be visible
+ bool m_bNoEmptyFolders; // should empty catalogs/schematas be prevented from being displayed?
public:
OTableTreeListBox(vcl::Window* pParent, WinBits nWinStyle);
virtual void dispose() override;
+ void init() { m_bVirtualRoot = true; }
+
typedef std::pair< OUString, bool > TTableViewName;
typedef std::vector< TTableViewName > TNames;
+ void suppressEmptyFolders() { m_bNoEmptyFolders = true; }
+
/** call when HiContrast change.
*/
void notifyHiContrastChanged();
@@ -100,10 +108,24 @@ public:
SvTreeListEntry* getEntryByQualifiedName( const OUString& _rName );
+ SvTreeListEntry* 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(SvTreeListEntry* _pEntry);
+
+ /** determine if the given entry is 'wildcard checked'
+ @see checkWildcard
+ */
+ static bool isWildcardChecked(SvTreeListEntry* pEntry);
+
private:
virtual void InitEntry(SvTreeListEntry* _pEntry, const OUString& _rString, const Image& _rCollapsedBitmap, const Image& _rExpandedBitmap) override;
- virtual void CheckButtonHdl() override;
+ virtual void CheckButtonHdl() override;
void checkedButton_noBroadcast(SvTreeListEntry* _pEntry);
void implEmphasize(SvTreeListEntry* _pEntry, bool _bChecked, bool _bUpdateDescendants = true, bool _bUpdateAncestors = true);
@@ -125,6 +147,8 @@ private:
bool impl_getAndAssertMetaData( css::uno::Reference< css::sdbc::XDatabaseMetaData >& _out_rMetaData ) const;
+ bool haveVirtualRoot() const { return m_bVirtualRoot; }
+
/** fill the table list with the tables and views determined by the two given containers
@param _rxConnection the connection where you got the object names from. Must not be NULL.
Used to split the full qualified names into its parts.
@@ -137,6 +161,9 @@ private:
void InitButtonData();
+ /// the handler given is called whenever the check state of one or more items changed
+ void SetCheckHandler(const Link<void*,void>& _rHdl) { m_aCheckButtonHandler = _rHdl; }
+
SvButtonState implDetermineState(SvTreeListEntry* _pEntry);
// determines the check state of the given entry, by analyzing the states of all descendants
@@ -170,6 +197,10 @@ public:
void SuppressEmptyFolders() { m_bNoEmptyFolders = true; }
void DisableCheckButtons();
+ /** determines whether the given entry denotes a tables folder
+ */
+ static bool isFolderEntry( const SvTreeListEntry* _pEntry );
+
/** fill the table list with the tables belonging to the connection described by the parameters
@param _rxConnection
the connection, which must support the service com.sun.star.sdb.Connection
@@ -193,6 +224,27 @@ public:
const css::uno::Sequence< OUString>& _rViews
);
+ /** returns a NamedDatabaseObject record which describes the given entry
+ */
+ css::sdb::application::NamedDatabaseObject
+ describeObject( SvTreeListEntry* _pEntry );
+
+ /** to be used if a foreign instance added a table
+ */
+ SvTreeListEntry* addedTable( const OUString& _rName );
+
+ /** to be used if a foreign instance removed a table
+ */
+ void removedTable( const OUString& _rName );
+
+ /** returns the fully qualified name of a table entry
+ @param _pEntry
+ the entry whose name is to be obtained. Must not denote a folder entry.
+ */
+ OUString getQualifiedTableName( SvTreeListEntry* _pEntry ) const;
+
+ SvTreeListEntry* getEntryByQualifiedName( const OUString& _rName );
+
std::unique_ptr<weld::TreeIter> getAllObjectsEntry() const;
/** does a wildcard check of the given entry
@@ -224,7 +276,8 @@ private:
*/
void implAddEntry(
const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxMeta,
- const OUString& _rTableName
+ const OUString& _rTableName,
+ bool _bCheckName = true
);
void implOnNewConnection( const css::uno::Reference< css::sdbc::XConnection >& _rxConnection );