1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: inputwin.hxx,v $
10 * $Revision: 1.17.32.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_INPUTWIN_HXX
32 #define SC_INPUTWIN_HXX
35 #ifndef _TOOLBOX_HXX //autogen
36 #include <vcl/toolbox.hxx>
38 #include <sfx2/childwin.hxx>
39 #include <svtools/lstner.hxx>
40 #ifndef _COMBOBOX_HXX //autogen
41 #include <vcl/combobox.hxx>
43 #include <vcl/window.hxx>
44 #include <svtools/transfer.hxx>
46 class ScEditEngineDefaulter
;
50 class ScAccessibleEditLineTextData
;
54 //========================================================================
56 class ScTextWnd
: public Window
, public DragSourceHelper
// edit window
59 ScTextWnd( Window
* pParent
);
62 void SetTextString( const String
& rString
);
63 const String
& GetTextString() const;
66 EditView
* GetEditView();
68 // fuer FunktionsAutopiloten
69 void MakeDialogEditView();
71 void StartEditEngine();
72 void StopEditEngine( BOOL bAll
);
74 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
76 void SetFormulaMode( BOOL bSet
);
78 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
80 void SetAccessibleTextData(ScAccessibleEditLineTextData
* pTextData
) {pAccTextData
= pTextData
;}
82 DECL_LINK( NotifyHdl
, EENotify
* );
85 virtual void Paint( const Rectangle
& rRec
);
86 virtual void Resize();
88 virtual void MouseMove( const MouseEvent
& rMEvt
);
89 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
90 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
91 virtual void Command( const CommandEvent
& rCEvt
);
92 virtual void KeyInput(const KeyEvent
& rKEvt
);
93 virtual void GetFocus();
94 virtual void LoseFocus();
96 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
);
98 virtual String
GetText() const;
101 void ImplInitSettings();
102 void UpdateAutoCorrFlag();
107 ScEditEngineDefaulter
* pEditEngine
; // erst bei Bedarf angelegt
109 ScAccessibleEditLineTextData
* pAccTextData
;
114 // #102710#; this flag should be true if a key input or a command is handled
115 // it prevents the call of InputChanged in the ModifyHandler of the EditEngine
119 //========================================================================
121 class ScPosWnd
: public ComboBox
, public SfxListener
// Positionsanzeige
131 ScPosWnd( Window
* pParent
);
134 void SetPos( const String
& rPosStr
); // angezeigter Text
135 void SetFormulaMode( BOOL bSet
);
138 virtual void Select();
139 virtual void Modify();
141 virtual long Notify( NotifyEvent
& rNEvt
);
143 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
146 void FillRangeNames();
147 void FillFunctions();
151 void ReleaseFocus_Impl();
154 //========================================================================
156 class ScInputWindow
: public ToolBox
// Parent-Toolbox
159 ScInputWindow( Window
* pParent
, SfxBindings
* pBind
);
160 virtual ~ScInputWindow();
162 virtual void Resize();
163 virtual void Select();
165 void SetFuncString( const String
& rString
, BOOL bDoEdit
= TRUE
);
166 void SetPosString( const String
& rStr
);
167 void SetTextString( const String
& rString
);
169 void SetOkCancelMode();
170 void SetSumAssignMode();
171 void EnableButtons( BOOL bEnable
= TRUE
);
173 void SetFormulaMode( BOOL bSet
);
175 BOOL
IsInputActive();
176 EditView
* GetEditView();
177 //UNUSED2008-05 EditView* ActivateEdit( const String& rText,
178 //UNUSED2008-05 const ESelection& rSel );
180 void TextGrabFocus();
181 void TextInvalidate();
182 void SwitchToTextWin();
186 // Fuer FunktionsAutopiloten
187 void MakeDialogEditView();
189 void StopEditEngine( BOOL bAll
);
191 void SetInputHandler( ScInputHandler
* pNew
);
193 ScInputHandler
* GetInputHandler(){ return pInputHdl
;}
195 void StateChanged( StateChangedType nType
);
196 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
200 virtual void SetText( const String
& rString
);
201 virtual String
GetText() const;
203 sal_Bool
UseSubTotal( ScRangeList
* pRangeList
) const;
207 ScTextWnd aTextWindow
;
208 ScInputHandler
* pInputHdl
;
209 SfxBindings
* pBindings
;
214 BOOL bIsOkCancelMode
;
217 //==================================================================
219 class ScInputWindowWrapper
: public SfxChildWindow
222 ScInputWindowWrapper( Window
* pParent
,
224 SfxBindings
* pBindings
,
225 SfxChildWinInfo
* pInfo
);
227 SFX_DECL_CHILDWINDOW(ScInputWindowWrapper
);