Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / dbtree.hxx
blobc6806cdfed8a93087e3a029025a5084be33151fe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_DBTREE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_DBTREE_HXX
22 #include <memory>
23 #include <vcl/weld.hxx>
25 #include <swdllapi.h>
27 class SwDBTreeList_Impl;
28 class SwWrtShell;
30 class SW_DLLPUBLIC SwDBTreeList
32 bool m_bInitialized;
33 bool m_bShowColumns;
35 rtl::Reference<SwDBTreeList_Impl> m_pImpl;
36 std::unique_ptr<weld::TreeView> m_xTreeView;
37 std::unique_ptr<weld::TreeIter> m_xScratchIter;
39 DECL_DLLPRIVATE_LINK(RequestingChildrenHdl, const weld::TreeIter&, bool);
40 SAL_DLLPRIVATE void InitTreeList();
42 public:
43 SwDBTreeList(std::unique_ptr<weld::TreeView> xTreeView);
44 ~SwDBTreeList();
46 OUString GetDBName(OUString& rTableName, OUString& rColumnName, sal_Bool* pbIsTable = nullptr);
48 void Select( std::u16string_view rDBName, std::u16string_view rTableName,
49 std::u16string_view rColumnName );
51 void ShowColumns(bool bShowCol);
53 void SetWrtShell(SwWrtShell& rSh);
55 void AddDataSource(const OUString& rSource);
57 void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); }
58 void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { m_xTreeView->connect_row_activated(rLink); }
59 std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pOrig = nullptr) const { return m_xTreeView->make_iterator(pOrig); }
60 bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); }
61 bool iter_parent(weld::TreeIter& rIter) const { return m_xTreeView->iter_parent(rIter); }
62 int get_iter_depth(const weld::TreeIter& rIter) const { return m_xTreeView->get_iter_depth(rIter); }
63 void set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
66 #endif
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */