1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
57 * For LWP filter architecture prototype - OLE object
59 /*************************************************************************
62 ************************************************************************/
63 #ifndef _LWPOLEOBJECT_HXX_
64 #define _LWPOLEOBJECT_HXX_
67 #include "lwpobjhdr.hxx"
68 #include "lwpobjid.hxx"
69 #include "lwpstory.hxx"
70 #include "tools/gen.hxx"
72 #include <so3/svstor.hxx>
73 #include <so3/outplace.hxx>
74 #include <so3/ipobj.hxx>
75 #include <so3/factory.hxx>
77 #include <svx/svdoole2.hxx>
78 #include <svx/svdpage.hxx>
79 #include <sfx2/objsh.hxx>
80 #include <sot/storinfo.hxx>
83 typedef struct tagAFID_CACHE
85 unsigned long LinkedFileSize
; /* 0 if not linked */
86 unsigned long LinkedFileTime
; /* 0 if not linked */
87 long Width
; /* -1 if not present */
88 long Height
; /* -1 if not present */
89 } AFID_CACHE
, * PAFID_CACHE
;
91 /* Maximum string sizes - includes space for null terminator */
92 #define AFID_MAX_FILE_FORMAT_SIZE 80
93 #define AFID_MAX_CONTEXT_FORMAT_SIZE 80
95 // OLE defined maximum
96 #define MAX_STREAMORSTORAGENAME 32
99 * super class of LwpOleObject and LwpGraphicObject
101 class LwpGraphicOleObject
: public LwpContent
104 LwpGraphicOleObject(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
106 virtual void GetGrafScaledSize(double& fWidth
, double& fHeight
);
107 virtual void GetGrafOrgSize(double& rWidth
, double& rHeight
);
109 LwpObjectID m_pPrevObj
;
110 LwpObjectID m_pNextObj
;
112 rtl::OUString m_strStyleName
;
115 class LwpFrameLayout
;
118 * class to read and parse VO_OLEOBJECT object
120 class LwpOleObject
: public LwpGraphicOleObject
123 LwpOleObject(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
126 virtual void Parse(IXFStream
* pOutputStream
);
127 virtual void XFConvert(XFContentContainer
* pCont
);
128 virtual void RegisterStyle();
129 void GetGrafOrgSize(double& rWidth
, double& rHeight
) ;
131 void GetChildStorageName(char *pObjName
);
132 Rectangle
GetOLEObjectSize( SotStorage
* pStor
) const;
134 sal_uInt16 cPersistentFlags
;
136 Rectangle m_SizeRect
;
140 * Added by for SODC_2667,03/20/2006
141 * Read the OLE Object stream and get the info of the OLE picture
143 #include <tools/stream.hxx>
144 #include <vcl/gdimtf.hxx>
145 #include <vcl/bitmap.hxx>
146 #include <vcl/outdev.hxx>
157 Size aSize
; // Groesse in 100TH_MM
159 LwpOlePres( ULONG nF
)
161 , nAdvFlags( 0x2 ) // in Dokument gefunden
173 void SetMtf( const GDIMetaFile
& rMtf
)
177 pMtf
= new GDIMetaFile( rMtf
);
179 Bitmap
*GetBitmap() const { return pBmp
; }
180 GDIMetaFile
*GetMetaFile() const { return pMtf
; }
181 ULONG
GetFormat() const { return nFormat
; }
182 void SetAspect( USHORT nAsp
) { nAspect
= nAsp
; }
183 ULONG
GetAdviseFlags() const { return nAdvFlags
; }
184 void SetAdviseFlags( ULONG nAdv
) { nAdvFlags
= nAdv
; }
185 void SetSize( const Size
& rSize
) { aSize
= rSize
; }
186 Size
GetSize() const { return aSize
; } //Add by , 10/26/2005
187 /// return FALSE => unknown format
188 BOOL
Read( SvStream
& rStm
);
189 void Write( SvStream
& rStm
);