summaryrefslogtreecommitdiffstats
path: root/sot
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-04-11 19:53:04 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-04-11 19:53:04 +0000
commit1dcdb6118da8876c0c773f2976a4e33ab76c787e (patch)
treeb16076a2690712db20e580cf5c04304ea304c199 /sot
parentINTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED (diff)
downloadcore-1dcdb6118da8876c0c773f2976a4e33ab76c787e.tar.gz
core-1dcdb6118da8876c0c773f2976a4e33ab76c787e.zip
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2007/02/09 16:14:16 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to sot/inc/sot and correspondent necessary changes
Diffstat (limited to 'sot')
-rw-r--r--sot/inc/sot/formats.hxx202
-rw-r--r--sot/inc/sot/object.hxx482
-rw-r--r--sot/inc/sot/sotdata.hxx71
-rw-r--r--sot/inc/sot/sotref.hxx85
4 files changed, 840 insertions, 0 deletions
diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx
new file mode 100644
index 000000000000..d3b0ec7fcb62
--- /dev/null
+++ b/sot/inc/sot/formats.hxx
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: formats.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:52:34 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SOT_FORMATS_HXX
+#define _SOT_FORMATS_HXX
+
+#ifdef _SOT_FORMATS_INCLUDE_SYSTEMFORMATS
+
+#ifdef WNT
+#ifdef _MSC_VER
+#pragma warning(push, 1)
+#pragma warning(disable: 4917)
+#endif
+#include <tools/prewin.h>
+#include <shlobj.h>
+#include <tools/postwin.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+
+#endif
+
+#ifndef _SOT_EXCHANGE_HXX
+#include <sot/exchange.hxx>
+#endif
+
+#define SOT_FORMAT_SYSTEM_START ((ULONG)0)
+#define SOT_FORMAT_STRING ((ULONG)FORMAT_STRING)
+#define SOT_FORMAT_BITMAP ((ULONG)FORMAT_BITMAP)
+#define SOT_FORMAT_GDIMETAFILE ((ULONG)FORMAT_GDIMETAFILE)
+#define SOT_FORMAT_PRIVATE ((ULONG)FORMAT_PRIVATE)
+#define SOT_FORMAT_FILE ((ULONG)FORMAT_FILE)
+#define SOT_FORMAT_FILE_LIST ((ULONG)FORMAT_FILE_LIST)
+#define SOT_FORMAT_RTF ((ULONG)FORMAT_RTF)
+
+#define SOT_FORMATSTR_ID_DRAWING ((ULONG)11)
+#define SOT_FORMATSTR_ID_SVXB ((ULONG)12)
+#define SOT_FORMATSTR_ID_SVIM ((ULONG)13)
+#define SOT_FORMATSTR_ID_XFA ((ULONG)14)
+#define SOT_FORMATSTR_ID_EDITENGINE ((ULONG)15)
+#define SOT_FORMATSTR_ID_INTERNALLINK_STATE ((ULONG)16)
+#define SOT_FORMATSTR_ID_SOLK ((ULONG)17)
+#define SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ((ULONG)18)
+#define SOT_FORMATSTR_ID_TREELISTBOX ((ULONG)19)
+#define SOT_FORMATSTR_ID_NATIVE ((ULONG)20)
+#define SOT_FORMATSTR_ID_OWNERLINK ((ULONG)21)
+#define SOT_FORMATSTR_ID_STARSERVER ((ULONG)22)
+#define SOT_FORMATSTR_ID_STAROBJECT ((ULONG)23)
+#define SOT_FORMATSTR_ID_APPLETOBJECT ((ULONG)24)
+#define SOT_FORMATSTR_ID_PLUGIN_OBJECT ((ULONG)25)
+#define SOT_FORMATSTR_ID_STARWRITER_30 ((ULONG)26)
+#define SOT_FORMATSTR_ID_STARWRITER_40 ((ULONG)27)
+#define SOT_FORMATSTR_ID_STARWRITER_50 ((ULONG)28)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_40 ((ULONG)29)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_50 ((ULONG)30)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_40 ((ULONG)31)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_50 ((ULONG)32)
+#define SOT_FORMATSTR_ID_STARDRAW ((ULONG)33)
+#define SOT_FORMATSTR_ID_STARDRAW_40 ((ULONG)34)
+#define SOT_FORMATSTR_ID_STARIMPRESS_50 ((ULONG)35)
+#define SOT_FORMATSTR_ID_STARDRAW_50 ((ULONG)36)
+#define SOT_FORMATSTR_ID_STARCALC ((ULONG)37)
+#define SOT_FORMATSTR_ID_STARCALC_40 ((ULONG)38)
+#define SOT_FORMATSTR_ID_STARCALC_50 ((ULONG)39)
+#define SOT_FORMATSTR_ID_STARCHART ((ULONG)40)
+#define SOT_FORMATSTR_ID_STARCHART_40 ((ULONG)41)
+#define SOT_FORMATSTR_ID_STARCHART_50 ((ULONG)42)
+#define SOT_FORMATSTR_ID_STARIMAGE ((ULONG)43)
+#define SOT_FORMATSTR_ID_STARIMAGE_40 ((ULONG)44)
+#define SOT_FORMATSTR_ID_STARIMAGE_50 ((ULONG)45)
+#define SOT_FORMATSTR_ID_STARMATH ((ULONG)46)
+#define SOT_FORMATSTR_ID_STARMATH_40 ((ULONG)47)
+#define SOT_FORMATSTR_ID_STARMATH_50 ((ULONG)48)
+#define SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC ((ULONG)49)
+#define SOT_FORMATSTR_ID_FILLED_AREA ((ULONG)50)
+#define SOT_FORMATSTR_ID_HTML ((ULONG)51)
+#define SOT_FORMATSTR_ID_HTML_SIMPLE ((ULONG)52)
+#define SOT_FORMATSTR_ID_CHAOS ((ULONG)53)
+#define SOT_FORMATSTR_ID_CNT_MSGATTACHFILE ((ULONG)54)
+#define SOT_FORMATSTR_ID_BIFF_5 ((ULONG)55)
+#define SOT_FORMATSTR_ID_BIFF__5 ((ULONG)56)
+#define SOT_FORMATSTR_ID_SYLK ((ULONG)57)
+#define SOT_FORMATSTR_ID_SYLK_BIGCAPS ((ULONG)58)
+#define SOT_FORMATSTR_ID_LINK ((ULONG)59)
+#define SOT_FORMATSTR_ID_DIF ((ULONG)60)
+#define SOT_FORMATSTR_ID_STARDRAW_TABBAR ((ULONG)61)
+#define SOT_FORMATSTR_ID_SONLK ((ULONG)62)
+#define SOT_FORMATSTR_ID_MSWORD_DOC ((ULONG)63)
+#define SOT_FORMATSTR_ID_STAR_FRAMESET_DOC ((ULONG)64)
+#define SOT_FORMATSTR_ID_OFFICE_DOC ((ULONG)65)
+#define SOT_FORMATSTR_ID_NOTES_DOCINFO ((ULONG)66)
+#define SOT_FORMATSTR_ID_NOTES_HNOTE ((ULONG)67)
+#define SOT_FORMATSTR_ID_NOTES_NATIVE ((ULONG)68)
+#define SOT_FORMATSTR_ID_SFX_DOC ((ULONG)69)
+#define SOT_FORMATSTR_ID_EVDF ((ULONG)70)
+#define SOT_FORMATSTR_ID_ESDF ((ULONG)71)
+#define SOT_FORMATSTR_ID_IDF ((ULONG)72)
+#define SOT_FORMATSTR_ID_EFTP ((ULONG)73)
+#define SOT_FORMATSTR_ID_EFD ((ULONG)74)
+#define SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH ((ULONG)75)
+#define SOT_FORMATSTR_ID_EXTENDED_TABBAR ((ULONG)76)
+#define SOT_FORMATSTR_ID_SBA_DATAEXCHANGE ((ULONG)77)
+#define SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE ((ULONG)78)
+#define SOT_FORMATSTR_ID_SBA_PRIVATE_URL ((ULONG)79)
+#define SOT_FORMATSTR_ID_SBA_TABED ((ULONG)80)
+#define SOT_FORMATSTR_ID_SBA_TABID ((ULONG)81)
+#define SOT_FORMATSTR_ID_SBA_JOIN ((ULONG)82)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ((ULONG)83)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR ((ULONG)84)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE ((ULONG)85)
+#define SOT_FORMATSTR_ID_LINK_SOURCE ((ULONG)86)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ ((ULONG)87)
+#define SOT_FORMATSTR_ID_FILECONTENT ((ULONG)88)
+#define SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ((ULONG)89)
+#define SOT_FORMATSTR_ID_FILENAME ((ULONG)90)
+#define SOT_FORMATSTR_ID_SD_OLE ((ULONG)91)
+#define SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE ((ULONG)92)
+#define SOT_FORMATSTR_ID_EMBED_SOURCE_OLE ((ULONG)93)
+#define SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ((ULONG)94)
+#define SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE ((ULONG)95)
+#define SOT_FORMATSTR_ID_LINK_SOURCE_OLE ((ULONG)96)
+#define SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE ((ULONG)97)
+#define SOT_FORMATSTR_ID_OUTPLACE_OBJ ((ULONG)98)
+#define SOT_FORMATSTR_ID_CNT_OWN_CLIP ((ULONG)99)
+#define SOT_FORMATSTR_ID_INET_IMAGE ((ULONG)100)
+#define SOT_FORMATSTR_ID_NETSCAPE_IMAGE ((ULONG)101)
+#define SOT_FORMATSTR_ID_SBA_FORMEXCHANGE ((ULONG)102)
+#define SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE ((ULONG)103)
+#define SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ((ULONG)104)
+#define SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 ((ULONG)105)
+#define SOT_FORMATSTR_ID_GRAPHOBJ ((ULONG)106)
+#define SOT_FORMATSTR_ID_STARWRITER_60 ((ULONG)107)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_60 ((ULONG)108)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_60 ((ULONG)109)
+#define SOT_FORMATSTR_ID_STARDRAW_60 ((ULONG)110)
+#define SOT_FORMATSTR_ID_STARIMPRESS_60 ((ULONG)111)
+#define SOT_FORMATSTR_ID_STARCALC_60 ((ULONG)112)
+#define SOT_FORMATSTR_ID_STARCHART_60 ((ULONG)113)
+#define SOT_FORMATSTR_ID_STARMATH_60 ((ULONG)114)
+#define SOT_FORMATSTR_ID_WMF ((ULONG)115)
+#define SOT_FORMATSTR_ID_DBACCESS_QUERY ((ULONG)116)
+#define SOT_FORMATSTR_ID_DBACCESS_TABLE ((ULONG)117)
+#define SOT_FORMATSTR_ID_DBACCESS_COMMAND ((ULONG)118)
+#define SOT_FORMATSTR_ID_DIALOG_60 ((ULONG)119)
+#define SOT_FORMATSTR_ID_EMF ((ULONG)120)
+#define SOT_FORMATSTR_ID_BIFF_8 ((ULONG)121)
+#define SOT_FORMATSTR_ID_BMP ((ULONG)122)
+#define SOT_FORMATSTR_ID_HTML_NO_COMMENT ((ULONG)123)
+#define SOT_FORMATSTR_ID_STARWRITER_8 ((ULONG)124)
+#define SOT_FORMATSTR_ID_STARWRITERWEB_8 ((ULONG)125)
+#define SOT_FORMATSTR_ID_STARWRITERGLOB_8 ((ULONG)126)
+#define SOT_FORMATSTR_ID_STARDRAW_8 ((ULONG)127)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8 ((ULONG)128)
+#define SOT_FORMATSTR_ID_STARCALC_8 ((ULONG)129)
+#define SOT_FORMATSTR_ID_STARCHART_8 ((ULONG)130)
+#define SOT_FORMATSTR_ID_STARMATH_8 ((ULONG)131)
+#define SOT_FORMATSTR_ID_XFORMS ((ULONG)132)
+#define SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE ((ULONG)133)
+#define SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE ((ULONG)134)
+#define SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE ((ULONG)135)
+#define SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE ((ULONG)136)
+#define SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE ((ULONG)137)
+#define SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE ((ULONG)138)
+#define SOT_FORMATSTR_ID_STARBASE_8 ((ULONG)139)
+#define SOT_FORMATSTR_ID_HC_GDIMETAFILE ((ULONG)140)
+#define SOT_FORMATSTR_ID_USER_END SOT_FORMATSTR_ID_HC_GDIMETAFILE
+
+#endif // _SOT_FORMATS_HXX
+
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
new file mode 100644
index 000000000000..153d50c159c0
--- /dev/null
+++ b/sot/inc/sot/object.hxx
@@ -0,0 +1,482 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: object.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:52:44 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SOT_OBJECT_HXX
+#define _SOT_OBJECT_HXX
+
+#ifndef _SOT_SOTREF_HXX
+#include <sot/sotref.hxx>
+#endif
+#ifndef _SOT_SOTDATA_HXX
+#include <sot/sotdata.hxx>
+#endif
+#ifndef _TOOLS_GLOBNAME_HXX
+#include <tools/globname.hxx>
+#endif
+#ifndef INCLUDED_SOTDLLAPI_H
+#include "sot/sotdllapi.h"
+#endif
+
+/*************************************************************************
+*************************************************************************/
+
+#define TEST_INVARIANT
+#ifdef TEST_INVARIANT
+#define SO2_DECL_INVARIANT() \
+ virtual void TestObjRef( BOOL bFree ); \
+ void TestMemberObjRef( BOOL bFree ); \
+ virtual void TestInvariant( BOOL bPrint ); \
+ void TestMemberInvariant( BOOL bPrint );
+
+#define SO2_IMPL_INVARIANT(ClassName) \
+void __EXPORT ClassName::TestObjRef( BOOL bFree ) \
+{ \
+ TestMemberObjRef( bFree ); \
+} \
+void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \
+{ \
+ TestMemberInvariant( bPrint ); \
+}
+
+#define SO2_IMPL_INVARIANT1(ClassName,Super1) \
+void __EXPORT ClassName::TestObjRef( BOOL bFree ) \
+{ \
+ TestMemberObjRef( bFree ); \
+ Super1::TestObjRef( bFree ); \
+} \
+void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \
+{ \
+ TestMemberInvariant( bPrint ); \
+ Super1::TestInvariant( bPrint ); \
+}
+
+#define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \
+void __EXPORT ClassName::TestObjRef( BOOL bFree ) \
+{ \
+ TestMemberObjRef( bFree ); \
+ Super1::TestObjRef( bFree ); \
+ Super2::TestObjRef( bFree ); \
+} \
+void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \
+{ \
+ TestMemberInvariant( bPrint ); \
+ Super1::TestInvariant( bPrint ); \
+ Super2::TestInvariant( bPrint ); \
+}
+
+#define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \
+void __EXPORT ClassName::TestObjRef( BOOL bFree ) \
+{ \
+ TestMemberObjRef( bFree ); \
+ Super1::TestObjRef( bFree ); \
+ Super2::TestObjRef( bFree ); \
+ Super3::TestObjRef( bFree ); \
+} \
+void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \
+{ \
+ TestMemberInvariant( bPrint ); \
+ Super1::TestInvariant( bPrint ); \
+ Super2::TestInvariant( bPrint ); \
+ Super3::TestInvariant( bPrint ); \
+}
+
+#define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \
+void __EXPORT ClassName::TestObjRef( BOOL bFree ) \
+{ \
+ TestMemberObjRef( bFree ); \
+ Super1::TestObjRef( bFree ); \
+ Super2::TestObjRef( bFree ); \
+ Super3::TestObjRef( bFree ); \
+ Super4::TestObjRef( bFree ); \
+} \
+void __EXPORT ClassName::TestInvariant( BOOL bPrint ) \
+{ \
+ TestMemberInvariant( bPrint ); \
+ Super1::TestInvariant( bPrint ); \
+ Super2::TestInvariant( bPrint ); \
+ Super3::TestInvariant( bPrint ); \
+ Super4::TestInvariant( bPrint ); \
+}
+
+#ifdef DBG_UTIL
+#define CALL_TEST_INVARIANT() SotFactory::TestInvariant()
+#else
+#define CALL_TEST_INVARIANT()
+#endif // DBG_UTIL
+
+#else // TEST_INVARIANT
+
+#define SO2_DECL_INVARIANT()
+
+#define SO2_IMPL_INVARIANT(ClassName)
+#define SO2_IMPL_INVARIANT1(ClassName,Super1)
+#define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2)
+#define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3)
+#define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4)
+
+#define CALL_TEST_INVARIANT()
+
+#endif // TEST_INVARIANT
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_DECL_BASIC_CLASS_DLL(ClassName,FacName) \
+private: \
+ static SotFactory ** GetFactoryAdress() \
+ { return &(FacName->p##ClassName##Factory); } \
+public: \
+ static void * CreateInstance( SotObject ** = NULL ); \
+ static SotFactory * ClassFactory(); \
+ virtual const SotFactory * GetSvFactory() const; \
+ virtual void * Cast( const SotFactory * );
+
+#define SO2_DECL_BASIC_CLASS(ClassName) \
+private: \
+ static SotFactory * pFactory; \
+ static SotFactory ** GetFactoryAdress() { return &pFactory; } \
+public: \
+ static void * CreateInstance( SotObject ** = NULL ); \
+ static SotFactory * ClassFactory(); \
+ virtual const SotFactory * GetSvFactory() const; \
+ virtual void * Cast( const SotFactory * );
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS_DLL(ClassName,FactoryName,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( #ClassName ) ), \
+ ClassName::CreateInstance ); \
+ } \
+ return *ppFactory; \
+} \
+void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * __EXPORT ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS(ClassName,FactoryName,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS_DLL(ClassName,FactoryName,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS1_DLL(ClassName,FactoryName,Super1,GlobalName)\
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( #ClassName ) ), \
+ ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ Super1* pSuper1 = p; \
+ SotObject* pBasicObj = pSuper1; \
+ if( ppObj ) \
+ *ppObj = pBasicObj; \
+ return p; \
+} \
+const SotFactory * __EXPORT ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS1(ClassName,FactoryName,Super1,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS1_DLL(ClassName,FactoryName,Super1,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS2_DLL(ClassName,FactoryName,Super1,Super2,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( #ClassName ) ), \
+ ClassName::CreateInstance ); \
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * __EXPORT ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ return pRet; \
+}
+#define SO2_IMPL_BASIC_CLASS2(ClassName,FactoryName,Super1,Super2,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS2_DLL(ClassName,FactoryName,Super1,Super2,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS3_DLL(ClassName,FactoryName,Super1,Super2,Super3,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new FactoryName( GlobalName, \
+ String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( #ClassName ) ), \
+ ClassName::CreateInstance );\
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super3::ClassFactory() ); \
+ } \
+ return *pFactory; \
+} \
+void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * __EXPORT ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super3::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS3(ClassName,FactoryName,Super1,Super2,Super3,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS3_DLL(ClassName,FactoryName,Super1,Super2,Super3,GlobalName)
+
+/**************************************************************************
+**************************************************************************/
+#define SO2_IMPL_BASIC_CLASS4_DLL(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName) \
+SotFactory * ClassName::ClassFactory() \
+{ \
+ SotFactory **ppFactory = GetFactoryAdress(); \
+ if( !*ppFactory ) \
+ { \
+ *ppFactory = new SotFactory( GlobalName, \
+ String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( #ClassName ) ), \
+ ClassName::CreateInstance );\
+ (*ppFactory)->PutSuperClass( Super1::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super2::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super3::ClassFactory() ); \
+ (*ppFactory)->PutSuperClass( Super4::ClassFactory() ); \
+ } \
+ return *ppFactory; \
+} \
+void * __EXPORT ClassName::CreateInstance( SotObject ** ppObj ) \
+{ \
+ ClassName * p = new ClassName(); \
+ if( ppObj ) \
+ *ppObj = p; \
+ return p; \
+} \
+const SotFactory * __EXPORT ClassName::GetSvFactory() const \
+{ \
+ return ClassFactory(); \
+} \
+void * __EXPORT ClassName::Cast( const SotFactory * pFact ) \
+{ \
+ void * pRet = NULL; \
+ if( !pFact || pFact == ClassFactory() ) \
+ pRet = this; \
+ if( !pRet ) \
+ pRet = Super1::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super2::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super3::Cast( pFact ); \
+ if( !pRet ) \
+ pRet = Super4::Cast( pFact ); \
+ return pRet; \
+}
+
+#define SO2_IMPL_BASIC_CLASS4(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName) \
+SotFactory * ClassName::pFactory = NULL; \
+ SO2_IMPL_BASIC_CLASS4_DLL(ClassName,FactoryName,Super1,Super2,Super3,Super4,GlobalName)
+
+//==================class SotObject========================================
+#ifdef MSC
+#pragma warning(disable: 4250)
+#endif
+
+class SvAggregateMemberList;
+struct IUnknown;
+class SOT_DLLPUBLIC SotObject : virtual public SvRefBase
+{
+friend class SotFactory;
+friend class SvObject;
+ SvAggregateMemberList * pAggList; // fuer Aggregation, erstes ist das MainObj
+ USHORT nStrongLockCount;
+ USHORT nOwnerLockCount;
+ BOOL bOwner:1,
+ bSVObject:1, // Ist Proxy, dann TRUE wenn andere Seite SV ist
+ bInClose:1; // TRUE, im DoClose
+
+ void * DownAggCast( const SotFactory * pFact );
+ void RemoveInterface( ULONG );
+ void RemoveInterface( SotObject * );
+#if defined (GCC) && (defined (C281) || defined (C290) || defined (C291))
+public:
+#else
+protected:
+#endif
+ virtual ~SotObject();
+ void SetExtern() { bOwner = FALSE; }
+ virtual BOOL Close();
+public:
+ SotObject();
+ SO2_DECL_BASIC_CLASS_DLL(SotObject,SOTDATA())
+ SO2_DECL_INVARIANT()
+
+ // Nur damit die Makros in So3 nicht ganz ausufern
+ virtual IUnknown * GetInterface( const SvGlobalName & );
+
+ BOOL Owner() const { return bOwner; }
+ BOOL IsSvObject() const;
+
+ // Methoden fuer die Aggregation (siehe OLE2-Spec)
+ BOOL ShouldDelete();
+ virtual void QueryDelete();
+ SvAggregateMemberList & GetAggList();
+ void AddInterface( SotObject * );
+ void AddInterface( SotFactory * );
+ virtual SotObjectRef CreateAggObj( const SotFactory * );
+ void * AggCast( const SotFactory * pFact );
+ void * CastAndAddRef( const SotFactory * pFact );
+ SotObject * GetMainObj() const;
+
+ // !!! Read the Manual !!!
+ virtual USHORT FuzzyLock( BOOL bLock, BOOL bIntern, BOOL bClose );
+ void Lock( BOOL bLock )
+ {
+ FuzzyLock( bLock, TRUE, TRUE );
+ }
+ USHORT GetOwnerLockCount() const { return nOwnerLockCount; }
+ USHORT GetStrongLockCount() const { return nStrongLockCount; }
+
+ void OwnerLock( BOOL bLock );
+ void RemoveOwnerLock();
+ BOOL DoClose();
+ BOOL IsInClose() const { return bInClose; }
+
+private:
+ // Kopieren und Zuweisen dieses Objekttyps ist nicht erlaubt
+ SOT_DLLPRIVATE SotObject & operator = ( const SotObject & );
+ SOT_DLLPRIVATE SotObject( const SotObject & );
+};
+
+//==================class SotObjectRef======================================
+SV_IMPL_REF(SotObject)
+
+inline SotObjectRef::SotObjectRef( SotObject * pObjP, SvCastEnum )
+{
+ if( pObjP )
+ {
+ pObj = (SotObject *)pObjP->AggCast( SotObject::ClassFactory() );
+ if( pObj )
+ pObj->AddRef();
+ }
+ else
+ pObj = NULL;
+}
+
+//==================class SotObject*List====================================
+SV_DECL_REF_LIST(SotObject,SotObject*)
+SV_IMPL_REF_LIST(SotObject,SotObject*)
+
+#endif // _IFACE_HXX
+
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
new file mode 100644
index 000000000000..beac4e3d5548
--- /dev/null
+++ b/sot/inc/sot/sotdata.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sotdata.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:52:54 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SOT_DATA_HXX
+#define _SOT_DATA_HXX
+
+/*************************************************************************
+*************************************************************************/
+
+#ifndef _TOOLS_SOLAR_H
+#include <tools/solar.h>
+#endif
+
+#ifndef INCLUDED_SOTDLLAPI_H
+#include "sot/sotdllapi.h"
+#endif
+
+//==================class SotData_Impl====================================
+
+class List;
+class SotFactory;
+class SotFactoryList;
+class SotObjectList;
+
+struct SotData_Impl
+{
+ UINT32 nSvObjCount;
+ SotObjectList * pObjectList;
+ SotFactoryList * pFactoryList;
+ SotFactory * pSotObjectFactory;
+ SotFactory * pSotStorageStreamFactory;
+ SotFactory * pSotStorageFactory;
+ List* pDataFlavorList;
+ SotData_Impl();
+};
+
+SOT_DLLPUBLIC SotData_Impl* SOTDATA();
+
+#endif
diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx
new file mode 100644
index 000000000000..868c33230dc2
--- /dev/null
+++ b/sot/inc/sot/sotref.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sotref.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 20:53:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SOT_SOTREF_HXX
+#define _SOT_SOTREF_HXX
+
+#ifndef _TOOLS_REF_HXX
+#include <tools/ref.hxx>
+#endif
+
+//========================================================================
+enum SvCastEnum { SV_AGGREGATION_CAST };
+#ifndef SVT_DECL_SOTOBJECT_DEFINED
+#define SVT_DECL_SOTOBJECT_DEFINED
+class SotObject;
+class SotObjectRef
+{
+ PRV_SV_DECL_REF(SotObject)
+ inline SotObjectRef( SotObject * pObjP, SvCastEnum );
+};
+#endif
+
+//========================================================================
+#define SO2_DECL_REF(ClassName) \
+class ClassName; \
+class ClassName##Ref \
+{ \
+ PRV_SV_DECL_REF(ClassName) \
+ inline ClassName##Ref( const SotObjectRef & ); \
+ inline ClassName##Ref( SotObject * pObjP ); \
+ inline ClassName##Ref( SotObject * pObjP, SvCastEnum ); \
+};
+
+#define SO2_IMPL_REF(ClassName) \
+SV_IMPL_REF(ClassName) \
+inline ClassName##Ref::ClassName##Ref( const SotObjectRef & r ) \
+{ \
+ pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( &r ); \
+} \
+inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \
+{ \
+ pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( pObjP );\
+} \
+inline ClassName##Ref::ClassName##Ref( SotObject * pObjP, SvCastEnum ) \
+{ \
+ pObj = (ClassName *)ClassName::ClassFactory()->AggCastAndAddRef( pObjP );\
+}
+
+#define SO2_DECL_IMPL_REF(ClassName) \
+ SO2_DECL_REF(ClassName) \
+ SO2_IMPL_REF(ClassName)
+
+#endif // _SO2REF_HXX