1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SVX_COMMON_LINGUI_HXX 29*cdf0e10cSrcweir #define SVX_COMMON_LINGUI_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <vcl/ctrl.hxx> 32*cdf0e10cSrcweir #include <svtools/stdctrl.hxx> 33*cdf0e10cSrcweir #include <vcl/edit.hxx> 34*cdf0e10cSrcweir #include <svtools/svxbox.hxx> 35*cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX 36*cdf0e10cSrcweir #include <vcl/button.hxx> 37*cdf0e10cSrcweir #endif 38*cdf0e10cSrcweir #include <vcl/group.hxx> 39*cdf0e10cSrcweir #include <vcl/dialog.hxx> 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir //============================================================================= 42*cdf0e10cSrcweir // SvxClickInfoCtr 43*cdf0e10cSrcweir //============================================================================= 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir class SvxClickInfoCtr: public Control 46*cdf0e10cSrcweir { 47*cdf0e10cSrcweir private: 48*cdf0e10cSrcweir FixedInfo aFixedInfo; 49*cdf0e10cSrcweir Link aActivateLink; 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir public: 52*cdf0e10cSrcweir SvxClickInfoCtr( Window* pParent, const ResId& rResId ); 53*cdf0e10cSrcweir ~SvxClickInfoCtr(); 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir virtual void SetText( const XubString& rStr ); 56*cdf0e10cSrcweir virtual XubString GetText() const; 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir void SetActivateHdl( const Link& rLink ) { aActivateLink = rLink; } 59*cdf0e10cSrcweir const Link& GetActivateHdl() const { return aActivateLink; } 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir protected: 62*cdf0e10cSrcweir virtual void MouseButtonDown( const MouseEvent& rMEvt ); 63*cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt ); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir }; 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir //============================================================================= 68*cdf0e10cSrcweir // SvxCommonLinguisticControl 69*cdf0e10cSrcweir //============================================================================= 70*cdf0e10cSrcweir class SvxCommonLinguisticControl : public Window 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir public: 73*cdf0e10cSrcweir enum ButtonType 74*cdf0e10cSrcweir { 75*cdf0e10cSrcweir eClose, 76*cdf0e10cSrcweir eIgnore, 77*cdf0e10cSrcweir eIgnoreAll, 78*cdf0e10cSrcweir eChange, 79*cdf0e10cSrcweir eChangeAll, 80*cdf0e10cSrcweir eOptions 81*cdf0e10cSrcweir }; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir protected: 84*cdf0e10cSrcweir FixedText aWordText; 85*cdf0e10cSrcweir SvxClickInfoCtr aAktWord; 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir FixedText aNewWord; 88*cdf0e10cSrcweir Edit aNewWordED; 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir FixedText aSuggestionFT; 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir PushButton aIgnoreBtn; 93*cdf0e10cSrcweir PushButton aIgnoreAllBtn; 94*cdf0e10cSrcweir PushButton aChangeBtn; 95*cdf0e10cSrcweir PushButton aChangeAllBtn; 96*cdf0e10cSrcweir PushButton aOptionsBtn; 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir FixedInfo aStatusText; 99*cdf0e10cSrcweir HelpButton aHelpBtn; 100*cdf0e10cSrcweir CancelButton aCancelBtn; 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir GroupBox aAuditBox; 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir protected: 105*cdf0e10cSrcweir virtual void Paint( const Rectangle& rRect ); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir private: 108*cdf0e10cSrcweir PushButton* implGetButton( ButtonType _eType ) const; 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir public: 111*cdf0e10cSrcweir SvxCommonLinguisticControl( ModalDialog* _pParent ); 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir // handlers 114*cdf0e10cSrcweir inline void SetResetWordHdl( const Link& _rLink ) { aAktWord.SetActivateHdl( _rLink ); } 115*cdf0e10cSrcweir inline const Link& GetResetWordHdl() const { return aAktWord.GetActivateHdl(); } 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir void SetButtonHandler( ButtonType _eType, const Link& _rHandler ); 118*cdf0e10cSrcweir void EnableButton( ButtonType _eType, sal_Bool _bEnable ); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir inline PushButton* GetButton( ButtonType _eType ) { return implGetButton( _eType ); } 121*cdf0e10cSrcweir inline const PushButton* GetButton( ButtonType _eType ) const { return implGetButton( _eType ); } 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir // users of this class may want to insert own controls in some places, where the ordinary 124*cdf0e10cSrcweir // Z-Order determined by construction time is not sufficient 125*cdf0e10cSrcweir // Use the following methods for this 126*cdf0e10cSrcweir enum ControlGroup // control groups in this window which cannot be devided (e.g. are adjacent in the Z order) 127*cdf0e10cSrcweir { 128*cdf0e10cSrcweir eLeftRightWords, // the controls for the two words (original and suggestion), including the labels 129*cdf0e10cSrcweir eSuggestionLabel, // the label for the suggestion 130*cdf0e10cSrcweir eActionButtons, // the group of "ignore(all)" / "change(all)" buttons 131*cdf0e10cSrcweir eDialogButtons // the group of dialog control buttons (help and close) 132*cdf0e10cSrcweir }; 133*cdf0e10cSrcweir void InsertControlGroup( Window& _rFirstGroupWindow, Window& _rLastGroupWindow, ControlGroup _eInsertAfter ); 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir /** enlarges the window 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir Some controls "stick" to the borders: The group of change/ignore buttons, for instance, sticks 138*cdf0e10cSrcweir to the right, the dictionary list as well as the close/help buttons stick to the bottom of the 139*cdf0e10cSrcweir window. 140*cdf0e10cSrcweir */ 141*cdf0e10cSrcweir void Enlarge( sal_Int32 _nX, sal_Int32 _nY ); 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir // control access methods 144*cdf0e10cSrcweir inline void SetCurrentText( const String& _rText ) { aAktWord.SetText( _rText ); } 145*cdf0e10cSrcweir inline String GetCurrentText( ) const { return aAktWord.GetText(); } 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir inline void SetStatusText( const String& _rText ) { aStatusText.SetText( _rText ); } 148*cdf0e10cSrcweir inline String GetStatusText( ) const { return aStatusText.GetText(); } 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir inline Edit& GetWordInputControl() { return aNewWordED; } 151*cdf0e10cSrcweir inline const Edit& GetWordInputControl() const { return aNewWordED; } 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir // returns the location (upper-left corner) of the group of action buttons 154*cdf0e10cSrcweir inline Point GetActionButtonsLocation( ) const { return aIgnoreBtn.GetPosPixel(); } 155*cdf0e10cSrcweir }; 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir #endif // SVX_COMMON_LINGUI_HXX 160