LibreOffice Module fpicker (master) 1
fileview.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#pragma once
20
21#include <memory>
22#include <com/sun/star/uno/Sequence.h>
23#include <utility>
24#include <vcl/weld.hxx>
25#include <rtl/ustring.hxx>
26
27namespace com :: sun :: star :: ucb { class XContent; }
28
29// class SvtFileView -----------------------------------------------------
30
32struct SvtContentEntry;
33
36{
41};
42
44{
46 eIcon
47};
48
51{
52 sal_uInt32 nMinTimeout;
53 sal_uInt32 nMaxTimeout;
55
57 {
58 }
59};
60
62{
63private:
64 std::unique_ptr<SvtFileView_Impl> mpImpl;
65 css::uno::Sequence<OUString> maDenyList;
66
67 DECL_LINK(HeaderSelect_Impl, int, void);
68
69public:
70 SvtFileView(weld::Window* pTopLevel,
71 std::unique_ptr<weld::TreeView> xTreeView,
72 std::unique_ptr<weld::IconView> xIconView,
73 bool bOnlyFolder, bool bMultiSelection, bool bShowType = true);
75
76 void SetViewMode( FileViewMode eMode );
77
78 const OUString& GetViewURL() const;
79 OUString GetURL(const weld::TreeIter& rEntry) const;
80 OUString GetCurrentURL() const;
81
82 bool GetParentURL( OUString& _rParentURL ) const;
83 void CreatedFolder( const OUString& rUrl, const OUString& rNewFolder );
84
85 void set_help_id(const OUString& rHelpId);
86 OUString get_help_id() const;
87
88 void grab_focus();
89 bool has_focus() const;
90
91 OUString get_selected_text() const;
92
93 weld::Widget* identifier() const; // just to uniquely identify this widget
94
106 const OUString& rFolderURL,
107 const OUString& rFilter,
108 const FileViewAsyncAction* pAsyncDescriptor,
109 const css::uno::Sequence< OUString >& rDenyList
110 );
111
127 const OUString& rFilter,
128 const FileViewAsyncAction* pAsyncDescriptor
129 );
130
138
148 const FileViewAsyncAction* pAsyncDescriptor
149 );
150
151 void SetNoSelection();
152
153 void SetSelectHdl( const Link<SvtFileView*,void>& rHdl );
154 void SetDoubleClickHdl( const Link<SvtFileView*,bool>& rHdl );
155 void SetOpenDoneHdl( const Link<SvtFileView*,void>& rHdl );
156
157 sal_uInt32 GetSelectionCount() const;
159
160 void selected_foreach(const std::function<bool(weld::TreeIter&)>& func);
161
162 void EnableDelete( bool bEnable );
163
164 // save and load column size and sort order
165 OUString GetConfigString() const;
166 void SetConfigString( std::u16string_view rCfgStr );
167
168 void EndInplaceEditing();
169
170 ::std::vector< SvtContentEntry > GetContent();
171};
172
173// struct SvtContentEntry ------------------------------------------------
174
176{
178 OUString maURL;
179
180 SvtContentEntry( OUString aURL, bool bIsFolder ) :
181 mbIsFolder( bIsFolder ), maURL(std::move( aURL )) {}
182};
183
184/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Sequence< OUString > maDenyList
Definition: fileview.hxx:65
void set_help_id(const OUString &rHelpId)
Definition: fileview.cxx:923
SvtContentEntry * FirstSelected() const
Definition: fileview.cxx:1004
const OUString & GetViewURL() const
Definition: fileview.cxx:1022
bool has_focus() const
Definition: fileview.cxx:818
FileViewResult PreviousLevel(const FileViewAsyncAction *pAsyncDescriptor)
initializes the view with the parent folder of the current folder
Definition: fileview.cxx:881
OUString get_help_id() const
Definition: fileview.cxx:918
void SetConfigString(std::u16string_view rCfgStr)
Definition: fileview.cxx:1103
sal_uInt32 GetSelectionCount() const
Definition: fileview.cxx:997
void SetViewMode(FileViewMode eMode)
Definition: fileview.cxx:827
::std::vector< SvtContentEntry > GetContent()
Definition: fileview.cxx:1090
bool GetParentURL(OUString &_rParentURL) const
Definition: fileview.cxx:892
void CancelRunningAsyncAction()
cancels a running async action (if any)
Definition: fileview.cxx:976
weld::Widget * identifier() const
Definition: fileview.cxx:1803
void CreatedFolder(const OUString &rUrl, const OUString &rNewFolder)
Definition: fileview.cxx:865
std::unique_ptr< SvtFileView_Impl > mpImpl
Definition: fileview.hxx:64
void SetNoSelection()
Definition: fileview.cxx:981
void SetOpenDoneHdl(const Link< SvtFileView *, void > &rHdl)
Definition: fileview.cxx:1027
SvtFileView(weld::Window *pTopLevel, std::unique_ptr< weld::TreeView > xTreeView, std::unique_ptr< weld::IconView > xIconView, bool bOnlyFolder, bool bMultiSelection, bool bShowType=true)
Definition: fileview.cxx:791
OUString GetURL(const weld::TreeIter &rEntry) const
Definition: fileview.cxx:832
void EndInplaceEditing()
Definition: fileview.cxx:1037
void selected_foreach(const std::function< bool(weld::TreeIter &)> &func)
Definition: fileview.cxx:1795
FileViewResult Initialize(const OUString &rFolderURL, const OUString &rFilter, const FileViewAsyncAction *pAsyncDescriptor, const css::uno::Sequence< OUString > &rDenyList)
initialize the view with the content of a folder given by URL, and apply an immediate filter
Definition: fileview.cxx:935
FileViewResult ExecuteFilter(const OUString &rFilter, const FileViewAsyncAction *pAsyncDescriptor)
reads the current content of the current folder again, and applies the given filter to it
Definition: fileview.cxx:966
void SetDoubleClickHdl(const Link< SvtFileView *, bool > &rHdl)
Definition: fileview.cxx:992
OUString get_selected_text() const
Definition: fileview.cxx:928
void grab_focus()
Definition: fileview.cxx:813
void SetSelectHdl(const Link< SvtFileView *, void > &rHdl)
Definition: fileview.cxx:987
OUString GetCurrentURL() const
Definition: fileview.cxx:844
DECL_LINK(HeaderSelect_Impl, int, void)
void EnableDelete(bool bEnable)
Definition: fileview.cxx:1032
OUString GetConfigString() const
Definition: fileview.cxx:1064
URL aURL
FileViewMode
Definition: fileview.hxx:44
@ eIcon
Definition: fileview.hxx:46
@ eDetailedList
Definition: fileview.hxx:45
FileViewResult
the result of an action in the FileView
Definition: fileview.hxx:36
@ eSuccess
Definition: fileview.hxx:37
@ eTimeout
Definition: fileview.hxx:39
@ eFailure
Definition: fileview.hxx:38
@ eStillRunning
Definition: fileview.hxx:40
describes parameters for doing an action on the FileView asynchronously
Definition: fileview.hxx:51
sal_uInt32 nMaxTimeout
minimum time to wait for a result, in milliseconds
Definition: fileview.hxx:53
FileViewAsyncAction()
the handler to be called when the action is finished. Called in every case, no matter of the result
Definition: fileview.hxx:56
sal_uInt32 nMinTimeout
Definition: fileview.hxx:52
Link< void *, void > aFinishHandler
maximum time to wait for a result, in milliseconds, until eTimeout is returned
Definition: fileview.hxx:54
SvtContentEntry(OUString aURL, bool bIsFolder)
Definition: fileview.hxx:180
OUString maURL
Definition: fileview.hxx:178