bump product version to 4.1.6.2
[LibreOffice.git] / fpicker / source / office / OfficeControlAccess.hxx
blobac472e777addeec520035e468f3b1cd259785b35
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 .
20 #ifndef SVTOOLS_CONTROLACCESS_HXX
21 #define SVTOOLS_CONTROLACCESS_HXX
23 #include <svtools/fileview.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <com/sun/star/lang/IllegalArgumentException.hpp>
26 #include "pickercallbacks.hxx"
28 //.........................................................................
29 namespace svt
31 //.........................................................................
33 // --------------------------------------------------------------------
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;
43 // --------------------------------------------------------------------
44 /** implements the XControlAccess, XControlInformation and XFilePickerControlAccess for the file picker
46 class OControlAccess
48 IFilePickerController* m_pFilePickerController;
49 SvtFileView* m_pFileView;
51 public:
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 sal_Bool isControlSupported( const OUString& _rControlName );
62 sal_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, sal_Bool _bEnable );
71 static void setHelpURL( Window* _pControl, const OUString& _rURL, sal_Bool _bFileView );
72 static OUString getHelpURL( Window* _pControl, sal_Bool _bFileView );
74 private:
75 /** implements the various methods for setting properties on controls
77 @param _nControlId
78 the id of the control
79 @param _pControl
80 the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL.
81 @param _nProperty
82 the property to set
83 See PROPERTY_FLAG_*
84 @param _rValue
85 the value to set
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 sal_Bool _bIgnoreIllegalArgument = sal_True );
94 Control* implGetControl( const OUString& _rControlName, sal_Int16* _pId = NULL, sal_Int32* _pPropertyMask = NULL ) const SAL_THROW( (::com::sun::star::lang::IllegalArgumentException) );
96 /** implements the various methods for retrieving properties from controls
98 @param _pControl
99 the affected control
100 @PRECOND not <NULL/>
101 @param _nProperty
102 the property to retrieve
103 See PROPERTY_FLAG_*
104 @return
106 ::com::sun::star::uno::Any implGetControlProperty( Control* _pControl, sal_Int16 _nProperty ) const;
108 void implDoListboxAction( ListBox* _pListbox, sal_Int16 _nCtrlAction, const ::com::sun::star::uno::Any& _rValue );
112 //.........................................................................
113 } // namespace svt
114 //.........................................................................
116 #endif // SVTOOLS_CONTROLACCESS_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */