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