1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_FPICKER_SOURCE_OFFICE_FPDIALOGBASE_HXX
20 #define INCLUDED_FPICKER_SOURCE_OFFICE_FPDIALOGBASE_HXX
22 #include <vcl/weld.hxx>
23 #include <com/sun/star/beans/StringPair.hpp>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include "pickercallbacks.hxx"
30 class SvtFileDialogFilter_Impl
;
33 enum class PickerFlags
{
35 AutoExtension
= 0x000001,
36 FilterOptions
= 0x000002,
37 ShowVersions
= 0x000004,
38 InsertAsLink
= 0x000008,
39 ShowPreview
= 0x000010,
41 PlayButton
= 0x000040,
43 ImageTemplate
= 0x000100,
44 PathDialog
= 0x000200,
49 MultiSelection
= 0x004000,
50 ImageAnchor
= 0x008000,
53 template<> struct typed_flags
<PickerFlags
> : is_typed_flags
<PickerFlags
, 0x00ffff> {};
56 #define FILEDIALOG_FILTER_ALL "*.*"
60 class SvtFileDialog_Base
: public weld::GenericDialogController
, public ::svt::IFilePickerController
63 SvtFileDialog_Base(weld::Window
* pParent
, const OUString
& rUIXMLDescription
, const OString
& rID
)
64 : weld::GenericDialogController(pParent
, rUIXMLDescription
, rID
)
68 virtual bool PrepareExecute() { return true ; }
70 virtual SvtFileView
* GetView() = 0;
72 virtual void SetHasFilename( bool bHasFilename
) = 0;
73 virtual void SetBlackList( const css::uno::Sequence
< OUString
>& rBlackList
) = 0;
74 virtual const css::uno::Sequence
< OUString
>& GetBlackList() const = 0;
75 virtual void SetStandardDir( const OUString
& rStdDir
) = 0;
76 virtual const OUString
& GetStandardDir() const = 0;
77 virtual void SetPath( const OUString
& rNewURL
) = 0;
78 virtual const OUString
& GetPath() = 0;
79 virtual std::vector
<OUString
> GetPathList() const = 0;
80 virtual bool ContentIsFolder( const OUString
& rURL
) = 0;
82 virtual OUString
getCurrentFileText() const = 0;
83 virtual void setCurrentFileText( const OUString
& rText
, bool bSelectAll
= false ) = 0;
85 virtual void AddFilter( const OUString
& rFilter
, const OUString
& rType
) = 0;
86 virtual void AddFilterGroup( const OUString
& _rFilter
,
87 const css::uno::Sequence
< css::beans::StringPair
>& rFilters
) = 0;
88 virtual OUString
GetCurFilter() const = 0;
89 virtual void SetCurFilter( const OUString
& rFilter
) = 0;
90 virtual void FilterSelect() = 0;
92 virtual void SetFileCallback( ::svt::IFilePickerListener
*pNotifier
) = 0;
93 virtual void onAsyncOperationStarted() = 0;
94 virtual void onAsyncOperationFinished() = 0;
95 virtual void UpdateControls( const OUString
& rURL
) = 0;
97 virtual void EnableAutocompletion( bool _bEnable
= true ) = 0;
99 virtual sal_Int32
getAvailableWidth() = 0;
100 virtual sal_Int32
getAvailableHeight() = 0;
102 virtual void setImage( const css::uno::Any
& rImage
) = 0;
104 virtual bool getShowState() = 0;
107 #define FILE_SELECTION_CHANGED 1
108 #define DIRECTORY_CHANGED 2
109 #define CTRL_STATE_CHANGED 4
110 #define DIALOG_SIZE_CHANGED 5
113 #endif // INCLUDED_FPICKER_SOURCE_OFFICE_IODLG_HXX
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */