1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SVTOOLS_CONTROLACCESS_HXX
29 #define SVTOOLS_CONTROLACCESS_HXX
31 #include <svtools/fileview.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <com/sun/star/lang/IllegalArgumentException.hpp>
34 #include "pickercallbacks.hxx"
36 //.........................................................................
39 //.........................................................................
41 // --------------------------------------------------------------------
42 namespace InternalFilePickerElementIds
44 static const sal_Int16 PUSHBUTTON_HELP
= (sal_Int16
)0x1000;
45 static const sal_Int16 TOOLBOXBUTOON_DEFAULT_LOCATION
= (sal_Int16
)0x1001;
46 static const sal_Int16 TOOLBOXBUTOON_LEVEL_UP
= (sal_Int16
)0x1002;
47 static const sal_Int16 TOOLBOXBUTOON_NEW_FOLDER
= (sal_Int16
)0x1003;
48 static const sal_Int16 FIXEDTEXT_CURRENTFOLDER
= (sal_Int16
)0x1004;
51 // --------------------------------------------------------------------
52 /** implements the XControlAccess, XControlInformation and XFilePickerControlAccess for the file picker
56 IFilePickerController
* m_pFilePickerController
;
57 SvtFileView
* m_pFileView
;
60 OControlAccess( IFilePickerController
* _pController
, SvtFileView
* _pFileView
);
62 // XControlAccess implementation
63 void setControlProperty( const ::rtl::OUString
& _rControlName
, const ::rtl::OUString
& _rControlProperty
, const ::com::sun::star::uno::Any
& _rValue
);
64 ::com::sun::star::uno::Any
getControlProperty( const ::rtl::OUString
& _rControlName
, const ::rtl::OUString
& _rControlProperty
);
66 // XControlInformation implementation
67 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedControls( );
68 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedControlProperties( const ::rtl::OUString
& _rControlName
);
69 sal_Bool
isControlSupported( const ::rtl::OUString
& _rControlName
);
70 sal_Bool
isControlPropertySupported( const ::rtl::OUString
& _rControlName
, const ::rtl::OUString
& _rControlProperty
);
72 // XFilePickerControlAccess
73 void setValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
, const ::com::sun::star::uno::Any
& _rValue
);
74 ::com::sun::star::uno::Any
getValue( sal_Int16 _nId
, sal_Int16 _nCtrlAction
) const;
75 void setLabel( sal_Int16 _nId
, const ::rtl::OUString
& _rValue
);
76 ::rtl::OUString
getLabel( sal_Int16 _nId
) const;
77 void enableControl( sal_Int16 _nId
, sal_Bool _bEnable
);
79 static void setHelpURL( Window
* _pControl
, const ::rtl::OUString
& _rURL
, sal_Bool _bFileView
);
80 static ::rtl::OUString
getHelpURL( Window
* _pControl
, sal_Bool _bFileView
);
83 /** implements the various methods for setting properties on controls
88 the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL.
94 @param _bIgnoreIllegalArgument
95 if <FALSE/>, an exception will be thrown if the given value is of improper type
97 void implSetControlProperty(
98 sal_Int16 _nControlId
,
99 Control
* _pControl
, sal_Int16 _nProperty
, const ::com::sun::star::uno::Any
& _rValue
,
100 sal_Bool _bIgnoreIllegalArgument
= sal_True
);
102 Control
* implGetControl( const ::rtl::OUString
& _rControlName
, sal_Int16
* _pId
= NULL
, sal_Int32
* _pPropertyMask
= NULL
) const SAL_THROW( (::com::sun::star::lang::IllegalArgumentException
) );
104 /** implements the various methods for retrieving properties from controls
110 the property to retrieve
114 ::com::sun::star::uno::Any
implGetControlProperty( Control
* _pControl
, sal_Int16 _nProperty
) const;
116 void implDoListboxAction( ListBox
* _pListbox
, sal_Int16 _nCtrlAction
, const ::com::sun::star::uno::Any
& _rValue
);
120 //.........................................................................
122 //.........................................................................
124 #endif // SVTOOLS_CONTROLACCESS_HXX