diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-05 15:52:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-05 15:54:29 +0000 |
commit | ab3fe69ffb9c9e8d57968bb112434df91bfc3c7e (patch) | |
tree | 652306083429d0de7f00ca80d61bded3eb9cdb50 /framework | |
parent | 46153bdcf2f89e88607dfb0dd0003108796424e9 (diff) |
finish moving ImageList to framework
Change-Id: I9d9f292066321174af8b0bcd96c58de5fc7566b8
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uiconfiguration/CommandImageResolver.hxx | 2 | ||||
-rw-r--r-- | framework/source/uiconfiguration/ImageList.cxx | 1 | ||||
-rw-r--r-- | framework/source/uiconfiguration/ImageList.hxx | 67 |
3 files changed, 70 insertions, 0 deletions
diff --git a/framework/source/uiconfiguration/CommandImageResolver.hxx b/framework/source/uiconfiguration/CommandImageResolver.hxx index 79368fc5ceca..d7788e4e49bf 100644 --- a/framework/source/uiconfiguration/CommandImageResolver.hxx +++ b/framework/source/uiconfiguration/CommandImageResolver.hxx @@ -16,6 +16,8 @@ #include <com/sun/star/uno/Sequence.hxx> +#include "ImageList.hxx" + #include <unordered_map> #include <vector> diff --git a/framework/source/uiconfiguration/ImageList.cxx b/framework/source/uiconfiguration/ImageList.cxx index 6610c51c3216..389c01621330 100644 --- a/framework/source/uiconfiguration/ImageList.cxx +++ b/framework/source/uiconfiguration/ImageList.cxx @@ -32,6 +32,7 @@ #include <vcl/imagerepository.hxx> #include <vcl/ImageTree.hxx> #include <image.h> +#include "ImageList.hxx" ImageList::ImageList() { diff --git a/framework/source/uiconfiguration/ImageList.hxx b/framework/source/uiconfiguration/ImageList.hxx new file mode 100644 index 000000000000..426a6267bb92 --- /dev/null +++ b/framework/source/uiconfiguration/ImageList.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef FRAMEWORK_SOURCE_UICONFIGURATION_IMAGELIST_HXX +#define FRAMEWORK_SOURCE_UICONFIGURATION_IMAGELIST_HXX + +class ImageList +{ +public: + explicit ImageList(); + ImageList( const std::vector<OUString>& rNameVector, + const OUString& rPrefix); + + void InsertFromHorizontalStrip( const BitmapEx &rBitmapEx, + const std::vector< OUString > &rNameVector ); + BitmapEx GetAsHorizontalStrip() const; + sal_uInt16 GetImageCount() const; + Size GetImageSize() const; + + void AddImage( const OUString& rImageName, const Image& rImage ); + + void ReplaceImage( const OUString& rImageName, const Image& rImage ); + + void RemoveImage( sal_uInt16 nId ); + + Image GetImage( sal_uInt16 nId ) const; + Image GetImage( const OUString& rImageName ) const; + + sal_uInt16 GetImagePos( sal_uInt16 nId ) const; + bool HasImageForId( sal_uInt16 nId ) const; + sal_uInt16 GetImagePos( const OUString& rImageName ) const; + + sal_uInt16 GetImageId( sal_uInt16 nPos ) const; + + OUString GetImageName( sal_uInt16 nPos ) const; + void GetImageNames( ::std::vector< OUString >& rNames ) const; + + bool operator==( const ImageList& rImageList ) const; + bool operator!=( const ImageList& rImageList ) const { return !(ImageList::operator==( rImageList )); } + +private: + + std::shared_ptr<ImplImageList> mpImplData; + + void ImplInit( sal_uInt16 nItems, const Size &rSize ); + sal_uInt16 ImplGetImageId( const OUString& rImageName ) const; +}; + +#endif // INCLUDED_VCL_IMAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |