update dev300-m58
[ooovba.git] / fpicker / source / office / OfficeControlAccess.hxx
blobb524f99a006751c7b9db8abc477859264cf7f9fc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OfficeControlAccess.hxx,v $
10 * $Revision: 1.4 $
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 //.........................................................................
40 namespace svt
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
57 class OControlAccess
59 IFilePickerController* m_pFilePickerController;
60 SvtFileView* m_pFileView;
62 public:
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 );
85 private:
86 /** implements the various methods for setting properties on controls
88 @param _nControlId
89 the id of the control
90 @param _pControl
91 the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL.
92 @param _nProperty
93 the property to set
94 See PROPERTY_FLAG_*
95 @param _rValue
96 the value to set
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
109 @param _pControl
110 the affected control
111 @PRECOND not <NULL/>
112 @param _nProperty
113 the property to retrieve
114 See PROPERTY_FLAG_*
115 @return
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 //.........................................................................
124 } // namespace svt
125 //.........................................................................
127 #endif // SVTOOLS_CONTROLACCESS_HXX