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 
10 #pragma once
11 
12 #include <com/sun/star/uno/Sequence.hxx>
13 #include <vcl/weld.hxx>
14 
15 namespace com :: sun :: star :: ucb { class XCommandEnvironment; }
16 
17 using namespace ::com::sun::star::ucb;
18 using namespace ::com::sun::star::uno;
19 
20 class FolderTree
21 {
22 private:
23     std::unique_ptr<weld::TreeView> m_xTreeView;
24     std::unique_ptr<weld::TreeIter> m_xScratchIter;
25     weld::Window* m_pTopLevel;
26     Reference< XCommandEnvironment > m_xEnv;
27     ::osl::Mutex m_aMutex;
28     Sequence< OUString > m_aDenyList;
29 
30     OUString m_sLastUpdatedDir;
31 
32     DECL_LINK(RequestingChildrenHdl, const weld::TreeIter&, bool);
33 
34 public:
35     FolderTree(std::unique_ptr<weld::TreeView> xTreeView, weld::Window* pTopLevel);
36 
clear()37     void clear() { m_xTreeView->clear(); }
38 
connect_changed(const Link<weld::TreeView &,void> & rLink)39     void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); }
40 
41     void InsertRootEntry(const OUString& rId, const OUString& rRootLabel);
42     void FillTreeEntry(const weld::TreeIter& rEntry);
43     void FillTreeEntry(const OUString & rUrl, const ::std::vector< std::pair< OUString, OUString > >& rFolders);
44     void SetTreePath(OUString const & sUrl);
45     void SetDenyList(const css::uno::Sequence< OUString >& rDenyList);
46 };
47 
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
49