xref: /AOO41X/main/dtrans/source/win32/dtobj/DataFmtTransl.hxx (revision fbcf0fe955ab8df0a2f1d76ae10cf7d5c87503b1)
1*fbcf0fe9SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*fbcf0fe9SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*fbcf0fe9SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*fbcf0fe9SAndrew Rist  * distributed with this work for additional information
6*fbcf0fe9SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*fbcf0fe9SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*fbcf0fe9SAndrew Rist  * "License"); you may not use this file except in compliance
9*fbcf0fe9SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*fbcf0fe9SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*fbcf0fe9SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*fbcf0fe9SAndrew Rist  * software distributed under the License is distributed on an
15*fbcf0fe9SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*fbcf0fe9SAndrew Rist  * KIND, either express or implied.  See the License for the
17*fbcf0fe9SAndrew Rist  * specific language governing permissions and limitations
18*fbcf0fe9SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*fbcf0fe9SAndrew Rist  *************************************************************/
21*fbcf0fe9SAndrew Rist 
22*fbcf0fe9SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _DATAFMTTRANSL_HXX_
26cdf0e10cSrcweir #define _DATAFMTTRANSL_HXX_
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //-----------------------------------------------
29cdf0e10cSrcweir // includes
30cdf0e10cSrcweir //-----------------------------------------------
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <cppuhelper/servicefactory.hxx>
33cdf0e10cSrcweir #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp>
34cdf0e10cSrcweir #include <com/sun/star/datatransfer/XTransferable.hpp>
35cdf0e10cSrcweir #include <sal/types.h>
36cdf0e10cSrcweir #include <rtl/ustring.hxx>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #if defined _MSC_VER
39cdf0e10cSrcweir #pragma warning(push,1)
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #include <windows.h>
42cdf0e10cSrcweir #if defined _MSC_VER
43cdf0e10cSrcweir #pragma warning(pop)
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir 
46cdf0e10cSrcweir //-----------------------------------------------
47cdf0e10cSrcweir // declaration
48cdf0e10cSrcweir //-----------------------------------------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class CFormatEtc;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class CDataFormatTranslator
53cdf0e10cSrcweir {
54cdf0e10cSrcweir public:
55cdf0e10cSrcweir 	CDataFormatTranslator( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&	aServiceManager );
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	CFormatEtc getFormatEtcFromDataFlavor( const com::sun::star::datatransfer::DataFlavor& aDataFlavor ) const;
58cdf0e10cSrcweir 	com::sun::star::datatransfer::DataFlavor getDataFlavorFromFormatEtc(
59cdf0e10cSrcweir 		const FORMATETC& aFormatEtc, LCID lcid = GetThreadLocale( ) ) const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	CFormatEtc    SAL_CALL getFormatEtcForClipformat( CLIPFORMAT cf ) const;
62cdf0e10cSrcweir 	CFormatEtc    SAL_CALL getFormatEtcForClipformatName( const rtl::OUString& aClipFmtName ) const;
63cdf0e10cSrcweir 	rtl::OUString SAL_CALL getClipboardFormatName( CLIPFORMAT aClipformat ) const;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	sal_Bool SAL_CALL isHTMLFormat( CLIPFORMAT cf ) const;
66cdf0e10cSrcweir 	sal_Bool SAL_CALL isTextHtmlFormat( CLIPFORMAT cf ) const;
67cdf0e10cSrcweir 	sal_Bool SAL_CALL isOemOrAnsiTextFormat( CLIPFORMAT cf ) const;
68cdf0e10cSrcweir 	sal_Bool SAL_CALL isUnicodeTextFormat( CLIPFORMAT cf ) const;
69cdf0e10cSrcweir 	sal_Bool SAL_CALL isTextFormat( CLIPFORMAT cf ) const;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir private:
72cdf0e10cSrcweir 	rtl::OUString SAL_CALL getTextCharsetFromLCID( LCID lcid, CLIPFORMAT aClipformat ) const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir private:
75cdf0e10cSrcweir 	const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >	m_SrvMgr;
76cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::datatransfer::XDataFormatTranslator >	m_XDataFormatTranslator;
77cdf0e10cSrcweir };
78cdf0e10cSrcweir 
79cdf0e10cSrcweir #endif
80