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"
34 namespace InternalFilePickerElementIds
36 static const sal_Int16 PUSHBUTTON_HELP
= (sal_Int16
)0x1000;
37 static const sal_Int16 TOOLBOXBUTOON_DEFAULT_LOCATION
= (sal_Int16
)0x1001;
38 static const sal_Int16 TOOLBOXBUTOON_LEVEL_UP
= (sal_Int16
)0x1002;
39 static const sal_Int16 TOOLBOXBUTOON_NEW_FOLDER
= (sal_Int16
)0x1003;
40 static const sal_Int16 FIXEDTEXT_CURRENTFOLDER
= (sal_Int16
)0x1004;
44 /** implements the XControlAccess, XControlInformation and XFilePickerControlAccess for the file picker
48 IFilePickerController
* m_pFilePickerController
;
49 VclPtr
<SvtFileView
> m_pFileView
;
52 OControlAccess( IFilePickerController
* _pController
, SvtFileView
* _pFileView
);
54 // XControlAccess implementation
55 void setControlProperty( const OUString
& _rControlName
, const OUString
& _rControlProperty
, const ::com::sun::star::uno::Any
& _rValue
);
56 ::com::sun::star::uno::Any
getControlProperty( const OUString
& _rControlName
, const OUString
& _rControlProperty
);
58 // XControlInformation implementation
59 ::com::sun::star::uno::Sequence
< OUString
> getSupportedControls( );
60 ::com::sun::star::uno::Sequence
< OUString
> getSupportedControlProperties( const OUString
& _rControlName
);
61 static bool isControlSupported( const OUString
& _rControlName
);
62 bool isControlPropertySupported( const OUString
& _rControlName
, const OUString
& _rControlProperty
);
64 // XFilePickerControlAccess
65 void setValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
, const ::com::sun::star::uno::Any
& _rValue
);
66 ::com::sun::star::uno::Any
getValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
) const;
67 void setLabel( sal_Int16 _nId
, const OUString
& _rValue
);
68 OUString
getLabel( sal_Int16 _nId
) const;
69 void enableControl( sal_Int16 _nId
, bool _bEnable
);
71 static void setHelpURL( vcl::Window
* _pControl
, const OUString
& _rURL
, bool _bFileView
);
72 static OUString
getHelpURL( vcl::Window
* _pControl
, bool _bFileView
);
75 /** implements the various methods for setting properties on controls
80 the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL.
86 @param _bIgnoreIllegalArgument
87 if <FALSE/>, an exception will be thrown if the given value is of improper type
89 void implSetControlProperty(
90 sal_Int16 _nControlId
,
91 Control
* _pControl
, sal_Int16 _nProperty
, const ::com::sun::star::uno::Any
& _rValue
,
92 bool _bIgnoreIllegalArgument
= true );
94 Control
* implGetControl( const OUString
& _rControlName
, sal_Int16
* _pId
= NULL
, sal_Int32
* _pPropertyMask
= NULL
) const;
96 /** implements the various methods for retrieving properties from controls
102 the property to retrieve
106 ::com::sun::star::uno::Any
implGetControlProperty( Control
* _pControl
, sal_Int16 _nProperty
) const;
108 static void implDoListboxAction( ListBox
* _pListbox
, sal_Int16 _nCtrlAction
, const ::com::sun::star::uno::Any
& _rValue
);
116 #endif // INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */