Bump version to 24.04.3.4
[LibreOffice.git] / fpicker / source / office / fpdialogbase.hxx
blob60205695b7198e6937f0ba256a64cb7da160e402
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 #pragma once
21 #include <vcl/weld.hxx>
22 #include <com/sun/star/beans/StringPair.hpp>
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include "pickercallbacks.hxx"
27 class SvTabListBox;
28 class SvtFileView;
29 class SvtFileDialogFilter_Impl;
32 enum class PickerFlags {
33 NONE = 0x000000,
34 AutoExtension = 0x000001,
35 FilterOptions = 0x000002,
36 ShowVersions = 0x000004,
37 InsertAsLink = 0x000008,
38 ShowPreview = 0x000010,
39 Templates = 0x000020,
40 PlayButton = 0x000040,
41 Selection = 0x000080,
42 ImageTemplate = 0x000100,
43 PathDialog = 0x000200,
44 Open = 0x000400,
45 SaveAs = 0x000800,
46 Password = 0x001000,
47 ReadOnly = 0x002000,
48 MultiSelection = 0x004000,
49 ImageAnchor = 0x008000,
51 namespace o3tl {
52 template<> struct typed_flags<PickerFlags> : is_typed_flags<PickerFlags, 0x00ffff> {};
55 inline constexpr OUString FILEDIALOG_FILTER_ALL = u"*.*"_ustr;
57 // SvtFileDialog_Base
59 class SvtFileDialog_Base : public weld::GenericDialogController, public ::svt::IFilePickerController
61 public:
62 SvtFileDialog_Base(weld::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID)
63 : weld::GenericDialogController(pParent, rUIXMLDescription, rID)
67 virtual bool PrepareExecute() { return true ; }
69 virtual SvtFileView* GetView() = 0;
71 virtual void SetHasFilename( bool bHasFilename ) = 0;
72 virtual void SetDenyList( const css::uno::Sequence< OUString >& rDenyList ) = 0;
73 virtual const css::uno::Sequence< OUString >& GetDenyList() const = 0;
74 virtual void SetStandardDir( const OUString& rStdDir ) = 0;
75 virtual const OUString& GetStandardDir() const = 0;
76 virtual void SetPath( const OUString& rNewURL ) = 0;
77 virtual const OUString& GetPath() = 0;
78 virtual std::vector<OUString> GetPathList() const = 0;
79 virtual bool ContentIsFolder( const OUString& rURL ) = 0;
81 virtual OUString getCurrentFileText() const = 0;
82 virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) = 0;
84 virtual void AddFilter( const OUString& rFilter, const OUString& rType ) = 0;
85 virtual void AddFilterGroup( const OUString& _rFilter,
86 const css::uno::Sequence< css::beans::StringPair >& rFilters ) = 0;
87 virtual OUString GetCurFilter() const = 0;
88 virtual void SetCurFilter( const OUString& rFilter ) = 0;
89 virtual void FilterSelect() = 0;
91 virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) = 0;
92 virtual void onAsyncOperationStarted() = 0;
93 virtual void onAsyncOperationFinished() = 0;
94 virtual void UpdateControls( const OUString& rURL ) = 0;
96 virtual void EnableAutocompletion( bool _bEnable = true ) = 0;
98 virtual sal_Int32 getAvailableWidth() = 0;
99 virtual sal_Int32 getAvailableHeight() = 0;
101 virtual void setImage( const css::uno::Any& rImage ) = 0;
103 virtual bool getShowState() = 0;
106 #define FILE_SELECTION_CHANGED 1
107 #define DIRECTORY_CHANGED 2
108 #define CTRL_STATE_CHANGED 4
109 #define DIALOG_SIZE_CHANGED 5
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */