LCOV - code coverage report
Current view: top level - include/svx - tbcontrl.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 3 3 100.0 %
Date: 2014-11-03 Functions: 6 6 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_SVX_TBCONTRL_HXX
      20             : #define INCLUDED_SVX_TBCONTRL_HXX
      21             : 
      22             : /*--------------------------------------------------------------*\
      23             : 
      24             :     Description:
      25             :     -------------
      26             :     ToolBox-Controller for:
      27             :         Font-Name, Font-Height, Font-Color
      28             :         Fore-/Background color /-patterns
      29             :         Frames, Lines
      30             :         (indentation-)templates
      31             : 
      32             :     Use:
      33             :     ----------
      34             :         SvxFontNameToolBoxControl
      35             :         -------------------------
      36             :         Item type:      SvxFontItem
      37             :         Execute-Id:     SID_ATTR_CHAR_FONT
      38             :                         -> SvxFontItem
      39             :         Additional information
      40             :         from DocShell:   SvxFontListItem (SID_ATTR_CHAR_FONTLIST)
      41             : 
      42             :         SvxColorToolBoxControl
      43             :         ----------------------
      44             :         Item type:      SvxColorItem
      45             :                         SfxBoolItem
      46             :                         XLineColorItem
      47             :                     and XFillColorItem
      48             : 
      49             :         for font color (writer, ...)
      50             :         Execute-Id      SID_ATTR_CHAR_COLOR2
      51             :                     and SID_ATTR_CHAR_COLOR_EXT
      52             : 
      53             :         for font color
      54             :         (calc/impress/draw and writer drawing objects)
      55             :         Execute-Id      SID_ATTR_CHAR_COLOR
      56             : 
      57             :         for character background color (writer)
      58             :         Execute-Id      SID_ATTR_CHAR_COLOR_BACKGROUND
      59             :                     and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
      60             : 
      61             :         for paragraph background color (writer)
      62             :         and cell background color (calc)
      63             :         Execute-Id      SID_BACKGROUND_COLOR
      64             : 
      65             :         for table/cell border color (writer, calc)
      66             :         Execute-Id      SID_FRAME_LINECOLOR
      67             : 
      68             :         for 3D extrusion
      69             :         Execute-Id      SID_EXTRUSION_3D_COLOR
      70             : 
      71             :         for line color
      72             :         Execute-Id      SID_ATTR_LINE_COLOR
      73             : 
      74             :         for area fill color
      75             :         Execute-Id      SID_ATTR_FILL_COLOR
      76             : 
      77             :         SvxPatternToolBoxControl
      78             :         ------------------------
      79             :         Item type:      SvxBrushItem
      80             :         Execute-Id:     SID_BACKGROUND_PATTERN
      81             :                         -> SvxBrushItem
      82             :         Additional information
      83             :         from DocShell:   presently none
      84             :                         in future: color palette
      85             :         Note:           Analysis of BrushItem:
      86             :                         Brush-FillColor() is misused as switch,
      87             :                         to distinguish whether a new style
      88             :                         or a new color has been set
      89             : 
      90             :                         GetFillColor() == COL_BLACK -> GetStyle() ,
      91             :                         GetFillColor() == COL_WHITE -> GetColor()
      92             : 
      93             :         SvxFrameToolBoxControl
      94             :         ----------------------
      95             :         Item type:      SvxBoxItem
      96             :         Execute-Id:     SID_ATTR_BORDER
      97             :                         -> SvxBoxItem & SvxBoxInfoItem
      98             :         Additional information
      99             :         from DocShell:  none
     100             :         Bemerkung:      provides dependent of chosen ValueSet-Item
     101             :                         only SvxBoxItem or additionally SvxBoxInfoItem
     102             :                         If the Controller ein SfxUInt16Item receives a
     103             :                         value != 0, paragraph mode will be switched on,
     104             :                         i.e. the last line will be hidden.
     105             :                         A value == 0 switches again to Tabel mode.
     106             : 
     107             :         SvxFrameLineStyleToolBoxControl
     108             :         -------------------------------
     109             :         Item type:      SvxLineItem
     110             :         Execute-Id:     SID_FRAME_LINESTYLE
     111             :                         -> SvxLineItem
     112             :         Additional information
     113             :         from DocShell:  none
     114             :         Bemerkung:      provides a SvxLineItem, which provides a SvxBorderLine
     115             :                         without color information.
     116             : 
     117             :         SvxStyleToolBoxControl
     118             :         ----------------------
     119             :         Item type:      SfxTemplateItem
     120             :         Execute-Id:     SID_TEMPLATE_APPLY
     121             :                         -> StyleName (SfxStringItem)
     122             :                         -> eStyleFamily (SfxUInt16Item)
     123             :         Additional information
     124             :         from DocShell:  none
     125             :         Bemerkung:      Switch family by Invalidate
     126             :                         at the Bindings (->SfxStyleControllerItem)
     127             : 
     128             : \*--------------------------------------------------------------*/
     129             : 
     130             : // ITEMID_...-Defines i *.cxx
     131             : 
     132             : #include <rsc/rscsfx.hxx>
     133             : #include <svl/lstner.hxx>
     134             : #include <sfx2/tbxctrl.hxx>
     135             : #include <svx/strarray.hxx>
     136             : #include <svx/svxdllapi.h>
     137             : #include <boost/scoped_ptr.hpp>
     138             : #include <com/sun/star/awt/FontDescriptor.hpp>
     139             : #include <svx/PaletteManager.hxx>
     140             : 
     141             : // important im tbxctrls.hxx created HeDaBu !!!
     142             : class SvxLineItem;
     143             : class SvxBoxInfoItem;
     144             : class SvxFontItem;
     145             : class SfxStyleControllerItem_Impl;
     146             : class SfxStyleSheetBasePool;
     147             : class SfxTemplateItem;
     148             : 
     149             : namespace svx
     150             : {
     151             :     class ToolboxButtonColorUpdater;
     152             : }
     153             : 
     154             : 
     155             : // class SvxStyleToolBoxControl ------------------------------------------
     156             : 
     157             : class SVX_DLLPUBLIC SvxStyleToolBoxControl : public SfxToolBoxControl
     158             : {
     159             :     struct Impl;
     160             : public:
     161             :     SFX_DECL_TOOLBOX_CONTROL();
     162             : 
     163             :     SvxStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     164             :     virtual ~SvxStyleToolBoxControl();
     165             : 
     166             :     virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
     167             : 
     168             :     virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,
     169             :                                   const SfxPoolItem* pState ) SAL_OVERRIDE;
     170             : 
     171             :     DECL_LINK( VisibilityNotification, void* );
     172             : protected:
     173             :     // XInitialization
     174             :     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     175             : 
     176             :     // XUpdatable
     177             :     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     178             : 
     179             :     // XComponent
     180             :     virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     181             : 
     182             : private:
     183             : 
     184             : #define MAX_FAMILIES 5
     185             : 
     186             :     SfxStyleSheetBasePool*              pStyleSheetPool;
     187             :     SfxStyleControllerItem_Impl*        pBoundItems [MAX_FAMILIES];
     188             :     css::uno::Reference< css::lang::XComponent >
     189             :                                         m_xBoundItems[MAX_FAMILIES];
     190             :     SfxTemplateItem*                    pFamilyState[MAX_FAMILIES];
     191             :     sal_uInt16                          nActFamily; // Id in the ToolBox = Position - 1
     192             :     Impl*                               pImpl;
     193             : 
     194             :     SVX_DLLPRIVATE void Update();
     195             :     SVX_DLLPRIVATE void FillStyleBox();
     196             :     SVX_DLLPRIVATE void     SelectStyle( const OUString& rStyleName );
     197             : 
     198             : friend class SfxStyleControllerItem_Impl;
     199             : 
     200             :     SVX_DLLPRIVATE void         SetFamilyState  ( sal_uInt16 nIdx, const SfxTemplateItem* pItem );
     201             :     SVX_DLLPRIVATE SfxStyleFamily   GetActFamily    ();
     202             : };
     203             : 
     204             : 
     205             : // class SvxFontNameToolBoxControl ---------------------------------------
     206             : 
     207        3908 : class SVX_DLLPUBLIC SvxFontNameToolBoxControl : public SfxToolBoxControl
     208             : {
     209             : public:
     210             :     SFX_DECL_TOOLBOX_CONTROL();
     211             :     SvxFontNameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     212             : 
     213             :     virtual void    StateChanged        ( sal_uInt16 nSID, SfxItemState eState,
     214             :                                           const SfxPoolItem* pState ) SAL_OVERRIDE;
     215             :     virtual vcl::Window* CreateItemWindow    ( vcl::Window *pParent ) SAL_OVERRIDE;
     216             : };
     217             : 
     218             : 
     219             : // class SvxColorToolBoxControl --------------------------------------
     220             : 
     221             : class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
     222             : {
     223             :     using SfxToolBoxControl::StateChanged;
     224             : 
     225             :     ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > pBtnUpdater;
     226             :     PaletteManager                      mPaletteManager;
     227             :     bool bSidebarType;
     228             :     DECL_LINK( SelectedHdl, Color* );
     229             : public:
     230             :     SFX_DECL_TOOLBOX_CONTROL();
     231             :     SvxColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     232             :     virtual ~SvxColorToolBoxControl();
     233             : 
     234             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     235             :                                               const SfxPoolItem* pState ) SAL_OVERRIDE;
     236             :     virtual SfxPopupWindowType  GetPopupWindowType() const SAL_OVERRIDE;
     237             :     virtual SfxPopupWindow*     CreatePopupWindow() SAL_OVERRIDE;
     238             :     virtual void                Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
     239             : };
     240             : 
     241             : 
     242             : // class SvxFrameToolBoxControl ------------------------------------------
     243             : 
     244         732 : class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
     245             : {
     246             : public:
     247             :     SFX_DECL_TOOLBOX_CONTROL();
     248             :     SvxFrameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     249             : 
     250             :     virtual SfxPopupWindowType  GetPopupWindowType() const SAL_OVERRIDE;
     251             :     virtual SfxPopupWindow*     CreatePopupWindow() SAL_OVERRIDE;
     252             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     253             :                                               const SfxPoolItem* pState ) SAL_OVERRIDE;
     254             : 
     255             : };
     256             : 
     257             : 
     258             : // class SvxLineStyleToolBoxControl --------------------------------------
     259             : 
     260         732 : class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
     261             : {
     262             : public:
     263             :     SFX_DECL_TOOLBOX_CONTROL();
     264             :     SvxFrameLineStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     265             : 
     266             :     virtual SfxPopupWindowType  GetPopupWindowType() const SAL_OVERRIDE;
     267             :     virtual SfxPopupWindow*     CreatePopupWindow() SAL_OVERRIDE;
     268             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     269             :                                               const SfxPoolItem* pState ) SAL_OVERRIDE;
     270             : };
     271             : 
     272             : 
     273             : class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl
     274             : {
     275             : private:
     276             :     OUString             aDefaultText;
     277             : 
     278             : public:
     279             :     SFX_DECL_TOOLBOX_CONTROL();
     280             :     SvxSimpleUndoRedoController( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     281             :     virtual ~SvxSimpleUndoRedoController();
     282             : 
     283             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     284             :                                               const SfxPoolItem* pState ) SAL_OVERRIDE;
     285             : };
     286             : 
     287             : #endif // INCLUDED_SVX_TBCONTRL_HXX
     288             : 
     289             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10