LCOV - code coverage report
Current view: top level - sfx2/source/sidebar - Paint.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 1 1 100.0 %
Date: 2014-04-11 Functions: 3 3 100.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             : #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_PAINT_HXX
      20             : #define INCLUDED_SFX2_SOURCE_SIDEBAR_PAINT_HXX
      21             : 
      22             : #include <tools/color.hxx>
      23             : #include <vcl/gradient.hxx>
      24             : #include <vcl/wall.hxx>
      25             : #include <com/sun/star/awt/Gradient.hpp>
      26             : 
      27             : #include <boost/variant.hpp>
      28             : 
      29             : namespace cssu = ::com::sun::star::uno;
      30             : 
      31             : namespace sfx2 { namespace sidebar {
      32             : 
      33             : /** Abstraction of different ways to fill outlines.
      34             :     Can be
      35             :      - none (empty: outline is not filled)
      36             :      - singular color
      37             :      - gradient
      38             : */
      39         244 : class Paint
      40             : {
      41             : public:
      42             :     enum Type
      43             :     {
      44             :         NoPaint,
      45             :         ColorPaint,
      46             :         GradientPaint
      47             :     };
      48             : 
      49             :     // Create a Paint object for an Any that may contain a color, a
      50             :     // awt::Gradient, or nothing.
      51             :     static Paint Create (const cssu::Any& rValue);
      52             : 
      53             :     // Create paint with type NoPaint.
      54             :     explicit Paint (void);
      55             : 
      56             :     // Create a Paint object for the given color.
      57             :     explicit Paint (const Color& rColor);
      58             : 
      59             :     // Create a Paint object for the given gradient.
      60             :     explicit Paint (const Gradient& rGradient);
      61             : 
      62             :     Type GetType (void) const;
      63             :     const Color& GetColor (void) const;
      64             :     const Gradient& GetGradient (void) const;
      65             : 
      66             :     Wallpaper GetWallpaper (void) const;
      67             : 
      68             : private:
      69             :     Type meType;
      70             :     ::boost::variant<
      71             :         Color,
      72             :         Gradient
      73             :     > maValue;
      74             : };
      75             : 
      76             : 
      77             : } } // end of namespace sfx2::sidebar
      78             : 
      79             : #endif
      80             : 
      81             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10