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: objuno.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 ************************************************************************/
30 #ifndef _SFX_OBJUNO_HXX
31 #define _SFX_OBJUNO_HXX
33 #ifndef _SVSTOR_HXX //autogen
34 #include <bf_so3/svstor.hxx>
37 #ifndef _CPPUHELPER_WEAKREF_HXX_
38 #include <cppuhelper/weakref.hxx>
40 #ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFO_HPP_
41 #include <com/sun/star/document/XDocumentInfo.hpp>
43 #ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFOSUPPLIER_HPP_
44 #include <com/sun/star/document/XDocumentInfoSupplier.hpp>
46 #ifndef _COM_SUN_STAR_DOCUMENT_XSTANDALONEDOCUMENTINFO_HPP_
47 #include <com/sun/star/document/XStandaloneDocumentInfo.hpp>
49 #ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
50 #include <com/sun/star/frame/XController.hpp>
52 #ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
53 #include <com/sun/star/frame/XStorable.hpp>
55 #ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
56 #include <com/sun/star/frame/XModel.hpp>
58 #ifndef _COM_SUN_STAR_VIEW_PAPERFORMAT_HPP_
59 #include <com/sun/star/view/PaperFormat.hpp>
61 #ifndef _COM_SUN_STAR_VIEW_XPRINTSETTINGSSUPPLIER_HPP_
62 #include <com/sun/star/view/XPrintSettingsSupplier.hpp>
64 #ifndef _COM_SUN_STAR_VIEW_XPRINTPREVIEW_HPP_
65 #include <com/sun/star/view/XPrintPreview.hpp>
67 #ifndef _COM_SUN_STAR_VIEW_XPRINTABLE_HPP_
68 #include <com/sun/star/view/XPrintable.hpp>
70 #ifndef _COM_SUN_STAR_VIEW_PAPERORIENTATION_HPP_
71 #include <com/sun/star/view/PaperOrientation.hpp>
73 #ifndef _COM_SUN_STAR_VIEW_XCONTROLACCESS_HPP_
74 #include <com/sun/star/view/XControlAccess.hpp>
76 #ifndef _COM_SUN_STAR_VIEW_XSELECTIONCHANGELISTENER_HPP_
77 #include <com/sun/star/view/XSelectionChangeListener.hpp>
79 #ifndef _COM_SUN_STAR_VIEW_DOCUMENTZOOMTYPE_HPP_
80 #include <com/sun/star/view/DocumentZoomType.hpp>
82 #ifndef _COM_SUN_STAR_VIEW_XSCREENCURSOR_HPP_
83 #include <com/sun/star/view/XScreenCursor.hpp>
85 #ifndef _COM_SUN_STAR_VIEW_XVIEWSETTINGSSUPPLIER_HPP_
86 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
88 #ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_
89 #include <com/sun/star/view/XSelectionSupplier.hpp>
91 #ifndef _COM_SUN_STAR_UTIL_XMODIFYLISTENER_HPP_
92 #include <com/sun/star/util/XModifyListener.hpp>
94 #ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_
95 #include <com/sun/star/util/XModifiable.hpp>
97 #ifndef _COM_SUN_STAR_UTIL_XMODIFYBROADCASTER_HPP_
98 #include <com/sun/star/util/XModifyBroadcaster.hpp>
100 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
101 #include <com/sun/star/beans/PropertyValues.hpp>
103 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
104 #include <com/sun/star/beans/XPropertySet.hpp>
106 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
107 #include <com/sun/star/beans/PropertyValue.hpp>
109 #ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
110 #include <com/sun/star/beans/PropertyState.hpp>
112 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
113 #include <com/sun/star/beans/XPropertySetInfo.hpp>
115 #ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
116 #include <com/sun/star/beans/XMultiPropertySet.hpp>
118 #ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
119 #include <com/sun/star/beans/XFastPropertySet.hpp>
121 #ifndef _COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HPP_
122 #include <com/sun/star/beans/XVetoableChangeListener.hpp>
124 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
125 #include <com/sun/star/beans/XPropertyState.hpp>
127 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HPP_
128 #include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
130 #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
131 #include <com/sun/star/beans/PropertyAttribute.hpp>
133 #ifndef _COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HPP_
134 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
136 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
137 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
139 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
140 #include <com/sun/star/beans/XPropertyAccess.hpp>
142 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_
143 #include <com/sun/star/beans/XPropertyContainer.hpp>
145 #ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HPP_
146 #include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
148 #ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
149 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
151 #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
152 #include <com/sun/star/lang/XEventListener.hpp>
154 #ifndef _COM_SUN_STAR_LANG_EVENTOBJECT_HPP_
155 #include <com/sun/star/lang/EventObject.hpp>
157 #ifndef _COM_SUN_STAR_SCRIPT_XALLLISTENERADAPTERSERVICE_HPP_
158 #include <com/sun/star/script/XAllListenerAdapterService.hpp>
160 #ifndef _COM_SUN_STAR_SCRIPT_XALLLISTENER_HPP_
161 #include <com/sun/star/script/XAllListener.hpp>
163 #ifndef _COM_SUN_STAR_SCRIPT_ALLEVENTOBJECT_HPP_
164 #include <com/sun/star/script/AllEventObject.hpp>
166 #ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
167 #include <com/sun/star/container/XChild.hpp>
169 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
170 #include <com/sun/star/lang/XServiceInfo.hpp>
172 #ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
173 #include <com/sun/star/util/DateTime.hpp>
176 #include <com/sun/star/io/IOException.hpp>
178 #include <bf_svtools/itemprop.hxx>
179 #include <bf_svtools/lstner.hxx>
180 #ifndef _SFX_SFXBASEMODEL_HXX_
181 #include <bf_sfx2/sfxbasemodel.hxx>
183 #ifndef _DATETIME_HXX
184 #include <tools/datetime.hxx>
186 #include <bf_sfx2/sfxuno.hxx>
187 #include <bf_sfx2/objsh.hxx>
188 namespace binfilter
{
190 class SfxDocumentInfo
;
194 class SfxDocumentInfoObject
: public ::com::sun::star::lang::XTypeProvider
,
195 public ::com::sun::star::document::XDocumentInfo
,
196 public ::com::sun::star::lang::XComponent
,
197 public ::com::sun::star::beans::XPropertySet
,
198 public ::com::sun::star::beans::XFastPropertySet
,
199 public ::com::sun::star::beans::XPropertyAccess
,
200 public ::cppu::OWeakObject
202 SfxItemPropertySet _aPropSet
;
203 sal_Bool _bStandalone
;
206 struct SfxDocumentInfoObject_Impl
* _pImp
;
207 SfxDocumentInfo
* _pInfo
;
208 const SfxFilter
* _pFilter
;
209 ::com::sun::star::uno::WeakReference
< ::com::sun::star::frame::XModel
> _wModel
;
211 SfxDocumentInfoObject( sal_Bool bStandalone
);
213 SfxDocumentInfoObject( SfxObjectShell
*pObjSh
);
214 ~SfxDocumentInfoObject();
216 // XInterface, XTypeProvider
217 SFX_DECL_XINTERFACE_XTYPEPROVIDER
219 //ASDBG virtual void* getImplementation(Reflection *p)
220 //ASDBG { return OWeakObject::getImplementation(p); }
223 virtual void SAL_CALL
dispose() throw( ::com::sun::star::uno::RuntimeException
);
224 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw( ::com::sun::star::uno::RuntimeException
);
225 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw( ::com::sun::star::uno::RuntimeException
);
228 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException
);
229 virtual void SAL_CALL
setPropertyValue(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw( ::com::sun::star::uno::RuntimeException
);
230 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue(const ::rtl::OUString
& aPropertyName
) throw( ::com::sun::star::uno::RuntimeException
);
231 virtual void SAL_CALL
addPropertyChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
232 virtual void SAL_CALL
removePropertyChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
233 virtual void SAL_CALL
addVetoableChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
234 virtual void SAL_CALL
removeVetoableChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
236 // ::com::sun::star::beans::XFastPropertySet
237 virtual void SAL_CALL
setFastPropertyValue(sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& aValue
) throw( ::com::sun::star::uno::RuntimeException
);
238 virtual ::com::sun::star::uno::Any SAL_CALL
getFastPropertyValue(sal_Int32 nHandle
) throw( ::com::sun::star::uno::RuntimeException
);
240 // ::com::sun::star::beans::XPropertyAccess
241 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> SAL_CALL
getPropertyValues() throw( ::com::sun::star::uno::RuntimeException
);
242 virtual void SAL_CALL
setPropertyValues( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aProps
) throw( ::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
244 // ::com::sun::star::document::XDocumentInfo
245 virtual sal_Int16 SAL_CALL
getUserFieldCount() throw( ::com::sun::star::uno::RuntimeException
);
246 virtual ::rtl::OUString SAL_CALL
getUserFieldName(sal_Int16 nIndex
) throw( ::com::sun::star::uno::RuntimeException
);
247 virtual ::rtl::OUString SAL_CALL
getUserFieldValue(sal_Int16 nIndex
) throw( ::com::sun::star::uno::RuntimeException
);
248 virtual void SAL_CALL
setUserFieldName(sal_Int16 nIndex
, const ::rtl::OUString
& aName
) throw( ::com::sun::star::uno::RuntimeException
);
249 virtual void SAL_CALL
setUserFieldValue(sal_Int16 nIndex
, const ::rtl::OUString
& aValue
) throw( ::com::sun::star::uno::RuntimeException
);
251 static ::com::sun::star::util::DateTime
impl_DateTime_Object2Struct( const DateTime
& aDateTimeObject
);
252 static DateTime
impl_DateTime_Struct2Object ( const ::com::sun::star::util::DateTime
& aDateTimeStruct
);
255 class SfxStandaloneDocumentInfoObject
: public SfxDocumentInfoObject
,
256 public ::com::sun::star::lang::XServiceInfo
,
257 public ::com::sun::star::document::XStandaloneDocumentInfo
260 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> _xFactory
;
262 SvStorage
* GetStorage_Impl( const String
& rName
, sal_Bool bWrite
);
265 SfxStandaloneDocumentInfoObject( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
);
266 virtual ~SfxStandaloneDocumentInfoObject();
268 // XInterface, XTypeProvider, XServiceInfo
269 SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
271 // ÎMPLNAME L"com.sun.star.comp.sfx2.StandaloneDocumentInfo"
272 //ASDBG virtual void* getImplementation(Reflection *p)
273 //ASDBG { return Sf::com::sun::star::document::XDocumentInfoObject::getImplementation(p); }
275 // ::com::sun::star::document::XDocumentInfo
276 virtual sal_Int16 SAL_CALL
getUserFieldCount() throw( ::com::sun::star::uno::RuntimeException
);
277 virtual ::rtl::OUString SAL_CALL
getUserFieldName(sal_Int16 nIndex
) throw( ::com::sun::star::uno::RuntimeException
);
278 virtual ::rtl::OUString SAL_CALL
getUserFieldValue(sal_Int16 nIndex
) throw( ::com::sun::star::uno::RuntimeException
);
279 virtual void SAL_CALL
setUserFieldName(sal_Int16 nIndex
, const ::rtl::OUString
& aName
) throw( ::com::sun::star::uno::RuntimeException
);
280 virtual void SAL_CALL
setUserFieldValue(sal_Int16 nIndex
, const ::rtl::OUString
& aValue
) throw( ::com::sun::star::uno::RuntimeException
);
282 // ::com::sun::star::document::XStandaloneDocumentInfo
283 virtual void SAL_CALL
loadFromURL(const ::rtl::OUString
& aURL
) throw( ::com::sun::star::io::IOException
);
284 virtual void SAL_CALL
storeIntoURL(const ::rtl::OUString
& aURL
) throw( ::com::sun::star::io::IOException
);
287 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
> SAL_CALL
bf_BinaryDocInfo_createInstance(const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> & rSMgr
)
288 throw( com::sun::star::uno::Exception
);
290 }//end of namespace binfilter