LibreOffice Module framework (master) 1
|
#include <imagemanagerimpl.hxx>
Public Types | |
enum | NotifyOp { NotifyOp_Remove , NotifyOp_Insert , NotifyOp_Replace } |
Public Member Functions | |
ImageManagerImpl (css::uno::Reference< css::uno::XComponentContext > xContext,::cppu::OWeakObject *pOwner, bool _bUseGlobal) | |
~ImageManagerImpl () | |
void | dispose () |
void | initialize (const css::uno::Sequence< css::uno::Any > &aArguments) |
void | addEventListener (const css::uno::Reference< css::lang::XEventListener > &xListener) |
void | removeEventListener (const css::uno::Reference< css::lang::XEventListener > &aListener) |
void | reset () |
css::uno::Sequence< OUString > | getAllImageNames (::sal_Int16 nImageType) |
bool | hasImage (::sal_Int16 nImageType, const OUString &aCommandURL) |
css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > | getImages (::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence) |
void | replaceImages (::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence, const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > &aGraphicsSequence) |
void | removeImages (::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aResourceURLSequence) |
void | insertImages (::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence, const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > &aGraphicSequence) |
void | addConfigurationListener (const css::uno::Reference< css::ui::XUIConfigurationListener > &Listener) |
void | removeConfigurationListener (const css::uno::Reference< css::ui::XUIConfigurationListener > &Listener) |
void | reload () |
void | store () |
void | storeToStorage (const css::uno::Reference< css::embed::XStorage > &Storage) |
bool | isModified () const |
bool | isReadOnly () const |
void | clear () |
void | implts_initialize () |
void | implts_notifyContainerListener (const css::ui::ConfigurationEvent &aEvent, NotifyOp eOp) |
ImageList * | implts_getUserImageList (vcl::ImageType nImageType) |
void | implts_loadUserImages (vcl::ImageType nImageType, const css::uno::Reference< css::embed::XStorage > &xUserImageStorage, const css::uno::Reference< css::embed::XStorage > &xUserBitmapsStorage) |
bool | implts_storeUserImages (vcl::ImageType nImageType, const css::uno::Reference< css::embed::XStorage > &xUserImageStorage, const css::uno::Reference< css::embed::XStorage > &xUserBitmapsStorage) |
const rtl::Reference< GlobalImageList > & | implts_getGlobalImageList () |
CmdImageList * | implts_getDefaultImageList () |
Public Attributes | |
css::uno::Reference< css::embed::XStorage > | m_xUserConfigStorage |
css::uno::Reference< css::embed::XStorage > | m_xUserImageStorage |
css::uno::Reference< css::embed::XStorage > | m_xUserBitmapsStorage |
css::uno::Reference< css::embed::XTransactedObject > | m_xUserRootCommit |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
::cppu::OWeakObject * | m_pOwner |
rtl::Reference< GlobalImageList > | m_pGlobalImageList |
std::unique_ptr< CmdImageList > | m_pDefaultImageList |
OUString | m_aModuleIdentifier |
OUString | m_aResourceString |
std::mutex | m_mutex |
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > | m_aEventListeners |
comphelper::OInterfaceContainerHelper4< css::ui::XUIConfigurationListener > | m_aConfigListeners |
o3tl::enumarray< vcl::ImageType, std::unique_ptr< ImageList > > | m_pUserImageList |
o3tl::enumarray< vcl::ImageType, bool > | m_bUserImageListModified |
bool | m_bUseGlobal |
bool | m_bReadOnly |
bool | m_bInitialized |
bool | m_bModified |
bool | m_bDisposed |
Definition at line 76 of file imagemanagerimpl.hxx.
Enumerator | |
---|---|
NotifyOp_Remove | |
NotifyOp_Insert | |
NotifyOp_Replace |
Definition at line 140 of file imagemanagerimpl.hxx.
framework::ImageManagerImpl::ImageManagerImpl | ( | css::uno::Reference< css::uno::XComponentContext > | xContext, |
::cppu::OWeakObject * | pOwner, | ||
bool | _bUseGlobal | ||
) |
Definition at line 479 of file imagemanagerimpl.cxx.
References m_bReadOnly, m_bUserImageListModified, m_pOwner, m_pUserImageList, n, and pOwner.
framework::ImageManagerImpl::~ImageManagerImpl | ( | ) |
Definition at line 496 of file imagemanagerimpl.cxx.
References clear().
void framework::ImageManagerImpl::addConfigurationListener | ( | const css::uno::Reference< css::ui::XUIConfigurationListener > & | Listener | ) |
css::uno::RuntimeException |
Definition at line 1148 of file imagemanagerimpl.cxx.
References comphelper::OInterfaceContainerHelper4< class ListenerT >::addInterface(), m_aConfigListeners, m_bDisposed, and m_mutex.
void framework::ImageManagerImpl::addEventListener | ( | const css::uno::Reference< css::lang::XEventListener > & | xListener | ) |
css::uno::RuntimeException |
Definition at line 531 of file imagemanagerimpl.cxx.
References comphelper::OInterfaceContainerHelper4< class ListenerT >::addInterface(), m_aEventListeners, m_bDisposed, and m_mutex.
void framework::ImageManagerImpl::clear | ( | ) |
Definition at line 1199 of file imagemanagerimpl.cxx.
References m_pUserImageList, and n.
Referenced by ~ImageManagerImpl().
void framework::ImageManagerImpl::dispose | ( | void | ) |
Definition at line 501 of file imagemanagerimpl.cxx.
References aEvent, comphelper::OInterfaceContainerHelper4< class ListenerT >::disposeAndClear(), m_aConfigListeners, m_aEventListeners, m_bDisposed, m_bModified, m_mutex, m_pDefaultImageList, m_pOwner, m_pUserImageList, m_xUserConfigStorage, m_xUserImageStorage, m_xUserRootCommit, and n.
Sequence< OUString > framework::ImageManagerImpl::getAllImageNames | ( | ::sal_Int16 | nImageType | ) |
css::uno::RuntimeException |
Definition at line 623 of file imagemanagerimpl.cxx.
References comphelper::containerToSequence(), framework::CmdImageList::getImageCommandNames(), ImageList::GetImageNames(), i, framework::implts_convertImageTypeToIndex(), implts_getDefaultImageList(), implts_getGlobalImageList(), implts_getUserImageList(), m_bDisposed, m_bUseGlobal, and nIndex.
Sequence< uno::Reference< XGraphic > > framework::ImageManagerImpl::getImages | ( | ::sal_Int16 | nImageType, |
const css::uno::Sequence< OUString > & | aCommandURLSequence | ||
) |
css::lang::IllegalArgumentException | |
css::uno::RuntimeException |
Definition at line 699 of file imagemanagerimpl.cxx.
References ImageList::GetImage(), framework::CmdImageList::getImageFromCommandURL(), framework::implts_convertImageTypeToIndex(), implts_getDefaultImageList(), implts_getGlobalImageList(), implts_getUserImageList(), m_bDisposed, m_bUseGlobal, MAX_IMAGETYPE_VALUE, n, and nIndex.
bool framework::ImageManagerImpl::hasImage | ( | ::sal_Int16 | nImageType, |
const OUString & | aCommandURL | ||
) |
css::lang::IllegalArgumentException | |
css::uno::RuntimeException |
Definition at line 661 of file imagemanagerimpl.cxx.
References ImageList::GetImagePos(), hasImage(), IMAGELIST_IMAGE_NOTFOUND, framework::implts_convertImageTypeToIndex(), implts_getDefaultImageList(), implts_getGlobalImageList(), implts_getUserImageList(), m_bDisposed, m_bUseGlobal, MAX_IMAGETYPE_VALUE, and nIndex.
Referenced by hasImage().
CmdImageList * framework::ImageManagerImpl::implts_getDefaultImageList | ( | ) |
Definition at line 469 of file imagemanagerimpl.cxx.
References m_aModuleIdentifier, m_pDefaultImageList, and m_xContext.
Referenced by getAllImageNames(), getImages(), hasImage(), reload(), and removeImages().
const rtl::Reference< GlobalImageList > & framework::ImageManagerImpl::implts_getGlobalImageList | ( | ) |
Definition at line 460 of file imagemanagerimpl.cxx.
References framework::getGlobalImageList(), m_pGlobalImageList, and m_xContext.
Referenced by getAllImageNames(), getImages(), hasImage(), reload(), and removeImages().
ImageList * framework::ImageManagerImpl::implts_getUserImageList | ( | vcl::ImageType | nImageType | ) |
Definition at line 248 of file imagemanagerimpl.cxx.
References implts_loadUserImages(), m_pUserImageList, m_xUserBitmapsStorage, and m_xUserImageStorage.
Referenced by getAllImageNames(), getImages(), hasImage(), implts_storeUserImages(), reload(), removeImages(), replaceImages(), reset(), and storeToStorage().
void framework::ImageManagerImpl::implts_initialize | ( | ) |
Definition at line 257 of file imagemanagerimpl.cxx.
References BITMAPS_FOLDER, IMAGE_FOLDER, m_bReadOnly, m_xUserBitmapsStorage, m_xUserConfigStorage, and m_xUserImageStorage.
Referenced by initialize().
void framework::ImageManagerImpl::implts_loadUserImages | ( | vcl::ImageType | nImageType, |
const css::uno::Reference< css::embed::XStorage > & | xUserImageStorage, | ||
const css::uno::Reference< css::embed::XStorage > & | xUserBitmapsStorage | ||
) |
Definition at line 292 of file imagemanagerimpl.cxx.
References framework::ImageItemDescriptor::aCommandURL, BITMAP_FILE_NAMES, utl::UcbStreamHelper::CreateStream(), i, IMAGELIST_XML_FILE, framework::ImagesConfiguration::LoadImages(), m_pUserImageList, m_xContext, nCount, vcl::PngImageReader::read(), and xStream.
Referenced by implts_getUserImageList(), and reload().
void framework::ImageManagerImpl::implts_notifyContainerListener | ( | const css::ui::ConfigurationEvent & | aEvent, |
NotifyOp | eOp | ||
) |
Definition at line 1169 of file imagemanagerimpl.cxx.
References aEvent, comphelper::OInterfaceIteratorHelper4< class ListenerT >::hasMoreElements(), m_aConfigListeners, m_mutex, comphelper::OInterfaceIteratorHelper4< class ListenerT >::next(), NotifyOp_Insert, NotifyOp_Remove, NotifyOp_Replace, and comphelper::OInterfaceIteratorHelper4< class ListenerT >::remove().
Referenced by reload(), removeImages(), and replaceImages().
bool framework::ImageManagerImpl::implts_storeUserImages | ( | vcl::ImageType | nImageType, |
const css::uno::Reference< css::embed::XStorage > & | xUserImageStorage, | ||
const css::uno::Reference< css::embed::XStorage > & | xUserBitmapsStorage | ||
) |
Definition at line 364 of file imagemanagerimpl.cxx.
References framework::ImageItemDescriptor::aCommandURL, BITMAP_FILE_NAMES, utl::UcbStreamHelper::CreateStream(), ImageList::GetAsHorizontalStrip(), ImageList::GetImageCount(), ImageList::GetImageName(), i, IMAGELIST_XML_FILE, implts_getUserImageList(), m_bModified, m_xContext, framework::ImagesConfiguration::StoreImages(), vcl::PngImageWriter::write(), and xStream.
Referenced by store(), and storeToStorage().
void framework::ImageManagerImpl::initialize | ( | const css::uno::Sequence< css::uno::Any > & | aArguments | ) |
Definition at line 553 of file imagemanagerimpl.cxx.
References aArguments, Any, implts_initialize(), m_aModuleIdentifier, m_bInitialized, m_bReadOnly, m_xUserConfigStorage, and m_xUserRootCommit.
void framework::ImageManagerImpl::insertImages | ( | ::sal_Int16 | nImageType, |
const css::uno::Sequence< OUString > & | aCommandURLSequence, | ||
const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > & | aGraphicSequence | ||
) |
css::container::ElementExistException | |
css::lang::IllegalArgumentException | |
css::lang::IllegalAccessException | |
css::uno::RuntimeException |
Definition at line 925 of file imagemanagerimpl.cxx.
References replaceImages().
bool framework::ImageManagerImpl::isModified | ( | ) | const |
css::uno::RuntimeException |
Definition at line 1136 of file imagemanagerimpl.cxx.
References m_bModified.
bool framework::ImageManagerImpl::isReadOnly | ( | ) | const |
css::uno::RuntimeException |
Definition at line 1142 of file imagemanagerimpl.cxx.
References m_bReadOnly.
void framework::ImageManagerImpl::reload | ( | ) |
css::uno::Exception | |
css::uno::RuntimeException |
Definition at line 931 of file imagemanagerimpl.cxx.
References Any, ImageList::GetImage(), framework::CmdImageList::getImageFromCommandURL(), ImageList::GetImageNames(), i, implts_getDefaultImageList(), implts_getGlobalImageList(), implts_getUserImageList(), implts_loadUserImages(), implts_notifyContainerListener(), m_aResourceString, m_bDisposed, m_bModified, m_bUseGlobal, m_bUserImageListModified, m_pOwner, m_xUserBitmapsStorage, m_xUserImageStorage, NotifyOp_Insert, NotifyOp_Remove, and NotifyOp_Replace.
void framework::ImageManagerImpl::removeConfigurationListener | ( | const css::uno::Reference< css::ui::XUIConfigurationListener > & | Listener | ) |
css::uno::RuntimeException |
Definition at line 1162 of file imagemanagerimpl.cxx.
References m_aConfigListeners, m_mutex, and comphelper::OInterfaceContainerHelper4< class ListenerT >::removeInterface().
void framework::ImageManagerImpl::removeEventListener | ( | const css::uno::Reference< css::lang::XEventListener > & | aListener | ) |
css::uno::RuntimeException |
Definition at line 545 of file imagemanagerimpl.cxx.
References m_aEventListeners, m_mutex, and comphelper::OInterfaceContainerHelper4< class ListenerT >::removeInterface().
void framework::ImageManagerImpl::removeImages | ( | ::sal_Int16 | nImageType, |
const css::uno::Sequence< OUString > & | aResourceURLSequence | ||
) |
css::lang::IllegalArgumentException | |
css::lang::IllegalAccessException | |
css::uno::RuntimeException |
Definition at line 827 of file imagemanagerimpl.cxx.
References Any, framework::CmdImageList::getImageFromCommandURL(), ImageList::GetImageId(), ImageList::GetImagePos(), IMAGELIST_IMAGE_NOTFOUND, framework::implts_convertImageTypeToIndex(), implts_getDefaultImageList(), implts_getGlobalImageList(), implts_getUserImageList(), implts_notifyContainerListener(), m_aResourceString, m_bDisposed, m_bModified, m_bReadOnly, m_bUseGlobal, m_bUserImageListModified, m_pOwner, MAX_IMAGETYPE_VALUE, nId, nIndex, NotifyOp_Remove, NotifyOp_Replace, nPos, and ImageList::RemoveImage().
Referenced by reset().
void framework::ImageManagerImpl::replaceImages | ( | ::sal_Int16 | nImageType, |
const css::uno::Sequence< OUString > & | aCommandURLSequence, | ||
const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > & | aGraphicsSequence | ||
) |
css::lang::IllegalArgumentException | |
css::lang::IllegalAccessException | |
css::uno::RuntimeException |
Definition at line 746 of file imagemanagerimpl.cxx.
References ImageList::AddImage(), Any, ImageList::GetImagePos(), i, IMAGELIST_IMAGE_NOTFOUND, framework::implts_checkAndScaleGraphic(), framework::implts_convertImageTypeToIndex(), implts_getUserImageList(), implts_notifyContainerListener(), m_aResourceString, m_bDisposed, m_bModified, m_bReadOnly, m_bUserImageListModified, m_pOwner, MAX_IMAGETYPE_VALUE, nIndex, NotifyOp_Insert, NotifyOp_Replace, nPos, and ImageList::ReplaceImage().
Referenced by insertImages().
void framework::ImageManagerImpl::reset | ( | ) |
css::uno::RuntimeException | |
css::lang::IllegalAccessException |
Definition at line 597 of file imagemanagerimpl.cxx.
References comphelper::containerToSequence(), ImageList::GetImageNames(), i, implts_getUserImageList(), m_bDisposed, m_bModified, m_bUserImageListModified, and removeImages().
void framework::ImageManagerImpl::store | ( | ) |
css::uno::Exception | |
css::uno::RuntimeException |
Definition at line 1074 of file imagemanagerimpl.cxx.
References i, implts_storeUserImages(), m_bDisposed, m_bModified, m_bUserImageListModified, m_xUserBitmapsStorage, m_xUserConfigStorage, m_xUserImageStorage, and m_xUserRootCommit.
void framework::ImageManagerImpl::storeToStorage | ( | const css::uno::Reference< css::embed::XStorage > & | Storage | ) |
css::uno::Exception | |
css::uno::RuntimeException |
Definition at line 1106 of file imagemanagerimpl.cxx.
References BITMAPS_FOLDER, i, IMAGE_FOLDER, implts_getUserImageList(), implts_storeUserImages(), m_bDisposed, m_bModified, and Storage.
comphelper::OInterfaceContainerHelper4<css::ui::XUIConfigurationListener> framework::ImageManagerImpl::m_aConfigListeners |
Definition at line 171 of file imagemanagerimpl.hxx.
Referenced by addConfigurationListener(), dispose(), implts_notifyContainerListener(), and removeConfigurationListener().
comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> framework::ImageManagerImpl::m_aEventListeners |
Definition at line 170 of file imagemanagerimpl.hxx.
Referenced by addEventListener(), dispose(), and removeEventListener().
OUString framework::ImageManagerImpl::m_aModuleIdentifier |
Definition at line 167 of file imagemanagerimpl.hxx.
Referenced by implts_getDefaultImageList(), and initialize().
OUString framework::ImageManagerImpl::m_aResourceString |
Definition at line 168 of file imagemanagerimpl.hxx.
Referenced by reload(), removeImages(), and replaceImages().
bool framework::ImageManagerImpl::m_bDisposed |
Definition at line 178 of file imagemanagerimpl.hxx.
Referenced by addConfigurationListener(), addEventListener(), dispose(), getAllImageNames(), getImages(), hasImage(), reload(), removeImages(), replaceImages(), reset(), store(), and storeToStorage().
bool framework::ImageManagerImpl::m_bInitialized |
Definition at line 176 of file imagemanagerimpl.hxx.
Referenced by initialize().
bool framework::ImageManagerImpl::m_bModified |
Definition at line 177 of file imagemanagerimpl.hxx.
Referenced by dispose(), implts_storeUserImages(), isModified(), reload(), removeImages(), replaceImages(), reset(), store(), and storeToStorage().
bool framework::ImageManagerImpl::m_bReadOnly |
Definition at line 175 of file imagemanagerimpl.hxx.
Referenced by implts_initialize(), initialize(), isReadOnly(), removeImages(), and replaceImages().
bool framework::ImageManagerImpl::m_bUseGlobal |
Definition at line 174 of file imagemanagerimpl.hxx.
Referenced by getAllImageNames(), getImages(), hasImage(), reload(), and removeImages().
o3tl::enumarray<vcl::ImageType,bool> framework::ImageManagerImpl::m_bUserImageListModified |
Definition at line 173 of file imagemanagerimpl.hxx.
Referenced by ImageManagerImpl(), reload(), removeImages(), replaceImages(), reset(), and store().
std::mutex framework::ImageManagerImpl::m_mutex |
Definition at line 169 of file imagemanagerimpl.hxx.
Referenced by addConfigurationListener(), addEventListener(), dispose(), implts_notifyContainerListener(), removeConfigurationListener(), and removeEventListener().
std::unique_ptr<CmdImageList> framework::ImageManagerImpl::m_pDefaultImageList |
Definition at line 166 of file imagemanagerimpl.hxx.
Referenced by dispose(), and implts_getDefaultImageList().
rtl::Reference< GlobalImageList > framework::ImageManagerImpl::m_pGlobalImageList |
Definition at line 165 of file imagemanagerimpl.hxx.
Referenced by implts_getGlobalImageList().
::cppu::OWeakObject* framework::ImageManagerImpl::m_pOwner |
Definition at line 164 of file imagemanagerimpl.hxx.
Referenced by dispose(), reload(), removeImages(), and replaceImages().
o3tl::enumarray<vcl::ImageType,std::unique_ptr<ImageList> > framework::ImageManagerImpl::m_pUserImageList |
Definition at line 172 of file imagemanagerimpl.hxx.
Referenced by clear(), dispose(), ImageManagerImpl(), implts_getUserImageList(), and implts_loadUserImages().
css::uno::Reference< css::uno::XComponentContext > framework::ImageManagerImpl::m_xContext |
Definition at line 163 of file imagemanagerimpl.hxx.
Referenced by implts_getDefaultImageList(), implts_getGlobalImageList(), implts_loadUserImages(), and implts_storeUserImages().
css::uno::Reference< css::embed::XStorage > framework::ImageManagerImpl::m_xUserBitmapsStorage |
Definition at line 161 of file imagemanagerimpl.hxx.
Referenced by implts_getUserImageList(), implts_initialize(), reload(), and store().
css::uno::Reference< css::embed::XStorage > framework::ImageManagerImpl::m_xUserConfigStorage |
Definition at line 159 of file imagemanagerimpl.hxx.
Referenced by dispose(), implts_initialize(), initialize(), and store().
css::uno::Reference< css::embed::XStorage > framework::ImageManagerImpl::m_xUserImageStorage |
Definition at line 160 of file imagemanagerimpl.hxx.
Referenced by dispose(), implts_getUserImageList(), implts_initialize(), reload(), and store().
css::uno::Reference< css::embed::XTransactedObject > framework::ImageManagerImpl::m_xUserRootCommit |
Definition at line 162 of file imagemanagerimpl.hxx.
Referenced by dispose(), initialize(), and store().