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