LCOV - code coverage report
Current view: top level - sw/source/ui/inc - workctrl.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 8 50.0 %
Date: 2012-08-25 Functions: 5 9 55.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 10 40.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                 :            : #ifndef _WORKCTRL_HXX
      29                 :            : #define _WORKCTRL_HXX
      30                 :            : 
      31                 :            : #include <sfx2/tbxctrl.hxx>
      32                 :            : #include <vcl/toolbox.hxx>
      33                 :            : #include <svtools/stdctrl.hxx>
      34                 :            : #include <vcl/button.hxx>
      35                 :            : 
      36                 :            : class PopupMenu;
      37                 :            : class SwView;
      38                 :            : 
      39                 :            : // double entry! hrc and hxx
      40                 :            : // these Ids say what the buttons below the scrollbar are doing
      41                 :            : #define NID_START   20000
      42                 :            : #define NID_NEXT    20000
      43                 :            : #define NID_PREV    20001
      44                 :            : #define NID_TBL     20002
      45                 :            : #define NID_FRM     20003
      46                 :            : #define NID_PGE     20004
      47                 :            : #define NID_DRW     20005
      48                 :            : #define NID_CTRL    20006
      49                 :            : #define NID_REG     20007
      50                 :            : #define NID_BKM     20008
      51                 :            : #define NID_GRF     20009
      52                 :            : #define NID_OLE     20010
      53                 :            : #define NID_OUTL    20011
      54                 :            : #define NID_SEL     20012
      55                 :            : #define NID_FTN     20013
      56                 :            : #define NID_MARK    20014
      57                 :            : #define NID_POSTIT  20015
      58                 :            : #define NID_SRCH_REP 20016
      59                 :            : #define NID_INDEX_ENTRY  20017
      60                 :            : #define NID_TABLE_FORMULA   20018
      61                 :            : #define NID_TABLE_FORMULA_ERROR     20019
      62                 :            : #define NID_COUNT  20
      63                 :            : 
      64                 :            : 
      65                 :            : 
      66                 :            : //----------------------------------------------------------------------------
      67                 :            : //
      68                 :            : //----------------------------------------------------------------------------
      69                 :            : 
      70                 :            : class SwTbxInsertCtrl : public SfxToolBoxControl
      71                 :            : {
      72                 :            :     sal_uInt16                  nLastSlotId;
      73                 :            : 
      74                 :            :     using SfxToolBoxControl::Select;
      75                 :            :     virtual void            Select( sal_Bool bMod1 = sal_False );
      76                 :            : 
      77                 :            : public:
      78                 :            :     SFX_DECL_TOOLBOX_CONTROL();
      79                 :            : 
      80                 :            :     SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
      81                 :            :     ~SwTbxInsertCtrl();
      82                 :            : 
      83                 :            :     virtual SfxPopupWindowType  GetPopupWindowType() const;
      84                 :            :     virtual SfxPopupWindow*     CreatePopupWindow();
      85                 :            :     virtual void                StateChanged( sal_uInt16 nSID,
      86                 :            :                                               SfxItemState eState,
      87                 :            :                                               const SfxPoolItem* pState );
      88                 :            : 
      89                 :            :     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
      90                 :            : };
      91                 :            : 
      92                 :            : //----------------------------------------------------------------------------
      93                 :            : //
      94                 :            : //----------------------------------------------------------------------------
      95                 :            : 
      96                 :            : class SwTbxAutoTextCtrl : public SfxToolBoxControl
      97                 :            : {
      98                 :            :     PopupMenu*              pPopup;
      99                 :            :     SwView*                 pView;
     100                 :            : 
     101                 :            : 
     102                 :            :     void                    DelPopup();
     103                 :            : public:
     104                 :            :     SFX_DECL_TOOLBOX_CONTROL();
     105                 :            : 
     106                 :            :     SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     107                 :            :     ~SwTbxAutoTextCtrl();
     108                 :            : 
     109                 :            :     virtual SfxPopupWindowType  GetPopupWindowType() const;
     110                 :            :     virtual SfxPopupWindow*     CreatePopupWindow();
     111                 :            :     virtual void                StateChanged( sal_uInt16 nSID,
     112                 :            :                                               SfxItemState eState,
     113                 :            :                                               const SfxPoolItem* pState );
     114                 :            : 
     115                 :            :     DECL_LINK(PopupHdl, PopupMenu*);
     116                 :            : };
     117                 :            : 
     118                 :            : 
     119                 :            : //----------------------------------------------------------------------------
     120                 :            : //
     121                 :            : //----------------------------------------------------------------------------
     122                 :            : 
     123         [ #  # ]:          0 : class SwScrollNaviToolBox : public ToolBox
     124                 :            : {
     125                 :            :     virtual void    MouseButtonUp( const MouseEvent& rMEvt );
     126                 :            :     virtual void    RequestHelp( const HelpEvent& rHEvt );
     127                 :            : 
     128                 :            :     public:
     129                 :          0 :         SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
     130                 :          0 :             ToolBox(pParent, nWinStyle ) {}
     131                 :            : };
     132                 :            : 
     133                 :            : class SwScrollNaviPopup : public SfxPopupWindow
     134                 :            : {
     135                 :            :     SwScrollNaviToolBox    aToolBox;
     136                 :            :     FixedLine       aSeparator;
     137                 :            :     FixedInfo       aInfoField;
     138                 :            :     ImageList       aIList;
     139                 :            : 
     140                 :            :     String          sQuickHelp[2 * NID_COUNT];
     141                 :            : 
     142                 :            :     sal_uInt16          nFwdId;
     143                 :            :     sal_uInt16          nBackId;
     144                 :            : 
     145                 :            :     void            ApplyImageList();
     146                 :            : 
     147                 :            :     using Window::GetQuickHelpText;
     148                 :            : 
     149                 :            : protected:
     150                 :            :         DECL_LINK(SelectHdl, ToolBox*);
     151                 :            :         virtual void        DataChanged( const DataChangedEvent& rDCEvt );
     152                 :            : 
     153                 :            : public:
     154                 :            :         SwScrollNaviPopup( sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
     155                 :            :         ~SwScrollNaviPopup();
     156                 :            : 
     157                 :            :     static String           GetQuickHelpText(sal_Bool bNext);
     158                 :            : 
     159                 :            :     virtual SfxPopupWindow* Clone() const;
     160                 :          0 :     void                GrabFocus(){aToolBox.GrabFocus();}
     161                 :            : };
     162                 :            : 
     163                 :            : //----------------------------------------------------------------------------
     164                 :            : //
     165                 :            : //----------------------------------------------------------------------------
     166                 :            : 
     167 [ +  - ][ +  - ]:       2462 : class SwNaviImageButton : public ImageButton
                 [ -  + ]
     168                 :            : {
     169                 :            :         SwScrollNaviPopup*  pPopup;
     170                 :            :         Image               aImage;
     171                 :            :         String              sQuickText;
     172                 :            :         SfxPopupWindow*     pPopupWindow;
     173                 :            :         SfxPopupWindow*     pFloatingWindow;
     174                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
     175                 :            : 
     176                 :            :     protected:
     177                 :            :         DECL_LINK( PopupModeEndHdl, void * );
     178                 :            :         DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
     179                 :            : 
     180                 :            :         virtual void    Click();
     181                 :            :         virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     182                 :            :         void            SetPopupWindow( SfxPopupWindow* pWindow );
     183                 :            : 
     184                 :            :     public:
     185                 :            :         SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
     186                 :            : };
     187                 :            : 
     188                 :            : //----------------------------------------------------------------------------
     189                 :            : //  ImageButtons have to set the HelpText themselves if needed
     190                 :            : //----------------------------------------------------------------------------
     191                 :            : 
     192         [ -  + ]:       4924 : class SwHlpImageButton : public ImageButton
     193                 :            : {
     194                 :            :     sal_Bool        bUp;
     195                 :            :     public:
     196                 :       2636 :         SwHlpImageButton(Window* pParent, const ResId& rResId, sal_Bool bUpBtn) :
     197                 :       2636 :             ImageButton(pParent, rResId), bUp(bUpBtn){}
     198                 :            : 
     199                 :            :     virtual void    RequestHelp( const HelpEvent& rHEvt );
     200                 :            : 
     201                 :            : };
     202                 :            : 
     203                 :            : class SwPreviewZoomControl : public SfxToolBoxControl
     204                 :            : {
     205                 :            : public:
     206                 :            :     SFX_DECL_TOOLBOX_CONTROL();
     207                 :            : 
     208                 :            :     SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     209                 :            :     ~SwPreviewZoomControl();
     210                 :            : 
     211                 :            :     virtual void            StateChanged( sal_uInt16 nSID,
     212                 :            :                                               SfxItemState eState,
     213                 :            :                                               const SfxPoolItem* pState );
     214                 :            : 
     215                 :            :     virtual Window*         CreateItemWindow( Window *pParent );
     216                 :            : };
     217                 :            : #endif
     218                 :            : 
     219                 :            : 
     220                 :            : 
     221                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10