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