diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-10-04 20:05:39 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-10-04 20:05:39 +0000 |
commit | 2349a0d0f0f92db4507c2844c7e4fa4356d0eca3 (patch) | |
tree | 70999df8361a917521ec849d117a50b2a1b96629 /comphelper/inc/comphelper/embeddedobjectcontainer.hxx | |
parent | 2190f78f8410ee8857d6afb806c473f5dd35e386 (diff) |
INTEGRATION: CWS mav09 (1.1.2); FILE ADDED
2004/08/16 10:30:56 mav 1.1.2.7: #i27773# storage format
2004/08/16 10:15:34 mav 1.1.2.6: #i27773# storage format
2004/07/15 10:27:20 mba 1.1.2.5: #i27773#: method for removing of graphic streams
2004/06/25 11:48:39 mav 1.1.2.4: #i27773# linkage support
2004/06/10 16:49:04 mba 1.1.2.3: #i27773#: improve handling of graphical reps
2004/05/18 17:10:58 mba 1.1.2.2: #i27773#: new method MoveEmbeddedObject
2004/05/16 17:25:25 mba 1.1.2.1: #i27773#: new EmbeddedObjectContainer
Diffstat (limited to 'comphelper/inc/comphelper/embeddedobjectcontainer.hxx')
-rw-r--r-- | comphelper/inc/comphelper/embeddedobjectcontainer.hxx | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/comphelper/inc/comphelper/embeddedobjectcontainer.hxx b/comphelper/inc/comphelper/embeddedobjectcontainer.hxx new file mode 100644 index 000000000000..54b6bfb649e5 --- /dev/null +++ b/comphelper/inc/comphelper/embeddedobjectcontainer.hxx @@ -0,0 +1,169 @@ +/************************************************************************* + * + * $RCSfile: embeddedobjectcontainer.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: kz $ $Date: 2004-10-04 21:05:39 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _COMPHELPER_OBJECTCONTAINER_HXX_ +#define _COMPHELPER_OBJECTCONTAINER_HXX_ + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_EMBED_XEMBEDDEDOBJECT_HPP_ +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#endif +#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_HPP_ +#include <com/sun/star/embed/XStorage.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_ +#include <com/sun/star/io/XInputStrem.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif + +#include <rtl/ustring.hxx> + +namespace comphelper +{ + +struct EmbedImpl; +class EmbeddedObjectContainer +{ + EmbedImpl* pImpl; + + // add an embedded object to the container storage + sal_Bool StoreEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, ::rtl::OUString&, sal_Bool ); + +public: + // add an embedded object that has been imported from the container storage - should only be called by filters! + void AddEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, const ::rtl::OUString& ); + + EmbeddedObjectContainer(); + EmbeddedObjectContainer( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& ); + ~EmbeddedObjectContainer(); + + void SwitchPersistence( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& ); + + ::rtl::OUString CreateUniqueObjectName(); + + // get a list of object names that have been added so far + com::sun::star::uno::Sequence < ::rtl::OUString > GetObjectNames(); + + // check for existence of objects at all + sal_Bool HasEmbeddedObjects(); + + // check existence of an object - either by identity or by name + sal_Bool HasEmbeddedObject( const ::rtl::OUString& ); + sal_Bool HasEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ); + + // get the object name of an object - this is the persist name if the object has persistence + ::rtl::OUString GetEmbeddedObjectName( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ); + + // retrieve an embedded object by name that either has been added already or is available in the container storage + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > GetEmbeddedObject( const ::rtl::OUString& ); + + // create an object from a ClassId + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > + CreateEmbeddedObject( const com::sun::star::uno::Sequence < sal_Int8 >&, ::rtl::OUString& ); + + // insert an embedded object into the container - objects persistant representation will be added to the storage + sal_Bool InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, ::rtl::OUString& ); + + // load an embedded object from a MediaDescriptor and insert it into the container + // a new object will be created from the new content and returned + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > + InsertEmbeddedObject( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, ::rtl::OUString& ); + + // create an embedded link based on a MediaDescriptor and insert it into the container + // a new object will be created from the new content and returned + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > + InsertEmbeddedLink( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, ::rtl::OUString& ); + + // create an object from a stream that contains its persistent representation and insert it as usual (usually called from clipboard) + // a new object will be created from the new content and returned + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > + InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >&, ::rtl::OUString& ); + + // copy an embedded object into the storage and create another object from it + ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > CopyEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, ::rtl::OUString& ); + + // remove an embedded object from the container and from the storage + sal_Bool RemoveEmbeddedObject( const ::rtl::OUString& rName, sal_Bool bClose=sal_True ); + sal_Bool RemoveEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, sal_Bool bClose=sal_True ); + + // move an embedded object to another container (keep the persistent name) + sal_Bool MoveEmbeddedObject( const ::rtl::OUString& rName, EmbeddedObjectContainer& ); + + // get the stored graphical representation for the object + com::sun::star::uno::Reference < com::sun::star::io::XInputStream > GetGraphicStream( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, ::rtl::OUString* pMediaType=0 ); + + // add a graphical representation for an object + sal_Bool InsertGraphicStream( const com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& rStream, const ::rtl::OUString& rObjectName, const ::rtl::OUString& rMediaType ); + + // remove a graphical representation for an object + sal_Bool RemoveGraphicStream( const ::rtl::OUString& rObjectName ); +}; + +}; + +#endif + |