1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_UICONFIGURATION_IMAGEMANAGER_HXX_
21 #define __FRAMEWORK_UICONFIGURATION_IMAGEMANAGER_HXX_
24 /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
25 with solaris headers ...
29 #include <boost/unordered_map.hpp>
32 #include <threadhelp/threadhelpbase.hxx>
33 #include <macros/generic.hxx>
34 #include <macros/xinterface.hxx>
35 #include <macros/xtypeprovider.hxx>
36 #include <macros/xserviceinfo.hxx>
38 #include <uiconfiguration/imagetype.hxx>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/lang/XTypeProvider.hpp>
42 #include <com/sun/star/lang/XComponent.hpp>
43 #include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
44 #include <com/sun/star/ui/XUIConfigurationStorage.hpp>
45 #include <com/sun/star/ui/XUIConfiguration.hpp>
46 #include <com/sun/star/ui/XImageManager.hpp>
47 #include <com/sun/star/lang/XInitialization.hpp>
48 #include <com/sun/star/ui/ConfigurationEvent.hpp>
49 #include <com/sun/star/embed/XTransactedObject.hpp>
51 #include <cppuhelper/implbase2.hxx>
52 #include <cppuhelper/interfacecontainer.hxx>
53 #include <rtl/ustring.hxx>
55 #include <vcl/image.hxx>
56 #include <rtl/ref.hxx>
60 class ImageManagerImpl
;
61 class ImageManager
: private ThreadHelpBase
, // Struct for right initalization of mutex member! Must be first of baseclasses.
62 public ::cppu::WeakImplHelper2
< ::com::sun::star::ui::XImageManager
, css::lang::XServiceInfo
>
65 // XInterface, XTypeProvider, XServiceInfo
68 ImageManager( com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
> xServiceManager
);
69 virtual ~ImageManager();
72 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
);
73 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
74 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
);
77 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
80 virtual void SAL_CALL
reset() throw (::com::sun::star::uno::RuntimeException
);
81 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getAllImageNames( ::sal_Int16 nImageType
) throw (::com::sun::star::uno::RuntimeException
);
82 virtual ::sal_Bool SAL_CALL
hasImage( ::sal_Int16 nImageType
, const OUString
& aCommandURL
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
83 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::graphic::XGraphic
> > SAL_CALL
getImages( ::sal_Int16 nImageType
, const ::com::sun::star::uno::Sequence
< OUString
>& aCommandURLSequence
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
84 virtual void SAL_CALL
replaceImages( ::sal_Int16 nImageType
, const ::com::sun::star::uno::Sequence
< OUString
>& aCommandURLSequence
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::graphic::XGraphic
> >& aGraphicsSequence
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IllegalAccessException
, ::com::sun::star::uno::RuntimeException
);
85 virtual void SAL_CALL
removeImages( ::sal_Int16 nImageType
, const ::com::sun::star::uno::Sequence
< OUString
>& aResourceURLSequence
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IllegalAccessException
, ::com::sun::star::uno::RuntimeException
);
86 virtual void SAL_CALL
insertImages( ::sal_Int16 nImageType
, const ::com::sun::star::uno::Sequence
< OUString
>& aCommandURLSequence
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::graphic::XGraphic
> >& aGraphicSequence
) throw (::com::sun::star::container::ElementExistException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::IllegalAccessException
, ::com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
addConfigurationListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::ui::XUIConfigurationListener
>& Listener
) throw (::com::sun::star::uno::RuntimeException
);
90 virtual void SAL_CALL
removeConfigurationListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::ui::XUIConfigurationListener
>& Listener
) throw (::com::sun::star::uno::RuntimeException
);
92 // XUIConfigurationPersistence
93 virtual void SAL_CALL
reload() throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
store() throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
storeToStorage( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& Storage
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
96 virtual sal_Bool SAL_CALL
isModified() throw (::com::sun::star::uno::RuntimeException
);
97 virtual sal_Bool SAL_CALL
isReadOnly() throw (::com::sun::star::uno::RuntimeException
);
100 void setStorage( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& Storage
) throw (::com::sun::star::uno::RuntimeException
);
103 ::std::auto_ptr
<ImageManagerImpl
> m_pImpl
;
107 #endif // __FRAMEWORK_UICONFIGURATION_IMAGEMANAGER_HXX_
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */