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: WinImplHelper.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 ************************************************************************/
32 #ifndef _WINIMPLHELPER_HXX_
33 #define _WINIMPLHELPER_HXX_
35 //------------------------------------------------------------------------
37 //------------------------------------------------------------------------
39 #include <sal/types.h>
40 #include <rtl/ustring.hxx>
43 #pragma warning(push, 1)
49 #include <com/sun/star/uno/Any.hxx>
50 #include <com/sun/star/lang/IllegalArgumentException.hpp>
52 //------------------------------------------------------------------------
54 //------------------------------------------------------------------------
56 bool SAL_CALL
IsWindowsVistaOrNewer();
57 bool SAL_CALL
IsWindows7();
58 bool SAL_CALL
IsWindowsVista();
59 bool SAL_CALL
IsWindows2000();
60 bool SAL_CALL
IsWindowsXP();
61 bool SAL_CALL
IsWindows98();
62 bool SAL_CALL
IsWindowsME();
64 // returns true if the platform is
65 // Windows 2000 or above
66 bool SAL_CALL
IsWindows2000Platform();
68 #define IsWin2000 IsWindows2000
71 void SAL_CALL
ListboxAddItem(
72 HWND hwnd
, const ::com::sun::star::uno::Any
& aItem
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
73 throw( ::com::sun::star::lang::IllegalArgumentException
);
75 void SAL_CALL
ListboxAddItems(
76 HWND hwnd
, const ::com::sun::star::uno::Any
& aItemList
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
77 throw( ::com::sun::star::lang:: IllegalArgumentException
);
79 void SAL_CALL
ListboxDeleteItem(
80 HWND hwnd
, const ::com::sun::star::uno::Any
& aPosition
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
81 throw( ::com::sun::star::lang::IllegalArgumentException
);
83 void SAL_CALL
ListboxDeleteItems(
84 HWND hwnd
, const ::com::sun::star::uno::Any
& aUnused
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
85 throw( ::com::sun::star::lang::IllegalArgumentException
);
87 void SAL_CALL
ListboxSetSelectedItem(
88 HWND hwnd
, const ::com::sun::star::uno::Any
& aPosition
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
89 throw( ::com::sun::star::lang::IllegalArgumentException
);
92 ::com::sun::star::uno::Any SAL_CALL
ListboxGetItems( HWND hwnd
);
93 ::com::sun::star::uno::Any SAL_CALL
ListboxGetSelectedItem( HWND hwnd
);
94 ::com::sun::star::uno::Any SAL_CALL
ListboxGetSelectedItemIndex( HWND hwnd
);
96 // checkbox helper functions
97 ::com::sun::star::uno::Any SAL_CALL
CheckboxGetState( HWND hwnd
);
99 void SAL_CALL
CheckboxSetState(
100 HWND hwnd
, const ::com::sun::star::uno::Any
& aState
, const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rXInterface
, sal_Int16 aArgPos
)
101 throw( ::com::sun::star::lang::IllegalArgumentException
);
103 // calculates the length of '\0' separated and '\0\0'
104 // ending strings used in some Win32 functions
105 // e.g. Filter\0*.txt\0\0
106 // the returned length excludes the last '\0'
107 sal_uInt32 SAL_CALL
_wcslenex( const sal_Unicode
* pStr
);
110 // converts a soffice label to a windows label
111 // the following rules for character replacements
116 rtl::OUString
SOfficeToWindowsLabel( const rtl::OUString
& aSOLabel
);
118 // converts a windows label to a soffice label
119 // the following rules for character replacements
124 rtl::OUString
WindowsToSOfficeLabel( const rtl::OUString
& aWinLabel
);