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