1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef _CONTROLACCESS_HXX_
26 #define _CONTROLACCESS_HXX_
27 
28 //------------------------------------------------------------------------
29 // includes
30 //------------------------------------------------------------------------
31 
32 #include <sal/types.h>
33 #include <rtl/ustring.hxx>
34 
35 #if defined _MSC_VER
36 #pragma warning(push, 1)
37 #endif
38 #include <windows.h>
39 #if defined _MSC_VER
40 #pragma warning(pop)
41 #endif
42 #include <com/sun/star/uno/Any.hxx>
43 
44 //------------------------------------------------------------------------
45 // deklarations
46 //------------------------------------------------------------------------
47 
48 typedef void ( SAL_CALL *CTRL_SETVALUE_FUNCTION_T)( HWND, const ::com::sun::star::uno::Any&, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&, sal_Int16 );
49 typedef ::com::sun::star::uno::Any ( SAL_CALL *CTRL_GETVALUE_FUNCTION_T )( HWND );
50 
51 // the currently supported control classes
52 enum CTRL_CLASS
53 {
54     UNKNOWN = 0,
55     CHECKBOX,
56     LISTBOX,
57     PUSHBUTTON
58 };
59 
60 // returns the class of a control
61 CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl );
62 
63 // returns a pointer to a setValue function based on the control class
64 // and the control action, if no function was found NULL will be returned
65 CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction );
66 
67 // returns a pointer to a getValue function based on the control class
68 // and the control action, if no function was found NULL will be returned
69 CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction );
70 
71 // translates a CommonFilePickerElementId as defined in CommonFilePickerElementIds.idl
72 // to a control id that is valid for the FileOpen dialog under windows as defined
73 // in dlgs.h in the Windows Platform SDK
74 int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId );
75 
76 #endif
77