summaryrefslogtreecommitdiff
path: root/sot/inc/sot
diff options
context:
space:
mode:
Diffstat (limited to 'sot/inc/sot')
-rw-r--r--sot/inc/sot/exchange.hxx250
-rw-r--r--sot/inc/sot/factory.hxx90
-rw-r--r--sot/inc/sot/formats.hxx193
-rw-r--r--sot/inc/sot/object.hxx468
-rw-r--r--sot/inc/sot/sotdata.hxx61
-rw-r--r--sot/inc/sot/sotdllapi.h43
-rw-r--r--sot/inc/sot/sotref.hxx78
-rw-r--r--sot/inc/sot/storage.hxx269
8 files changed, 1452 insertions, 0 deletions
diff --git a/sot/inc/sot/exchange.hxx b/sot/inc/sot/exchange.hxx
new file mode 100644
index 000000000000..48dd74e57fde
--- /dev/null
+++ b/sot/inc/sot/exchange.hxx
@@ -0,0 +1,250 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_EXCHANGE_HXX
+#define _SOT_EXCHANGE_HXX
+
+#include <list>
+#include <vector>
+#include <tools/string.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <com/sun/star/datatransfer/dnd/DNDConstants.hdl>
+#include "sot/sotdllapi.h"
+
+class SotDataObject;
+
+namespace com { namespace sun { namespace star { namespace datatransfer {
+ class XTransferable;
+} } } }
+
+// ---------------------
+// - SotFormatStringId -
+// ---------------------
+
+typedef ULONG SotFormatStringId;
+
+// ----------------
+// - DataFlavorEx -
+// ----------------
+
+struct DataFlavorEx : public ::com::sun::star::datatransfer::DataFlavor
+{
+ SotFormatStringId mnSotId;
+};
+
+typedef ::std::vector< ::com::sun::star::datatransfer::DataFlavor > DataFlavorVector;
+typedef ::std::vector< DataFlavorEx > _DataFlavorExVector;
+
+// JP 23.03.2001 - this struct is only for "hide" the STD of the vetor,
+// because our makefile filter all this symbols and so nowbody can use
+// these struct in any interfacses.
+struct DataFlavorExVector : public _DataFlavorExVector
+{
+};
+
+typedef ::std::list< ::com::sun::star::datatransfer::DataFlavor > DataFlavorList;
+typedef ::std::list< DataFlavorEx > DataFlavorExList;
+
+SOT_DLLPUBLIC sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector,
+ ULONG nId );
+
+// -------------------------
+// - Vordefinierte Formate -
+// -------------------------
+
+// Die Reihenfolge und die Werte dürfen nicht geändert werden,
+// da die Implementation sich darauf verläßt.
+// Standard-Formate fuer die es auch Copy/Paste-Methoden gibt
+#define FORMAT_STRING 1
+#define FORMAT_BITMAP 2
+#define FORMAT_GDIMETAFILE 3
+#define FORMAT_PRIVATE 4
+#define FORMAT_FILE 5
+#define FORMAT_FILE_LIST 6
+
+// Weitere Standardformate (diese gehen nur ueber CopyData/PasteData)
+#define FORMAT_RTF 10
+
+// Source-Options
+#define EXCHG_SOURCE_MOVEABLE ((USHORT)0x0001)
+#define EXCHG_SOURCE_COPYABLE ((USHORT)0x0002)
+#define EXCHG_SOURCE_LINKABLE ((USHORT)0x0004)
+#define EXCHG_SOURCE_PRINTABLE ((USHORT)0x0008)
+#define EXCHG_SOURCE_DISCARDABLE ((USHORT)0x0010)
+#define EXCHG_SOURCE_ALL ((USHORT)0x001F)
+#define EXCHG_SOURCE_DEF_COPYABLE ((USHORT)0x0020)
+
+// Aktionen
+#define EXCHG_ACTION_MASK ((USHORT)0x00FF)
+#define EXCHG_INOUT_ACTION_NONE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_NONE)
+#define EXCHG_IN_ACTION_DEFAULT EXCHG_INOUT_ACTION_NONE
+#define EXCHG_IN_ACTION_MOVE ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_MOVE)
+#define EXCHG_IN_ACTION_COPY ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_COPY)
+#define EXCHG_IN_ACTION_LINK ((USHORT)com::sun::star::datatransfer::dnd::DNDConstants::ACTION_LINK)
+#define EXCHG_INOUT_ACTION_PRINT ((USHORT)8)
+#define EXCHG_INOUT_ACTION_DISCARD ((USHORT)16)
+#define EXCHG_OUT_ACTION_INSERT_OBJ ((USHORT)17)
+#define EXCHG_OUT_ACTION_INSERT_BOOKMARK ((USHORT)18)
+#define EXCHG_OUT_ACTION_INSERT_FILELINK ((USHORT)19)
+#define EXCHG_OUT_ACTION_INSERT_FILE ((USHORT)20)
+#define EXCHG_OUT_ACTION_INSERT_FILELIST ((USHORT)21)
+#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP ((USHORT)22)
+#define EXCHG_OUT_ACTION_INSERT_OLE ((USHORT)23)
+#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE ((USHORT)24)
+#define EXCHG_OUT_ACTION_INSERT_URLBUTTON ((USHORT)25)
+#define EXCHG_OUT_ACTION_INSERT_CHAOSOBJ ((USHORT)26) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_REPLACE_OBJ ((USHORT)27)
+#define EXCHG_OUT_ACTION_REPLACE_LINK ((USHORT)28)
+#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP ((USHORT)29)
+#define EXCHG_OUT_ACTION_GET_ATTRIBUTES ((USHORT)30)
+#define EXCHG_OUT_ACTION_UPLOAD ((USHORT)31) // OBSOLET ab 500.b ?
+#define EXCHG_OUT_ACTION_MOVE_FILE ((USHORT)32)
+#define EXCHG_OUT_ACTION_MOVE_FILELIST ((USHORT)33)
+#define EXCHG_OUT_ACTION_UPDATE_RANGE ((USHORT)34)
+#define EXCHG_OUT_ACTION_INSERT_PRIVATE ((USHORT)35)
+#define EXCHG_OUT_ACTION_INSERT_HTML ((USHORT)36)
+#define EXCHG_OUT_ACTION_MOVE_PRIVATE ((USHORT)37)
+#define EXCHG_OUT_ACTION_INSERT_STRING ((USHORT)38)
+#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ ((USHORT)39)
+#define EXCHG_OUT_ACTION_INSERT_SVXB ((USHORT)40)
+#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE ((USHORT)41)
+#define EXCHG_OUT_ACTION_INSERT_BITMAP ((USHORT)42)
+#define EXCHG_OUT_ACTION_INSERT_DDE ((USHORT)43)
+#define EXCHG_OUT_ACTION_INSERT_HYPERLINK ((USHORT)44)
+#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ ((USHORT)45)
+#define EXCHG_OUT_ACTION_REPLACE_SVXB ((USHORT)46)
+#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE ((USHORT)47)
+#define EXCHG_OUT_ACTION_REPLACE_BITMAP ((USHORT)48)
+#define EXCHG_OUT_ACTION_REPLACE_GRAPH ((USHORT)49)
+#define EXCHG_OUT_ACTION_INSERT_GRAPH ((USHORT)50)
+#define EXCHG_OUT_ACTION_INSERT_MSGATTACH ((USHORT)51) // obsolet ab 500.b ?
+#define EXCHG_OUT_ACTION_COPY_CHAOSOBJ ((USHORT)52)
+#define EXCHG_OUT_ACTION_MOVE_CHAOSOBJ ((USHORT)53)
+#define EXCHG_OUT_ACTION_COPY_MSGATTACH ((USHORT)54)
+#define EXCHG_OUT_ACTION_COPY_BOOKMARK ((USHORT)55)
+#define EXCHG_OUT_ACTION_COPY_FILE ((USHORT)56)
+
+#define EXCHG_OUT_ACTION_FLAG_CREATE_THEME ((USHORT)0x0100)
+#define EXCHG_OUT_ACTION_FLAG_KEEP_POSSIZE ((USHORT)0x0200)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_IMAGEMAP ((USHORT)0x0400)
+#define EXCHG_OUT_ACTION_FLAG_REPLACE_IMAGEMAP ((USHORT)0x0800)
+#define EXCHG_OUT_ACTION_FLAG_FILL ((USHORT)0x1000)
+#define EXCHG_OUT_ACTION_FLAG_INSERT_TARGETURL ((USHORT)0x2000)
+
+// Ziele
+#define EXCHG_DEST_DOC_OLEOBJ 1
+#define EXCHG_DEST_CHARTDOC_OLEOBJ 2
+#define EXCHG_DEST_DOC_TEXTFRAME 3
+#define EXCHG_DEST_DOC_GRAPHOBJ 4
+#define EXCHG_DEST_DOC_LNKD_GRAPHOBJ 5
+#define EXCHG_DEST_DOC_GRAPH_W_IMAP 6
+#define EXCHG_DEST_DOC_LNKD_GRAPH_W_IMAP 7
+#define EXCHG_DEST_DOC_IMAPREGION 8
+#define EXCHG_DEST_DOC_DRAWOBJ 9
+#define EXCHG_DEST_DOC_URLBUTTON 10
+#define EXCHG_DEST_DOC_URLFIELD 11
+#define EXCHG_DEST_DOC_GROUPOBJ 12
+#define EXCHG_DEST_SWDOC_FREE_AREA 13
+#define EXCHG_DEST_SCDOC_FREE_AREA 14
+#define EXCHG_DEST_SDDOC_FREE_AREA 15
+#define EXCHG_DEST_DOC_TEXTFRAME_WEB 16
+#define EXCHG_DEST_SWDOC_FREE_AREA_WEB 17
+
+// ------------
+// - Exchange -
+// ------------
+class SvGlobalName;
+class SOT_DLLPUBLIC SotExchange
+{
+public:
+ static ULONG RegisterFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static ULONG RegisterFormatName( const String& rName );
+ static ULONG RegisterFormatMimeType( const String& rMimeType );
+
+ static ULONG GetFormat( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatName( ULONG nFormat );
+ static sal_Bool GetFormatDataFlavor( ULONG nFormat, ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ static String GetFormatMimeType( ULONG nFormat );
+ static BOOL IsInternal( const SvGlobalName& );
+ static ULONG GetFormatIdFromMimeType( const String& rMimeType );
+
+ // bestimme die SotFormatStringId von dem registrierten Format
+ //JP 12.11.98: diese 3 Methoden sind ab sofort ueberfluessig, da
+ // die ClipboardIds statisch sind und aequivalent zur
+ // SotFormatStringId ist!
+ static SotFormatStringId GetFormatStringId( ULONG nFormat )
+ { return nFormat; }
+ static SotFormatStringId GetFormatStringId( const String& rName )
+ { return SotExchange::RegisterFormatMimeType( rName ); }
+ static ULONG RegisterSotFormatName( SotFormatStringId nId )
+ { return nId; }
+
+ // same for XTransferable interface
+ static USHORT GetExchangeAction(
+ // XTransferable
+ const DataFlavorExVector& rDataFlavorExVector,
+ // Ziel der Aktion (EXCHG_DEST_*)
+ USHORT nDestination,
+ // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...)
+ USHORT nSourceOptions,
+ // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*)
+ USHORT nUserAction,
+ // In:- Out: Zu benutzendes Format
+ ULONG& rFormat,
+ // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*)
+ USHORT& rDefaultAction,
+ // In:- optional - check only for this specific format
+ ULONG nOnlyTestFormat = 0,
+ // In:- optional - check the contents of Xtransferable
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >* pxTransferable = NULL );
+
+ // same for XTransferable interface
+ static USHORT GetExchangeAction(
+ // XTransferable
+ const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable,
+ // Ziel der Aktion (EXCHG_DEST_*)
+ USHORT nDestination,
+ // Aktionen, die Quelle unterstuetzt (EXCHG_SOURCE_...)
+ USHORT nSourceOptions,
+ // vom Anwender gewaehlte Aktion (EXCHG_IN_*, EXCHG_INOUT_*)
+ USHORT nUserAction,
+ // In:- Out: Zu benutzendes Format
+ ULONG& rFormat,
+ // In:- Out: Default-Action (EXCHG_IN_*, EXCHG_INOUT_*)
+ USHORT& rDefaultAction,
+ // In:- optional - check only for this specific format
+ ULONG nOnlyTestFormat = 0 );
+
+ static USHORT IsChart( const SvGlobalName& rName );
+ static USHORT IsMath( const SvGlobalName& rName );
+};
+
+#endif // _EXCHANGE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx
new file mode 100644
index 000000000000..e2b32c6aa65c
--- /dev/null
+++ b/sot/inc/sot/factory.hxx
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_FACTORY_HXX
+#define _SOT_FACTORY_HXX
+
+#include <tools/globname.hxx>
+#include <tools/rtti.hxx>
+#include "sot/sotdllapi.h"
+
+/*************************************************************************
+*************************************************************************/
+class SotObject;
+class SotFactory;
+
+DECLARE_LIST( SotFactoryList, SotFactory * )
+typedef void * (*CreateInstanceType)( SotObject ** );
+
+//==================class SotFactory=======================================
+class SOT_DLLPUBLIC SotFactory : public SvGlobalName
+{
+ USHORT nSuperCount; // Anzahl der Superklassen
+ const SotFactory ** pSuperClasses; // Superklassen
+ CreateInstanceType pCreateFunc;
+
+ String aClassName;
+
+ static BOOL ExistTest( const SvGlobalName & );
+protected:
+ virtual ~SotFactory();
+public:
+ TYPEINFO();
+ static void DeInit();
+ static void IncSvObjectCount( SotObject * = NULL );
+ static void DecSvObjectCount( SotObject * = NULL );
+ static UINT32 GetSvObjectCount();
+ static void TestInvariant();
+
+ static const SotFactory * Find( const SvGlobalName & );
+ static const SotFactoryList * GetFactoryList();
+
+ SotFactory( const SvGlobalName &,
+ const String & rClassName, CreateInstanceType );
+
+ void PutSuperClass( const SotFactory * );
+ virtual void * CreateInstance( SotObject ** ppObj = NULL ) const;
+ void * CastAndAddRef( SotObject * ) const;
+ void * AggCastAndAddRef( SotObject * ) const;
+
+ BOOL Is( const SotFactory * pSuperClass ) const;
+ const SotFactory * GetSuper( USHORT nPos ) const
+ {
+ return nPos < nSuperCount ?
+ pSuperClasses[ nPos ]
+ : NULL;
+ }
+
+private:
+ SOT_DLLPRIVATE SotFactory( const SotFactory & );
+ SOT_DLLPRIVATE SotFactory & operator = ( const SotFactory & );
+};
+
+#endif // _FACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/formats.hxx b/sot/inc/sot/formats.hxx
new file mode 100644
index 000000000000..03b0b17cd8f8
--- /dev/null
+++ b/sot/inc/sot/formats.hxx
@@ -0,0 +1,193 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#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
+#include <sot/exchange.hxx>
+
+#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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
new file mode 100644
index 000000000000..cb876fedcab1
--- /dev/null
+++ b/sot/inc/sot/object.hxx
@@ -0,0 +1,468 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_OBJECT_HXX
+#define _SOT_OBJECT_HXX
+
+#include <sot/sotref.hxx>
+#include <sot/sotdata.hxx>
+#include <tools/globname.hxx>
+#include "sot/sotdllapi.h"
+
+/*************************************************************************
+*************************************************************************/
+
+#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_VER
+#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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/sotdata.hxx b/sot/inc/sot/sotdata.hxx
new file mode 100644
index 000000000000..7bf2e0eec1e3
--- /dev/null
+++ b/sot/inc/sot/sotdata.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_DATA_HXX
+#define _SOT_DATA_HXX
+
+/*************************************************************************
+*************************************************************************/
+
+#include <tools/solar.h>
+#include "sot/sotdllapi.h"
+
+//==================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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/sotdllapi.h b/sot/inc/sot/sotdllapi.h
new file mode 100644
index 000000000000..092e55d629cb
--- /dev/null
+++ b/sot/inc/sot/sotdllapi.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_SOTDLLAPI_H
+#define INCLUDED_SOTDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SOT_DLLIMPLEMENTATION)
+#define SOT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SOT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SOT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SOTDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx
new file mode 100644
index 000000000000..cb1a991320ab
--- /dev/null
+++ b/sot/inc/sot/sotref.hxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_SOTREF_HXX
+#define _SOT_SOTREF_HXX
+
+#include <tools/ref.hxx>
+
+//========================================================================
+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
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx
new file mode 100644
index 000000000000..893837abac88
--- /dev/null
+++ b/sot/inc/sot/storage.hxx
@@ -0,0 +1,269 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SOT_STORAGE_HXX
+#define _SOT_STORAGE_HXX
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.h>
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <sot/object.hxx>
+#include <sot/factory.hxx>
+#include <tools/stream.hxx>
+#include <tools/errcode.hxx>
+#include "sot/sotdllapi.h"
+
+#define STORAGE_FAILIFTHERE 0x02
+#define STORAGE_TRANSACTED 0x04
+#define STORAGE_PRIORITY 0x08
+#define STORAGE_DELETEONRELEASE 0x10
+#define STORAGE_CONVERT 0x20
+#define STORAGE_UNPACKED_MODE 0x40
+#define STORAGE_DISKSPANNED_MODE 0x80
+#define STORAGE_CREATE_UNPACKED 0x44
+typedef short StorageMode;
+
+class SvStorage;
+namespace binfilter
+{
+ class SvStorage;
+}
+
+/*************************************************************************
+*************************************************************************/
+class SotStorage;
+class BaseStorageStream;
+class SOT_DLLPUBLIC SotStorageStream : virtual public SotObject, public SvStream
+{
+friend class SotStorage;
+friend class ImpStream;
+ BaseStorageStream * pOwnStm;// Zeiger auf den eigenen Stream
+protected:
+ virtual ULONG GetData( void* pData, ULONG nSize );
+ virtual ULONG PutData( const void* pData, ULONG nSize );
+ virtual ULONG SeekPos( ULONG nPos );
+ virtual void FlushData();
+ ~SotStorageStream();
+public:
+ SotStorageStream( const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorageStream( BaseStorageStream *pStm );
+ SotStorageStream();
+ SO2_DECL_BASIC_CLASS_DLL(SotStorageStream,SOTDATA())
+ SO2_DECL_INVARIANT()
+
+ using SvStream::SyncSvStream;
+ virtual void SyncSvStream();
+ void SyncSysStream() { SvStream::SyncSysStream(); }
+
+ virtual void ResetError();
+
+ virtual void SetSize( ULONG nNewSize );
+ UINT32 GetSize() const;
+ BOOL CopyTo( SotStorageStream * pDestStm );
+ virtual BOOL Commit();
+ virtual BOOL Revert();
+ BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ GetXInputStream() const;
+};
+
+#ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED
+#define SOT_DECL_SOTSTORAGESTREAM_DEFINED
+SO2_DECL_REF(SotStorageStream)
+#endif
+SO2_IMPL_REF(SotStorageStream)
+
+namespace ucbhelper
+{
+ class Content;
+}
+
+class SvStorageInfoList;
+class BaseStorage;
+class UNOStorageHolder;
+class SOT_DLLPUBLIC SotStorage : virtual public SotObject
+{
+friend class SotStorageStream;
+friend class SvStorage;
+friend class ::binfilter::SvStorage;
+
+ BaseStorage * m_pTmpStg; // Temp-Storage fuer Transacted, nur auf diesem schreiben! ??? Useless ???
+ BaseStorage * m_pOwnStg; // Zielstorage
+ SvStream * m_pStorStm; // nur fuer SDSTORAGES
+ ULONG m_nError;
+ String m_aName; // Name des Storage
+ BOOL m_bIsRoot:1, // z.B.: File-Storage
+ m_bDelStm:1;
+ ByteString m_aKey; // aKey.Len != 0 -> Verschluesselung
+ long m_nVersion;
+
+protected:
+ ~SotStorage();
+ void CreateStorage( BOOL bUCBStorage, StreamMode, StorageMode );
+public:
+ SotStorage( const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage( BOOL bUCBStorage, const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage( const ::ucbhelper::Content& rContent, const String &,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage( BaseStorage * );
+ SotStorage( SvStream & rStm );
+ SotStorage( BOOL bUCBStorage, SvStream & rStm );
+ SotStorage( SvStream * pStm, BOOL bDelete );
+ SotStorage();
+ SO2_DECL_BASIC_CLASS_DLL(SotStorage,SOTDATA())
+ SO2_DECL_INVARIANT()
+
+ SvMemoryStream * CreateMemoryStream();
+ const SvStream * GetSvStream();
+
+ static BOOL IsStorageFile( const String & rFileName );
+ static BOOL IsStorageFile( SvStream* pStream );
+
+ virtual const String & GetName() const;
+
+ virtual BOOL Validate();
+
+ void SetKey( const ByteString& rKey );
+ const ByteString & GetKey() const { return m_aKey; }
+
+ void SetVersion( long nVers )
+ {
+ m_nVersion = nVers;
+ }
+ long GetVersion() const
+ {
+ return m_nVersion;
+ }
+
+ ULONG GetErrorCode() const { return m_nError; }
+ ULONG GetError() const { return ERRCODE_TOERROR(m_nError); }
+ void SetError( ULONG nErrorCode )
+ {
+ if( m_nError == SVSTREAM_OK )
+ m_nError = nErrorCode;
+ }
+ virtual void ResetError();
+
+ BOOL IsRoot() const { return m_bIsRoot; }
+ void SignAsRoot( BOOL b = TRUE ) { m_bIsRoot = b; }
+ void SetDeleteStream( BOOL bDelete ) { m_bDelStm = bDelete; }
+
+ // eigener Datenbereich
+ virtual void SetClass( const SvGlobalName & rClass,
+ ULONG bOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual void SetConvertClass( const SvGlobalName & rConvertClass,
+ ULONG bOriginalClipFormat,
+ const String & rUserTypeName );
+ virtual SvGlobalName GetClassName();// Typ der Daten im Storage
+ virtual ULONG GetFormat();
+ virtual String GetUserName();
+ virtual BOOL ShouldConvert();
+ void SetName( const String& rName );
+
+ // Liste aller Elemente
+ virtual void FillInfoList( SvStorageInfoList * ) const;
+ virtual BOOL CopyTo( SotStorage * pDestStg );
+ virtual BOOL Commit();
+ virtual BOOL Revert();
+
+ /* Element Methoden */
+ // Stream mit Verbindung zu Storage erzeugen,
+ // in etwa eine Parent-Child Beziehung
+ SotStorageStream * OpenSotStream( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorageStream * OpenEncryptedSotStream( const String & rEleName, const ByteString& rKey,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = 0 );
+ SotStorage * OpenSotStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = STORAGE_TRANSACTED );
+ SotStorage * OpenUCBStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = STORAGE_TRANSACTED );
+ SotStorage * OpenOLEStorage( const String & rEleName,
+ StreamMode = STREAM_STD_READWRITE,
+ StorageMode = STORAGE_TRANSACTED );
+ // Abfrage auf Storage oder Stream
+ virtual BOOL IsStream( const String & rEleName ) const;
+ virtual BOOL IsStorage( const String & rEleName ) const;
+ virtual BOOL IsContained( const String & rEleName ) const;
+ // Element loeschen
+ virtual BOOL Remove( const String & rEleName );
+ // Elementnamen aendern
+ virtual BOOL Rename( const String & rEleName,
+ const String & rNewName );
+ virtual BOOL CopyTo( const String & rEleName, SotStorage * pDest,
+ const String & rNewName );
+ virtual BOOL MoveTo( const String & rEleName, SotStorage * pDest,
+ const String & rNewName );
+
+ SvStream* GetTargetSvStream() const;
+ BOOL SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue );
+ BOOL GetProperty( const String& rName, ::com::sun::star::uno::Any& rValue );
+ BOOL GetProperty( const String& rEleName, const String& rName, ::com::sun::star::uno::Any& rValue );
+ BOOL IsOLEStorage() const;
+ static BOOL IsOLEStorage( const String & rFileName );
+ static BOOL IsOLEStorage( SvStream* pStream );
+
+ // this is temporary HACK, _MUST_ be removed before release
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+ GetUNOAPIDuplicate( const String& rEleName, sal_Int32 nUNOStorageMode );
+ void RemoveUNOStorageHolder( UNOStorageHolder* pHolder );
+
+ static SotStorage* OpenOLEStorage( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
+ const String& rEleName, StreamMode = STREAM_STD_READWRITE );
+ static sal_Int32 GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
+ static sal_Int32 GetVersion( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
+};
+
+#ifndef SOT_DECL_SOTSTORAGE_DEFINED
+#define SOT_DECL_SOTSTORAGE_DEFINED
+SO2_DECL_REF(SotStorage)
+#endif
+SO2_IMPL_REF(SotStorage)
+
+#define SvStorage SotStorage
+#define SvStorageRef SotStorageRef
+#define SvStorageStream SotStorageStream
+#define SvStorageStreamRef SotStorageStreamRef
+
+#endif // _SVSTOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */