LibreOffice Module sw (master)  1
dbtree.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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DBTREE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_DBTREE_HXX
21 
22 #include <memory>
23 #include <vcl/weld.hxx>
24 
25 #include <swdllapi.h>
26 
27 class SwDBTreeList_Impl;
28 class SwWrtShell;
29 
31 {
34 
36  std::unique_ptr<weld::TreeView> m_xTreeView;
37 
38  DECL_DLLPRIVATE_LINK(RequestingChildrenHdl, const weld::TreeIter&, bool);
39  SAL_DLLPRIVATE void InitTreeList();
40 
41 public:
42  SwDBTreeList(std::unique_ptr<weld::TreeView> xTreeView);
43  ~SwDBTreeList();
44 
45  OUString GetDBName(OUString& rTableName, OUString& rColumnName, sal_Bool* pbIsTable = nullptr);
46 
47  void Select( const OUString& rDBName, const OUString& rTableName,
48  const OUString& rColumnName );
49 
50  void ShowColumns(bool bShowCol);
51 
52  void SetWrtShell(SwWrtShell& rSh);
53 
54  void AddDataSource(const OUString& rSource);
55 
56  void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); }
57  void connect_row_activated(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_row_activated(rLink); }
58  std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pOrig = nullptr) const { return m_xTreeView->make_iterator(pOrig); }
59  bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); }
60  bool iter_parent(weld::TreeIter& rIter) const { return m_xTreeView->iter_parent(rIter); }
61  int get_iter_depth(const weld::TreeIter& rIter) const { return m_xTreeView->get_iter_depth(rIter); }
62  void set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
63 };
64 
65 #endif
66 
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
int get_iter_depth(const weld::TreeIter &rIter) const
Definition: dbtree.hxx:61
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
std::unique_ptr< weld::TreeView > m_xTreeView
Definition: dbtree.hxx:36
unsigned char sal_Bool
bool bShowColumns
Definition: dbtree.hxx:33
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
rtl::Reference< SwDBTreeList_Impl > pImpl
Definition: dbtree.hxx:35
void set_size_request(int nWidth, int nHeight)
Definition: dbtree.hxx:62
bool get_selected(weld::TreeIter *pIter) const
Definition: dbtree.hxx:59
std::unique_ptr< weld::TreeIter > make_iterator(const weld::TreeIter *pOrig=nullptr) const
Definition: dbtree.hxx:58
bool bInitialized
Definition: dbtree.hxx:32
void connect_row_activated(const Link< weld::TreeView &, void > &rLink)
Definition: dbtree.hxx:57
void connect_changed(const Link< weld::TreeView &, void > &rLink)
Definition: dbtree.hxx:56
bool iter_parent(weld::TreeIter &rIter) const
Definition: dbtree.hxx:60