2000-09-18 16:07:07 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* $RCSfile: gridcell.hxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2006-08-28 14:02:57 +00:00
|
|
|
|
* $Revision: 1.18 $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2006-08-28 14:02:57 +00:00
|
|
|
|
* last change: $Author: ihi $ $Date: 2006-08-28 15:02:57 $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
|
* =============================================
|
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-08 22:23:29 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _SVX_GRIDCELL_HXX
|
|
|
|
|
#define _SVX_GRIDCELL_HXX
|
|
|
|
|
|
|
|
|
|
#ifndef _SVX_GRIDCTRL_HXX
|
|
|
|
|
#include "gridctrl.hxx"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _SVX_FMTOOLS_HXX
|
|
|
|
|
#include "fmtools.hxx"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _CPPUHELPER_COMPONENT_HXX_
|
|
|
|
|
#include <cppuhelper/component.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_SDB_XCOLUMN_HPP_
|
|
|
|
|
#include <com/sun/star/sdb/XColumn.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_FORM_XBOUNDCONTROL_HPP_
|
|
|
|
|
#include <com/sun/star/form/XBoundControl.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_XTEXTCOMPONENT_HPP_
|
|
|
|
|
#include <com/sun/star/awt/XTextComponent.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_XLISTBOX_HPP_
|
|
|
|
|
#include <com/sun/star/awt/XListBox.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_TEXTALIGN_HPP_
|
|
|
|
|
#include <com/sun/star/awt/TextAlign.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_XCONTROLMODEL_HPP_
|
|
|
|
|
#include <com/sun/star/awt/XControlModel.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_XCONTROL_HPP_
|
|
|
|
|
#include <com/sun/star/awt/XControl.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_AWT_XCHECKBOX_HPP_
|
|
|
|
|
#include <com/sun/star/awt/XCheckBox.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
|
|
|
|
|
#include <com/sun/star/beans/XFastPropertySet.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
|
|
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
|
|
|
|
#endif
|
2000-10-20 13:13:45 +00:00
|
|
|
|
#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
|
|
|
|
|
#include <comphelper/propmultiplex.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#endif
|
2001-07-25 12:44:28 +00:00
|
|
|
|
#ifndef SVX_SQLPARSERCLIENT_HXX
|
|
|
|
|
#include "sqlparserclient.hxx"
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SVX_TYPECONVERSION_CLIENT_HXX
|
|
|
|
|
#include "typeconversionclient.hxx"
|
2000-11-03 13:56:25 +00:00
|
|
|
|
#endif
|
2002-04-03 15:34:40 +00:00
|
|
|
|
#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
|
|
|
|
|
#include <comphelper/propmultiplex.hxx>
|
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
#ifndef _RTTI_HXX
|
|
|
|
|
#include <tools/rtti.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
class DbCellControl;
|
|
|
|
|
class Edit;
|
|
|
|
|
class FmXGridCell;
|
|
|
|
|
|
2001-03-29 12:39:32 +00:00
|
|
|
|
//==================================================================
|
|
|
|
|
// FmMutexHelper
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmMutexHelper
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
|
};
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
//==================================================================
|
|
|
|
|
// DbGridColumn, Spaltenbeschreibung
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbGridColumn
|
|
|
|
|
{
|
|
|
|
|
friend class DbGridControl;
|
|
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xModel;
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xField; // Verbindung zum Datenbankfeld
|
2001-06-29 07:45:10 +00:00
|
|
|
|
::svt::CellControllerRef m_xController; // Struktur zum Verwalten der Controls fuer eine Spalte
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// diese wird von der DbBrowseBox auf die jeweiligen Zellen
|
|
|
|
|
// einer Spalte positioniert
|
2002-04-03 15:34:40 +00:00
|
|
|
|
FmXGridCell* m_pCell;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
DbGridControl& m_rParent;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
sal_Int32 m_nLastVisibleWidth; // nur gueltig, wenn m_bHidden == sal_True
|
|
|
|
|
sal_Int32 m_nFormatKey;
|
|
|
|
|
sal_Int16 m_nFieldType;
|
|
|
|
|
sal_Int16 m_nTypeId;
|
|
|
|
|
sal_uInt16 m_nId;
|
|
|
|
|
sal_Int16 m_nFieldPos;
|
|
|
|
|
sal_Int16 m_nAlign; // wird mit TXT_ALIGN_LEFT .... angegeben
|
|
|
|
|
sal_Bool m_bReadOnly : 1;
|
|
|
|
|
sal_Bool m_bAutoValue : 1;
|
|
|
|
|
sal_Bool m_bInSave : 1;
|
|
|
|
|
sal_Bool m_bNumeric : 1;
|
|
|
|
|
sal_Bool m_bObject : 1; // Verweist die Column auf ein Object Datentyp?
|
|
|
|
|
sal_Bool m_bHidden : 1;
|
|
|
|
|
sal_Bool m_bLocked : 1;
|
|
|
|
|
sal_Bool m_bDateTime : 1;
|
|
|
|
|
|
2001-06-29 07:45:10 +00:00
|
|
|
|
static ::svt::CellControllerRef s_xEmptyController;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// used by locked columns
|
|
|
|
|
public:
|
|
|
|
|
DbGridColumn(sal_uInt16 _nId, DbGridControl& rParent)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
:m_pCell(NULL)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
,m_rParent(rParent)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
,m_nLastVisibleWidth(-1)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
,m_nFormatKey(0)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
,m_nFieldType(0)
|
|
|
|
|
,m_nTypeId(0)
|
|
|
|
|
,m_nId(_nId)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
,m_nFieldPos(-1)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
,m_nAlign(::com::sun::star::awt::TextAlign::LEFT)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
,m_bReadOnly(sal_False)
|
|
|
|
|
,m_bAutoValue(sal_False)
|
|
|
|
|
,m_bInSave(sal_False)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
,m_bNumeric(sal_False)
|
|
|
|
|
,m_bObject(sal_False)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
,m_bHidden(sal_False)
|
2002-04-03 15:34:40 +00:00
|
|
|
|
,m_bLocked(sal_False)
|
2006-06-19 15:08:05 +00:00
|
|
|
|
,m_bDateTime(sal_False)
|
2002-04-03 15:34:40 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
~DbGridColumn();
|
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& getModel() const { return m_xModel; }
|
2006-08-28 14:02:57 +00:00
|
|
|
|
void setModel(::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _xModel);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_uInt16 GetId() const {return m_nId;}
|
|
|
|
|
sal_Bool IsReadOnly() const {return m_bReadOnly;}
|
|
|
|
|
sal_Bool IsAutoValue() const {return m_bAutoValue;}
|
|
|
|
|
sal_Bool IsUpdating() const {return m_bInSave;}
|
|
|
|
|
sal_Int16 GetAlignment() const {return m_nAlign;}
|
|
|
|
|
sal_Int16 GetType() const {return m_nFieldType;}
|
|
|
|
|
sal_Int16 GetFieldPos() const {return m_nFieldPos; }
|
|
|
|
|
sal_Bool IsNumeric() const {return m_bNumeric;}
|
|
|
|
|
sal_Bool IsDateTime() const {return m_bDateTime;}
|
|
|
|
|
sal_Bool IsObject() const {return m_bObject;}
|
|
|
|
|
sal_Bool IsHidden() const {return m_bHidden;}
|
|
|
|
|
sal_Int32 GetKey() const {return m_nFormatKey;}
|
2001-06-29 07:45:10 +00:00
|
|
|
|
const ::svt::CellControllerRef& GetController() const {return m_bLocked ? s_xEmptyController : m_xController;}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& GetField() const {return m_xField;}
|
|
|
|
|
DbGridControl& GetParent() const {return m_rParent;}
|
|
|
|
|
FmXGridCell* GetCell() const {return m_pCell;}
|
|
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn > GetCurrentFieldValue() const;
|
|
|
|
|
|
|
|
|
|
// Zeichnen eines Feldes an einer Position, ist ein ::com::sun::star::sdbcx::View gesetzt
|
|
|
|
|
// uebernimmt dieser das Zeichnen, z.B. fuer CheckBoxen
|
|
|
|
|
void Paint(OutputDevice& rDev,
|
|
|
|
|
const Rectangle& rRect,
|
|
|
|
|
const DbGridRow* pRow,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Inititialierung im alive mode
|
|
|
|
|
// Ist kein ColumnController gesetzt, wird eine DefaultInitialisierung
|
|
|
|
|
// vorgenommen
|
|
|
|
|
void CreateControl(sal_Int32 _nFieldPos, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xField, sal_Int32 nTypeId);
|
|
|
|
|
void UpdateControl()
|
|
|
|
|
{
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xField(m_xField);
|
|
|
|
|
CreateControl(m_nFieldPos, xField, m_nTypeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Editieren einer Zelle
|
|
|
|
|
void UpdateFromField(const DbGridRow* pRow, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
|
|
|
|
|
sal_Bool Commit();
|
|
|
|
|
|
|
|
|
|
// freigeben aller Daten, die fuer den AliveMode noetig sind
|
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
|
|
XubString GetCellText(const DbGridRow* pRow, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
void SetReadOnly(sal_Bool bRead){m_bReadOnly = bRead;}
|
|
|
|
|
void SetObject(sal_Int16 nPos) {m_bObject = m_bReadOnly = sal_True; m_nFieldPos = nPos;}
|
|
|
|
|
void ImplInitSettings(Window* pParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground);
|
|
|
|
|
|
|
|
|
|
// Properties, die auf den ::com::sun::star::frame::Controller durchschlagen koennen
|
|
|
|
|
sal_Int16 SetAlignment(sal_Int16 _nAlign);
|
|
|
|
|
// if _nAlign is -1, the alignment is calculated from the type of the field we are bound to
|
|
|
|
|
// the value really set is returned
|
|
|
|
|
sal_Int16 SetAlignmentFromModel(sal_Int16 nStandardAlign);
|
|
|
|
|
// set the alignment according to the "Align"-property of m_xModel, use the given standard
|
|
|
|
|
// alignment if the property if void, return the really set alignment
|
|
|
|
|
|
|
|
|
|
// column locking
|
|
|
|
|
sal_Bool isLocked() const { return m_bLocked; }
|
|
|
|
|
void setLock(sal_Bool _bLock);
|
2006-08-28 14:02:57 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/** attaches or detaches our cell object to the SctriptEventAttacherManager implemented
|
|
|
|
|
by our model's parent
|
|
|
|
|
*/
|
|
|
|
|
void impl_toggleScriptManager_nothrow( bool _bAttach );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
// DbCellControl, liefert die Daten fuer einen CellController
|
|
|
|
|
// wird in der Regel nur f<>r komplexe Controls wie z.B ComboBoxen
|
|
|
|
|
// benoetigt
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbCellControl
|
2001-07-25 12:44:28 +00:00
|
|
|
|
:public ::svxform::OTypeConversionClient
|
|
|
|
|
,public ::svxform::OStaticDataAccessTools
|
2002-04-03 15:34:40 +00:00
|
|
|
|
,public FmMutexHelper // _before_ the listener, so the listener is to be destroyed first!
|
|
|
|
|
,public ::comphelper::OPropertyChangeListener
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2002-04-03 15:34:40 +00:00
|
|
|
|
private:
|
|
|
|
|
::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
sal_Bool m_bTransparent : 1;
|
|
|
|
|
sal_Bool m_bAlignedController : 1;
|
|
|
|
|
sal_Bool m_bAccessingValueProperty : 1;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
DbGridColumn& m_rColumn;
|
|
|
|
|
Window* m_pPainter;
|
|
|
|
|
Window* m_pWindow;
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
protected:
|
2002-04-03 15:34:40 +00:00
|
|
|
|
// control transparency
|
|
|
|
|
inline sal_Bool isTransparent( ) const { return m_bTransparent; }
|
|
|
|
|
inline void setTransparent( sal_Bool _bSet ) { m_bTransparent = _bSet; }
|
|
|
|
|
|
|
|
|
|
// control alignment
|
|
|
|
|
inline void setAlignedController( sal_Bool _bAlign = sal_True ) { m_bAlignedController = _bAlign; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** determined whether or not the value property is locked
|
|
|
|
|
@see lockValueProperty
|
|
|
|
|
*/
|
|
|
|
|
inline sal_Bool isValuePropertyLocked() const;
|
|
|
|
|
|
|
|
|
|
/** locks the listening at the value property.
|
|
|
|
|
<p>This means that every subsequent change now done on the value property of the model ("Text", or "Value",
|
|
|
|
|
or whatever) is then ignored.<br/>
|
|
|
|
|
This base class uses this setting in <method>Commit</method>.</p>
|
|
|
|
|
@precond
|
|
|
|
|
Value locking can't be nested
|
|
|
|
|
@see unlockValueProperty
|
|
|
|
|
*/
|
|
|
|
|
inline void lockValueProperty();
|
|
|
|
|
/** unlocks the listening at the value property
|
|
|
|
|
@see lockValueProperty
|
|
|
|
|
*/
|
|
|
|
|
inline void unlockValueProperty();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// adds the given property to the list of properties which we listen for
|
|
|
|
|
void doPropertyListening( const ::rtl::OUString& _rPropertyName );
|
|
|
|
|
|
|
|
|
|
// called whenever a property which affects field settings in general is called
|
|
|
|
|
// you should overwrite this method for every property you add yourself as listener to
|
|
|
|
|
// with doPropertyListening
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
|
|
|
|
|
// called by _propertyChanged if a property which denotes the column value has changed
|
2003-05-19 11:52:21 +00:00
|
|
|
|
void implValuePropertyChanged( );
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbCellControl(DbGridColumn& _rColumn, sal_Bool _bText = sal_True);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual ~DbCellControl();
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
Window* GetControl() const { return m_pWindow; }
|
|
|
|
|
|
|
|
|
|
// control alignment
|
|
|
|
|
inline sal_Bool isAlignedController() const { return m_bAlignedController; }
|
|
|
|
|
void AlignControl(sal_Int16 nAlignment);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-06-11 10:45:16 +00:00
|
|
|
|
void SetTextLineColor();
|
|
|
|
|
void SetTextLineColor(const Color& _rColor);
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// Initialisieren bevor ein Control angezeigt wird
|
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Schreiben des Wertes in das Model
|
2002-04-03 15:34:40 +00:00
|
|
|
|
sal_Bool Commit();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Formatting the field data to output text
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
virtual void Update(){}
|
|
|
|
|
// Refresh the control by the field data
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Painten eines Zellinhalts im vorgegeben Rechteck
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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);
|
|
|
|
|
virtual void PaintCell( OutputDevice& _rDev, const Rectangle& _rRect );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void ImplInitSettings(Window* pParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground);
|
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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;
|
2001-05-14 11:08:04 +00:00
|
|
|
|
|
2006-03-29 11:29:55 +00:00
|
|
|
|
protected:
|
2002-04-03 15:34:40 +00:00
|
|
|
|
void invalidatedController();
|
|
|
|
|
|
|
|
|
|
/** commits the content of the control (e.g. the text of an edit field) into the column model
|
|
|
|
|
(e.g. the "Text" property of the model).
|
|
|
|
|
<p>To be overwritten in derived classes.</p>
|
|
|
|
|
@see updateFromModel
|
|
|
|
|
*/
|
|
|
|
|
virtual sal_Bool commitControl( ) = 0;
|
|
|
|
|
|
|
|
|
|
/** updates the current content of the control (e.g. the text of an edit field) from the column model
|
|
|
|
|
(e.g. the "Text" property of the model).
|
|
|
|
|
<p>To be overwritten in derived classes.</p>
|
|
|
|
|
@precond
|
|
|
|
|
NULL != _rxModel
|
|
|
|
|
@precond
|
|
|
|
|
NULL != m_pWindow
|
|
|
|
|
|
|
|
|
|
@see commitControl
|
|
|
|
|
*/
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) = 0;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// OPropertyChangeListener
|
|
|
|
|
virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void implDoPropertyListening( const ::rtl::OUString& _rPropertyName, sal_Bool _bWarnIfNotExistent = sal_True );
|
|
|
|
|
|
|
|
|
|
/// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
|
|
|
|
|
void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
|
|
|
|
|
/// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
|
|
|
|
|
void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
inline sal_Bool DbCellControl::isValuePropertyLocked() const
|
|
|
|
|
{
|
|
|
|
|
return m_bAccessingValueProperty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
inline void DbCellControl::lockValueProperty()
|
|
|
|
|
{
|
|
|
|
|
OSL_ENSURE( !isValuePropertyLocked(), "DbCellControl::lockValueProperty: not to be nested!" );
|
|
|
|
|
m_bAccessingValueProperty = sal_True;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
inline void DbCellControl::unlockValueProperty()
|
|
|
|
|
{
|
|
|
|
|
OSL_ENSURE( isValuePropertyLocked(), "DbCellControl::lockValueProperty: not locked so far!" );
|
|
|
|
|
m_bAccessingValueProperty = sal_False;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
/** a field which is bound to a column which supports the MaxTextLen property
|
|
|
|
|
*/
|
|
|
|
|
class DbLimitedLengthField : public DbCellControl
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2004-05-10 12:15:41 +00:00
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
protected:
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbLimitedLengthField( DbGridColumn& _rColumn );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbTextField : public DbLimitedLengthField
|
|
|
|
|
{
|
2004-05-10 12:15:41 +00:00
|
|
|
|
::svt::IEditImplementation* m_pEdit;
|
|
|
|
|
::svt::IEditImplementation* m_pPainterImplementation;
|
2005-02-17 09:58:49 +00:00
|
|
|
|
sal_Int16 m_nKeyType;
|
|
|
|
|
sal_Bool m_bIsSimpleEdit;
|
2004-05-10 12:15:41 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
~DbTextField( );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbTextField(DbGridColumn& _rColumn);
|
2004-05-10 12:15:41 +00:00
|
|
|
|
|
|
|
|
|
::svt::IEditImplementation* GetEditImplementation() { return m_pEdit; }
|
2005-02-17 09:58:49 +00:00
|
|
|
|
sal_Bool IsSimpleEdit() const { return m_bIsSimpleEdit; }
|
2004-05-10 12:15:41 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintFieldToCell( OutputDevice& _rDev, const Rectangle& _rRect,
|
2004-05-10 12:15:41 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
2002-04-03 15:34:40 +00:00
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbFormattedField : public DbLimitedLengthField
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2002-04-03 15:34:40 +00:00
|
|
|
|
protected:
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xSupplier;
|
|
|
|
|
sal_Int16 m_nKeyType;
|
|
|
|
|
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbFormattedField(DbGridColumn& _rColumn);
|
|
|
|
|
virtual ~DbFormattedField();
|
|
|
|
|
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
// OPropertyChangeListener
|
|
|
|
|
virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbCheckBox : public DbCellControl
|
|
|
|
|
{
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbCheckBox(DbGridColumn& _rColumn);
|
2006-06-19 15:08:05 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect,
|
2004-05-10 12:15:41 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
|
2000-09-18 16:07:07 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbComboBox : public DbCellControl
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
sal_Int16 m_nKeyType;
|
|
|
|
|
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
DbComboBox(DbGridColumn& _rColumn);
|
|
|
|
|
|
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void SetList(const ::com::sun::star::uno::Any& rItems);
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
|
|
|
|
|
// OPropertyChangeListener
|
|
|
|
|
virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2001-03-29 12:39:32 +00:00
|
|
|
|
class DbListBox :public DbCellControl
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
sal_Bool m_bBound : 1;
|
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aValueList;
|
|
|
|
|
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
DbListBox(DbGridColumn& _rColumn);
|
|
|
|
|
|
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
void SetList(const ::com::sun::star::uno::Any& rItems);
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
|
|
|
|
|
// OPropertyChangeListener
|
|
|
|
|
virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbPatternField : public DbCellControl
|
|
|
|
|
{
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbPatternField(DbGridColumn& _rColumn);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
/// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class DbSpinField : public DbCellControl
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
sal_Int16 m_nStandardAlign;
|
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
protected:
|
|
|
|
|
DbSpinField( DbGridColumn& _rColumn, sal_Int16 _nStandardAlign = com::sun::star::awt::TextAlign::RIGHT );
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void Init( Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxCursor );
|
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual SpinField* createField(
|
|
|
|
|
Window* _pParent,
|
|
|
|
|
WinBits _nFieldStyle,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
|
|
|
|
|
) = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbDateField : public DbSpinField
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbDateField(DbGridColumn& _rColumn);
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
// DbSpinField
|
|
|
|
|
virtual SpinField* createField(
|
|
|
|
|
Window* _pParent,
|
|
|
|
|
WinBits _nFieldStyle,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// initializes everything which relates to the properties describing the numeric behaviour
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbTimeField : public DbSpinField
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbTimeField(DbGridColumn& _rColumn);
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
// DbSpinField
|
|
|
|
|
virtual SpinField* createField(
|
|
|
|
|
Window* _pParent,
|
|
|
|
|
WinBits _nFieldStyle,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// initializes everything which relates to the properties describing the numeric behaviour
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbCurrencyField : public DbSpinField
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
sal_Int16 m_nScale;
|
|
|
|
|
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbCurrencyField(DbGridColumn& _rColumn);
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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;
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
// DbSpinField
|
|
|
|
|
virtual SpinField* createField(
|
|
|
|
|
Window* _pParent,
|
|
|
|
|
WinBits _nFieldStyle,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// initializes everything which relates to the properties describing the numeric behaviour
|
|
|
|
|
virtual void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2002-04-03 15:34:40 +00:00
|
|
|
|
class DbNumericField : public DbSpinField
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2002-04-03 15:34:40 +00:00
|
|
|
|
DbNumericField(DbGridColumn& _rColumn);
|
2004-05-10 12:15:41 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2002-04-03 15:34:40 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
|
|
|
|
// DbSpinField
|
|
|
|
|
virtual SpinField* createField(
|
|
|
|
|
Window* _pParent,
|
|
|
|
|
WinBits _nFieldStyle,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
/// initializes everything which relates to the properties describing the numeric behaviour
|
|
|
|
|
void implAdjustGenericFieldSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
2001-07-25 12:44:28 +00:00
|
|
|
|
class DbFilterField
|
|
|
|
|
:public DbCellControl
|
|
|
|
|
,public ::svxform::OSQLParserClient
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-07-25 12:44:28 +00:00
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > m_aValueList;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
XubString m_aText;
|
|
|
|
|
Link m_aCommitLink;
|
|
|
|
|
sal_Int16 m_nControlClass;
|
|
|
|
|
sal_Bool m_bFilterList : 1;
|
|
|
|
|
sal_Bool m_bFilterListFilled : 1;
|
|
|
|
|
sal_Bool m_bBound : 1;
|
|
|
|
|
|
|
|
|
|
public:
|
2004-05-10 12:15:41 +00:00
|
|
|
|
TYPEINFO();
|
2000-11-03 13:56:25 +00:00
|
|
|
|
DbFilterField(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,DbGridColumn& _rColumn);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual ~DbFilterField();
|
|
|
|
|
|
|
|
|
|
virtual void Init(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor);
|
2001-06-29 07:45:10 +00:00
|
|
|
|
virtual ::svt::CellControllerRef CreateController() const;
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual void Update();
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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);
|
|
|
|
|
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);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
const XubString& GetText() const {return m_aText;}
|
|
|
|
|
void SetText(const XubString& rText);
|
|
|
|
|
|
|
|
|
|
void SetCommitHdl( const Link& rLink ) { m_aCommitLink = rLink; }
|
|
|
|
|
const Link& GetCommitHdl() const { return m_aCommitLink; }
|
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
protected:
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
// DbCellControl
|
|
|
|
|
virtual sal_Bool commitControl( );
|
|
|
|
|
virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel );
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
protected:
|
|
|
|
|
void SetList(const ::com::sun::star::uno::Any& rItems, sal_Bool bComboBox);
|
|
|
|
|
void CreateControl(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xModel);
|
|
|
|
|
DECL_LINK( OnClick, void* );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
// Base class providing the access to a grid cell
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXGridCell : public ::cppu::OComponentHelper,
|
|
|
|
|
public ::com::sun::star::awt::XControl,
|
|
|
|
|
public ::com::sun::star::form::XBoundControl
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
|
DbGridColumn* m_pColumn;
|
|
|
|
|
DbCellControl* m_pCellControl;
|
|
|
|
|
|
2003-05-19 11:52:21 +00:00
|
|
|
|
virtual ~FmXGridCell();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
|
|
|
|
FmXGridCell(DbGridColumn* pColumn, DbCellControl* pControl);
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
DECLARE_UNO3_AGG_DEFAULTS(FmXGridCell, OComponentHelper);
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
2001-06-11 10:45:16 +00:00
|
|
|
|
void SetTextLineColor();
|
|
|
|
|
void SetTextLineColor(const Color& _rColor);
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
// XTypeProvider
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// OComponentHelper
|
|
|
|
|
virtual void SAL_CALL disposing();
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::lang::XComponent
|
|
|
|
|
virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException){OComponentHelper::dispose();}
|
|
|
|
|
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);}
|
|
|
|
|
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);}
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::awt::XControl
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void SAL_CALL setContext(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& /*Context*/) throw(::com::sun::star::uno::RuntimeException){}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext() throw(::com::sun::star::uno::RuntimeException);
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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){}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-09-12 15:26:26 +00:00
|
|
|
|
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 > ();}
|
2006-06-19 15:08:05 +00:00
|
|
|
|
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;}
|
2001-09-12 15:26:26 +00:00
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
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 > ();}
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void SAL_CALL setDesignMode(sal_Bool /*bOn*/) throw (::com::sun::star::uno::RuntimeException) {}
|
2001-09-12 15:26:26 +00:00
|
|
|
|
virtual sal_Bool SAL_CALL isDesignMode() throw (::com::sun::star::uno::RuntimeException) {return sal_False;}
|
|
|
|
|
virtual sal_Bool SAL_CALL isTransparent() throw (::com::sun::star::uno::RuntimeException) {return sal_False;}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// ::com::sun::star::form::XBoundControl
|
|
|
|
|
virtual sal_Bool SAL_CALL getLock() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
sal_Bool Commit() {return m_pCellControl->Commit();}
|
|
|
|
|
void ImplInitSettings(Window* pParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground)
|
|
|
|
|
{ m_pCellControl->ImplInitSettings(pParent, bFont, bForeground, bBackground); }
|
|
|
|
|
|
2002-04-03 15:34:40 +00:00
|
|
|
|
sal_Bool isAlignedController() const { return m_pCellControl->isAlignedController(); }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
void AlignControl(sal_Int16 nAlignment)
|
|
|
|
|
{ m_pCellControl->AlignControl(nAlignment);}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXDataCell : public FmXGridCell
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
|
|
|
|
FmXDataCell(DbGridColumn* pColumn, DbCellControl* pControl):FmXGridCell(pColumn, pControl){}
|
|
|
|
|
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintFieldToCell(OutputDevice& rDev,
|
2000-09-18 16:07:07 +00:00
|
|
|
|
const Rectangle& rRect,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
|
|
|
|
|
|
|
|
|
|
void UpdateFromField(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter)
|
|
|
|
|
{ m_pCellControl->UpdateFromField(xField, xFormatter); }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void UpdateFromColumn();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXTextCell : public FmXDataCell
|
|
|
|
|
{
|
2005-02-17 09:58:49 +00:00
|
|
|
|
protected:
|
|
|
|
|
/** determines whether the text of this cell can be painted directly, without
|
|
|
|
|
using the painter control
|
|
|
|
|
|
2006-06-19 15:08:05 +00:00
|
|
|
|
If this is <TRUE/>, the <member>PaintCell</member> method will simply use the text as returned
|
|
|
|
|
by <member>GetText</member>, and draw it onto the device passed to <member>PaintFieldToCell</member>,
|
2005-02-17 09:58:49 +00:00
|
|
|
|
while respecting the current alignment settings.
|
|
|
|
|
|
2006-06-19 15:08:05 +00:00
|
|
|
|
If this is <FALSE/>, the <member>PaintFieldToCell</member> request will be forwarded to the painter
|
2005-02-17 09:58:49 +00:00
|
|
|
|
control (<member>m_pPainter</member>). This is more expensive, but the only option
|
|
|
|
|
if your painting involves more that a simple DrawText.
|
|
|
|
|
|
|
|
|
|
This member is <TRUE/> by default, and can be modified by derived classes.
|
|
|
|
|
*/
|
|
|
|
|
sal_Bool m_bFastPaint;
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
2005-02-17 09:58:49 +00:00
|
|
|
|
FmXTextCell( DbGridColumn* pColumn, DbCellControl* pControl )
|
|
|
|
|
:FmXDataCell( pColumn, pControl )
|
2005-03-18 09:02:17 +00:00
|
|
|
|
,m_bFastPaint( sal_True )
|
2005-02-17 09:58:49 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintFieldToCell(OutputDevice& rDev,
|
2000-09-18 16:07:07 +00:00
|
|
|
|
const Rectangle& rRect,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& xField,
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
|
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
XubString GetText(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField,
|
2000-09-18 16:07:07 +00:00
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter,
|
|
|
|
|
Color** ppColor = NULL)
|
2004-05-10 12:15:41 +00:00
|
|
|
|
{return m_pCellControl->GetFormatText(_rxField, xFormatter, ppColor);}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXEditCell : public FmXTextCell,
|
|
|
|
|
public ::com::sun::star::awt::XTextComponent
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
::cppu::OInterfaceContainerHelper m_aTextListeners;
|
2004-05-10 12:15:41 +00:00
|
|
|
|
::svt::IEditImplementation* m_pEditImplementation;
|
|
|
|
|
bool m_bOwnEditImplementation;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2003-05-19 11:52:21 +00:00
|
|
|
|
virtual ~FmXEditCell();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
FmXEditCell(DbGridColumn* pColumn, DbCellControl* pControl);
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
DECLARE_UNO3_AGG_DEFAULTS(FmXEditCell, FmXTextCell);
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// XTypeProvider
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// OComponentHelper
|
|
|
|
|
virtual void SAL_CALL disposing();
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::awt::XTextComponent
|
|
|
|
|
virtual void SAL_CALL addTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setText(const ::rtl::OUString& aText) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL insertText(const ::com::sun::star::awt::Selection& Sel, const ::rtl::OUString& Text) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getSelectedText() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setSelection(const ::com::sun::star::awt::Selection& aSelection) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::awt::Selection SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Bool SAL_CALL isEditable() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setEditable(sal_Bool bEditable) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
DECL_LINK( OnTextChanged, void* );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXCheckBoxCell : public FmXDataCell,
|
|
|
|
|
public ::com::sun::star::awt::XCheckBox
|
|
|
|
|
{
|
|
|
|
|
::cppu::OInterfaceContainerHelper m_aItemListeners;
|
|
|
|
|
CheckBox* m_pBox;
|
2003-05-19 11:52:21 +00:00
|
|
|
|
protected:
|
|
|
|
|
virtual ~FmXCheckBoxCell();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
FmXCheckBoxCell(DbGridColumn* pColumn, DbCellControl* pControl);
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// UNO
|
|
|
|
|
DECLARE_UNO3_AGG_DEFAULTS(FmXCheckBoxCell, FmXDataCell);
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// OComponentHelper
|
|
|
|
|
virtual void SAL_CALL disposing();
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::awt::XCheckBox
|
|
|
|
|
virtual void SAL_CALL addItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getState() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setState(sal_Int16 n) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL enableTriState(sal_Bool b) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
DECL_LINK( OnClick, void* );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXListBoxCell : public FmXTextCell,
|
|
|
|
|
public ::com::sun::star::awt::XListBox
|
|
|
|
|
{
|
|
|
|
|
::cppu::OInterfaceContainerHelper m_aItemListeners,
|
|
|
|
|
m_aActionListeners;
|
|
|
|
|
ListBox* m_pBox;
|
2003-05-19 11:52:21 +00:00
|
|
|
|
protected:
|
|
|
|
|
virtual ~FmXListBoxCell();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
FmXListBoxCell(DbGridColumn* pColumn, DbCellControl* pControl);
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
DECLARE_UNO3_AGG_DEFAULTS(FmXListBoxCell, FmXTextCell);
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// OComponentHelper
|
|
|
|
|
virtual void SAL_CALL disposing();
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::awt::XListBox
|
|
|
|
|
virtual void SAL_CALL addItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeItemListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL addActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL addItem(const ::rtl::OUString& aItem, sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL addItems(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aItems, sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeItems(sal_Int16 nPos, sal_Int16 nCount) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getItemCount() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getItem(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getSelectedItemPos() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getSelectedItem() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedItems() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL SAL_CALL selectItemPos(sal_Int16 nPos, sal_Bool bSelect) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
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);
|
|
|
|
|
virtual void SAL_CALL SAL_CALL selectItem(const ::rtl::OUString& aItem, sal_Bool bSelect) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Bool SAL_CALL isMutipleMode() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL SAL_CALL setMultipleMode(sal_Bool bMulti) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getDropDownLineCount() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL SAL_CALL setDropDownLineCount(sal_Int16 nLines) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL SAL_CALL makeVisible(sal_Int16 nEntry) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
protected:
|
2006-08-28 14:02:57 +00:00
|
|
|
|
DECL_LINK( OnSelect, VclWindowEvent* );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
DECL_LINK( OnDoubleClick, void* );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
class FmXFilterCell :public FmXGridCell
|
|
|
|
|
,public ::com::sun::star::awt::XTextComponent
|
|
|
|
|
,public ::com::sun::star::lang::XUnoTunnel
|
|
|
|
|
{
|
|
|
|
|
::cppu::OInterfaceContainerHelper m_aTextListeners;
|
2003-05-19 11:52:21 +00:00
|
|
|
|
protected:
|
|
|
|
|
virtual ~FmXFilterCell();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
public:
|
|
|
|
|
TYPEINFO();
|
|
|
|
|
FmXFilterCell(DbGridColumn* pColumn = NULL, DbCellControl* pControl = NULL);
|
2003-05-19 11:52:21 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
DECLARE_UNO3_AGG_DEFAULTS(FmXFilterCell, FmXGridCell);
|
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// XUnoTunnel
|
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
// helpers for XUnoTunnel
|
|
|
|
|
static const ::com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
|
|
|
|
|
static FmXFilterCell* getImplementation(
|
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxObject);
|
|
|
|
|
|
2004-05-10 12:15:41 +00:00
|
|
|
|
// painting the filter text
|
2006-06-19 15:08:05 +00:00
|
|
|
|
virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
void Update(){m_pCellControl->Update();}
|
|
|
|
|
|
|
|
|
|
// OComponentHelper
|
|
|
|
|
virtual void SAL_CALL disposing();
|
|
|
|
|
|
|
|
|
|
// ::com::sun::star::awt::XTextComponent
|
|
|
|
|
virtual void SAL_CALL addTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL removeTextListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setText(const ::rtl::OUString& aText) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL insertText(const ::com::sun::star::awt::Selection& Sel, const ::rtl::OUString& Text) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getText() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::rtl::OUString SAL_CALL getSelectedText() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setSelection(const ::com::sun::star::awt::Selection& aSelection) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual ::com::sun::star::awt::Selection SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Bool SAL_CALL isEditable() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setEditable(sal_Bool bEditable) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual void SAL_CALL setMaxTextLen(sal_Int16 nLen) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
virtual sal_Int16 SAL_CALL getMaxTextLen() throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
DECL_LINK( OnCommit, void* );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // _SVX_GRIDCELL_HXX
|
|
|
|
|
|