LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/vcl - button.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 41 7.3 %
Date: 2012-12-27 Functions: 3 40 7.5 %
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/symbol.hxx>
      27             : #include <vcl/ctrl.hxx>
      28             : #include <vcl/bitmap.hxx>
      29             : #include <vcl/salnativewidgets.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( XubString& 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             :                         Button( WindowType nType );
      65             : 
      66             : public:
      67             :                        ~Button();
      68             : 
      69             :     virtual void        Click();
      70             : 
      71         944 :     void                SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
      72           0 :     const Link&         GetClickHdl() const { return maClickHdl; }
      73             : 
      74             :     static XubString    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        3795 :     SAL_DLLPRIVATE sal_Bool            IsSymbol() const { return ( (meSymbol != SYMBOL_NOSYMBOL) && (meSymbol != SYMBOL_IMAGE) ); }
     122           0 :     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             :                     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             :                     PushButton( Window* pParent, WinBits nStyle = 0 );
     148             :                     PushButton( Window* pParent, const ResId& rResId );
     149             :                     ~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         845 :     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           0 :     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           0 :     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(WindowSizeType eType) const;
     190             : 
     191             :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     192             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     193             :     virtual bool set_property(const rtl::OString &rKey, const rtl::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             :                     OKButton( Window* pParent, WinBits nStyle = WB_DEFBUTTON );
     223             :                     OKButton( Window* pParent, const ResId& rResId );
     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             :                     CancelButton( Window* pParent, WinBits nStyle = 0 );
     245             :                     CancelButton( Window* pParent, const ResId& rResId );
     246             : 
     247             :     virtual void    Click();
     248             : };
     249             : 
     250             : // --------------
     251             : // - HelpButton -
     252             : // --------------
     253             : 
     254           0 : class VCL_DLLPUBLIC HelpButton : public PushButton
     255             : {
     256             : protected:
     257             :     using PushButton::ImplInit;
     258             : private:
     259             :     SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
     260             : 
     261             :     // Copy assignment is forbidden and not implemented.
     262             :     SAL_DLLPRIVATE      HelpButton( const HelpButton & );
     263             :     SAL_DLLPRIVATE      HelpButton & operator= ( const HelpButton & );
     264             : 
     265             : public:
     266             :                     HelpButton( Window* pParent, WinBits nStyle = 0 );
     267             :                     HelpButton( Window* pParent, const ResId& rResId );
     268             : 
     269             :     virtual void    Click();
     270             : };
     271             : 
     272             : // ---------------
     273             : // - RadioButton -
     274             : // ---------------
     275             : 
     276             : class VCL_DLLPUBLIC RadioButton : public Button
     277             : {
     278             : private:
     279             :     boost::shared_ptr< std::vector<RadioButton*> > m_xGroup;
     280             :     Rectangle       maStateRect;
     281             :     Rectangle       maMouseRect;
     282             :     Image           maImage;
     283             :     sal_Bool        mbChecked;
     284             :     sal_Bool        mbSaveValue;
     285             :     sal_Bool        mbRadioCheck;
     286             :     sal_Bool        mbStateChanged;
     287             :     Link            maToggleHdl;
     288             :     // when mbLegacyNoTextAlign is set then the old behaviour where
     289             :     // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
     290             :     // occurs, otherwise the image ( radiobutton circle ) is placed
     291             :     // to the left or right ( depending on RTL or LTR settings )
     292             :     bool            mbLegacyNoTextAlign;
     293             :     SAL_DLLPRIVATE void     ImplInitRadioButtonData();
     294             :     SAL_DLLPRIVATE WinBits  ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     295             :     SAL_DLLPRIVATE void     ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
     296             :     SAL_DLLPRIVATE void     ImplDrawRadioButtonState();
     297             :     SAL_DLLPRIVATE void     ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     298             :                               const Point& rPos, const Size& rSize,
     299             :                               const Size& rImageSize, Rectangle& rStateRect,
     300             :                               Rectangle& rMouseRect, bool bLayout = false );
     301             :     SAL_DLLPRIVATE void     ImplDrawRadioButton( bool bLayout = false );
     302             :     SAL_DLLPRIVATE void     ImplInvalidateOrDrawRadioButtonState();
     303             :     SAL_DLLPRIVATE void     ImplUncheckAllOther();
     304             :     SAL_DLLPRIVATE Size     ImplGetRadioImageSize() const;
     305             :     SAL_DLLPRIVATE long     ImplGetImageToTextDistance() const;
     306             : 
     307             :     // Copy assignment is forbidden and not implemented.
     308             :     SAL_DLLPRIVATE          RadioButton(const RadioButton &);
     309             :     SAL_DLLPRIVATE          RadioButton& operator= (const RadioButton &);
     310             : 
     311             : protected:
     312             :     using Control::ImplInitSettings;
     313             :     using Window::ImplInit;
     314             :     SAL_DLLPRIVATE void     ImplInit( Window* pParent, WinBits nStyle );
     315             :     SAL_DLLPRIVATE void     ImplLoadRes( const ResId& rResId );
     316             : 
     317             : public:
     318             :     SAL_DLLPRIVATE void     ImplCallClick( sal_Bool bGrabFocus = sal_False, sal_uInt16 nFocusFlags = 0 );
     319             :     SAL_DLLPRIVATE void     ImplSetMinimumNWFSize();
     320             : 
     321             : protected:
     322             :     virtual void FillLayoutData() const;
     323             :     virtual const Font&
     324             :                     GetCanonicalFont( const StyleSettings& _rStyle ) const;
     325             :     virtual const Color&
     326             :                     GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
     327             : 
     328           0 :     inline void             SetMouseRect( const Rectangle& _rMouseRect )    { maMouseRect = _rMouseRect; }
     329             :     inline const Rectangle& GetMouseRect( ) const                           { return maMouseRect; }
     330           0 :     inline void             SetStateRect( const Rectangle& _rStateRect )    { maStateRect = _rStateRect; }
     331             :     inline const Rectangle& GetStateRect( ) const                           { return maStateRect; }
     332             : 
     333             :     // draws the radio button (the knob image), in it's current state (pressed/checked)
     334             :     // at the usual location, which can be overridden with SetStateRect
     335             :     void            DrawRadioButtonState( );
     336             : 
     337             : public:
     338             :                     RadioButton( Window* pParent, WinBits nWinStyle = 0 );
     339             :                     RadioButton( Window* pParent, const ResId& rResId );
     340             :                     ~RadioButton();
     341             : 
     342             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     343             :     virtual void    Tracking( const TrackingEvent& rTEvt );
     344             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     345             :     virtual void    KeyUp( const KeyEvent& rKEvt );
     346             :     virtual void    Paint( const Rectangle& rRect );
     347             :     virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
     348             :     virtual void    Resize();
     349             :     virtual void    GetFocus();
     350             :     virtual void    LoseFocus();
     351             :     virtual void    StateChanged( StateChangedType nType );
     352             :     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     353             :     virtual long    PreNotify( NotifyEvent& rNEvt );
     354             : 
     355             :     virtual void    Toggle();
     356             : 
     357           0 :     sal_Bool            IsStateChanged() const { return mbStateChanged; }
     358             : 
     359           0 :     void            EnableRadioCheck( sal_Bool bRadioCheck = sal_True ) { mbRadioCheck = bRadioCheck; }
     360           0 :     sal_Bool            IsRadioCheckEnabled() const { return mbRadioCheck; }
     361             : 
     362             :     sal_Bool        SetModeRadioImage( const Image& rImage );
     363             :     const Image&    GetModeRadioImage( ) const;
     364             : 
     365             :     void            SetState( sal_Bool bCheck );
     366             :     void            Check( sal_Bool bCheck = sal_True );
     367           0 :     sal_Bool            IsChecked() const { return mbChecked; }
     368             : 
     369           0 :     void            SaveValue() { mbSaveValue = IsChecked(); }
     370           0 :     sal_Bool            GetSavedValue() const { return mbSaveValue; }
     371             : 
     372             :     static Image    GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags );
     373             : 
     374             :     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
     375             :     virtual Size    GetOptimalSize(WindowSizeType eType) const;
     376             : 
     377           0 :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     378             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     379             : 
     380             :     /** GetRadioButtonGroup returns a list of pointers to <code>RadioButton</code>s in the same group.
     381             : 
     382             :     The pointers in the returned list are valid at the time call returns. However rescheduling
     383             :     or giving up the SolarMutex may mean events get executed that lead to the pointers getting
     384             :     invalid.
     385             : 
     386             :     @param bIncludeThis
     387             :     defines whether <code>this</code> is contained in the returned list
     388             : 
     389             :     @return
     390             :     on return contains the <code>RadioButton</code>s
     391             :     in the same group as this <code>RadioButton</code>.
     392             :     */
     393             :     std::vector<RadioButton*> GetRadioButtonGroup(bool bIncludeThis = true) const;
     394             : 
     395             :     virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
     396             : 
     397             :     /*
     398             :      * Group this RadioButton with another
     399             :      */
     400             :     void group(RadioButton &rOther);
     401             : };
     402             : 
     403             : // ------------
     404             : // - CheckBox -
     405             : // ------------
     406             : 
     407           0 : class VCL_DLLPUBLIC CheckBox : public Button
     408             : {
     409             : private:
     410             :     Rectangle       maStateRect;
     411             :     Rectangle       maMouseRect;
     412             :     TriState        meState;
     413             :     TriState        meSaveValue;
     414             :     sal_Bool            mbTriState;
     415             :     Link            maToggleHdl;
     416             :     // when mbLegacyNoTextAlign is set then the old behaviour where
     417             :     // the WB_LEFT, WB_RIGHT & WB_CENTER affect the image placement
     418             :     // occurs, otherwise the image ( checkbox box ) is placed
     419             :     // to the left or right ( depending on RTL or LTR settings )
     420             :     bool            mbLegacyNoTextAlign;
     421             :     SAL_DLLPRIVATE void         ImplInitCheckBoxData();
     422             :     SAL_DLLPRIVATE WinBits      ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
     423             :     SAL_DLLPRIVATE void         ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
     424             :     SAL_DLLPRIVATE void         ImplInvalidateOrDrawCheckBoxState();
     425             :     SAL_DLLPRIVATE void         ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
     426             :                                     const Point& rPos, const Size& rSize,
     427             :                                     const Size& rImageSize, Rectangle& rStateRect,
     428             :                                     Rectangle& rMouseRect, bool bLayout );
     429             :     SAL_DLLPRIVATE void         ImplDrawCheckBox( bool bLayout = false );
     430             :     SAL_DLLPRIVATE long         ImplGetImageToTextDistance() const;
     431             :     SAL_DLLPRIVATE Size         ImplGetCheckImageSize() const;
     432             : 
     433             :     // Copy assignment is forbidden and not implemented.
     434             :     SAL_DLLPRIVATE              CheckBox(const CheckBox &);
     435             :     SAL_DLLPRIVATE              CheckBox& operator= (const CheckBox &);
     436             : 
     437             : protected:
     438             :     using Control::ImplInitSettings;
     439             :     using Window::ImplInit;
     440             :     SAL_DLLPRIVATE void         ImplInit( Window* pParent, WinBits nStyle );
     441             :     SAL_DLLPRIVATE void         ImplLoadRes( const ResId& rResId );
     442             :     SAL_DLLPRIVATE virtual void FillLayoutData() const;
     443             :     SAL_DLLPRIVATE virtual const Font&
     444             :                                 GetCanonicalFont( const StyleSettings& _rStyle ) const;
     445             :     SAL_DLLPRIVATE virtual const Color&
     446             :                                 GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
     447             : 
     448             :     SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
     449           0 :     SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; }
     450           0 :     SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
     451             : 
     452             : public:
     453             :     SAL_DLLPRIVATE void         ImplCheck();
     454             :     SAL_DLLPRIVATE void         ImplSetMinimumNWFSize();
     455             : public:
     456             :                     CheckBox( Window* pParent, WinBits nStyle = 0 );
     457             :                     CheckBox( Window* pParent, const ResId& rResId );
     458             : 
     459             :     virtual void    MouseButtonDown( const MouseEvent& rMEvt );
     460             :     virtual void    Tracking( const TrackingEvent& rTEvt );
     461             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     462             :     virtual void    KeyUp( const KeyEvent& rKEvt );
     463             :     virtual void    Paint( const Rectangle& rRect );
     464             :     virtual void    Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
     465             :     virtual void    Resize();
     466             :     virtual void    GetFocus();
     467             :     virtual void    LoseFocus();
     468             :     virtual void    StateChanged( StateChangedType nType );
     469             :     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
     470             :     virtual long    PreNotify( NotifyEvent& rNEvt );
     471             : 
     472             :     virtual void    Toggle();
     473             : 
     474             :     void            SetState( TriState eState );
     475           0 :     TriState        GetState() const { return meState; }
     476             : 
     477             :     void            Check( sal_Bool bCheck = sal_True );
     478             :     sal_Bool            IsChecked() const;
     479             : 
     480             :     void            EnableTriState( sal_Bool bTriState = sal_True );
     481           0 :     sal_Bool            IsTriStateEnabled() const { return mbTriState; }
     482             : 
     483           0 :     void            SaveValue() { meSaveValue = GetState(); }
     484           0 :     TriState        GetSavedValue() const { return meSaveValue; }
     485             : 
     486             :     static Image    GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags );
     487             : 
     488             :     Size            CalcMinimumSize( long nMaxWidth = 0 ) const;
     489             :     virtual Size    GetOptimalSize(WindowSizeType eType) const;
     490             : 
     491           0 :     void            SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
     492             :     const Link&     GetToggleHdl() const { return maToggleHdl; }
     493             :     bool            IsLegacyNoTextAlign() { return mbLegacyNoTextAlign; }
     494           0 :     void            SetLegacyNoTextAlign( bool bVal ) { mbLegacyNoTextAlign = bVal; }
     495             : 
     496             :     virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
     497             : };
     498             : 
     499           0 : inline void CheckBox::Check( sal_Bool bCheck )
     500             : {
     501           0 :     SetState( (bCheck) ? STATE_CHECK : STATE_NOCHECK );
     502           0 : }
     503             : 
     504           0 : inline sal_Bool CheckBox::IsChecked() const
     505             : {
     506           0 :     return (GetState() == STATE_CHECK);
     507             : }
     508             : 
     509             : // ---------------------------------
     510             : // - Control-Layer fuer alten Code -
     511             : // ---------------------------------
     512             : 
     513             : class VCL_DLLPUBLIC ImageButton : public PushButton
     514             : {
     515             : protected:
     516             :     using PushButton::ImplInitStyle;
     517             : private:
     518             :     SAL_DLLPRIVATE void     ImplInitStyle();
     519             : 
     520             :     // Copy assignment is forbidden and not implemented.
     521             :     SAL_DLLPRIVATE          ImageButton( const ImageButton & );
     522             :     SAL_DLLPRIVATE          ImageButton & operator= ( const ImageButton & );
     523             : 
     524             : public:
     525             :                     ImageButton( Window* pParent, WinBits nStyle = 0 );
     526             :                     ImageButton( Window* pParent, const ResId& rResId );
     527             :                     ~ImageButton();
     528             : };
     529             : 
     530             : class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
     531             : {
     532             :     // Copy assignment is forbidden and not implemented.
     533             :     SAL_DLLPRIVATE  ImageRadioButton( const ImageRadioButton & );
     534             :     SAL_DLLPRIVATE  ImageRadioButton & operator= ( const ImageRadioButton & );
     535             : 
     536             : public:
     537             :                     ImageRadioButton( Window* pParent, WinBits nStyle = 0 );
     538             :                     ImageRadioButton( Window* pParent, const ResId& rResId );
     539             :                     ~ImageRadioButton();
     540             : };
     541             : 
     542             : class VCL_DLLPUBLIC TriStateBox : public CheckBox
     543             : {
     544             :     // Copy assignment is forbidden and not implemented.
     545             :     SAL_DLLPRIVATE  TriStateBox( const TriStateBox & );
     546             :     SAL_DLLPRIVATE  TriStateBox & operator= ( const TriStateBox & );
     547             : 
     548             : public:
     549             :             TriStateBox( Window* pParent, WinBits nStyle = 0 );
     550             :             TriStateBox( Window* pParent, const ResId& rResId );
     551             :             ~TriStateBox();
     552             : };
     553             : 
     554           0 : class VCL_DLLPUBLIC DisclosureButton : public CheckBox
     555             : {
     556             : protected:
     557             :     SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
     558             : public:
     559             :     DisclosureButton( Window* pParent, WinBits nStyle = 0 );
     560             :     DisclosureButton( Window* pParent, const ResId& rResId );
     561             : 
     562             :     virtual void    KeyInput( const KeyEvent& rKEvt );
     563             : };
     564             : 
     565             : #endif  // _SV_BUTTON_HXX
     566             : 
     567             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10