Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
21 : #define INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
22 :
23 : #include <svx/gridctrl.hxx>
24 :
25 : #include "sqlparserclient.hxx"
26 :
27 : #include <com/sun/star/sdb/XColumn.hpp>
28 : #include <com/sun/star/form/XBoundControl.hpp>
29 : #include <com/sun/star/awt/XTextComponent.hpp>
30 : #include <com/sun/star/awt/XListBox.hpp>
31 : #include <com/sun/star/awt/XComboBox.hpp>
32 : #include <com/sun/star/awt/TextAlign.hpp>
33 : #include <com/sun/star/awt/XControlModel.hpp>
34 : #include <com/sun/star/awt/XControl.hpp>
35 : #include <com/sun/star/awt/XCheckBox.hpp>
36 : #include <com/sun/star/awt/XButton.hpp>
37 : #include <com/sun/star/beans/XFastPropertySet.hpp>
38 : #include <com/sun/star/lang/XUnoTunnel.hpp>
39 : #include <com/sun/star/form/XChangeBroadcaster.hpp>
40 : #include <com/sun/star/awt/XWindow.hpp>
41 :
42 : #include <comphelper/propmultiplex.hxx>
43 : #include <cppuhelper/component.hxx>
44 : #include <cppuhelper/implbase1.hxx>
45 : #include <cppuhelper/implbase2.hxx>
46 : #include <tools/diagnose_ex.h>
47 : #include <tools/rtti.hxx>
48 :
49 : class DbCellControl;
50 : class Edit;
51 : class FmXGridCell;
52 :
53 124 : class FmMutexHelper
54 : {
55 : protected:
56 : ::osl::Mutex m_aMutex;
57 : };
58 :
59 :
60 : // DbGridColumn, Spaltenbeschreibung
61 :
62 : class DbGridColumn
63 : {
64 : friend class DbGridControl;
65 :
66 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xModel;
67 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xField; // Verbindung zum Datenbankfeld
68 : ::svt::CellControllerRef m_xController; // Struktur zum Verwalten der Controls fuer eine Spalte
69 : // diese wird von der DbBrowseBox auf die jeweiligen Zellen
70 : // einer Spalte positioniert
71 : FmXGridCell* m_pCell;
72 :
73 : protected:
74 : DbGridControl& m_rParent;
75 :
76 : private:
77 : sal_Int32 m_nLastVisibleWidth; // nur gueltig, wenn m_bHidden == sal_True
78 : sal_Int32 m_nFormatKey;
79 : sal_Int16 m_nFieldType;
80 : sal_Int16 m_nTypeId;
81 : sal_uInt16 m_nId;
82 : sal_Int16 m_nFieldPos;
83 : sal_Int16 m_nAlign; // wird mit TXT_ALIGN_LEFT .... angegeben
84 : bool m_bReadOnly : 1;
85 : bool m_bAutoValue : 1;
86 : bool m_bInSave : 1;
87 : bool m_bNumeric : 1;
88 : bool m_bObject : 1; // Verweist die Column auf ein Object Datentyp?
89 : bool m_bHidden : 1;
90 : bool m_bLocked : 1;
91 : bool m_bDateTime : 1;
92 :
93 : static ::svt::CellControllerRef s_xEmptyController;
94 : // used by locked columns
95 : public:
96 140 : DbGridColumn(sal_uInt16 _nId, DbGridControl& rParent)
97 : :m_pCell(NULL)
98 : ,m_rParent(rParent)
99 : ,m_nLastVisibleWidth(-1)
100 : ,m_nFormatKey(0)
101 : ,m_nFieldType(0)
102 : ,m_nTypeId(0)
103 : ,m_nId(_nId)
104 : ,m_nFieldPos(-1)
105 : ,m_nAlign(::com::sun::star::awt::TextAlign::LEFT)
106 : ,m_bReadOnly(false)
107 : ,m_bAutoValue(false)
108 : ,m_bInSave(false)
109 : ,m_bNumeric(false)
110 : ,m_bObject(false)
111 : ,m_bHidden(false)
112 : ,m_bLocked(false)
113 140 : ,m_bDateTime(false)
114 : {
115 140 : }
116 :
117 : ~DbGridColumn();
118 :
119 714 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& getModel() const { return m_xModel; }
120 : void setModel(::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _xModel);
121 :
122 :
123 11559 : sal_uInt16 GetId() const {return m_nId;}
124 62 : bool IsReadOnly() const {return m_bReadOnly;}
125 0 : bool IsAutoValue() const {return m_bAutoValue;}
126 : bool IsUpdating() const {return m_bInSave;}
127 108 : sal_Int16 GetAlignment() const {return m_nAlign;}
128 : sal_Int16 GetType() const {return m_nFieldType;}
129 0 : sal_Int16 GetFieldPos() const {return m_nFieldPos; }
130 132 : bool IsNumeric() const {return m_bNumeric;}
131 : bool IsDateTime() const {return m_bDateTime;}
132 : bool IsObject() const {return m_bObject;}
133 966 : bool IsHidden() const {return m_bHidden;}
134 0 : sal_Int32 GetKey() const {return m_nFormatKey;}
135 2 : const ::svt::CellControllerRef& GetController() const {return m_bLocked ? s_xEmptyController : m_xController;}
136 62 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& GetField() const {return m_xField;}
137 0 : DbGridControl& GetParent() const {return m_rParent;}
138 0 : FmXGridCell* GetCell() const {return m_pCell;}
139 :
140 : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn > GetCurrentFieldValue() const;
141 :
142 : // Zeichnen eines Feldes an einer Position, ist ein View gesetzt
143 : // uebernimmt dieser das Zeichnen, z.B. fuer CheckBoxen
144 : void Paint(OutputDevice& rDev,
145 : const Rectangle& rRect,
146 : const DbGridRow* pRow,
147 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
148 :
149 :
150 : // Inititialierung im alive mode
151 : // Ist kein ColumnController gesetzt, wird eine DefaultInitialisierung
152 : // vorgenommen
153 : void CreateControl(sal_Int32 _nFieldPos, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xField, sal_Int32 nTypeId);
154 0 : void UpdateControl()
155 : {
156 0 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xField(m_xField);
157 0 : CreateControl(m_nFieldPos, xField, m_nTypeId);
158 0 : }
159 :
160 : // Editieren einer Zelle
161 : void UpdateFromField(const DbGridRow* pRow, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
162 : bool Commit();
163 :
164 : // freigeben aller Daten, die fuer den AliveMode noetig sind
165 : void Clear();
166 :
167 : OUString GetCellText(const DbGridRow* pRow, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
168 : OUString GetCellText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
169 :
170 0 : void SetReadOnly(bool bRead){m_bReadOnly = bRead;}
171 0 : void SetObject(sal_Int16 nPos) {m_bObject = m_bReadOnly = true; m_nFieldPos = nPos;}
172 :
173 : void ImplInitWindow( vcl::Window& rParent, const InitWindowFacet _eInitWhat );
174 :
175 : // Properties, die auf den ::com::sun::star::frame::Controller durchschlagen koennen
176 : sal_Int16 SetAlignment(sal_Int16 _nAlign);
177 : // if _nAlign is -1, the alignment is calculated from the type of the field we are bound to
178 : // the value really set is returned
179 : sal_Int16 SetAlignmentFromModel(sal_Int16 nStandardAlign);
180 : // set the alignment according to the "Align"-property of m_xModel, use the given standard
181 : // alignment if the property if void, return the really set alignment
182 :
183 : // column locking
184 0 : bool isLocked() const { return m_bLocked; }
185 : void setLock(bool _bLock);
186 :
187 : private:
188 : /** attaches or detaches our cell object to the SctriptEventAttacherManager implemented
189 : by our model's parent
190 : */
191 : void impl_toggleScriptManager_nothrow( bool _bAttach );
192 : };
193 :
194 :
195 : // DbCellControl, liefert die Daten fuer einen CellController
196 : // wird in der Regel nur f\FCr komplexe Controls wie z.B ComboBoxen
197 : // benoetigt
198 :
199 : class DbCellControl
200 : :public FmMutexHelper // _before_ the listener, so the listener is to be destroyed first!
201 : ,public ::comphelper::OPropertyChangeListener
202 : {
203 : private:
204 : ::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster;
205 : ::comphelper::OPropertyChangeMultiplexer* m_pFieldChangeBroadcaster;
206 :
207 : private:
208 : bool m_bTransparent : 1;
209 : bool m_bAlignedController : 1;
210 : bool m_bAccessingValueProperty : 1;
211 :
212 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >
213 : m_xCursor;
214 :
215 : protected:
216 : DbGridColumn& m_rColumn;
217 : vcl::Window* m_pPainter;
218 : vcl::Window* m_pWindow;
219 :
220 : protected:
221 : // attribute access
222 0 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& getCursor() const { return m_xCursor; }
223 :
224 : // control transparency
225 248 : inline bool isTransparent( ) const { return m_bTransparent; }
226 0 : inline void setTransparent( bool _bSet ) { m_bTransparent = _bSet; }
227 :
228 : // control alignment
229 0 : inline void setAlignedController( bool _bAlign = true ) { m_bAlignedController = _bAlign; }
230 :
231 :
232 : /** determined whether or not the value property is locked
233 : @see lockValueProperty
234 : */
235 : inline bool isValuePropertyLocked() const;
236 :
237 : /** locks the listening at the value property.
238 : <p>This means that every subsequent change now done on the value property of the model ("Text", or "Value",
239 : or whatever) is then ignored.<br/>
240 : This base class uses this setting in <method>Commit</method>.</p>
241 : @precond
242 : Value locking can't be nested
243 : @see unlockValueProperty
244 : */
245 : inline void lockValueProperty();
246 : /** unlocks the listening at the value property
247 : @see lockValueProperty
248 : */
249 : inline void unlockValueProperty();
250 :
251 : protected:
252 : // adds the given property to the list of properties which we listen for
253 : void doPropertyListening( const OUString& _rPropertyName );
254 :
255 : // called whenever a property which affects field settings in general is called
256 : // you should overwrite this method for every property you add yourself as listener to
257 : // with doPropertyListening
258 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
259 :
260 : // called by _propertyChanged if a property which denotes the column value has changed
261 : void implValuePropertyChanged( );
262 :
263 :
264 : public:
265 : TYPEINFO();
266 : DbCellControl(DbGridColumn& _rColumn, bool _bText = true);
267 : virtual ~DbCellControl();
268 :
269 :
270 90 : vcl::Window& GetWindow() const
271 : {
272 90 : ENSURE_OR_THROW( m_pWindow, "no window" );
273 90 : return *m_pWindow;
274 : }
275 :
276 : // control alignment
277 62 : inline bool isAlignedController() const { return m_bAlignedController; }
278 : void AlignControl(sal_Int16 nAlignment);
279 :
280 : void SetTextLineColor();
281 : void SetTextLineColor(const Color& _rColor);
282 :
283 : // Initialisieren bevor ein Control angezeigt wird
284 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
285 : virtual ::svt::CellControllerRef CreateController() const = 0;
286 :
287 : // Schreiben des Wertes in das Model
288 : bool Commit();
289 :
290 : // Formatting the field data to output text
291 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) = 0;
292 :
293 0 : virtual void Update(){}
294 : // Refresh the control by the field data
295 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) = 0;
296 :
297 : // Painten eines Zellinhalts im vorgegeben Rechteck
298 : virtual void PaintFieldToCell( OutputDevice& rDev, const Rectangle& rRect, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
299 : virtual void PaintCell( OutputDevice& _rDev, const Rectangle& _rRect );
300 :
301 : void ImplInitWindow( vcl::Window& rParent, const InitWindowFacet _eInitWhat );
302 :
303 : double GetValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
304 :
305 : protected:
306 : void invalidatedController();
307 :
308 : /** commits the content of the control (e.g. the text of an edit field) into the column model
309 : (e.g. the "Text" property of the model).
310 : <p>To be overwritten in derived classes.</p>
311 : @see updateFromModel
312 : */
313 : virtual bool commitControl( ) = 0;
314 :
315 : /** updates the current content of the control (e.g. the text of an edit field) from the column model
316 : (e.g. the "Text" property of the model).
317 : <p>To be overwritten in derived classes.</p>
318 : @precond
319 : NULL != _rxModel
320 : @precond
321 : NULL != m_pWindow
322 :
323 : @see commitControl
324 : */
325 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) = 0;
326 :
327 : protected:
328 : // OPropertyChangeListener
329 : virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
330 :
331 : private:
332 : void implDoPropertyListening( const OUString& _rPropertyName, bool _bWarnIfNotExistent = true );
333 :
334 : /// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
335 : void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel,bool i_bReadOnly );
336 :
337 : /// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
338 : void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
339 : };
340 :
341 :
342 :
343 0 : inline bool DbCellControl::isValuePropertyLocked() const
344 : {
345 0 : return m_bAccessingValueProperty;
346 : }
347 :
348 :
349 0 : inline void DbCellControl::lockValueProperty()
350 : {
351 : OSL_ENSURE( !isValuePropertyLocked(), "DbCellControl::lockValueProperty: not to be nested!" );
352 0 : m_bAccessingValueProperty = true;
353 0 : }
354 :
355 :
356 0 : inline void DbCellControl::unlockValueProperty()
357 : {
358 : OSL_ENSURE( isValuePropertyLocked(), "DbCellControl::lockValueProperty: not locked so far!" );
359 0 : m_bAccessingValueProperty = false;
360 0 : }
361 :
362 :
363 : /** a field which is bound to a column which supports the MaxTextLen property
364 : */
365 62 : class DbLimitedLengthField : public DbCellControl
366 : {
367 : public:
368 : TYPEINFO_OVERRIDE();
369 :
370 : protected:
371 : DbLimitedLengthField( DbGridColumn& _rColumn );
372 :
373 : protected:
374 : // DbCellControl
375 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
376 :
377 : protected:
378 62 : void implSetMaxTextLen( sal_Int16 _nMaxLen )
379 : {
380 62 : implSetEffectiveMaxTextLen( _nMaxLen ? _nMaxLen : EDIT_NOLIMIT );
381 62 : }
382 : virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen );
383 : };
384 :
385 :
386 : class DbTextField : public DbLimitedLengthField
387 : {
388 : ::svt::IEditImplementation* m_pEdit;
389 : ::svt::IEditImplementation* m_pPainterImplementation;
390 : bool m_bIsSimpleEdit;
391 :
392 : protected:
393 : virtual ~DbTextField( );
394 :
395 : public:
396 : TYPEINFO_OVERRIDE();
397 : DbTextField(DbGridColumn& _rColumn);
398 :
399 34 : ::svt::IEditImplementation* GetEditImplementation() { return m_pEdit; }
400 34 : bool IsSimpleEdit() const { return m_bIsSimpleEdit; }
401 :
402 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
403 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
404 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
405 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
406 : virtual void PaintFieldToCell( OutputDevice& _rDev, const Rectangle& _rRect,
407 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
408 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter ) SAL_OVERRIDE;
409 :
410 : protected:
411 : // DbCellControl
412 : virtual bool commitControl( ) SAL_OVERRIDE;
413 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
414 : // DbLimitedLengthField
415 : virtual void implSetEffectiveMaxTextLen( sal_Int32 _nMaxLen ) SAL_OVERRIDE;
416 : };
417 :
418 :
419 : class DbFormattedField : public DbLimitedLengthField
420 : {
421 : protected:
422 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xSupplier;
423 : sal_Int16 m_nKeyType;
424 :
425 :
426 : public:
427 : TYPEINFO_OVERRIDE();
428 : DbFormattedField(DbGridColumn& _rColumn);
429 : virtual ~DbFormattedField();
430 :
431 :
432 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
433 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
434 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
435 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
436 :
437 : protected:
438 : // DbCellControl
439 : virtual bool commitControl( ) SAL_OVERRIDE;
440 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
441 :
442 : // OPropertyChangeListener
443 : virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
444 : };
445 :
446 :
447 0 : class DbCheckBox : public DbCellControl
448 : {
449 : public:
450 : TYPEINFO_OVERRIDE();
451 : DbCheckBox(DbGridColumn& _rColumn);
452 :
453 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
454 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
455 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
456 : virtual void PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect,
457 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
458 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
459 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
460 :
461 : protected:
462 : // DbCellControl
463 : virtual bool commitControl( ) SAL_OVERRIDE;
464 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
465 : };
466 :
467 :
468 0 : class DbComboBox : public DbCellControl
469 : {
470 : sal_Int16 m_nKeyType;
471 :
472 : public:
473 : TYPEINFO_OVERRIDE();
474 : DbComboBox(DbGridColumn& _rColumn);
475 :
476 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
477 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
478 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
479 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
480 :
481 : void SetList(const ::com::sun::star::uno::Any& rItems);
482 :
483 : protected:
484 : // DbCellControl
485 : virtual bool commitControl( ) SAL_OVERRIDE;
486 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
487 :
488 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
489 :
490 : // OPropertyChangeListener
491 : virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
492 : };
493 :
494 :
495 0 : class DbListBox :public DbCellControl
496 : {
497 : bool m_bBound : 1;
498 : ::com::sun::star::uno::Sequence< OUString > m_aValueList;
499 :
500 : public:
501 : TYPEINFO_OVERRIDE();
502 : DbListBox(DbGridColumn& _rColumn);
503 :
504 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
505 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
506 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
507 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
508 :
509 : void SetList(const ::com::sun::star::uno::Any& rItems);
510 :
511 : protected:
512 : // DbCellControl
513 : virtual bool commitControl( ) SAL_OVERRIDE;
514 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
515 :
516 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
517 :
518 : // OPropertyChangeListener
519 : virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
520 : };
521 :
522 :
523 0 : class DbPatternField : public DbCellControl
524 : {
525 : public:
526 : TYPEINFO_OVERRIDE();
527 : DbPatternField( DbGridColumn& _rColumn, const css::uno::Reference<css::uno::XComponentContext>& _rContext );
528 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
529 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
530 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
531 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
532 :
533 : protected:
534 : /// DbCellControl
535 : virtual bool commitControl( ) SAL_OVERRIDE;
536 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
537 :
538 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
539 :
540 : private:
541 : OUString impl_formatText(const OUString& _rText);
542 :
543 : private:
544 : ::std::unique_ptr< ::dbtools::FormattedColumnValue > m_pValueFormatter;
545 : ::std::unique_ptr< ::dbtools::FormattedColumnValue > m_pPaintFormatter;
546 : css::uno::Reference<css::uno::XComponentContext> m_xContext;
547 : };
548 :
549 :
550 0 : class DbSpinField : public DbCellControl
551 : {
552 : private:
553 : sal_Int16 m_nStandardAlign;
554 :
555 : public:
556 : TYPEINFO_OVERRIDE();
557 :
558 : protected:
559 : DbSpinField( DbGridColumn& _rColumn, sal_Int16 _nStandardAlign = com::sun::star::awt::TextAlign::RIGHT );
560 :
561 : public:
562 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxCursor ) SAL_OVERRIDE;
563 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
564 :
565 : protected:
566 : virtual SpinField* createField(
567 : vcl::Window* _pParent,
568 : WinBits _nFieldStyle,
569 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
570 : ) = 0;
571 : };
572 :
573 :
574 0 : class DbDateField : public DbSpinField
575 : {
576 : public:
577 : TYPEINFO_OVERRIDE();
578 : DbDateField(DbGridColumn& _rColumn);
579 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
580 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
581 :
582 : protected:
583 : // DbCellControl
584 : virtual bool commitControl( ) SAL_OVERRIDE;
585 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
586 :
587 : // DbSpinField
588 : virtual SpinField* createField(
589 : vcl::Window* _pParent,
590 : WinBits _nFieldStyle,
591 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
592 : ) SAL_OVERRIDE;
593 :
594 : /// initializes everything which relates to the properties describing the numeric behaviour
595 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
596 : };
597 :
598 :
599 0 : class DbTimeField : public DbSpinField
600 : {
601 : public:
602 : TYPEINFO_OVERRIDE();
603 : DbTimeField(DbGridColumn& _rColumn);
604 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
605 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
606 :
607 : protected:
608 : // DbCellControl
609 : virtual bool commitControl( ) SAL_OVERRIDE;
610 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
611 :
612 : // DbSpinField
613 : virtual SpinField* createField(
614 : vcl::Window* _pParent,
615 : WinBits _nFieldStyle,
616 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
617 : ) SAL_OVERRIDE;
618 :
619 : /// initializes everything which relates to the properties describing the numeric behaviour
620 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
621 : };
622 :
623 :
624 0 : class DbCurrencyField : public DbSpinField
625 : {
626 : sal_Int16 m_nScale;
627 :
628 : public:
629 : TYPEINFO_OVERRIDE();
630 : DbCurrencyField(DbGridColumn& _rColumn);
631 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
632 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
633 :
634 : double GetCurrency(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
635 :
636 : protected:
637 : // DbCellControl
638 : virtual bool commitControl( ) SAL_OVERRIDE;
639 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
640 :
641 : // DbSpinField
642 : virtual SpinField* createField(
643 : vcl::Window* _pParent,
644 : WinBits _nFieldStyle,
645 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
646 : ) SAL_OVERRIDE;
647 :
648 : /// initializes everything which relates to the properties describing the numeric behaviour
649 : virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
650 : };
651 :
652 :
653 0 : class DbNumericField : public DbSpinField
654 : {
655 : public:
656 : TYPEINFO_OVERRIDE();
657 : DbNumericField(DbGridColumn& _rColumn);
658 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
659 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
660 :
661 : protected:
662 : // DbCellControl
663 : virtual bool commitControl( ) SAL_OVERRIDE;
664 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
665 :
666 : // DbSpinField
667 : virtual SpinField* createField(
668 : vcl::Window* _pParent,
669 : WinBits _nFieldStyle,
670 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
671 : ) SAL_OVERRIDE;
672 :
673 : /// initializes everything which relates to the properties describing the numeric behaviour
674 : void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel ) SAL_OVERRIDE;
675 : };
676 :
677 :
678 : class DbFilterField
679 : :public DbCellControl
680 : ,public ::svxform::OSQLParserClient
681 : {
682 : ::com::sun::star::uno::Sequence< OUString > m_aValueList;
683 : OUString m_aText;
684 : Link m_aCommitLink;
685 : sal_Int16 m_nControlClass;
686 : bool m_bFilterList : 1;
687 : bool m_bFilterListFilled : 1;
688 : bool m_bBound : 1;
689 :
690 : public:
691 : TYPEINFO_OVERRIDE();
692 : DbFilterField(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, DbGridColumn& _rColumn);
693 : virtual ~DbFilterField();
694 :
695 : virtual void Init( vcl::Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor ) SAL_OVERRIDE;
696 : virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE;
697 : virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect) SAL_OVERRIDE;
698 : virtual void Update() SAL_OVERRIDE;
699 : virtual OUString GetFormatText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter, Color** ppColor = NULL) SAL_OVERRIDE;
700 : virtual void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
701 :
702 0 : const OUString& GetText() const {return m_aText;}
703 : void SetText(const OUString& rText);
704 :
705 0 : void SetCommitHdl( const Link& rLink ) { m_aCommitLink = rLink; }
706 : const Link& GetCommitHdl() const { return m_aCommitLink; }
707 :
708 : protected:
709 :
710 : // DbCellControl
711 : virtual bool commitControl( ) SAL_OVERRIDE;
712 : virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE;
713 :
714 : protected:
715 : void SetList(const ::com::sun::star::uno::Any& rItems, bool bComboBox);
716 : void CreateControl(vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xModel);
717 : DECL_LINK( OnClick, void* );
718 : };
719 :
720 :
721 : // Base class providing the access to a grid cell
722 :
723 : typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XControl
724 : , ::com::sun::star::form::XBoundControl
725 : > FmXGridCell_Base;
726 : typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XWindow
727 : > FmXGridCell_WindowBase;
728 : class FmXGridCell :public ::cppu::OComponentHelper
729 : ,public FmXGridCell_Base
730 : ,public FmXGridCell_WindowBase
731 : {
732 : protected:
733 : ::osl::Mutex m_aMutex;
734 : DbGridColumn* m_pColumn;
735 : DbCellControl* m_pCellControl;
736 :
737 : private:
738 : ::cppu::OInterfaceContainerHelper m_aWindowListeners;
739 : ::cppu::OInterfaceContainerHelper m_aFocusListeners;
740 : ::cppu::OInterfaceContainerHelper m_aKeyListeners;
741 : ::cppu::OInterfaceContainerHelper m_aMouseListeners;
742 : ::cppu::OInterfaceContainerHelper m_aMouseMotionListeners;
743 :
744 : protected:
745 : virtual ~FmXGridCell();
746 :
747 : public:
748 : TYPEINFO();
749 : FmXGridCell( DbGridColumn* pColumn, DbCellControl* pControl );
750 : void init();
751 :
752 2480 : DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell, OComponentHelper)
753 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
754 :
755 : void SetTextLineColor();
756 : void SetTextLineColor(const Color& _rColor);
757 :
758 : // XTypeProvider
759 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
760 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
761 :
762 : // OComponentHelper
763 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
764 :
765 : // ::com::sun::star::lang::XComponent
766 62 : virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {OComponentHelper::dispose();}
767 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener)throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { OComponentHelper::addEventListener(aListener);}
768 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener)throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { OComponentHelper::removeEventListener(aListener);}
769 :
770 : // ::com::sun::star::awt::XControl
771 0 : virtual void SAL_CALL setContext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& /*Context*/) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {}
772 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
773 0 : virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& /*Toolkit*/, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& /*Parent*/) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {}
774 :
775 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getPeer() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ();}
776 0 : virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& /*Model*/) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {return sal_False;}
777 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
778 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > SAL_CALL getView() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > ();}
779 0 : virtual void SAL_CALL setDesignMode(sal_Bool /*bOn*/) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {}
780 0 : virtual sal_Bool SAL_CALL isDesignMode() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {return sal_False;}
781 0 : virtual sal_Bool SAL_CALL isTransparent() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE {return sal_False;}
782 :
783 : // ::com::sun::star::form::XBoundControl
784 : virtual sal_Bool SAL_CALL getLock() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
785 : virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
786 :
787 : // XWindow
788 : virtual void SAL_CALL setPosSize( ::sal_Int32 X, ::sal_Int32 Y, ::sal_Int32 Width, ::sal_Int32 Height, ::sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
789 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
790 : virtual void SAL_CALL setVisible( sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
791 : virtual void SAL_CALL setEnable( sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
792 : virtual void SAL_CALL setFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
793 : virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
794 : virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
795 : virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
796 : virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
797 : virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
798 : virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
799 : virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
800 : virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
801 : virtual void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
802 : virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
803 : virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
804 : virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
805 :
806 0 : bool Commit() {return m_pCellControl->Commit();}
807 0 : void ImplInitWindow( vcl::Window& rParent, const InitWindowFacet _eInitWhat )
808 0 : { m_pCellControl->ImplInitWindow( rParent, _eInitWhat ); }
809 :
810 0 : bool isAlignedController() const { return m_pCellControl->isAlignedController(); }
811 0 : void AlignControl(sal_Int16 nAlignment)
812 0 : { m_pCellControl->AlignControl(nAlignment);}
813 :
814 : protected:
815 : virtual vcl::Window* getEventWindow() const;
816 : virtual void onWindowEvent( const sal_uLong _nEventId, const vcl::Window& _rWindow, const void* _pEventData );
817 :
818 : // default implementations call our focus listeners, don't forget to call them if you override this
819 : virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent );
820 : virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent );
821 :
822 : private:
823 : DECL_LINK( OnWindowEvent, VclWindowEvent* );
824 : };
825 :
826 :
827 62 : class FmXDataCell : public FmXGridCell
828 : {
829 : public:
830 : TYPEINFO_OVERRIDE();
831 62 : FmXDataCell( DbGridColumn* pColumn, DbCellControl& _rControl )
832 62 : :FmXGridCell( pColumn, &_rControl )
833 : {
834 62 : }
835 :
836 : virtual void PaintFieldToCell(OutputDevice& rDev,
837 : const Rectangle& rRect,
838 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
839 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
840 :
841 2 : void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
842 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter)
843 2 : { m_pCellControl->UpdateFromField(xField, xFormatter); }
844 :
845 : protected:
846 : void UpdateFromColumn();
847 : };
848 :
849 :
850 62 : class FmXTextCell : public FmXDataCell
851 : {
852 : protected:
853 : /** determines whether the text of this cell can be painted directly, without
854 : using the painter control
855 :
856 : If this is <TRUE/>, the <member>PaintCell</member> method will simply use the text as returned
857 : by <member>GetText</member>, and draw it onto the device passed to <member>PaintFieldToCell</member>,
858 : while respecting the current alignment settings.
859 :
860 : If this is <FALSE/>, the <member>PaintFieldToCell</member> request will be forwarded to the painter
861 : control (<member>m_pPainter</member>). This is more expensive, but the only option
862 : if your painting involves more that a simple DrawText.
863 :
864 : This member is <TRUE/> by default, and can be modified by derived classes.
865 : */
866 : bool m_bFastPaint;
867 :
868 : public:
869 : TYPEINFO_OVERRIDE();
870 : FmXTextCell( DbGridColumn* pColumn, DbCellControl& _rControl );
871 :
872 : virtual void PaintFieldToCell(OutputDevice& rDev,
873 : const Rectangle& rRect,
874 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
875 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) SAL_OVERRIDE;
876 :
877 46 : OUString GetText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
878 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter,
879 : Color** ppColor = NULL)
880 46 : {return m_pCellControl->GetFormatText(_rxField, xFormatter, ppColor);}
881 : };
882 :
883 :
884 : typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent
885 : , ::com::sun::star::form::XChangeBroadcaster
886 : > FmXEditCell_Base;
887 : class FmXEditCell : public FmXTextCell,
888 : public FmXEditCell_Base
889 : {
890 : private:
891 : OUString m_sValueOnEnter;
892 :
893 : protected:
894 : ::cppu::OInterfaceContainerHelper m_aTextListeners;
895 : ::cppu::OInterfaceContainerHelper m_aChangeListeners;
896 : ::svt::IEditImplementation* m_pEditImplementation;
897 : bool m_bOwnEditImplementation;
898 :
899 : virtual ~FmXEditCell();
900 : public:
901 : FmXEditCell( DbGridColumn* pColumn, DbCellControl& _rControl );
902 :
903 2480 : DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell, FmXTextCell)
904 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
905 :
906 : // XTypeProvider
907 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
908 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
909 :
910 : // OComponentHelper
911 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
912 :
913 : // ::com::sun::star::awt::XTextComponent
914 : virtual void SAL_CALL addTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
915 : virtual void SAL_CALL removeTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
916 : virtual void SAL_CALL setText(const OUString& aText) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
917 : virtual void SAL_CALL insertText(const ::com::sun::star::awt::Selection& Sel, const OUString& Text) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
918 : virtual OUString SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
919 : virtual OUString SAL_CALL getSelectedText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
920 : virtual void SAL_CALL setSelection(const ::com::sun::star::awt::Selection& aSelection) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
921 : virtual ::com::sun::star::awt::Selection SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
922 : virtual sal_Bool SAL_CALL isEditable() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
923 : virtual void SAL_CALL setEditable(sal_Bool bEditable) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
924 : virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
925 : virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
926 :
927 : // XChangeBroadcaster
928 : virtual void SAL_CALL addChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
929 : virtual void SAL_CALL removeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XChangeListener >& aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
930 :
931 : protected:
932 : virtual void onWindowEvent( const sal_uLong _nEventId, const vcl::Window& _rWindow, const void* _pEventData ) SAL_OVERRIDE;
933 :
934 : virtual void onFocusGained( const ::com::sun::star::awt::FocusEvent& _rEvent ) SAL_OVERRIDE;
935 : virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent ) SAL_OVERRIDE;
936 :
937 : private:
938 : void onTextChanged();
939 : };
940 :
941 :
942 : typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XCheckBox
943 : , ::com::sun::star::awt::XButton
944 : > FmXCheckBoxCell_Base;
945 : class FmXCheckBoxCell : public FmXDataCell,
946 : public FmXCheckBoxCell_Base
947 : {
948 : ::cppu::OInterfaceContainerHelper m_aItemListeners;
949 : ::cppu::OInterfaceContainerHelper m_aActionListeners;
950 : OUString m_aActionCommand;
951 : CheckBox* m_pBox;
952 :
953 : protected:
954 : virtual ~FmXCheckBoxCell();
955 :
956 : public:
957 : FmXCheckBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
958 :
959 : // UNO
960 0 : DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell, FmXDataCell)
961 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
962 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
963 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
964 :
965 : // OComponentHelper
966 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
967 :
968 : // ::com::sun::star::awt::XCheckBox
969 : virtual void SAL_CALL addItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
970 : virtual void SAL_CALL removeItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
971 : virtual sal_Int16 SAL_CALL getState() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
972 : virtual void SAL_CALL setState(sal_Int16 n) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
973 : virtual void SAL_CALL setLabel(const OUString& Label) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
974 : virtual void SAL_CALL enableTriState(sal_Bool b) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
975 :
976 : // XButton
977 : virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
978 : virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
979 : //virtual void SAL_CALL setLabel( const OUString& Label ) throw (::com::sun::star::uno::RuntimeException);
980 : virtual void SAL_CALL setActionCommand( const OUString& Command ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
981 :
982 : protected:
983 : virtual vcl::Window* getEventWindow() const SAL_OVERRIDE;
984 : virtual void onWindowEvent( const sal_uLong _nEventId, const vcl::Window& _rWindow, const void* _pEventData ) SAL_OVERRIDE;
985 : };
986 :
987 :
988 : typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XListBox
989 : > FmXListBoxCell_Base;
990 : class FmXListBoxCell :public FmXTextCell
991 : ,public FmXListBoxCell_Base
992 : {
993 : ::cppu::OInterfaceContainerHelper m_aItemListeners,
994 : m_aActionListeners;
995 : ListBox* m_pBox;
996 :
997 : protected:
998 : virtual ~FmXListBoxCell();
999 :
1000 : public:
1001 : FmXListBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
1002 :
1003 0 : DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell)
1004 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1005 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1006 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1007 :
1008 : // OComponentHelper
1009 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
1010 :
1011 : // ::com::sun::star::awt::XListBox
1012 : virtual void SAL_CALL addItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1013 : virtual void SAL_CALL removeItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1014 : virtual void SAL_CALL addActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1015 : virtual void SAL_CALL removeActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1016 : virtual void SAL_CALL addItem(const OUString& aItem, sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1017 : virtual void SAL_CALL addItems(const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1018 : virtual void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1019 : virtual sal_Int16 SAL_CALL getItemCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1020 : virtual OUString SAL_CALL getItem(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1021 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1022 : virtual sal_Int16 SAL_CALL getSelectedItemPos() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1023 : virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1024 : virtual OUString SAL_CALL getSelectedItem() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1025 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedItems() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1026 : virtual void SAL_CALL SAL_CALL selectItemPos(sal_Int16 nPos, sal_Bool bSelect) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1027 : virtual void SAL_CALL SAL_CALL selectItemsPos(const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1028 : virtual void SAL_CALL SAL_CALL selectItem(const OUString& aItem, sal_Bool bSelect) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1029 : virtual sal_Bool SAL_CALL isMutipleMode() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1030 : virtual void SAL_CALL SAL_CALL setMultipleMode(sal_Bool bMulti) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1031 : virtual sal_Int16 SAL_CALL getDropDownLineCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1032 : virtual void SAL_CALL SAL_CALL setDropDownLineCount(sal_Int16 nLines) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1033 : virtual void SAL_CALL SAL_CALL makeVisible(sal_Int16 nEntry) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1034 :
1035 : protected:
1036 : virtual void onWindowEvent( const sal_uLong _nEventId, const vcl::Window& _rWindow, const void* _pEventData ) SAL_OVERRIDE;
1037 :
1038 : DECL_LINK( OnDoubleClick, void* );
1039 : };
1040 :
1041 :
1042 : typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XComboBox
1043 : > FmXComboBoxCell_Base;
1044 : class FmXComboBoxCell :public FmXTextCell
1045 : ,public FmXComboBoxCell_Base
1046 : {
1047 : private:
1048 : ::cppu::OInterfaceContainerHelper m_aItemListeners,
1049 : m_aActionListeners;
1050 : ComboBox* m_pComboBox;
1051 :
1052 : protected:
1053 : virtual ~FmXComboBoxCell();
1054 :
1055 : public:
1056 : FmXComboBoxCell( DbGridColumn* pColumn, DbCellControl& _rControl );
1057 :
1058 0 : DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell)
1059 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1060 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1061 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1062 :
1063 : // OComponentHelper
1064 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
1065 :
1066 : // XComboBox
1067 : virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1068 : virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1069 : virtual void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1070 : virtual void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& _Listener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1071 : virtual void SAL_CALL addItem( const OUString& _Item, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1072 : virtual void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& _Items, ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1073 : virtual void SAL_CALL removeItems( ::sal_Int16 nPos, ::sal_Int16 nCount ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1074 : virtual ::sal_Int16 SAL_CALL getItemCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1075 : virtual OUString SAL_CALL getItem( ::sal_Int16 _Pos ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1076 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1077 : virtual ::sal_Int16 SAL_CALL getDropDownLineCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1078 : virtual void SAL_CALL setDropDownLineCount( ::sal_Int16 _Lines ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1079 :
1080 : protected:
1081 : virtual void onWindowEvent( const sal_uLong _nEventId, const vcl::Window& _rWindow, const void* _pEventData ) SAL_OVERRIDE;
1082 : };
1083 :
1084 :
1085 : typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XTextComponent
1086 : , ::com::sun::star::lang::XUnoTunnel
1087 : > FmXFilterCell_Base;
1088 : class FmXFilterCell :public FmXGridCell
1089 : ,public FmXFilterCell_Base
1090 : {
1091 : ::cppu::OInterfaceContainerHelper m_aTextListeners;
1092 : protected:
1093 : virtual ~FmXFilterCell();
1094 : public:
1095 : TYPEINFO_OVERRIDE();
1096 : FmXFilterCell(DbGridColumn* pColumn = NULL, DbCellControl* pControl = NULL);
1097 :
1098 :
1099 0 : DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell, FmXGridCell)
1100 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1101 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1102 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1103 :
1104 : // XUnoTunnel
1105 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1106 :
1107 : // helpers for XUnoTunnel
1108 : static const ::com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
1109 :
1110 : // painting the filter text
1111 : virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect);
1112 0 : void Update(){m_pCellControl->Update();}
1113 :
1114 : // OComponentHelper
1115 : virtual void SAL_CALL disposing() SAL_OVERRIDE;
1116 :
1117 : // ::com::sun::star::awt::XTextComponent
1118 : virtual void SAL_CALL addTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1119 : virtual void SAL_CALL removeTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1120 : virtual void SAL_CALL setText(const OUString& aText) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1121 : virtual void SAL_CALL insertText(const ::com::sun::star::awt::Selection& Sel, const OUString& Text) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1122 : virtual OUString SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1123 : virtual OUString SAL_CALL getSelectedText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1124 : virtual void SAL_CALL setSelection(const ::com::sun::star::awt::Selection& aSelection) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1125 : virtual ::com::sun::star::awt::Selection SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1126 : virtual sal_Bool SAL_CALL isEditable() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1127 : virtual void SAL_CALL setEditable(sal_Bool bEditable) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1128 : virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1129 : virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1130 :
1131 : protected:
1132 : DECL_LINK( OnCommit, void* );
1133 : };
1134 :
1135 : #endif // INCLUDED_SVX_SOURCE_INC_GRIDCELL_HXX
1136 :
1137 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|