1*353d8f4dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*353d8f4dSAndrew Rist * distributed with this work for additional information 6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance 9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an 15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the 17*353d8f4dSAndrew Rist * specific language governing permissions and limitations 18*353d8f4dSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*353d8f4dSAndrew Rist *************************************************************/ 21*353d8f4dSAndrew Rist 22*353d8f4dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 25cdf0e10cSrcweir #include <com/sun/star/io/XStream.hpp> 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <rtl/ustring.hxx> 28cdf0e10cSrcweir class SvMemoryStream; 29cdf0e10cSrcweir class GDIMetaFile; 30cdf0e10cSrcweir class BitmapEx; 31cdf0e10cSrcweir 32cdf0e10cSrcweir class GraphicHelper 33cdf0e10cSrcweir { 34cdf0e10cSrcweir 35cdf0e10cSrcweir static sal_Bool mergeBitmaps_Impl( const BitmapEx& rBmpEx, const BitmapEx& rOverlay, 36cdf0e10cSrcweir const Rectangle& rOverlayRect, BitmapEx& rReturn ); 37cdf0e10cSrcweir 38cdf0e10cSrcweir static sal_Bool createThumb_Impl( const GDIMetaFile& rMtf, 39cdf0e10cSrcweir sal_uInt32 nMaximumExtent, 40cdf0e10cSrcweir BitmapEx& rBmpEx, 41cdf0e10cSrcweir const BitmapEx* pOverlay = NULL, 42cdf0e10cSrcweir const Rectangle* pOverlayRect = NULL ); 43cdf0e10cSrcweir 44cdf0e10cSrcweir public: 45cdf0e10cSrcweir 46cdf0e10cSrcweir static SvMemoryStream* getFormatStrFromGDI_Impl( const GDIMetaFile* pGDIMeta, sal_uInt32 nFormat ); 47cdf0e10cSrcweir 48cdf0e10cSrcweir static void* getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta ); 49cdf0e10cSrcweir 50cdf0e10cSrcweir static void* getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, const Size& aMetaSize ); 51cdf0e10cSrcweir 52cdf0e10cSrcweir static sal_Bool supportsMetaFileHandle_Impl(); 53cdf0e10cSrcweir 54cdf0e10cSrcweir static sal_Bool getThumbnailFormatFromGDI_Impl( 55cdf0e10cSrcweir GDIMetaFile* pMetaFile, 56cdf0e10cSrcweir sal_Bool bSigned, 57cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); 58cdf0e10cSrcweir 59cdf0e10cSrcweir static sal_Bool getSignedThumbnailFormatFromBitmap_Impl( 60cdf0e10cSrcweir const BitmapEx& aBitmap, 61cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); 62cdf0e10cSrcweir 63cdf0e10cSrcweir static sal_uInt16 getThumbnailReplacementIDByFactoryName_Impl( const ::rtl::OUString& aFactoryShortName, 64cdf0e10cSrcweir sal_Bool bIsTemplate ); 65cdf0e10cSrcweir 66cdf0e10cSrcweir static sal_Bool getThumbnailReplacement_Impl( 67cdf0e10cSrcweir sal_Int32 nResID, 68cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream ); 69cdf0e10cSrcweir 70cdf0e10cSrcweir }; 71cdf0e10cSrcweir 72