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 #ifndef DBAUI_QUERYDESIGN_OSELECTIONBROWSEBOX_HXX
28*cdf0e10cSrcweir #define DBAUI_QUERYDESIGN_OSELECTIONBROWSEBOX_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
31*cdf0e10cSrcweir #include <svtools/editbrowsebox.hxx>
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir //#ifndef DBAUI_QUERYCONTROLLER_HXX
34*cdf0e10cSrcweir //#include "querycontroller.hxx"
35*cdf0e10cSrcweir //#endif
36*cdf0e10cSrcweir #ifndef DBAUI_TABLEFIELDDESC_HXX
37*cdf0e10cSrcweir #include "TableFieldDescription.hxx"
38*cdf0e10cSrcweir #endif
39*cdf0e10cSrcweir #ifndef DBAUI_JOINEXCHANGE_HXX
40*cdf0e10cSrcweir #include "JoinExchange.hxx"
41*cdf0e10cSrcweir #endif
42*cdf0e10cSrcweir #ifndef DBAUI_ENUMTYPES_HXX
43*cdf0e10cSrcweir #include "QEnumTypes.hxx"
44*cdf0e10cSrcweir #endif
45*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
46*cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatter.hpp>
47*cdf0e10cSrcweir #endif
48*cdf0e10cSrcweir #ifndef _STRING_HXX
49*cdf0e10cSrcweir #include <tools/string.hxx>
50*cdf0e10cSrcweir #endif
51*cdf0e10cSrcweir #ifndef _TRANSFER_HXX
52*cdf0e10cSrcweir #include <svtools/transfer.hxx>
53*cdf0e10cSrcweir #endif
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir namespace connectivity
56*cdf0e10cSrcweir {
57*cdf0e10cSrcweir 	class OSQLParseNode;
58*cdf0e10cSrcweir }
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir namespace dbaui
61*cdf0e10cSrcweir {
62*cdf0e10cSrcweir 	//==================================================================
63*cdf0e10cSrcweir #define SIZ_NONE		0
64*cdf0e10cSrcweir #define SIZ_TOP			1
65*cdf0e10cSrcweir #define SIZ_BOTTOM		2
66*cdf0e10cSrcweir #define SIZ_LEFT		4
67*cdf0e10cSrcweir #define SIZ_RIGHT		8
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir #define BROW_FIELD_ROW			0
70*cdf0e10cSrcweir #define BROW_COLUMNALIAS_ROW	1
71*cdf0e10cSrcweir #define BROW_TABLE_ROW			2
72*cdf0e10cSrcweir #define BROW_ORDER_ROW			3
73*cdf0e10cSrcweir #define BROW_VIS_ROW			4
74*cdf0e10cSrcweir #define BROW_FUNCTION_ROW		5
75*cdf0e10cSrcweir #define BROW_CRIT1_ROW			6
76*cdf0e10cSrcweir #define BROW_CRIT2_ROW			7
77*cdf0e10cSrcweir #define BROW_CRIT3_ROW			8
78*cdf0e10cSrcweir #define BROW_CRIT4_ROW			9
79*cdf0e10cSrcweir #define BROW_CRIT5_ROW			10
80*cdf0e10cSrcweir #define BROW_CRIT6_ROW			11
81*cdf0e10cSrcweir #define BROW_ROW_CNT			12
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 	//==================================================================
84*cdf0e10cSrcweir 	class OQueryDesignView;
85*cdf0e10cSrcweir 	class OSelectionBrowseBox : public ::svt::EditBrowseBox
86*cdf0e10cSrcweir 	{
87*cdf0e10cSrcweir 		friend class OQueryDesignView;
88*cdf0e10cSrcweir 		::std::vector<bool> 				m_bVisibleRow;	// an Pos steht die RowId
89*cdf0e10cSrcweir 		Timer								m_timerInvalidate;
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 		long								m_nSeekRow;
92*cdf0e10cSrcweir 		BrowserMode							m_nMode;						// Merken des BrowseModes
93*cdf0e10cSrcweir 		Edit*								m_pTextCell;
94*cdf0e10cSrcweir 		::svt::CheckBoxControl*				m_pVisibleCell;
95*cdf0e10cSrcweir 		::svt::ComboBoxControl*				m_pFieldCell;
96*cdf0e10cSrcweir 		::svt::ListBoxControl*				m_pFunctionCell;
97*cdf0e10cSrcweir 		::svt::ListBoxControl*				m_pTableCell;
98*cdf0e10cSrcweir 		::svt::ListBoxControl*				m_pOrderCell;
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 		OTableFieldDescRef					m_pEmptyEntry;		// default entry in the list may reference more than once
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 		sal_Int32							m_nMaxColumns;				// maximale Anzahl der Spalten in einem Select-Statement
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 		String								m_aFunctionStrings;
105*cdf0e10cSrcweir 		sal_uInt16							m_nVisibleCount;				// Anzahl der max sichtbaren Zeilen
106*cdf0e10cSrcweir 		sal_Bool							m_bOrderByUnRelated;
107*cdf0e10cSrcweir 		sal_Bool							m_bGroupByUnRelated;
108*cdf0e10cSrcweir 		sal_Bool							m_bStopTimer;
109*cdf0e10cSrcweir 		sal_Bool							m_bWasEditing;
110*cdf0e10cSrcweir 		sal_Bool							m_bDisableErrorBox;
111*cdf0e10cSrcweir 		sal_Bool							m_bInUndoMode;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 		DECL_LINK(OnInvalidateTimer, void*);
114*cdf0e10cSrcweir 	public:							OSelectionBrowseBox( Window* pParent );
115*cdf0e10cSrcweir 									~OSelectionBrowseBox();
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 		void						initialize();
118*cdf0e10cSrcweir 		OTableFieldDescRef			InsertField( const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True );
119*cdf0e10cSrcweir 		OTableFieldDescRef			InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True );
120*cdf0e10cSrcweir 		void						InsertColumn( OTableFieldDescRef pEntry, sal_uInt16& _nColumnPostion );
121*cdf0e10cSrcweir 		void						RemoveColumn( sal_uInt16 _nColumnId );
122*cdf0e10cSrcweir 		void						DeleteFields( const String& rAliasName );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir         bool                        HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const;
125*cdf0e10cSrcweir 		// AddGroupBy:: F"ugt ein Feld mit Funktion == Grupierung. Falls das Feld schon vorhanden ist und ein Aggregate Funktion
126*cdf0e10cSrcweir 		// benutzt, wird das Flag nicht gesetzt
127*cdf0e10cSrcweir 		void						AddGroupBy( const OTableFieldDescRef& rInfo,sal_uInt32 _nCurrentPos);
128*cdf0e10cSrcweir 		void						AddCondition( const OTableFieldDescRef& rInfo,
129*cdf0e10cSrcweir 												  const String& rValue,
130*cdf0e10cSrcweir 												  const sal_uInt16 nLevel,
131*cdf0e10cSrcweir                                                   bool _bAddOrOnOneLine  );
132*cdf0e10cSrcweir 		void						DuplicateConditionLevel( const sal_uInt16 nLevel);
133*cdf0e10cSrcweir 		void						AddOrder(const OTableFieldDescRef& rInfo, const EOrderDir eDir, sal_uInt32 _nCurrentPos);
134*cdf0e10cSrcweir 		void						ClearAll();
135*cdf0e10cSrcweir 		OTableFieldDescRef			AppendNewCol( sal_uInt16 nCnt=1 );
136*cdf0e10cSrcweir 		sal_Bool					Save();
137*cdf0e10cSrcweir 		OQueryDesignView*			getDesignView();
138*cdf0e10cSrcweir 		OQueryDesignView*			getDesignView() const;
139*cdf0e10cSrcweir 		sal_uInt16					FieldsCount();
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 		void						SetColWidth(sal_uInt16 nColId, long lNewWidth);
142*cdf0e10cSrcweir 									// beachtet im Gegensatz zum SetColumnWidth der Basisklasse auch eine eventuell aktive Zelle in dieser Spalte
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir 		String						GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId);
145*cdf0e10cSrcweir 		void						SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const String& strNewText);
146*cdf0e10cSrcweir 										// Zelleninhalt (als String formatiert) setzen/liefern
147*cdf0e10cSrcweir 		sal_Int32					GetNoneVisibleRows() const;
148*cdf0e10cSrcweir 		void						SetNoneVisbleRow(long nRows);
149*cdf0e10cSrcweir 		sal_Bool					IsRowVisible(sal_uInt16 _nWhich) const;
150*cdf0e10cSrcweir 		void						SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis);
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 		void						SetReadOnly(sal_Bool bRO);
153*cdf0e10cSrcweir 		// calculate an optimal size. Basically, this takes into account the number of visible rows.
154*cdf0e10cSrcweir 		Size						CalcOptimalSize( const Size& _rAvailable );
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 		// can the current content be cut
157*cdf0e10cSrcweir 		sal_Bool					isPasteAllowed();
158*cdf0e10cSrcweir 		sal_Bool					isCutAllowed();
159*cdf0e10cSrcweir 		sal_Bool					isCopyAllowed();
160*cdf0e10cSrcweir 		void						cut();
161*cdf0e10cSrcweir 		void						paste();
162*cdf0e10cSrcweir 		void						copy();
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 		virtual void				GetFocus();
165*cdf0e10cSrcweir 		virtual void				DeactivateCell(sal_Bool bUpdate = sal_True);
166*cdf0e10cSrcweir 		virtual void				ColumnMoved( sal_uInt16 nColId ) { ColumnMoved(nColId,sal_True); }
167*cdf0e10cSrcweir 		void						ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo);
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 		void						Fill();
170*cdf0e10cSrcweir 		void						PreFill();
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 		/** Disables the generation of undo actions
173*cdf0e10cSrcweir 		*/
174*cdf0e10cSrcweir 		inline void					EnterUndoMode() { m_bInUndoMode = sal_True; }
175*cdf0e10cSrcweir 		/** Enables the generation of undo actions
176*cdf0e10cSrcweir 		*/
177*cdf0e10cSrcweir 		inline void					LeaveUndoMode() { m_bInUndoMode = sal_False; }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 		/** GetCellText returns the text at the given position
180*cdf0e10cSrcweir 			@param	_nRow
181*cdf0e10cSrcweir 				the number of the row
182*cdf0e10cSrcweir 			@param	_nColId
183*cdf0e10cSrcweir 				the ID of the column
184*cdf0e10cSrcweir 			@return
185*cdf0e10cSrcweir 				the text out of the cell
186*cdf0e10cSrcweir 		*/
187*cdf0e10cSrcweir 		virtual String				GetCellText(long _nRow, sal_uInt16 _nColId) const;
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir 		/** returns the description of the row.
190*cdf0e10cSrcweir 			@param	_nRow
191*cdf0e10cSrcweir 				The row number.
192*cdf0e10cSrcweir 			@return
193*cdf0e10cSrcweir 				The header text of the specified row.
194*cdf0e10cSrcweir 		*/
195*cdf0e10cSrcweir 		virtual ::rtl::OUString		GetRowDescription( sal_Int32 _nRow ) const;
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 		/** return the name of the specified object.
198*cdf0e10cSrcweir 			@param	eObjType
199*cdf0e10cSrcweir 				The type to ask for
200*cdf0e10cSrcweir 			@param	_nPosition
201*cdf0e10cSrcweir 				The position of a tablecell (index position), header bar  colum/row cell
202*cdf0e10cSrcweir 			@return
203*cdf0e10cSrcweir 				The name of the specified object.
204*cdf0e10cSrcweir 		*/
205*cdf0e10cSrcweir 		virtual ::rtl::OUString		GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 		// IAccessibleTableProvider
208*cdf0e10cSrcweir 		/** Creates the accessible object of a data table cell.
209*cdf0e10cSrcweir         @param nRow  The row index of the cell.
210*cdf0e10cSrcweir         @param nColumnId  The column ID of the cell.
211*cdf0e10cSrcweir         @return  The XAccessible interface of the specified cell. */
212*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId );
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 	protected:
216*cdf0e10cSrcweir 		virtual sal_Bool			SeekRow( long nRow );
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir 		virtual void				PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const;
219*cdf0e10cSrcweir 		virtual void				PaintCell(OutputDevice& rDev, const Rectangle& rRect,
220*cdf0e10cSrcweir 											  sal_uInt16 nColumnId ) const;
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 		virtual sal_Int8			AcceptDrop( const BrowserAcceptDropEvent& rEvt );
223*cdf0e10cSrcweir 		virtual sal_Int8			ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
224*cdf0e10cSrcweir 		virtual void				MouseButtonDown( const BrowserMouseEvent& rEvt );
225*cdf0e10cSrcweir 		virtual void				MouseButtonUp( const BrowserMouseEvent& rEvt );
226*cdf0e10cSrcweir 		virtual void				KeyInput( const KeyEvent& rEvt );
227*cdf0e10cSrcweir 		virtual void				Command(const CommandEvent& rEvt);
228*cdf0e10cSrcweir 		virtual void				ArrangeControls(sal_uInt16& nX, sal_uInt16 nY);
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 		virtual ::svt::CellController*	GetController(long nRow, sal_uInt16 nCol);
231*cdf0e10cSrcweir 		virtual void				InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol);
232*cdf0e10cSrcweir 		virtual void				CellModified();
233*cdf0e10cSrcweir 		virtual sal_Bool			SaveModified();
234*cdf0e10cSrcweir 		virtual void				Init();
235*cdf0e10cSrcweir 		virtual sal_uInt32			GetTotalCellWidth(long nRow, sal_uInt16 nColId) const;
236*cdf0e10cSrcweir 		virtual void				ColumnResized( sal_uInt16 nColId );
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir 		virtual sal_uInt32			GetTotalCellWidth(long nRow, sal_uInt16 nColId);
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 		virtual sal_uInt16			GetDefaultColumnWidth(const String& rName) const;
241*cdf0e10cSrcweir 		// if you want to have an own header ...
242*cdf0e10cSrcweir 		virtual BrowserHeader*		imp_CreateHeaderBar(BrowseBox* pParent);
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 		void						stopTimer();
245*cdf0e10cSrcweir 		void						startTimer();
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir 	private:
248*cdf0e10cSrcweir 		OTableFieldDescRef			FindFirstFreeCol(sal_uInt16& _rColumnPosition);
249*cdf0e10cSrcweir 			// rCol enthaelt die Nummer (in pOTableFieldDescList) der ersten Spalte, die von sich sagt, dass sie leer ist
250*cdf0e10cSrcweir 			// wenn es keine solche gibt, ist rCol undefiniert und der Rueckgabewert NULL
251*cdf0e10cSrcweir 		void						CheckFreeColumns(sal_uInt16& _rColumnPosition);
252*cdf0e10cSrcweir 			// testet, ob es noch freie Spalten gibt, wenn nicht, wird ein neuer Packen angefuegt
253*cdf0e10cSrcweir 			// rCol enthaelt die Nummer der ersten freien Spalte (in pOTableFieldDescList)
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir 		void			RemoveField( sal_uInt16 nId );
256*cdf0e10cSrcweir 		Rectangle		GetInvalidRect( sal_uInt16 nColId );
257*cdf0e10cSrcweir 		long			GetRealRow(long nRow) const;
258*cdf0e10cSrcweir 		long			GetBrowseRow(long nRowId) const;
259*cdf0e10cSrcweir 		sal_Bool		GetFunctionName(sal_uInt32 _nFunctionTokenId,String& rFkt);
260*cdf0e10cSrcweir 		void			appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow,sal_Bool& _bListAction);
261*cdf0e10cSrcweir 		void			appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow);
262*cdf0e10cSrcweir 		OTableFields&	getFields() const;
263*cdf0e10cSrcweir 		void			enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl);
264*cdf0e10cSrcweir 		void			setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const rtl::OString& _sHelpId);
265*cdf0e10cSrcweir 		void			invalidateUndoRedo();
266*cdf0e10cSrcweir 		OTableFieldDescRef getEntry(OTableFields::size_type _nPos);
267*cdf0e10cSrcweir 
268*cdf0e10cSrcweir 		void			adjustSelectionMode( sal_Bool _bClickedOntoHeader, sal_Bool _bClickedOntoHandleCol );
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir 		/** save the filed change in save modified
271*cdf0e10cSrcweir 			@param	_sFieldName
272*cdf0e10cSrcweir 				The field name inserted by the user.
273*cdf0e10cSrcweir 			@param	_pEntry
274*cdf0e10cSrcweir 				The entry which will contain the nescessary entries.
275*cdf0e10cSrcweir 			@param	_bListAction
276*cdf0e10cSrcweir 				Will be set to <TRUE/> when we are in a list action otherwise <FALSE/>
277*cdf0e10cSrcweir 			@return
278*cdf0e10cSrcweir 				<TRUE/> if an error occured otherwise <FALSE/>
279*cdf0e10cSrcweir 		*/
280*cdf0e10cSrcweir 		sal_Bool		saveField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction);
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 		/** sets the table window at the _pEntry
283*cdf0e10cSrcweir 			@param	_pEntry
284*cdf0e10cSrcweir 				The entry where the window should be set.
285*cdf0e10cSrcweir 			@param	_sTableName
286*cdf0e10cSrcweir 				The table name to search for.
287*cdf0e10cSrcweir 			@return
288*cdf0e10cSrcweir 				<TRUE/> if the table name was set otherwise <FALSE/>
289*cdf0e10cSrcweir 		*/
290*cdf0e10cSrcweir 		sal_Bool		fillEntryTable(OTableFieldDescRef& _pEntry,const ::rtl::OUString& _sTableName);
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir 		/** uses the parse node to fill all information into the field
293*cdf0e10cSrcweir 			@param	_pColumnRef
294*cdf0e10cSrcweir 				The parse node used to fill the info into the field.
295*cdf0e10cSrcweir 			@param	_xMetaData
296*cdf0e10cSrcweir 				Use to parse the node to a string.
297*cdf0e10cSrcweir 			@param	_pEntry
298*cdf0e10cSrcweir 				The entry which will contain the nescessary entries.
299*cdf0e10cSrcweir 			@param	_bListAction
300*cdf0e10cSrcweir 				Will be set to <TRUE/> when we are in a list action otherwise <FALSE/>
301*cdf0e10cSrcweir 			@return
302*cdf0e10cSrcweir 				<TRUE/> if an error occured otherwise <FALSE/>
303*cdf0e10cSrcweir 		*/
304*cdf0e10cSrcweir 		sal_Bool		fillColumnRef(	const ::connectivity::OSQLParseNode* _pColumnRef,
305*cdf0e10cSrcweir 										const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
306*cdf0e10cSrcweir 										OTableFieldDescRef& _pEntry,
307*cdf0e10cSrcweir 										sal_Bool& _bListAction);
308*cdf0e10cSrcweir 		sal_Bool		fillColumnRef(	const ::rtl::OUString& _sColumnName,
309*cdf0e10cSrcweir 										const ::rtl::OUString& _sTableRange,
310*cdf0e10cSrcweir 										const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData,
311*cdf0e10cSrcweir 										OTableFieldDescRef& _pEntry,
312*cdf0e10cSrcweir 										sal_Bool& _bListAction);
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir 		/** append an undo action for the table field
316*cdf0e10cSrcweir 			@param	_sOldAlias
317*cdf0e10cSrcweir 				The old table alias.
318*cdf0e10cSrcweir 			@param	_sAlias
319*cdf0e10cSrcweir 				The new alias name.
320*cdf0e10cSrcweir 			@param	_bListAction
321*cdf0e10cSrcweir 				Will be set to <TRUE/> when we are in a list action otherwise <FALSE/>
322*cdf0e10cSrcweir 		*/
323*cdf0e10cSrcweir 		void			notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId);
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir 		/** append an undo action for the function field
326*cdf0e10cSrcweir 			@param	_sOldFunctionName
327*cdf0e10cSrcweir 				The old value.
328*cdf0e10cSrcweir 			@param	_sFunctionName
329*cdf0e10cSrcweir 				The new function name.
330*cdf0e10cSrcweir 			@param	_bListAction
331*cdf0e10cSrcweir 				Will be set to <TRUE/> when we are in a list action otherwise <FALSE/>
332*cdf0e10cSrcweir 		*/
333*cdf0e10cSrcweir 		void			notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId);
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir 		/** clears the function fields of the submitted entry if it doesn't match the SQL standard and append an undo action.
336*cdf0e10cSrcweir 			E.q. AGGREGATE functions are only valid when the field name isn't an asterix
337*cdf0e10cSrcweir 			@param	_sFieldName
338*cdf0e10cSrcweir 				The field name.
339*cdf0e10cSrcweir 			@param	_pEntry
340*cdf0e10cSrcweir 				The entry to be cleared
341*cdf0e10cSrcweir 			@param	_bListAction
342*cdf0e10cSrcweir 				When <TRUE/> an list action will be created.
343*cdf0e10cSrcweir 		*/
344*cdf0e10cSrcweir 		void			clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId);
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir 		/** remove or insert the necessary function types
347*cdf0e10cSrcweir 			@param	_pEntry
348*cdf0e10cSrcweir 				The currently edited entry.
349*cdf0e10cSrcweir 		*/
350*cdf0e10cSrcweir 		void			setFunctionCell(OTableFieldDescRef& _pEntry);
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir     private:
353*cdf0e10cSrcweir         using ::svt::EditBrowseBox::AcceptDrop;
354*cdf0e10cSrcweir         using ::svt::EditBrowseBox::ExecuteDrop;
355*cdf0e10cSrcweir         using ::svt::EditBrowseBox::MouseButtonDown;
356*cdf0e10cSrcweir         using ::svt::EditBrowseBox::MouseButtonUp;
357*cdf0e10cSrcweir 	};
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir #endif // DBAUI_QUERYDESIGN_OSELECTIONBROWSEBOX_HXX
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir 
363