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 .
20 #ifndef INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
21 #define INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
23 #include <svtools/fileview.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <com/sun/star/lang/IllegalArgumentException.hpp>
26 #include "pickercallbacks.hxx"
33 namespace InternalFilePickerElementIds
35 static const sal_Int16 PUSHBUTTON_HELP
= (sal_Int16
)0x1000;
36 static const sal_Int16 TOOLBOXBUTOON_DEFAULT_LOCATION
= (sal_Int16
)0x1001;
37 static const sal_Int16 TOOLBOXBUTOON_LEVEL_UP
= (sal_Int16
)0x1002;
38 static const sal_Int16 TOOLBOXBUTOON_NEW_FOLDER
= (sal_Int16
)0x1003;
39 static const sal_Int16 FIXEDTEXT_CURRENTFOLDER
= (sal_Int16
)0x1004;
43 /** implements the XControlAccess, XControlInformation and XFilePickerControlAccess for the file picker
47 IFilePickerController
* m_pFilePickerController
;
48 VclPtr
<SvtFileView
> m_pFileView
;
51 OControlAccess( IFilePickerController
* _pController
, SvtFileView
* _pFileView
);
53 // XControlAccess implementation
54 void setControlProperty( const OUString
& _rControlName
, const OUString
& _rControlProperty
, const css::uno::Any
& _rValue
);
55 css::uno::Any
getControlProperty( const OUString
& _rControlName
, const OUString
& _rControlProperty
);
57 // XControlInformation implementation
58 css::uno::Sequence
< OUString
> getSupportedControls( );
59 css::uno::Sequence
< OUString
> getSupportedControlProperties( const OUString
& _rControlName
);
60 static bool isControlSupported( const OUString
& _rControlName
);
61 bool isControlPropertySupported( const OUString
& _rControlName
, const OUString
& _rControlProperty
);
63 // XFilePickerControlAccess
64 void setValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
, const css::uno::Any
& _rValue
);
65 css::uno::Any
getValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
) const;
66 void setLabel( sal_Int16 _nId
, const OUString
& _rValue
);
67 OUString
getLabel( sal_Int16 _nId
) const;
68 void enableControl( sal_Int16 _nId
, bool _bEnable
);
70 static void setHelpURL( vcl::Window
* _pControl
, const OUString
& _rURL
, bool _bFileView
);
71 static OUString
getHelpURL( vcl::Window
* _pControl
, bool _bFileView
);
74 /** implements the various methods for setting properties on controls
79 the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL.
85 @param _bIgnoreIllegalArgument
86 if <FALSE/>, an exception will be thrown if the given value is of improper type
88 void implSetControlProperty(
89 sal_Int16 _nControlId
,
90 Control
* _pControl
, sal_Int16 _nProperty
, const css::uno::Any
& _rValue
,
91 bool _bIgnoreIllegalArgument
= true );
93 Control
* implGetControl( const OUString
& _rControlName
, sal_Int16
* _pId
, sal_Int32
* _pPropertyMask
= nullptr ) const;
95 /** implements the various methods for retrieving properties from controls
101 the property to retrieve
105 css::uno::Any
implGetControlProperty( Control
* _pControl
, sal_Int16 _nProperty
) const;
107 static void implDoListboxAction( ListBox
* _pListbox
, sal_Int16 _nCtrlAction
, const css::uno::Any
& _rValue
);
115 #endif // INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */