LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx - tbcontrl.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 3 33.3 %
Date: 2012-12-17 Functions: 2 6 33.3 %
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 _SVX_TBCONTRL_HXX
      20             : #define _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             :         SvxFontColorToolBoxControl
      43             :         --------------------------
      44             :         Item type:      SvxFontColorItem
      45             :         Execute-Id:     SID_ATTR_CHAR_COLOR
      46             :                         -> SvxFontColorItem
      47             :         Additional information
      48             :         from DocShell:  presently none
      49             :                         in future: color palette
      50             : 
      51             :         class SvxColorExtToolBoxControl
      52             :         -----------------------------------
      53             :         Item type:      SvxColorItem
      54             :                     and SfxBoolItem
      55             : 
      56             :         for font color (writer, ...)
      57             :         Execute-Id      SID_ATTR_CHAR_COLOR2
      58             :                     and SID_ATTR_CHAR_COLOR_EXT
      59             : 
      60             :         for cell color (calc)
      61             :         Execute-Id      SID_ATTR_CHAR_COLOR
      62             : 
      63             :         for character background color (writer)
      64             :         Execute-Id      SID_ATTR_CHAR_COLOR_BACKGROUND
      65             :                     and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
      66             : 
      67             :         for paragraph background color (writer)
      68             :         Execute-Id      SID_BACKGROUND_COLOR
      69             : 
      70             :         for  cell background color (calc)
      71             :         Execute-Id      SID_ATTR_CHAR_COLOR_BACKGROUND
      72             : 
      73             :         for table/cell border color (writer, calc)
      74             :         Execute-Id      SID_FRAME_LINECOLOR
      75             : 
      76             :         SvxColorToolBoxControl
      77             :         --------------------------------
      78             :         Item type:      SvxBrushItem
      79             :         Execute-Id:     SID_BACKGROUND_COLOR
      80             :                         -> SvxColorItem
      81             : 
      82             :         SvxPatternToolBoxControl
      83             :         ------------------------
      84             :         Item type:      SvxBrushItem
      85             :         Execute-Id:     SID_BACKGROUND_PATTERN
      86             :                         -> SvxBrushItem
      87             :         Additional information
      88             :         from DocShell:   presently none
      89             :                         in future: color palette
      90             :         Note:           Analysis of BrushItem:
      91             :                         Brush-FillColor() is misused as switch,
      92             :                         to distinguish whether a new style
      93             :                         or a new color has been set
      94             : 
      95             :                         GetFillColor() == COL_BLACK -> GetStyle() ,
      96             :                         GetFillColor() == COL_WHITE -> GetColor()
      97             : 
      98             :         SvxFrameToolBoxControl
      99             :         ----------------------
     100             :         Item type:      SvxBoxItem
     101             :         Execute-Id:     SID_ATTR_BORDER
     102             :                         -> SvxBoxItem & SvxBoxInfoItem
     103             :         Additional information
     104             :         from DocShell:  none
     105             :         Bemerkung:      provides dependant of chosen ValueSet-Item
     106             :                         only SvxBoxItem or additionally SvxBoxInfoItem
     107             :                         If the Controller ein SfxUInt16Item receives a
     108             :                         value != 0, paragraph mode will be switched on,
     109             :                         i.e. the last line will be hidden.
     110             :                         A value == 0 switches again to Tabel mode.
     111             : 
     112             :         SvxFrameLineStyleToolBoxControl
     113             :         -------------------------------
     114             :         Item type:      SvxLineItem
     115             :         Execute-Id:     SID_FRAME_LINESTYLE
     116             :                         -> SvxLineItem
     117             :         Additional information
     118             :         from DocShell:  none
     119             :         Bemerkung:      provides a SvxLineItem, which provides a SvxBorderLine
     120             :                         without color information.
     121             : 
     122             :         SvxFrameLineColorToolBoxControl
     123             :         -------------------------------
     124             :         Item type:      SvxColorItem
     125             :         Execute-Id:     SID_FRAME_LINECOLOR
     126             :                         -> SvxColorItem
     127             :         Additional information
     128             :         from DocShell:   none
     129             : 
     130             :         SvxStyleToolBoxControl
     131             :         ----------------------
     132             :         Item type:      SfxTemplateItem
     133             :         Execute-Id:     SID_TEMPLATE_APPLY
     134             :                         -> StyleName (SfxStringItem)
     135             :                         -> eStyleFamily (SfxUInt16Item)
     136             :         Additional information
     137             :         from DocShell:  none
     138             :         Bemerkung:      Switch family by Invalidate
     139             :                         at the Bindings (->SfxStyleControllerItem)
     140             : 
     141             : \*--------------------------------------------------------------*/
     142             : 
     143             : // ITEMID_...-Defines i *.cxx
     144             : 
     145             : #include <rsc/rscsfx.hxx>
     146             : #include <svl/lstner.hxx>
     147             : #include <sfx2/tbxctrl.hxx>
     148             : #include <svx/strarray.hxx>
     149             : #include "svx/svxdllapi.h"
     150             : 
     151             : #include <com/sun/star/awt/FontDescriptor.hpp>
     152             : 
     153             : // important im tbxctrls.hxx created HeDaBu !!!
     154             : class SvxLineItem;
     155             : class SvxBoxInfoItem;
     156             : class SvxFontItem;
     157             : class SfxStyleControllerItem_Impl;
     158             : class SfxStyleSheetBasePool;
     159             : class SfxTemplateItem;
     160             : 
     161             : namespace svx
     162             : {
     163             :     class ToolboxButtonColorUpdater;
     164             : }
     165             : //########################################################################
     166             : 
     167             : //========================================================================
     168             : // class SvxStyleToolBoxControl ------------------------------------------
     169             : //========================================================================
     170             : class SVX_DLLPUBLIC SvxStyleToolBoxControl : public SfxToolBoxControl
     171             : {
     172             :     struct Impl;
     173             : public:
     174             :     SFX_DECL_TOOLBOX_CONTROL();
     175             : 
     176             :     SvxStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     177             :     ~SvxStyleToolBoxControl();
     178             : 
     179             :     virtual Window* CreateItemWindow( Window *pParent );
     180             : 
     181             :     virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,
     182             :                                   const SfxPoolItem* pState );
     183             : 
     184             :     DECL_LINK( VisibilityNotification, void* );
     185             : protected:
     186             :     // XInitialization
     187             :     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);
     188             : 
     189             :     // XUpdatable
     190             :     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
     191             : 
     192             :     // XComponent
     193             :     virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
     194             : 
     195             : private:
     196             : 
     197             : #define MAX_FAMILIES 5
     198             : 
     199             :     SfxStyleSheetBasePool*              pStyleSheetPool;
     200             :     SfxStyleControllerItem_Impl*        pBoundItems [MAX_FAMILIES];
     201             :     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xBoundItems[MAX_FAMILIES];
     202             :     SfxTemplateItem*                    pFamilyState[MAX_FAMILIES];
     203             :     sal_uInt16                              nActFamily; // Id in the ToolBox = Position - 1
     204             :     String                              aCurSel;
     205             :     Impl*                               pImpl;
     206             : 
     207             :     SVX_DLLPRIVATE void Update();
     208             :     SVX_DLLPRIVATE void FillStyleBox();
     209             :     SVX_DLLPRIVATE void     SelectStyle( const String& rStyleName );
     210             : 
     211             : friend class SfxStyleControllerItem_Impl;
     212             : 
     213             :     SVX_DLLPRIVATE void         SetFamilyState  ( sal_uInt16 nIdx, const SfxTemplateItem* pItem );
     214             :     SVX_DLLPRIVATE SfxStyleFamily   GetActFamily    ();
     215             : };
     216             : 
     217             : //========================================================================
     218             : // class SvxFontNameToolBoxControl ---------------------------------------
     219             : //========================================================================
     220             : 
     221             : 
     222           4 : class SVX_DLLPUBLIC SvxFontNameToolBoxControl : public SfxToolBoxControl
     223             : {
     224             : public:
     225             :     SFX_DECL_TOOLBOX_CONTROL();
     226             :     SvxFontNameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     227             : 
     228             :     virtual void    StateChanged        ( sal_uInt16 nSID, SfxItemState eState,
     229             :                                           const SfxPoolItem* pState );
     230             :     virtual Window* CreateItemWindow    ( Window *pParent );
     231             : };
     232             : 
     233             : 
     234             : 
     235             : //========================================================================
     236             : // class SvxFontColorToolBoxControl --------------------------------------
     237             : //========================================================================
     238             : 
     239             : 
     240             : 
     241             : class SVX_DLLPUBLIC SvxFontColorToolBoxControl : public SfxToolBoxControl
     242             : {
     243             :     ::svx::ToolboxButtonColorUpdater*   pBtnUpdater;
     244             :     Color                               mLastColor;
     245             : 
     246             : public:
     247             :     SFX_DECL_TOOLBOX_CONTROL();
     248             :     SvxFontColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     249             :     ~SvxFontColorToolBoxControl();
     250             : 
     251             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     252             :                                               const SfxPoolItem* pState );
     253             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     254             :     virtual SfxPopupWindow*     CreatePopupWindow();
     255             : };
     256             : 
     257             : 
     258             : 
     259             : //========================================================================
     260             : // class SvxColorExtToolBoxControl --------------------------------------
     261             : //========================================================================
     262             : 
     263             : 
     264             : 
     265             : class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl
     266             : {
     267             :     using SfxToolBoxControl::StateChanged;
     268             :     using SfxToolBoxControl::Select;
     269             : 
     270             :     //  SfxStatusForwarder          aForward;
     271             :     ::svx::ToolboxButtonColorUpdater*   pBtnUpdater;
     272             :     Color                               mLastColor;
     273             :     sal_Bool                            bChoiceFromPalette;
     274             : 
     275             : public:
     276             :     SFX_DECL_TOOLBOX_CONTROL();
     277             :     SvxColorExtToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     278             :     ~SvxColorExtToolBoxControl();
     279             : 
     280             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     281             :                                               const SfxPoolItem* pState );
     282             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     283             :     virtual SfxPopupWindow*     CreatePopupWindow();
     284             :     virtual void                Select( sal_Bool bMod1 = sal_False );
     285             : };
     286             : 
     287             : 
     288             : 
     289             : //========================================================================
     290             : // class SvxColorToolBoxControl ------------------------------------------
     291             : //========================================================================
     292             : 
     293             : 
     294             : class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
     295             : {
     296             :     ::svx::ToolboxButtonColorUpdater*   pBtnUpdater;
     297             :     Color                               mLastColor;
     298             : 
     299             : public:
     300             :     SvxColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     301             :     ~SvxColorToolBoxControl();
     302             : 
     303             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     304             :                                               const SfxPoolItem* pState );
     305             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     306             :     virtual SfxPopupWindow*     CreatePopupWindow();
     307             : };
     308             : 
     309             : 
     310             : 
     311             : //========================================================================
     312             : // class SvxFrameToolBoxControl ------------------------------------------
     313             : //========================================================================
     314             : 
     315             : 
     316           0 : class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
     317             : {
     318             : public:
     319             :     SFX_DECL_TOOLBOX_CONTROL();
     320             :     SvxFrameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     321             : 
     322             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     323             :     virtual SfxPopupWindow*     CreatePopupWindow();
     324             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     325             :                                               const SfxPoolItem* pState );
     326             : 
     327             : };
     328             : 
     329             : 
     330             : 
     331             : //========================================================================
     332             : // class SvxLineStyleToolBoxControl --------------------------------------
     333             : //========================================================================
     334             : 
     335             : 
     336           0 : class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
     337             : {
     338             : public:
     339             :     SFX_DECL_TOOLBOX_CONTROL();
     340             :     SvxFrameLineStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     341             : 
     342             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     343             :     virtual SfxPopupWindow*     CreatePopupWindow();
     344             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     345             :                                               const SfxPoolItem* pState );
     346             : };
     347             : 
     348             : 
     349             : 
     350             : //========================================================================
     351             : // class SvxFrameLineColorToolBoxControl ---------------------------------
     352             : //========================================================================
     353             : 
     354             : 
     355             : class SVX_DLLPUBLIC SvxFrameLineColorToolBoxControl : public SfxToolBoxControl
     356             : {
     357             :     ::svx::ToolboxButtonColorUpdater*   pBtnUpdater;
     358             :     Color                               mLastColor;
     359             : 
     360             : public:
     361             :     SFX_DECL_TOOLBOX_CONTROL();
     362             :     SvxFrameLineColorToolBoxControl( sal_uInt16 nSlotId,
     363             :                                      sal_uInt16 nId,
     364             :                                      ToolBox& rTbx );
     365             :     ~SvxFrameLineColorToolBoxControl();
     366             : 
     367             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     368             :                                               const SfxPoolItem* pState );
     369             :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     370             :     virtual SfxPopupWindow*     CreatePopupWindow();
     371             : };
     372             : 
     373             : class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl
     374             : {
     375             : private:
     376             :     ::rtl::OUString             aDefaultText;
     377             : 
     378             : public:
     379             :     SFX_DECL_TOOLBOX_CONTROL();
     380             :     SvxSimpleUndoRedoController( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     381             :     ~SvxSimpleUndoRedoController();
     382             : 
     383             :     virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
     384             :                                               const SfxPoolItem* pState );
     385             : };
     386             : 
     387             : #endif // #ifndef _SVX_TBCONTRL_HXX
     388             : 
     389             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10