LCOV - code coverage report
Current view: top level - framework/inc/xml - imagesconfiguration.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 9 0.0 %
Date: 2014-04-14 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_FRAMEWORK_INC_XML_IMAGESCONFIGURATION_HXX
      21             : #define INCLUDED_FRAMEWORK_INC_XML_IMAGESCONFIGURATION_HXX
      22             : 
      23             : #include <framework/fwedllapi.h>
      24             : #include <tools/stream.hxx>
      25             : #include <tools/color.hxx>
      26             : 
      27             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      28             : #include <com/sun/star/io/XInputStream.hpp>
      29             : #include <com/sun/star/io/XOutputStream.hpp>
      30             : #include <com/sun/star/uno/XComponentContext.hpp>
      31             : 
      32             : #include <vector>
      33             : #include <boost/ptr_container/ptr_vector.hpp>
      34             : 
      35             : namespace framework
      36             : {
      37             : 
      38             : enum ImageMaskMode
      39             : {
      40             :     ImageMaskMode_Color,
      41             :     ImageMaskMode_Bitmap
      42             : };
      43             : 
      44           0 : struct ImageItemDescriptor
      45             : {
      46           0 :     ImageItemDescriptor() : nIndex( -1 ) {}
      47             : 
      48             :     OUString  aCommandURL;                // URL command to dispatch
      49             :     long      nIndex;                     // index of the bitmap inside the bitmaplist
      50             : };
      51             : 
      52           0 : struct ExternalImageItemDescriptor
      53             : {
      54             :     OUString  aCommandURL;                // URL command to dispatch
      55             :     OUString  aURL;                       // a URL to an external bitmap
      56             : };
      57             : 
      58             : typedef boost::ptr_vector<ImageItemDescriptor> ImageItemListDescriptor;
      59             : 
      60             : typedef boost::ptr_vector<ExternalImageItemDescriptor> ExternalImageItemListDescriptor;
      61             : 
      62             : struct ImageListItemDescriptor
      63             : {
      64           0 :     ImageListItemDescriptor() : nMaskMode( ImageMaskMode_Color ),
      65           0 :                                 pImageItemList( 0 ) {}
      66             : 
      67           0 :     ~ImageListItemDescriptor() { delete pImageItemList; }
      68             : 
      69             :     OUString                    aURL;               // an URL to a bitmap with several images inside
      70             :     Color                       aMaskColor;         // a color used as transparent
      71             :     OUString                    aMaskURL;           // an URL to an optional bitmap used as a mask
      72             :     ImageMaskMode               nMaskMode;            // an enum to describe the current mask mode
      73             :     ImageItemListDescriptor*    pImageItemList;       // an array of ImageItemDescriptors that describes every image
      74             :     OUString                    aHighContrastURL;       // an URL to an optional high contrast bitmap with serveral images inside
      75             :     OUString                    aHighContrastMaskURL;   // an URL to an optional high contrast bitmap as a mask
      76             : };
      77             : 
      78             : typedef boost::ptr_vector<ImageListItemDescriptor> ImageListDescriptor;
      79             : 
      80             : struct ImageListsDescriptor
      81             : {
      82           0 :     ImageListsDescriptor() : pImageList( 0 ),
      83           0 :                      pExternalImageList( 0 ) {}
      84           0 :     ~ImageListsDescriptor() { delete pImageList; delete pExternalImageList; }
      85             : 
      86             :     ImageListDescriptor*            pImageList;
      87             :     ExternalImageItemListDescriptor*    pExternalImageList;
      88             : };
      89             : 
      90             : class ImagesConfiguration
      91             : {
      92             :     public:
      93             :         static bool LoadImages(
      94             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
      95             :             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream,
      96             :             ImageListsDescriptor& rItems );
      97             : 
      98             :         static bool StoreImages(
      99             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
     100             :             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOutputStream,
     101             :             const ImageListsDescriptor& rItems );
     102             : };
     103             : 
     104             : } // namespace framework
     105             : 
     106             : #endif // __FRAMEWORK_CLASSES_IMAGES
     107             : 
     108             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10