merge the formfield patch from ooo-build
[ooovba.git] / dtrans / source / win32 / dtobj / DataFmtTransl.hxx
blob1497cb857d3d39aff19a8057fef9ac0de1621daa
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: DataFmtTransl.hxx,v $
10 * $Revision: 1.10 $
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 _DATAFMTTRANSL_HXX_
33 #define _DATAFMTTRANSL_HXX_
35 //-----------------------------------------------
36 // includes
37 //-----------------------------------------------
39 #include <cppuhelper/servicefactory.hxx>
40 #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp>
41 #include <com/sun/star/datatransfer/XTransferable.hpp>
42 #include <sal/types.h>
43 #include <rtl/ustring.hxx>
45 #if defined _MSC_VER
46 #pragma warning(push,1)
47 #endif
48 #include <windows.h>
49 #if defined _MSC_VER
50 #pragma warning(pop)
51 #endif
53 //-----------------------------------------------
54 // declaration
55 //-----------------------------------------------
57 class CFormatEtc;
59 class CDataFormatTranslator
61 public:
62 CDataFormatTranslator( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager );
64 CFormatEtc getFormatEtcFromDataFlavor( const com::sun::star::datatransfer::DataFlavor& aDataFlavor ) const;
65 com::sun::star::datatransfer::DataFlavor getDataFlavorFromFormatEtc(
66 const FORMATETC& aFormatEtc, LCID lcid = GetThreadLocale( ) ) const;
68 CFormatEtc SAL_CALL getFormatEtcForClipformat( CLIPFORMAT cf ) const;
69 CFormatEtc SAL_CALL getFormatEtcForClipformatName( const rtl::OUString& aClipFmtName ) const;
70 rtl::OUString SAL_CALL getClipboardFormatName( CLIPFORMAT aClipformat ) const;
72 sal_Bool SAL_CALL isHTMLFormat( CLIPFORMAT cf ) const;
73 sal_Bool SAL_CALL isTextHtmlFormat( CLIPFORMAT cf ) const;
74 sal_Bool SAL_CALL isOemOrAnsiTextFormat( CLIPFORMAT cf ) const;
75 sal_Bool SAL_CALL isUnicodeTextFormat( CLIPFORMAT cf ) const;
76 sal_Bool SAL_CALL isTextFormat( CLIPFORMAT cf ) const;
78 private:
79 rtl::OUString SAL_CALL getTextCharsetFromLCID( LCID lcid, CLIPFORMAT aClipformat ) const;
81 private:
82 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_SrvMgr;
83 com::sun::star::uno::Reference< com::sun::star::datatransfer::XDataFormatTranslator > m_XDataFormatTranslator;
86 #endif