xref: /AOO41X/main/fpicker/source/win32/misc/WinImplHelper.hxx (revision 10ce801889b00990ebdbcb412f4f91e2a9e6f21d)
1*10ce8018SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*10ce8018SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*10ce8018SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*10ce8018SAndrew Rist  * distributed with this work for additional information
6*10ce8018SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*10ce8018SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*10ce8018SAndrew Rist  * "License"); you may not use this file except in compliance
9*10ce8018SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*10ce8018SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*10ce8018SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*10ce8018SAndrew Rist  * software distributed under the License is distributed on an
15*10ce8018SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*10ce8018SAndrew Rist  * KIND, either express or implied.  See the License for the
17*10ce8018SAndrew Rist  * specific language governing permissions and limitations
18*10ce8018SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*10ce8018SAndrew Rist  *************************************************************/
21*10ce8018SAndrew Rist 
22*10ce8018SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _WINIMPLHELPER_HXX_
26cdf0e10cSrcweir #define _WINIMPLHELPER_HXX_
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //------------------------------------------------------------------------
29cdf0e10cSrcweir // includes
30cdf0e10cSrcweir //------------------------------------------------------------------------
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <sal/types.h>
33cdf0e10cSrcweir #include <rtl/ustring.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #if defined _MSC_VER
36cdf0e10cSrcweir #pragma warning(push, 1)
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #include <windows.h>
39cdf0e10cSrcweir #if defined _MSC_VER
40cdf0e10cSrcweir #pragma warning(pop)
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
43cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir //------------------------------------------------------------------------
46cdf0e10cSrcweir // deklarations
47cdf0e10cSrcweir //------------------------------------------------------------------------
48cdf0e10cSrcweir 
49cdf0e10cSrcweir bool SAL_CALL IsWindowsVistaOrNewer();
50cdf0e10cSrcweir bool SAL_CALL IsWindows7();
51cdf0e10cSrcweir bool SAL_CALL IsWindowsVista();
52cdf0e10cSrcweir bool SAL_CALL IsWindows2000();
53cdf0e10cSrcweir bool SAL_CALL IsWindowsXP();
54cdf0e10cSrcweir bool SAL_CALL IsWindows98();
55cdf0e10cSrcweir bool SAL_CALL IsWindowsME();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir // returns true if the platform is
58cdf0e10cSrcweir // Windows 2000 or above
59cdf0e10cSrcweir bool SAL_CALL IsWindows2000Platform();
60cdf0e10cSrcweir 
61cdf0e10cSrcweir #define IsWin2000 IsWindows2000
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // set actions
64cdf0e10cSrcweir void SAL_CALL ListboxAddItem(
65cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aItem, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
66cdf0e10cSrcweir     throw( ::com::sun::star::lang::IllegalArgumentException );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir void SAL_CALL ListboxAddItems(
69cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aItemList, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
70cdf0e10cSrcweir     throw( ::com::sun::star::lang:: IllegalArgumentException );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir void SAL_CALL ListboxDeleteItem(
73cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aPosition, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
74cdf0e10cSrcweir     throw( ::com::sun::star::lang::IllegalArgumentException );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir void SAL_CALL ListboxDeleteItems(
77cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aUnused, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
78cdf0e10cSrcweir     throw( ::com::sun::star::lang::IllegalArgumentException );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir void SAL_CALL ListboxSetSelectedItem(
81cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aPosition, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
82cdf0e10cSrcweir     throw( ::com::sun::star::lang::IllegalArgumentException );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir // get actions
85cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL ListboxGetItems( HWND hwnd );
86cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL ListboxGetSelectedItem( HWND hwnd );
87cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL ListboxGetSelectedItemIndex( HWND hwnd );
88cdf0e10cSrcweir 
89cdf0e10cSrcweir // checkbox helper functions
90cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL CheckboxGetState( HWND hwnd );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir void SAL_CALL CheckboxSetState(
93cdf0e10cSrcweir     HWND hwnd, const ::com::sun::star::uno::Any& aState, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos )
94cdf0e10cSrcweir     throw( ::com::sun::star::lang::IllegalArgumentException );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir // calculates the length of '\0' separated and '\0\0'
97cdf0e10cSrcweir // ending strings used in some Win32 functions
98cdf0e10cSrcweir // e.g. Filter\0*.txt\0\0
99cdf0e10cSrcweir // the returned length excludes the last '\0'
100cdf0e10cSrcweir sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir // converts a soffice label to a windows label
104cdf0e10cSrcweir // the following rules for character replacements
105cdf0e10cSrcweir // will be done:
106cdf0e10cSrcweir // '~'  -> '&'
107cdf0e10cSrcweir // '~~' -> '~'
108cdf0e10cSrcweir // '&'  -> '&&'
109cdf0e10cSrcweir rtl::OUString SOfficeToWindowsLabel( const rtl::OUString& aSOLabel );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir // converts a windows label to a soffice label
112cdf0e10cSrcweir // the following rules for character replacements
113cdf0e10cSrcweir // will be done:
114cdf0e10cSrcweir // '&'  -> '~'
115cdf0e10cSrcweir // '&&' -> '&'
116cdf0e10cSrcweir // '~'  -> '~~'
117cdf0e10cSrcweir rtl::OUString WindowsToSOfficeLabel( const rtl::OUString& aWinLabel );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir #endif
120