1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
25 #define _SVTOOLS_EDITBROWSEBOX_HXX_
26 #define SVTOOLS_IN_EDITBROWSEBOX_HXX
27 
28 #include "svtools/svtdllapi.h"
29 #include <tools/ref.hxx>
30 #include <tools/rtti.hxx>
31 #include <vcl/window.hxx>
32 #include <vcl/combobox.hxx>
33 #include <vcl/lstbox.hxx>
34 
35 #ifndef _IMAGEBTN_HXX
36 #include <vcl/button.hxx>
37 #endif
38 #include <svtools/brwbox.hxx>
39 #include <vcl/timer.hxx>
40 #include <svtools/brwhead.hxx>
41 #include <svtools/svmedit.hxx>
42 #include <vcl/svapp.hxx>
43 
44 //==================================================================
45 // EditBrowseBoxFlags (EBBF)
46 
47 #define EBBF_NONE						((sal_Int32)0x0000)
48 /** if this bit is _not_ set, the handle column will be invalidated upon
49     changing the row in the browse box.  This is for forcing the row picture to
50     be repainted. If you do not have row pictures or text, you don't need this
51     invalidation, then you would specify this bit to prevent flicker
52 */
53 #define EBBF_NO_HANDLE_COLUMN_CONTENT	((sal_Int32)0x0001)
54 /** set this bit to activate the cell on a MouseButtonDown, not a MouseButtonUp event
55  */
56 #define EBBF_ACTIVATE_ON_BUTTONDOWN		((sal_Int32)0x0002)
57 /** if this bit is set and EBBF_NO_HANDLE_COLUMN_CONTENT is _not_ set, the handle
58     column is drawn with the text contained in column 0 instead of an image
59 */
60 #define EBBF_HANDLE_COLUMN_TEXT			((sal_Int32)0x0004)
61 
62 /** If this bit is set, tab traveling is somewhat modified<br/>
63 	If the control gets the focus because the user pressed the TAB key, then the
64 	first or last cell (depending on whether the traveling was cycling forward or backward)
65 	gets activated.
66 	@see Window::GetGetFocusFlags
67 	@see GETFOCUS_*
68 */
69 #define EBBF_SMART_TAB_TRAVEL			((sal_Int32)0x0008)
70 
71 /// @deprecated
72 #define EBBF_NOROWPICTURE				EBBF_NO_HANDLE_COLUMN_CONTENT
73 
74 //==================================================================
75 
76 class Edit;
77 class ListBoxFrame;
78 class ButtonCtrl;
79 class SpinField;
80 class FormattedField;
81 
82 // .......................................................................
83 namespace svt
84 {
85 // .......................................................................
86 
87 	class CellControllerRef;
88 
89 	//==================================================================
90 	//= CellController
91 	//==================================================================
92 	class SVT_DLLPUBLIC CellController : public SvRefBase
93 	{
94 		friend class EditBrowseBox;
95 
96 	protected:
97 		Control*	pWindow;
98 		sal_Bool	bSuspended;		// <sal_True> if the window is hidden and disabled
99 
100 	public:
101 		TYPEINFO();
102 
103 		CellController(Control* pW);
104 		virtual ~CellController();
105 
GetWindow() const106 		Control& GetWindow() const { return *const_cast< CellController* >( this )->pWindow; }
107 
108 		virtual void SetModified();
109 		virtual void ClearModified() = 0;
110 		virtual sal_Bool IsModified() const = 0;
111 
112 		// commit any current changes. Especially, do any reformatting you need (from input formatting
113 		// to output formatting) here
114 		// 95826 - 2002-10-14 - fs@openoffice.org
115 		virtual void CommitModifications();
116 
117 		// suspending the controller is not culmulative!
118 				void		suspend( );
119 				void		resume( );
isSuspended() const120 		inline	sal_Bool	isSuspended( ) const { return bSuspended; }
121 
122 	protected:
123 		virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
124 		virtual void SetModifyHdl(const Link& rLink) = 0;
125 		virtual sal_Bool WantMouseEvent() const;
126 	};
127 
128 	SV_DECL_IMPL_REF(CellController);
129 
130 	//==================================================================
131 	//= IEditImplementation
132 	//==================================================================
133     class IEditImplementation
134     {
135     public:
136         virtual Control&            GetControl() = 0;
137 
138         virtual String              GetText( LineEnd aSeparator ) const = 0;
139         virtual void                SetText( const String& _rStr ) = 0;
140 
141         virtual sal_Bool                IsReadOnly() const = 0;
142         virtual void                SetReadOnly( sal_Bool bReadOnly ) = 0;
143 
144         virtual xub_StrLen          GetMaxTextLen() const = 0;
145         virtual void                SetMaxTextLen( xub_StrLen _nMaxLen ) = 0;
146 
147         virtual Selection           GetSelection() const = 0;
148         virtual void                SetSelection( const Selection& _rSelection ) = 0;
149 
150         virtual void                ReplaceSelected( const String& _rStr ) = 0;
151         virtual void                DeleteSelected() = 0;
152         virtual String              GetSelected( LineEnd aSeparator ) const = 0;
153 
154         virtual void                SetModified() = 0;
155         virtual sal_Bool            IsModified() const = 0;
156         virtual void                ClearModified() = 0;
157         virtual void                SetModifyHdl( const Link& _rLink ) = 0;
158     };
159 
160     //==================================================================
161 	//= GenericEditImplementation
162 	//==================================================================
163     template <class EDIT>
164     class GenericEditImplementation : public IEditImplementation
165     {
166         EDIT&   m_rEdit;
167 	public:
168 		GenericEditImplementation( EDIT& _rEdit );
169 
GetEditWindow()170         EDIT& GetEditWindow() { return static_cast< EDIT& >( GetControl() ); }
171 
172         virtual Control&            GetControl();
173 
174         virtual String              GetText( LineEnd aSeparator ) const;
175         virtual void                SetText( const String& _rStr );
176 
177         virtual sal_Bool                IsReadOnly() const;
178         virtual void                SetReadOnly( sal_Bool bReadOnly );
179 
180         virtual xub_StrLen          GetMaxTextLen() const;
181         virtual void                SetMaxTextLen( xub_StrLen _nMaxLen );
182 
183         virtual Selection           GetSelection() const;
184         virtual void                SetSelection( const Selection& _rSelection );
185 
186         virtual void                ReplaceSelected( const String& _rStr );
187         virtual void                DeleteSelected();
188         virtual String              GetSelected( LineEnd aSeparator ) const;
189 
190         virtual void                SetModified();
191         virtual sal_Bool            IsModified() const;
192         virtual void                ClearModified();
193         virtual void                SetModifyHdl( const Link& _rLink );
194     };
195 
196     #include <svtools/editimplementation.hxx>
197 
198 	//==================================================================
199 	//= MultiLineTextCell
200 	//==================================================================
201     /** a multi line edit which can be used in a cell of a EditBrowseBox
202     */
203     class SVT_DLLPUBLIC MultiLineTextCell : public MultiLineEdit
204     {
205     public:
MultiLineTextCell(Window * _pParent,WinBits _nStyle)206         MultiLineTextCell( Window* _pParent, WinBits _nStyle )
207             :MultiLineEdit( _pParent, _nStyle )
208         {
209         }
210 
211     protected:
212         // Window overridables
213         virtual long PreNotify( NotifyEvent& rNEvt );
214 
215         // MultiLineEdit overridables
216         virtual void Modify();
217 
218     private:
219         sal_Bool    dispatchKeyEvent( const KeyEvent& _rEvent );
220     };
221 
222 	//==================================================================
223 	//= concrete edit implementations
224 	//==================================================================
225     typedef GenericEditImplementation< Edit >             EditImplementation;
226 
227     typedef GenericEditImplementation< MultiLineTextCell >  MultiLineEditImplementation_Base;
228     class SVT_DLLPUBLIC MultiLineEditImplementation : public MultiLineEditImplementation_Base
229     {
230     public:
MultiLineEditImplementation(MultiLineTextCell & _rEdit)231         MultiLineEditImplementation( MultiLineTextCell& _rEdit ) : MultiLineEditImplementation_Base( _rEdit )
232         {
233         }
234 
235         virtual String GetText( LineEnd aSeparator ) const;
236         virtual String GetSelected( LineEnd aSeparator ) const;
237     };
238 
239     //==================================================================
240 	//= EditCellController
241 	//==================================================================
242     class SVT_DLLPUBLIC EditCellController : public CellController
243     {
244         IEditImplementation*    m_pEditImplementation;
245         sal_Bool                    m_bOwnImplementation;   // did we create m_pEditImplementation?
246 
247 	public:
248 		TYPEINFO();
249 		EditCellController( Edit* _pEdit );
250 		EditCellController( MultiLineTextCell* _pEdit );
251 		EditCellController( IEditImplementation* _pImplementation );
252 		~EditCellController( );
253 
GetEditImplementation() const254         const IEditImplementation* GetEditImplementation( ) const { return m_pEditImplementation; }
GetEditImplementation()255               IEditImplementation* GetEditImplementation( )       { return m_pEditImplementation; }
256 
257 		virtual void SetModified();
258 		virtual sal_Bool IsModified() const;
259 		virtual void ClearModified();
260 
261 	protected:
262 		virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
263 		virtual void SetModifyHdl(const Link& rLink);
264     };
265 
266 	//==================================================================
267 	//= SpinCellController
268 	//==================================================================
269 	class SVT_DLLPUBLIC SpinCellController : public CellController
270 	{
271 	public:
272 		TYPEINFO();
273 		SpinCellController(SpinField* pSpinField);
GetSpinWindow() const274 		SpinField& GetSpinWindow() const {return (SpinField &)GetWindow();}
275 
276 		virtual void SetModified();
277 		virtual sal_Bool IsModified() const;
278 		virtual void ClearModified();
279 
280 	protected:
281 		virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
282 		virtual void SetModifyHdl(const Link& rLink);
283 	};
284 
285 	//==================================================================
286 	//= CheckBoxControl
287 	//==================================================================
288 	class SVT_DLLPUBLIC CheckBoxControl : public Control
289 	{
290 		CheckBox*	pBox;
291 		Rectangle	aFocusRect;
292 		Link		m_aClickLink,m_aModifyLink;
293 
294 	public:
295 		CheckBoxControl(Window* pParent, WinBits nWinStyle = 0);
296 		~CheckBoxControl();
297 
298 		virtual void GetFocus();
299 		virtual long PreNotify(NotifyEvent& rEvt);
300 		virtual void Paint(const Rectangle& rClientRect);
301 		virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
302 		virtual void StateChanged( StateChangedType nStateChange );
303         virtual void DataChanged( const DataChangedEvent& _rEvent );
304 		virtual void Resize();
305 
SetClickHdl(const Link & rHdl)306 		void SetClickHdl(const Link& rHdl) {m_aClickLink = rHdl;}
GetClickHdl() const307 		const Link& GetClickHdl() const {return m_aClickLink;}
308 
SetModifyHdl(const Link & rHdl)309 		void SetModifyHdl(const Link& rHdl) {m_aModifyLink = rHdl;}
GetModifyHdl() const310 		const Link& GetModifyHdl() const {return m_aModifyLink;}
311 
GetBox()312 		CheckBox&	GetBox() {return *pBox;};
313 
314 	private:
315 		DECL_LINK( OnClick, void* );
316 	};
317 
318 	//==================================================================
319 	//= CheckBoxCellController
320 	//==================================================================
321 	class SVT_DLLPUBLIC CheckBoxCellController : public CellController
322 	{
323 	public:
324 		TYPEINFO();
325 
CheckBoxCellController(CheckBoxControl * pWin)326 		CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin){}
327 		CheckBox& GetCheckBox() const;
328 
329 		virtual sal_Bool IsModified() const;
330 		virtual void ClearModified();
331 
332 	protected:
333 		virtual void SetModifyHdl(const Link& rLink);
334 		virtual sal_Bool WantMouseEvent() const;
335 	};
336 
337 	//==================================================================
338 	//= ComboBoxControl
339 	//==================================================================
340 	class SVT_DLLPUBLIC ComboBoxControl : public ComboBox
341 	{
342 		friend class ComboBoxCellController;
343 
344 	public:
345 		ComboBoxControl(Window* pParent, WinBits nWinStyle = 0);
346 
347 	protected:
348 		virtual long PreNotify( NotifyEvent& rNEvt );
349 	};
350 
351 	//==================================================================
352 	//= ComboBoxCellController
353 	//==================================================================
354 	class SVT_DLLPUBLIC ComboBoxCellController : public CellController
355 	{
356 	public:
357 		TYPEINFO();
358 
359 		ComboBoxCellController(ComboBoxControl* pParent);
GetComboBox() const360 		ComboBoxControl& GetComboBox() const {return (ComboBoxControl &)GetWindow();}
361 
362 		virtual sal_Bool IsModified() const;
363 		virtual void ClearModified();
364 
365 	protected:
366 		virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
367 		virtual void SetModifyHdl(const Link& rLink);
368 	};
369 
370 	//==================================================================
371 	//= ListBoxControl
372 	//==================================================================
373 	class SVT_DLLPUBLIC ListBoxControl : public ListBox
374 	{
375 		friend class ListBoxCellController;
376 
377 	public:
378 		ListBoxControl(Window* pParent, WinBits nWinStyle = 0);
379 
380 	protected:
381 		virtual long PreNotify( NotifyEvent& rNEvt );
382 	};
383 
384 	//==================================================================
385 	//= ListBoxCellController
386 	//==================================================================
387 	class SVT_DLLPUBLIC ListBoxCellController : public CellController
388 	{
389 	public:
390 		TYPEINFO();
391 
392 		ListBoxCellController(ListBoxControl* pParent);
GetListBox() const393 		ListBoxControl& GetListBox() const {return (ListBoxControl &)GetWindow();}
394 
395 		virtual sal_Bool IsModified() const;
396 		virtual void ClearModified();
397 
398 	protected:
399 		virtual sal_Bool MoveAllowed(const KeyEvent& rEvt) const;
400 		virtual void SetModifyHdl(const Link& rLink);
401 	};
402 
403 	//==================================================================
404 	//= FormattedFieldCellController
405 	//==================================================================
406 	class SVT_DLLPUBLIC FormattedFieldCellController : public EditCellController
407 	{
408 	public:
409 		TYPEINFO();
410 		FormattedFieldCellController( FormattedField* _pFormatted );
411 
412 		virtual void CommitModifications();
413 	};
414 
415 	//==================================================================
416 	//= EditBrowserHeader
417 	//==================================================================
418 	class SVT_DLLPUBLIC EditBrowserHeader : public BrowserHeader
419 	{
420 	public:
EditBrowserHeader(BrowseBox * pParent,WinBits nWinBits=WB_BUTTONSTYLE)421 		EditBrowserHeader( BrowseBox* pParent, WinBits nWinBits = WB_BUTTONSTYLE )
422 			:BrowserHeader(pParent, nWinBits){}
423 
424 	protected:
425 		virtual void DoubleClick();
426 	};
427 
428 	//==================================================================
429 	//= EditBrowseBox
430 	//==================================================================
431 	class EditBrowseBoxImpl;
432 	class SVT_DLLPUBLIC EditBrowseBox: public BrowseBox
433 	{
434 		friend class EditBrowserHeader;
435 
436 		enum BrowseInfo
437 		{
438 			COLSELECT	=	1,
439 			ROWSELECT	=	2,
440 			ROWCHANGE	=	4,
441 			COLCHANGE	=	8
442 		};
443 
444 	public:
445 		enum RowStatus
446 		{
447 			CLEAN				=	0,
448 			CURRENT				=	1,
449 			CURRENTNEW			=	2,
450 			MODIFIED			=	3,
451 			NEW					=	4,
452 			DELETED				=	5,
453 			PRIMARYKEY			=	6,
454 			CURRENT_PRIMARYKEY	=	7,
455 			FILTER				=	8,
456 			HEADERFOOTER		=	9
457 		};
458 
459 	private:
460 		// forbid these ones
461 		EditBrowseBox(EditBrowseBox&);
462 		EditBrowseBox& operator=(EditBrowseBox&);
463 
464 		class BrowserMouseEventPtr
465 		{
466 			BrowserMouseEvent* pEvent;
467 			sal_Bool bDown;
468 
469 		public:
BrowserMouseEventPtr()470 			BrowserMouseEventPtr():pEvent(NULL){}
~BrowserMouseEventPtr()471 			~BrowserMouseEventPtr(){Clear();}
472 
Is() const473 			sal_Bool Is() const {return pEvent != NULL;}
IsDown() const474 			sal_Bool IsDown() const {return bDown;}
operator ->() const475 			const BrowserMouseEvent* operator->() const {return pEvent;}
operator *() const476 			const BrowserMouseEvent& operator*() const {return *pEvent;}
477 
478 			SVT_DLLPUBLIC void Clear();
479 			void Set(const BrowserMouseEvent* pEvt, sal_Bool bIsDown);
480 		} aMouseEvent;
481 
482 		const BrowserMouseEvent* pMouseEvent;	// is set during a mouse event
483 		CellControllerRef		 aController,
484 								 aOldController;
485 
486 		sal_uLong	nStartEvent, nEndEvent, nCellModifiedEvent;		// event ids
487 		Window*	m_pFocusWhileRequest;
488 			// In ActivateCell, we grab the focus asynchronously, but if between requesting activation
489 			// and the asynchornous event the focus has changed, we won't grab it for ourself.
490 
491 		long	nPaintRow;	// row being painted
492 		long	nEditRow, nOldEditRow;
493 		sal_uInt16	nEditCol, nOldEditCol;
494 
495 		sal_Bool            bHasFocus : 1;
496 		mutable sal_Bool    bPaintStatus : 1;	// paint a status (image) in the handle column
497         sal_Bool            bActiveBeforeTracking;
498 
499 		CheckBoxControl* pCheckBoxPaint;
500 
501 		sal_Int32	m_nBrowserFlags;
502 		ImageList	m_aStatusImages;
503 		::std::auto_ptr< EditBrowseBoxImpl> m_aImpl;
504 
505 	protected:
506 		BrowserHeader*  pHeader;
507 
isGetCellFocusPending() const508 		sal_Bool isGetCellFocusPending() const { return nStartEvent != 0; }
cancelGetCellFocus()509 		void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; }
forceGetCellFocus()510 		void forceGetCellFocus() { cancelGetCellFocus(); LINK(this, EditBrowseBox, StartEditHdl).Call((void*)NULL); }
511 
getMouseEvent()512 		BrowserMouseEventPtr& getMouseEvent() { return aMouseEvent; }
513 
514 	protected:
GetHeaderBar() const515 		BrowserHeader*	GetHeaderBar() const {return pHeader;}
516 
517 		virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent);
518 
519 		// if you want to have an own header ...
520 		virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
521 
522 		virtual void ColumnMoved(sal_uInt16 nId);
523 		virtual void ColumnResized(sal_uInt16 nColId);
524 		virtual void Resize();
525 		virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
526 		virtual sal_Bool SeekRow(long nRow);
527 
528 		virtual void GetFocus();
529 		virtual void LoseFocus();
530 		virtual void KeyInput(const KeyEvent& rEvt);
531 		virtual void MouseButtonDown(const BrowserMouseEvent& rEvt);
532 		virtual void MouseButtonUp(const BrowserMouseEvent& rEvt);
533 		virtual void StateChanged( StateChangedType nType );
534 		virtual void DataChanged( const DataChangedEvent& rDCEvt );
535 
536         using BrowseBox::MouseButtonUp;
537         using BrowseBox::MouseButtonDown;
538 
539 		virtual long PreNotify(NotifyEvent& rNEvt );
540 		virtual long Notify(NotifyEvent& rNEvt);
541 
542 		virtual void EndScroll();
543 
544 		// should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders
545 		Rectangle GetCellRect(long nRow, sal_uInt16 nColId, sal_Bool bRelToBrowser = sal_True) const;
546 		virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
547 		virtual sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId);
548 
549 		virtual void PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
550 		virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId) const = 0;
551 
552 		virtual RowStatus GetRowStatus(long nRow) const;
553 
554         virtual void    RowHeightChanged();
555 
556         // callbacks for the data window
557         virtual void    ImplStartTracking();
558         virtual void    ImplTracking();
559         virtual void    ImplEndTracking();
560 
561         // when changing a row:
562 		// CursorMoving:	cursor is being moved, but GetCurRow() still provides the old row
563 		virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol);
564 
565 		// cursor has been moved
566 		virtual void CursorMoved();
567 
568 		virtual void CellModified();		// called whenever a cell has been modified
569 		virtual sal_Bool SaveModified();	// called whenever a cell should be left, and it's content should be saved
570 											// return sal_False prevents leaving the cell
571 		virtual sal_Bool SaveRow();			// commit the current row
572 
IsModified() const573 		virtual sal_Bool IsModified() const {return aController.Is() && aController->IsModified();}
574 
575 		virtual CellController* GetController(long nRow, sal_uInt16 nCol);
576 		virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol);
577 		virtual void ResizeController(CellControllerRef& rController, const Rectangle&);
578 		virtual void ReleaseController(CellControllerRef& pController, long nRow, sal_uInt16 nCol);
579 		virtual void DoubleClick(const BrowserMouseEvent&);
580 
ActivateCell()581 		void ActivateCell() { ActivateCell(GetCurRow(), GetCurColumnId()); }
582 
583 		// retrieve the image for the row status
584 		virtual Image GetImage(RowStatus) const;
585 
586 		// inserting columns
587 		// if you don't set a width, this will be calculated automatically
588 		// if the id isn't set the smallest unused will do it ...
589 		virtual sal_uInt16 AppendColumn(const String& rName, sal_uInt16 nWidth = 0, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = (sal_uInt16)-1);
590 
591 		// called whenever (Shift)Tab or Enter is pressed. If true is returned, these keys
592 		// result in traveling to the next or to th previous cell
593 		virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
594 
595 		virtual sal_Bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const;
596 
597 		void	PaintTristate(OutputDevice& rDev, const Rectangle& rRect,const TriState& eState,sal_Bool _bEnabled=sal_True) const;
598 
599 		void AsynchGetFocus();
600 			// secure starting of StartEditHdl
601 
602 	public:
603 		EditBrowseBox(Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 0 );
604 		EditBrowseBox(Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = 0 );
605 		~EditBrowseBox();
606 
IsEditing() const607 		sal_Bool IsEditing() const {return aController.Is();}
InvalidateStatusCell(long nRow)608 		void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);}
609 		void InvalidateHandleColumn();
610 
611 		// late construction
612 		virtual void Init();
613 		virtual void RemoveRows();
614 		virtual void Dispatch(sal_uInt16 nId);
615 
Controller() const616 		CellControllerRef Controller() const { return aController; }
GetBrowserFlags() const617 		sal_Int32	GetBrowserFlags() const { return m_nBrowserFlags; }
618 		void	SetBrowserFlags(sal_Int32 nFlags);
619 
620 		virtual void ActivateCell(long nRow, sal_uInt16	nCol, sal_Bool bSetCellFocus = sal_True);
621 		virtual void DeactivateCell(sal_Bool bUpdate = sal_True);
622 		// Children ---------------------------------------------------------------
623 
624 		/** Creates the accessible object of a data table cell.
625         @param nRow
626 			The row index of the cell.
627         @param nColumnId
628 			The column ID of the cell.
629         @return
630 			The XAccessible interface of the specified cell. */
631 		virtual ::com::sun::star::uno::Reference<
632 			::com::sun::star::accessibility::XAccessible >
633 		CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnPos );
634 
635 		/** @return  The count of additional controls of the control area. */
636 		virtual sal_Int32 GetAccessibleControlCount() const;
637 
638 		/** Creates the accessible object of an additional control.
639 			@param nIndex
640 				The 0-based index of the control.
641 			@return
642 				The XAccessible interface of the specified control. */
643 		virtual ::com::sun::star::uno::Reference<
644 			::com::sun::star::accessibility::XAccessible >
645 		CreateAccessibleControl( sal_Int32 nIndex );
646 
647 		/** Creates the accessible object of a column header.
648 			@param nColumnId
649 				The column ID of the header.
650 			@return
651 				The XAccessible interface of the specified column header. */
652 		virtual ::com::sun::star::uno::Reference<
653 			::com::sun::star::accessibility::XAccessible >
654 		CreateAccessibleRowHeader( sal_Int32 _nRow );
655 
656 		/** Sets focus to current cell of the data table. */
657 		virtual void GrabTableFocus();
658 
659 		virtual Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex);
660 		virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint);
661 
662 		::com::sun::star::uno::Reference<
663 			::com::sun::star::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState,sal_Bool _bEnabled=sal_True);
664 	protected:
665 		// creates the accessible which wraps the active cell
666 		void	implCreateActiveAccessible( );
667 
668 	private:
669 		virtual void PaintField(OutputDevice& rDev, const Rectangle& rRect,
670 								sal_uInt16 nColumnId ) const;
671         using Control::ImplInitSettings;
672 		SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
673 		SVT_DLLPRIVATE void DetermineFocus( const sal_uInt16 _nGetFocusFlags = 0);
674 		inline void HideAndDisable(CellControllerRef& rController);
675 		inline void EnableAndShow() const;
676 
677 		SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, sal_Bool _bUp);
678 		SVT_DLLPRIVATE void impl_construct();
679 
680 		DECL_DLLPRIVATE_LINK(ModifyHdl, void* );
681 		DECL_DLLPRIVATE_LINK(StartEditHdl, void* );
682 		DECL_DLLPRIVATE_LINK(EndEditHdl, void* );
683 		DECL_DLLPRIVATE_LINK(CellModifiedHdl, void* );
684 	};
685 
686 // .......................................................................
687 }	// namespace svt
688 // .......................................................................
689 
690 #undef SVTOOLS_IN_EDITBROWSEBOX_HXX
691 #endif // _SVTOOLS_EDITBROWSEBOX_HXX_
692 
693