LCOV - code coverage report
Current view: top level - sd/source/ui/slidesorter/inc/view - SlsTheme.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 1 100.0 %
Date: 2012-08-25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SD_SLIDESORTER_VIEW_THEME_HXX
      30                 :            : #define SD_SLIDESORTER_VIEW_THEME_HXX
      31                 :            : 
      32                 :            : #include "model/SlsVisualState.hxx"
      33                 :            : 
      34                 :            : #include <vcl/bitmapex.hxx>
      35                 :            : #include <vcl/font.hxx>
      36                 :            : #include <vcl/gradient.hxx>
      37                 :            : #include <tools/color.hxx>
      38                 :            : 
      39                 :            : #include <boost/shared_ptr.hpp>
      40                 :            : #include <boost/weak_ptr.hpp>
      41                 :            : 
      42                 :            : 
      43                 :            : namespace sd { namespace slidesorter { namespace controller {
      44                 :            : class Properties;
      45                 :            : } } }
      46                 :            : 
      47                 :            : namespace sd { namespace slidesorter { namespace view {
      48                 :            : 
      49                 :            : const int Theme_ButtonCornerRadius = 3;
      50                 :            : const int Theme_ButtonMaxAlpha = 0;
      51                 :            : const int Theme_ButtonBarMaxAlpha = 0;
      52                 :            : const int Theme_ButtonPaintType = 1;
      53                 :            : const int Theme_ButtonBorder = 4;
      54                 :            : const int Theme_ButtonGap = 0;
      55                 :            : const int Theme_ButtonFadeInDelay = 800;
      56                 :            : const int Theme_ButtonFadeInDuration = 100;
      57                 :            : const int Theme_ButtonFadeOutDelay = 0;
      58                 :            : const int Theme_ButtonFadeOutDuration = 100;
      59                 :            : const int Theme_ToolTipDelay = 1000;
      60                 :            : const int Theme_FocusIndicatorWidth = 3;
      61                 :            : 
      62                 :            : /** Collection of colors and styles that are used to paint the slide sorter
      63                 :            :     view.
      64                 :            : */
      65                 :        130 : class Theme
      66                 :            : {
      67                 :            : public:
      68                 :            :     Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties);
      69                 :            : 
      70                 :            :     /** Call this method to update some colors as response to a change of
      71                 :            :         a system color change.
      72                 :            :     */
      73                 :            :     void Update (
      74                 :            :         const ::boost::shared_ptr<controller::Properties>& rpProperties);
      75                 :            : 
      76                 :            :     //    BitmapEx GetInsertIndicatorIcon (void) const;
      77                 :            : 
      78                 :            :     enum FontType {
      79                 :            :         Font_PageNumber,
      80                 :            :         Font_PageCount
      81                 :            :     };
      82                 :            :     static ::boost::shared_ptr<Font> GetFont (
      83                 :            :         const FontType eType,
      84                 :            :         const OutputDevice& rDevice);
      85                 :            : 
      86                 :            :     enum ColorType {
      87                 :            :         Color_Background,
      88                 :            :         Color_PageNumberDefault,
      89                 :            :         Color_PageNumberHover,
      90                 :            :         Color_PageNumberHighContrast,
      91                 :            :         Color_PageNumberBrightBackground,
      92                 :            :         Color_PageNumberDarkBackground,
      93                 :            :         Color_Selection,
      94                 :            :         Color_PreviewBorder,
      95                 :            :         Color_PageCountFontColor,
      96                 :            :         _ColorType_Size_
      97                 :            :     };
      98                 :            :     ColorData GetColor (const ColorType eType);
      99                 :            : 
     100                 :            :     enum GradientColorType {
     101                 :            :         Gradient_NormalPage,
     102                 :            :         Gradient_SelectedPage,
     103                 :            :         Gradient_SelectedAndFocusedPage,
     104                 :            :         Gradient_MouseOverPage,
     105                 :            :         Gradient_MouseOverSelectedAndFocusedPage,
     106                 :            :         Gradient_FocusedPage,
     107                 :            :         Gradient_ButtonBackground,
     108                 :            :         _GradientColorType_Size_
     109                 :            :     };
     110                 :            :     enum GradientColorClass {
     111                 :            :         Border1,
     112                 :            :         Border2,
     113                 :            :         Fill1,
     114                 :            :         Fill2,
     115                 :            :         Base
     116                 :            :     };
     117                 :            :     ColorData GetGradientColor (
     118                 :            :         const GradientColorType eType,
     119                 :            :         const GradientColorClass eClass);
     120                 :            :     void SetGradient (
     121                 :            :         const GradientColorType eType,
     122                 :            :         const ColorData aBaseColor,
     123                 :            :         const sal_Int32 nSaturationOverride,
     124                 :            :         const sal_Int32 nBrightnessOverride,
     125                 :            :         const sal_Int32 nFillStartOffset,
     126                 :            :         const sal_Int32 nFillEndOffset,
     127                 :            :         const sal_Int32 nBorderStartOffset,
     128                 :            :         const sal_Int32 nBorderEndOffset);
     129                 :            : 
     130                 :            :     enum IconType
     131                 :            :     {
     132                 :            :         Icon_RawShadow,
     133                 :            :         Icon_RawInsertShadow,
     134                 :            :         Icon_HideSlideOverlay,
     135                 :            :         Icon_FocusBorder,
     136                 :            :         Icon_ButtonBarLarge,
     137                 :            :         Icon_ButtonBarMedium,
     138                 :            :         Icon_ButtonBarSmall,
     139                 :            :         Icon_Command1Large,
     140                 :            :         Icon_Command1LargeHover,
     141                 :            :         Icon_Command1Medium,
     142                 :            :         Icon_Command1MediumHover,
     143                 :            :         Icon_Command1Small,
     144                 :            :         Icon_Command1SmallHover,
     145                 :            :         Icon_Command2Large,
     146                 :            :         Icon_Command2LargeHover,
     147                 :            :         Icon_Command2Medium,
     148                 :            :         Icon_Command2MediumHover,
     149                 :            :         Icon_Command2Small,
     150                 :            :         Icon_Command2SmallHover,
     151                 :            :         Icon_Command2BLarge,
     152                 :            :         Icon_Command2BLargeHover,
     153                 :            :         Icon_Command2BMedium,
     154                 :            :         Icon_Command2BMediumHover,
     155                 :            :         Icon_Command2BSmall,
     156                 :            :         Icon_Command2BSmallHover,
     157                 :            :         Icon_Command3Large,
     158                 :            :         Icon_Command3LargeHover,
     159                 :            :         Icon_Command3Medium,
     160                 :            :         Icon_Command3MediumHover,
     161                 :            :         Icon_Command3Small,
     162                 :            :         Icon_Command3SmallHover,
     163                 :            :         _IconType_Size_
     164                 :            :     };
     165                 :            :     const BitmapEx& GetIcon (const IconType eType);
     166                 :            : 
     167                 :            : private:
     168                 :            :     bool mbIsHighContrastMode;
     169                 :            :     class GradientDescriptor
     170                 :            :     {
     171                 :            :     public:
     172                 :            :         ColorData maBaseColor;
     173                 :            : 
     174                 :            :         sal_Int32 mnSaturationOverride;
     175                 :            :         sal_Int32 mnBrightnessOverride;
     176                 :            : 
     177                 :            :         ColorData maFillColor1;
     178                 :            :         ColorData maFillColor2;
     179                 :            :         ColorData maBorderColor1;
     180                 :            :         ColorData maBorderColor2;
     181                 :            : 
     182                 :            :         sal_Int32 mnFillOffset1;
     183                 :            :         sal_Int32 mnFillOffset2;
     184                 :            :         sal_Int32 mnBorderOffset1;
     185                 :            :         sal_Int32 mnBorderOffset2;
     186                 :            :     };
     187                 :            :     ColorData maBackgroundColor;
     188                 :            :     ColorData maPageBackgroundColor;
     189                 :            :     ::std::vector<GradientDescriptor> maGradients;
     190                 :            :     ::std::vector<BitmapEx> maIcons;
     191                 :            :     ::std::vector<ColorData> maColor;
     192                 :            : 
     193                 :            :     GradientDescriptor& GetGradient (const GradientColorType eType);
     194                 :            :     /** Guarded initialization of the specified icon in the maIcons
     195                 :            :         container.  Call only while a LocalResource object is active.
     196                 :            :     */
     197                 :            :     void InitializeIcon (const IconType eType, sal_uInt16 nResourceId);
     198                 :            : };
     199                 :            : 
     200                 :            : 
     201                 :            : } } } // end of namespace ::sd::slidesorter::view
     202                 :            : 
     203                 :            : #endif
     204                 :            : 
     205                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10