LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/include/vcl - button.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 14 42 33.3 %
Date: 2013-07-09 Functions: 13 42 31.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             : 
      20             : #ifndef _SV_BUTTON_HXX
      21             : #define _SV_BUTTON_HXX
      22             : 
      23             : #include <tools/solar.h>
      24             : #include <vcl/dllapi.h>
      25             : #include <vcl/image.hxx>
      26             : #include <vcl/ctrl.hxx>
      27             : #include <vcl/bitmap.hxx>
      28             : #include <vcl/salnativewidgets.hxx>
      29             : #include <rsc/rsc-vcl-shared-types.hxx>
      30             : 
      31             : #include <vector>
      32             : 
      33             : class UserDrawEvent;
      34             : class ImplCommonButtonData;
      35             : 
      36             : // ----------
      37             : // - Button -
      38             : // ----------
      39             : 
      40             : class VCL_DLLPUBLIC Button : public Control
      41             : {
      42             : private:
      43             :     ImplCommonButtonData *mpButtonData;
      44             :     Link                  maClickHdl;
      45             : 
      46             :     // Copy assignment is forbidden and not implemented.
      47             :     SAL_DLLPRIVATE                  Button (const Button &);
      48             :     SAL_DLLPRIVATE                  Button & operator= (const Button &);
      49             : public:
      50             :     SAL_DLLPRIVATE sal_uInt16           ImplGetButtonState() const;
      51             :     SAL_DLLPRIVATE sal_uInt16&          ImplGetButtonState();
      52             :     SAL_DLLPRIVATE sal_uInt16           ImplGetTextStyle( OUString& rText, WinBits nWinStyle, sal_uLong nDrawFlags );
      53             :     SAL_DLLPRIVATE void             ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos, Size& rSize,
      54             :                                               sal_Bool bLayout, sal_uLong nImageSep, sal_uLong nDrawFlags,
      55             :                                               sal_uInt16 nTextStyle, Rectangle *pSymbolRect=NULL, bool bAddImageSep = false );
      56             :     SAL_DLLPRIVATE void             ImplSetFocusRect( const Rectangle &rFocusRect );
      57             :     SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const;
      58             :     SAL_DLLPRIVATE void             ImplSetSymbolAlign( SymbolAlign eAlign );
      59             :     /// The x-coordinate of the vertical separator line, use in MenuButton subclass only.
      60             :     SAL_DLLPRIVATE long             ImplGetSeparatorX() const;
      61             :     SAL_DLLPRIVATE void             ImplSetSeparatorX( long nX );
      62             : 
      63             : protected:
      64             :     explicit            Button( WindowType nType );
      65             : 
      66             : public:
      67             :     virtual            ~Button();
      68             : 
      69             :     virtual void        Click();
      70             : 
      71        5397 :     void                SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
      72           0 :     const Link&         GetClickHdl() const { return maClickHdl; }
      73             : 
      74             :     static OUString     GetStandardText( StandardButtonType eButton );
      75             :     static XubString    GetStandardHelpText( StandardButtonType eButton );
      76             : 
      77             :     sal_Bool            SetModeImage( const Image& rImage );
      78             :     const Image         GetModeImage( ) const;
      79             :     sal_Bool            HasImage() const;
      80             :     void                SetImageAlign( ImageAlign eAlign );
      81             :     ImageAlign          GetImageAlign() const;
      82             : 
      83             :     void                EnableImageDisplay( sal_Bool bEnable );
      84             :     void                EnableTextDisplay( sal_Bool bEnable );
      85             : 
      86             :     void                SetFocusRect( const Rectangle& rFocusRect );
      87             :     bool IsSmallSymbol() const;
      88             :     void SetSmallSymbol(bool bSmall = true);
      89             : };
      90             : 
      91             : // --------------------
      92             : // - PushButton-Types -
      93             : // --------------------
      94             : 
      95             : #define PUSHBUTTON_DROPDOWN_TOOLBOX         ((sal_uInt16)0x0001)
      96             : #define PUSHBUTTON_DROPDOWN_MENUBUTTON      ((sal_uInt16)0x0002)
      97             : 
      98             : // --------------
      99             : // - PushButton -
     100             : // --------------
     101             : 
     102             : class VCL_DLLPUBLIC PushButton : public Button
     103             : {
     104             : protected:
     105             :     SymbolType      meSymbol;
     106             :     TriState        meState;
     107             :     TriState        meSaveValue;
     108             :     sal_uInt16          mnDDStyle;
     109             :     sal_Bool            mbPressed;
     110             :     sal_Bool            mbInUserDraw;
     111             :     Link            maToggleHdl;
     112             : 
     113             :     SAL_DLLPRIVATE void            ImplInitPushButtonData();
     114             :     SAL_DLLPRIVATE WinBits         ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     115             :     SAL_DLLPRIVATE void            ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
     116             :     SAL_DLLPRIVATE void            ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawFlags,
     117             :                                                const Rectangle& rRect, bool bLayout, bool bMenuBtnSep );
     118             :     SAL_DLLPRIVATE void            ImplDrawPushButton( bool bLayout = false );
     119             :     using Button::ImplGetTextStyle;
     120             :     SAL_DLLPRIVATE sal_uInt16          ImplGetTextStyle( sal_uLong nDrawFlags ) const;
     121       24719 :     SAL_DLLPRIVATE sal_Bool            IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
     122           6 :     SAL_DLLPRIVATE sal_Bool            IsImage() const { return Button::HasImage(); }
     123             : 
     124             :     // Copy assignment is forbidden and not implemented.
     125             :     SAL_DLLPRIVATE                 PushButton( const PushButton & );
     126             :     SAL_DLLPRIVATE                 PushButton& operator=( const PushButton & );
     127             : 
     128             :     SAL_DLLPRIVATE void            ImplInit( Window* pParent, WinBits nStyle );
     129             : 
     130             :     using Control::ImplInitSettings;
     131             :     using Window::ImplInit;
     132             : public:
     133             :     SAL_DLLPRIVATE void            ImplSetDefButton( sal_Bool bSet );
     134             :     SAL_DLLPRIVATE static void     ImplDrawPushButtonFrame( Window* pDev, Rectangle& rRect, sal_uInt16 nStyle );
     135             :     SAL_DLLPRIVATE static sal_Bool     ImplHitTestPushButton( Window* pDev, const Point& rPos );
     136             :     SAL_DLLPRIVATE sal_Bool            ImplIsDefButton() const;
     137             : 
     138             : protected:
     139             :     explicit        PushButton( WindowType nType );
     140             : 
     141             :     virtual void    FillLayoutData() const;
     142             :     virtual const Font&
     143             :                     GetCanonicalFont( const StyleSettings& _rStyle ) const;
     144             :     virtual const Color&
     145             :                     GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
     146             : public:
     147             :     explicit        PushButton( Window* pParent, WinBits nStyle = 0 );
     148             :     explicit        PushButton( Window* pParent, const ResId& );
     149             :     virtual         ~PushButton();
     150             : 
     151             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     152             :     virtual void    Tracking( const TrackingEvent& rTEvt );
     153             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     154             :     virtual void    KeyUp( const KeyEvent& rKEvt );
     155             :     virtual void    Paint( const Rectangle& rRect );
     156             :     virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
     157             :     virtual void    Resize();
     158             :     virtual void    GetFocus();
     159             :     virtual void    LoseFocus();
     160             :     virtual void    StateChanged( StateChangedType nType );
     161             :     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     162             :     virtual long    PreNotify( NotifyEvent& rNEvt );
     163             :     virtual void    UserDraw( const UserDrawEvent& rUDEvt );
     164             : 
     165             :     virtual void    Toggle();
     166             : 
     167             :     void            SetSymbol( SymbolType eSymbol );
     168        7173 :     SymbolType      GetSymbol() const { return meSymbol; }
     169             :     void            SetSymbolAlign( SymbolAlign eAlign );
     170             : 
     171             :     void            SetDropDown( sal_uInt16 nStyle );
     172             :     sal_uInt16          GetDropDown() const { return mnDDStyle; }
     173             : 
     174             :     void            SetState( TriState eState );
     175          15 :     TriState        GetState() const { return meState; }
     176             : 
     177             :     void            Check( sal_Bool bCheck = sal_True );
     178             :     sal_Bool            IsChecked() const;
     179             : 
     180             :     void            SetPressed( sal_Bool bPressed );
     181          15 :     sal_Bool            IsPressed() const { return mbPressed; }
     182             : 
     183             :     void            EndSelection();
     184             : 
     185           0 :     void            SaveValue() { meSaveValue = GetState(); }
     186           0 :     TriState        GetSavedValue() const { return meSaveValue; }
     187             : 
     188             :     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
     189             :     virtual Size    GetOptimalSize() const;
     190             : 
     191             :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     192             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     193             :     virtual bool set_property(const OString &rKey, const OString &rValue);
     194             : };
     195             : 
     196           0 : inline void PushButton::Check( sal_Bool bCheck )
     197             : {
     198           0 :     SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
     199           0 : }
     200             : 
     201           0 : inline sal_Bool PushButton::IsChecked() const
     202             : {
     203           0 :     return (GetState() == STATE_CHECK);
     204             : }
     205             : 
     206             : // ------------
     207             : // - OKButton -
     208             : // ------------
     209             : 
     210           0 : class VCL_DLLPUBLIC OKButton : public PushButton
     211             : {
     212             : protected:
     213             :     using PushButton::ImplInit;
     214             : private:
     215             :     SAL_DLLPRIVATE void            ImplInit( Window* pParent, WinBits nStyle );
     216             : 
     217             :     // Copy assignment is forbidden and not implemented.
     218             :     SAL_DLLPRIVATE                 OKButton (const OKButton &);
     219             :     SAL_DLLPRIVATE                 OKButton & operator= (const OKButton &);
     220             : 
     221             : public:
     222             :     explicit        OKButton( Window* pParent, WinBits nStyle = WB_DEFBUTTON );
     223             :     explicit        OKButton( Window* pParent, const ResId& );
     224             : 
     225             :     virtual void    Click();
     226             : };
     227             : 
     228             : // ----------------
     229             : // - CancelButton -
     230             : // ----------------
     231             : 
     232           0 : class VCL_DLLPUBLIC CancelButton : public PushButton
     233             : {
     234             : protected:
     235             :     using PushButton::ImplInit;
     236             : private:
     237             :     SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
     238             : 
     239             :     // Copy assignment is forbidden and not implemented.
     240             :     SAL_DLLPRIVATE      CancelButton (const CancelButton &);
     241             :     SAL_DLLPRIVATE      CancelButton & operator= (const CancelButton &);
     242             : 
     243             : public:
     244             :     explicit        CancelButton( Window* pParent, WinBits nStyle = 0 );
     245             :     explicit        CancelButton( Window* pParent, const ResId& );
     246             : 
     247             :     virtual void    Click();
     248             : };
     249             : 
     250           0 : class VCL_DLLPUBLIC CloseButton : public CancelButton
     251             : {
     252             : public:
     253             :     explicit CloseButton(Window* pParent, WinBits nStyle = 0);
     254             : };
     255             : 
     256             : 
     257             : // --------------
     258             : // - HelpButton -
     259             : // --------------
     260             : 
     261           0 : class VCL_DLLPUBLIC HelpButton : public PushButton
     262             : {
     263             : protected:
     264             :     using PushButton::ImplInit;
     265             : private:
     266             :     SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
     267             : 
     268             :     // Copy assignment is forbidden and not implemented.
     269             :     SAL_DLLPRIVATE      HelpButton( const HelpButton & );
     270             :     SAL_DLLPRIVATE      HelpButton & operator= ( const HelpButton & );
     271             : 
     272             : public:
     273             :     explicit        HelpButton( Window* pParent, WinBits nStyle = 0 );
     274             :     explicit        HelpButton( Window* pParent, const ResId& );
     275             : 
     276             :     virtual void    Click();
     277             : };
     278             : 
     279             : // ---------------
     280             : // - RadioButton -
     281             : // ---------------
     282             : 
     283             : class VCL_DLLPUBLIC RadioButton : public Button
     284             : {
     285             : private:
     286             :     boost::shared_ptr< std::vector<RadioButton*> > m_xGroup;
     287             :     Rectangle       maStateRect;
     288             :     Rectangle       maMouseRect;
     289             :     Image           maImage;
     290             :     sal_Bool        mbChecked;
     291             :     sal_Bool        mbSaveValue;
     292             :     sal_Bool        mbRadioCheck;
     293             :     sal_Bool        mbStateChanged;
     294             :     Link            maToggleHdl;
     295             :     // when mbLegacyNoTextAlign is set then the old behaviour where
     296             :     // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
     297             :     // occurs, otherwise the image ( radiobutton circle ) is placed
     298             :     // to the left or right ( depending on RTL or LTR settings )
     299             :     bool            mbLegacyNoTextAlign;
     300             :     SAL_DLLPRIVATE void     ImplInitRadioButtonData();
     301             :     SAL_DLLPRIVATE WinBits  ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     302             :     SAL_DLLPRIVATE void     ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
     303             :     SAL_DLLPRIVATE void     ImplDrawRadioButtonState();
     304             :     SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     305             :                               const Point& rPos, const Size& rSize,
     306             :                               const Size& rImageSize, Rectangle& rStateRect,
     307             :                               Rectangle& rMouseRect, bool bLayout = false );
     308             :     SAL_DLLPRIVATE void     ImplDrawRadioButton( bool bLayout = false );
     309             :     SAL_DLLPRIVATE void     ImplInvalidateOrDrawRadioButtonState();
     310             :     SAL_DLLPRIVATE void     ImplUncheckAllOther();
     311             :     SAL_DLLPRIVATE Size     ImplGetRadioImageSize() const;
     312             :     SAL_DLLPRIVATE long     ImplGetImageToTextDistance() const;
     313             : 
     314             :     // Copy assignment is forbidden and not implemented.
     315             :     SAL_DLLPRIVATE          RadioButton(const RadioButton &);
     316             :     SAL_DLLPRIVATE          RadioButton& operator= (const RadioButton &);
     317             : 
     318             : protected:
     319             :     using Control::ImplInitSettings;
     320             :     using Window::ImplInit;
     321             :     SAL_DLLPRIVATE void     ImplInit( Window* pParent, WinBits nStyle );
     322             :     SAL_DLLPRIVATE void     ImplLoadRes( const ResId& rResId );
     323             : 
     324             : public:
     325             :     SAL_DLLPRIVATE void     ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
     326             :     SAL_DLLPRIVATE void     ImplSetMinimumNWFSize();
     327             : 
     328             : protected:
     329             :     virtual void FillLayoutData() const;
     330             :     virtual const Font&
     331             :                     GetCanonicalFont( const StyleSettings& _rStyle ) const;
     332             :     virtual const Color&
     333             :                     GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
     334             : 
     335           0 :     inline void             SetMouseRect( const Rectangle& _rMouseRect )    { maMouseRect = _rMouseRect; }
     336             :     inline const Rectangle& GetMouseRect( ) const                           { return maMouseRect; }
     337           0 :     inline void             SetStateRect( const Rectangle& _rStateRect )    { maStateRect = _rStateRect; }
     338             :     inline const Rectangle& GetStateRect( ) const                           { return maStateRect; }
     339             : 
     340             :     // draws the radio button (the knob image), in it's current state (pressed/checked)
     341             :     // at the usual location, which can be overridden with SetStateRect
     342             :     void            DrawRadioButtonState( );
     343             : 
     344             : public:
     345             :     explicit        RadioButton( Window* pParent, WinBits nWinStyle = 0 );
     346             :     explicit        RadioButton( Window* pParent, const ResId& );
     347             :     virtual         ~RadioButton();
     348             : 
     349             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     350             :     virtual void    Tracking( const TrackingEvent& rTEvt );
     351             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     352             :     virtual void    KeyUp( const KeyEvent& rKEvt );
     353             :     virtual void    Paint( const Rectangle& rRect );
     354             :     virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
     355             :     virtual void    Resize();
     356             :     virtual void    GetFocus();
     357             :     virtual void    LoseFocus();
     358             :     virtual void    StateChanged( StateChangedType nType );
     359             :     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     360             :     virtual long    PreNotify( NotifyEvent& rNEvt );
     361             : 
     362             :     virtual void    Toggle();
     363             : 
     364           0 :     sal_Bool            IsStateChanged() const { return mbStateChanged; }
     365             : 
     366          40 :     void            EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
     367          39 :     sal_Bool            IsRadioCheckEnabled() const { return mbRadioCheck; }
     368             : 
     369             :     sal_Bool        SetModeRadioImage( const Image& rImage );
     370             :     const Image&    GetModeRadioImage( ) const;
     371             : 
     372             :     void            SetState( sal_Bool bCheck );
     373             :     void            Check( sal_Bool bCheck = sal_True );
     374          36 :     sal_Bool            IsChecked() const { return mbChecked; }
     375             : 
     376           0 :     void            SaveValue() { mbSaveValue = IsChecked(); }
     377           0 :     sal_Bool            GetSavedValue() const { return mbSaveValue; }
     378             : 
     379             :     static Image    GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
     380             : 
     381             :     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
     382             :     virtual Size    GetOptimalSize() const;
     383             : 
     384           0 :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     385             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     386             : 
     387             :     /** GetRadioButtonGroup returns a list of pointers to <code>RadioButton</code>s in the same group.
     388             : 
     389             :     The pointers in the returned list are valid at the time call returns. However rescheduling
     390             :     or giving up the SolarMutex may mean events get executed that lead to the pointers getting
     391             :     invalid.
     392             : 
     393             :     @param bIncludeThis
     394             :     defines whether <code>this</code> is contained in the returned list
     395             : 
     396             :     @return
     397             :     on return contains the <code>RadioButton</code>s
     398             :     in the same group as this <code>RadioButton</code>.
     399             :     */
     400             :     std::vector<RadioButton*> GetRadioButtonGroup(bool bIncludeThis = true) const;
     401             : 
     402             :     virtual bool set_property(const OString &rKey, const OString &rValue);
     403             : 
     404             :     /*
     405             :      * Group this RadioButton with another
     406             :      */
     407             :     void group(RadioButton &rOther);
     408             : };
     409             : 
     410             : // ------------
     411             : // - CheckBox -
     412             : // ------------
     413             : 
     414         155 : class VCL_DLLPUBLIC CheckBox : public Button
     415             : {
     416             : private:
     417             :     Rectangle       maStateRect;
     418             :     Rectangle       maMouseRect;
     419             :     TriState        meState;
     420             :     TriState        meSaveValue;
     421             :     sal_Bool            mbTriState;
     422             :     Link            maToggleHdl;
     423             :     // when mbLegacyNoTextAlign is set then the old behaviour where
     424             :     // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
     425             :     // occurs, otherwise the image ( checkbox box ) is placed
     426             :     // to the left or right ( depending on RTL or LTR settings )
     427             :     bool            mbLegacyNoTextAlign;
     428             :     SAL_DLLPRIVATE void         ImplInitCheckBoxData();
     429             :     SAL_DLLPRIVATE WinBits      ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     430             :     SAL_DLLPRIVATE void         ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
     431             :     SAL_DLLPRIVATE void         ImplInvalidateOrDrawCheckBoxState();
     432             :     SAL_DLLPRIVATE void         ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     433             :                                     const Point& rPos, const Size& rSize,
     434             :                                     const Size& rImageSize, Rectangle& rStateRect,
     435             :                                     Rectangle& rMouseRect, bool bLayout );
     436             :     SAL_DLLPRIVATE void         ImplDrawCheckBox( bool bLayout = false );
     437             :     SAL_DLLPRIVATE long         ImplGetImageToTextDistance() const;
     438             :     SAL_DLLPRIVATE Size         ImplGetCheckImageSize() const;
     439             : 
     440             :     // Copy assignment is forbidden and not implemented.
     441             :     SAL_DLLPRIVATE              CheckBox(const CheckBox &);
     442             :     SAL_DLLPRIVATE              CheckBox& operator= (const CheckBox &);
     443             : 
     444             : protected:
     445             :     using Control::ImplInitSettings;
     446             :     using Window::ImplInit;
     447             :     SAL_DLLPRIVATE void         ImplInit( Window* pParent, WinBits nStyle );
     448             :     SAL_DLLPRIVATE void         ImplLoadRes( const ResId& rResId );
     449             :     virtual void FillLayoutData() const;
     450             :     virtual const Font&         GetCanonicalFont( const StyleSettings& _rStyle ) const;
     451             :     virtual const Color&        GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
     452             : 
     453             :     virtual void ImplDrawCheckBoxState();
     454           0 :     SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; }
     455           0 :     SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
     456             : 
     457             : public:
     458             :     SAL_DLLPRIVATE void         ImplCheck();
     459             :     SAL_DLLPRIVATE void         ImplSetMinimumNWFSize();
     460             : public:
     461             :     explicit        CheckBox( Window* pParent, WinBits nStyle = 0 );
     462             :     explicit        CheckBox( Window* pParent, const ResId& );
     463             : 
     464             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     465             :     virtual void    Tracking( const TrackingEvent& rTEvt );
     466             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     467             :     virtual void    KeyUp( const KeyEvent& rKEvt );
     468             :     virtual void    Paint( const Rectangle& rRect );
     469             :     virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
     470             :     virtual void    Resize();
     471             :     virtual void    GetFocus();
     472             :     virtual void    LoseFocus();
     473             :     virtual void    StateChanged( StateChangedType nType );
     474             :     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     475             :     virtual long    PreNotify( NotifyEvent& rNEvt );
     476             : 
     477             :     virtual void    Toggle();
     478             : 
     479             :     void            SetState( TriState eState );
     480           0 :     TriState        GetState() const { return meState; }
     481             : 
     482             :     void            Check( sal_Bool bCheck = sal_True );
     483             :     sal_Bool            IsChecked() const;
     484             : 
     485             :     void            EnableTriState( sal_Bool bTriState = sal_True );
     486           0 :     sal_Bool            IsTriStateEnabled() const { return mbTriState; }
     487             : 
     488           0 :     void            SaveValue() { meSaveValue = GetState(); }
     489           0 :     TriState        GetSavedValue() const { return meSaveValue; }
     490             : 
     491             :     static Image    GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
     492             : 
     493             :     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
     494             :     virtual Size    GetOptimalSize() const;
     495             : 
     496           0 :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     497             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     498             :     bool            IsLegacyNoTextAlign() { return mbLegacyNoTextAlign; }
     499          21 :     void            SetLegacyNoTextAlign( bool bVal ) { mbLegacyNoTextAlign = bVal; }
     500             : 
     501             :     virtual bool set_property(const OString &rKey, const OString &rValue);
     502             : };
     503             : 
     504          48 : inline void CheckBox::Check( sal_Bool bCheck )
     505             : {
     506          48 :     SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
     507          48 : }
     508             : 
     509           0 : inline sal_Bool CheckBox::IsChecked() const
     510             : {
     511           0 :     return (GetState() == STATE_CHECK);
     512             : }
     513             : 
     514             : // ---------------------------------
     515             : // - Control-Layer fuer alten Code -
     516             : // ---------------------------------
     517             : 
     518             : class VCL_DLLPUBLIC ImageButton : public PushButton
     519             : {
     520             : protected:
     521             :     using PushButton::ImplInitStyle;
     522             : private:
     523             :     SAL_DLLPRIVATE void     ImplInitStyle();
     524             : 
     525             :     // Copy assignment is forbidden and not implemented.
     526             :     SAL_DLLPRIVATE          ImageButton( const ImageButton & );
     527             :     SAL_DLLPRIVATE          ImageButton & operator= ( const ImageButton & );
     528             : 
     529             : public:
     530             :                     ImageButton( Window* pParent, WinBits nStyle = 0 );
     531             :                     ImageButton( Window* pParent, const ResId& rResId );
     532             :                     ~ImageButton();
     533             : };
     534             : 
     535             : class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
     536             : {
     537             :     // Copy assignment is forbidden and not implemented.
     538             :     SAL_DLLPRIVATE  ImageRadioButton( const ImageRadioButton & );
     539             :     SAL_DLLPRIVATE  ImageRadioButton & operator= ( const ImageRadioButton & );
     540             : 
     541             : public:
     542             :     explicit        ImageRadioButton( Window* pParent, WinBits nStyle = 0 );
     543             :     explicit        ImageRadioButton( Window* pParent, const ResId& );
     544             :     virtual         ~ImageRadioButton();
     545             : };
     546             : 
     547             : class VCL_DLLPUBLIC TriStateBox : public CheckBox
     548             : {
     549             :     // Copy assignment is forbidden and not implemented.
     550             :     SAL_DLLPRIVATE  TriStateBox( const TriStateBox & );
     551             :     SAL_DLLPRIVATE  TriStateBox & operator= ( const TriStateBox & );
     552             : 
     553             : public:
     554             :     explicit        TriStateBox( Window* pParent, WinBits nStyle = 0 );
     555             :     explicit        TriStateBox( Window* pParent, const ResId& );
     556             :     virtual         ~TriStateBox();
     557             : };
     558             : 
     559           0 : class VCL_DLLPUBLIC DisclosureButton : public CheckBox
     560             : {
     561             : protected:
     562             :     SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
     563             : public:
     564             :     explicit DisclosureButton( Window* pParent, WinBits nStyle = 0 );
     565             : 
     566             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     567             : };
     568             : 
     569             : #endif  // _SV_BUTTON_HXX
     570             : 
     571             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10