2006-11-08 10:53:26 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
|
|
*
|
|
|
|
* $RCSfile: dlgcont.hxx,v $
|
|
|
|
*
|
2007-03-19 09:48:06 +00:00
|
|
|
* $Revision: 1.6 $
|
2006-11-08 10:53:26 +00:00
|
|
|
*
|
2007-03-19 09:48:06 +00:00
|
|
|
* last change: $Author: obo $ $Date: 2007-03-19 10:48:06 $
|
2006-11-08 10:53:26 +00:00
|
|
|
*
|
|
|
|
* 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 BASIC_DIALOGCONTAINER_HXX
|
|
|
|
#define BASIC_DIALOGCONTAINER_HXX
|
|
|
|
|
|
|
|
#ifndef BASIC_NAMECONTAINER_HXX
|
|
|
|
#include "namecont.hxx"
|
|
|
|
#endif
|
|
|
|
|
2007-01-02 14:40:39 +00:00
|
|
|
#ifndef _COM_SUN_STAR_AWT_XSTRINGRESOURCESUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/resource/XStringResourceSupplier.hpp>
|
|
|
|
#endif
|
2007-01-29 15:27:31 +00:00
|
|
|
#ifndef _COM_SUN_STAR_RESOURCE_XSTRINGRESOURCEPERSISTENCE_HPP_
|
|
|
|
#include "com/sun/star/resource/XStringResourcePersistence.hpp"
|
2007-01-02 14:40:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <cppuhelper/implbase1.hxx>
|
2007-03-15 14:38:19 +00:00
|
|
|
#include <comphelper/uno3.hxx>
|
2007-01-02 14:40:39 +00:00
|
|
|
|
2006-11-08 10:53:26 +00:00
|
|
|
namespace basic
|
|
|
|
{
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
class SfxDialogLibraryContainer : public SfxLibraryContainer
|
|
|
|
{
|
|
|
|
// Methods to distinguish between different library types
|
2007-01-02 14:40:39 +00:00
|
|
|
virtual SfxLibrary* SAL_CALL implCreateLibrary( const ::rtl::OUString& aName );
|
2006-11-08 10:53:26 +00:00
|
|
|
virtual SfxLibrary* SAL_CALL implCreateLibraryLink
|
2007-01-02 14:40:39 +00:00
|
|
|
( const ::rtl::OUString& aName, const ::rtl::OUString& aLibInfoFileURL,
|
2006-11-08 10:53:26 +00:00
|
|
|
const ::rtl::OUString& StorageURL, sal_Bool ReadOnly );
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL createEmptyLibraryElement( void );
|
|
|
|
virtual sal_Bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement );
|
|
|
|
virtual void SAL_CALL writeLibraryElement
|
|
|
|
(
|
|
|
|
::com::sun::star::uno::Any aElement,
|
|
|
|
const ::rtl::OUString& aElementName,
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOutput
|
|
|
|
)
|
|
|
|
throw(::com::sun::star::uno::Exception);
|
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL importLibraryElement
|
|
|
|
( const ::rtl::OUString& aFile,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xElementStream );
|
|
|
|
|
|
|
|
virtual void SAL_CALL importFromOldStorage( const ::rtl::OUString& aFile );
|
|
|
|
|
|
|
|
virtual SfxLibraryContainer* createInstanceImpl( void );
|
|
|
|
|
2007-01-02 14:40:39 +00:00
|
|
|
virtual void implSetStorage( const ::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::embed::XStorage >& xStorage );
|
|
|
|
|
2007-03-15 14:38:19 +00:00
|
|
|
virtual const sal_Char* SAL_CALL getInfoFileName() const;
|
|
|
|
virtual const sal_Char* SAL_CALL getOldInfoFileName() const;
|
|
|
|
virtual const sal_Char* SAL_CALL getLibElementFileExtension() const;
|
|
|
|
virtual const sal_Char* SAL_CALL getLibrariesDir() const;
|
2006-11-08 10:53:26 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SfxDialogLibraryContainer( void );
|
|
|
|
SfxDialogLibraryContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
|
|
|
|
|
2007-03-15 14:38:19 +00:00
|
|
|
// Methods XStorageBasedLibraryContainer
|
2006-11-08 10:53:26 +00:00
|
|
|
virtual void SAL_CALL storeLibrariesToStorage(
|
2007-03-15 14:38:19 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& RootStorage )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
2006-11-08 10:53:26 +00:00
|
|
|
|
2007-01-02 14:40:39 +00:00
|
|
|
// Resource handling
|
2007-01-29 15:27:31 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourcePersistence >
|
2007-01-02 14:40:39 +00:00
|
|
|
implCreateStringResource( class SfxDialogLibrary* pDialog );
|
|
|
|
|
2007-03-15 14:38:19 +00:00
|
|
|
// Methods XServiceInfo
|
|
|
|
virtual ::rtl::OUString SAL_CALL getImplementationName( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2006-11-08 10:53:26 +00:00
|
|
|
// Service
|
|
|
|
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static();
|
|
|
|
static ::rtl::OUString getImplementationName_static();
|
|
|
|
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create
|
|
|
|
( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xServiceManager )
|
|
|
|
throw( ::com::sun::star::uno::Exception );
|
|
|
|
};
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
2007-03-15 14:38:19 +00:00
|
|
|
typedef ::cppu::ImplHelper1 < ::com::sun::star::resource::XStringResourceSupplier
|
|
|
|
> SfxDialogLibrary_BASE;
|
2007-01-02 14:40:39 +00:00
|
|
|
|
2007-03-15 14:38:19 +00:00
|
|
|
class SfxDialogLibrary :public SfxLibrary
|
|
|
|
,public SfxDialogLibrary_BASE
|
2006-11-08 10:53:26 +00:00
|
|
|
{
|
2007-01-02 14:40:39 +00:00
|
|
|
SfxDialogLibraryContainer* m_pParent;
|
|
|
|
::com::sun::star::uno::Reference
|
2007-01-29 15:27:31 +00:00
|
|
|
< ::com::sun::star::resource::XStringResourcePersistence> m_xStringResourcePersistence;
|
2007-01-02 14:40:39 +00:00
|
|
|
::rtl::OUString m_aName;
|
|
|
|
|
|
|
|
// Provide modify state including resources
|
|
|
|
virtual sal_Bool isModified( void );
|
|
|
|
virtual void storeResources( void );
|
|
|
|
virtual void storeResourcesAsURL( const ::rtl::OUString& URL, const ::rtl::OUString& NewName );
|
|
|
|
virtual void storeResourcesToURL( const ::rtl::OUString& URL,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
|
|
|
|
virtual void storeResourcesToStorage( const ::com::sun::star::uno::Reference
|
|
|
|
< ::com::sun::star::embed::XStorage >& xStorage );
|
|
|
|
|
2006-11-08 10:53:26 +00:00
|
|
|
public:
|
|
|
|
SfxDialogLibrary
|
|
|
|
(
|
2007-03-15 14:38:19 +00:00
|
|
|
ModifiableHelper& _rModifiable,
|
2007-01-02 14:40:39 +00:00
|
|
|
const ::rtl::OUString& aName,
|
2007-03-15 14:38:19 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xSFI,
|
2007-01-02 14:40:39 +00:00
|
|
|
SfxDialogLibraryContainer* pParent
|
2006-11-08 10:53:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
SfxDialogLibrary
|
|
|
|
(
|
2007-03-15 14:38:19 +00:00
|
|
|
ModifiableHelper& _rModifiable,
|
2007-01-02 14:40:39 +00:00
|
|
|
const ::rtl::OUString& aName,
|
2007-03-15 14:38:19 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xSFI,
|
2007-01-02 14:40:39 +00:00
|
|
|
const ::rtl::OUString& aLibInfoFileURL, const ::rtl::OUString& aStorageURL, sal_Bool ReadOnly,
|
|
|
|
SfxDialogLibraryContainer* pParent
|
2006-11-08 10:53:26 +00:00
|
|
|
);
|
2007-01-02 14:40:39 +00:00
|
|
|
|
2007-03-19 09:48:06 +00:00
|
|
|
DECLARE_XINTERFACE()
|
|
|
|
DECLARE_XTYPEPROVIDER()
|
2007-03-15 14:38:19 +00:00
|
|
|
|
2007-01-02 14:40:39 +00:00
|
|
|
// XStringResourceSupplier
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >
|
|
|
|
SAL_CALL getStringResource( ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
::rtl::OUString getName( void )
|
|
|
|
{ return m_aName; }
|
|
|
|
|
2007-01-29 15:27:31 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourcePersistence >
|
|
|
|
getStringResourcePersistence( void )
|
2007-01-02 14:40:39 +00:00
|
|
|
{
|
2007-01-29 15:27:31 +00:00
|
|
|
return m_xStringResourcePersistence;
|
2007-01-02 14:40:39 +00:00
|
|
|
}
|
2006-11-08 10:53:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace basic
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|