2001-03-16 09:22:00 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 09:56:16 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2005-09-08 09:56:16 -05:00
|
|
|
* $RCSfile: indexfieldscontrol.hxx,v $
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2007-07-06 02:30:39 -05:00
|
|
|
* $Revision: 1.10 $
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2007-07-06 02:30:39 -05:00
|
|
|
* last change: $Author: rt $ $Date: 2007-07-06 08:30:39 $
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2005-09-08 09:56:16 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 09:56:16 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2005-09-08 09:56:16 -05: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.
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2005-09-08 09:56:16 -05: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.
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
2005-09-08 09:56:16 -05: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
|
2001-03-16 09:22:00 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DBAUI_INDEXFIELDSCONTROL_HXX_
|
|
|
|
#define _DBAUI_INDEXFIELDSCONTROL_HXX_
|
|
|
|
|
2007-07-06 02:30:39 -05:00
|
|
|
#ifndef _DBAUI_MODULE_DBU_HXX_
|
|
|
|
#include "moduledbu.hxx"
|
|
|
|
#endif
|
2001-06-29 02:45:10 -05:00
|
|
|
#ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
|
|
|
|
#include <svtools/editbrowsebox.hxx>
|
2001-03-16 09:22:00 -06:00
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_INDEXCOLLECTION_HXX_
|
|
|
|
#include "indexcollection.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//......................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//......................................................................
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
// IndexFieldsControl
|
|
|
|
//==================================================================
|
2001-06-29 02:45:10 -05:00
|
|
|
class IndexFieldsControl : public ::svt::EditBrowseBox
|
2001-03-16 09:22:00 -06:00
|
|
|
{
|
2007-07-06 02:30:39 -05:00
|
|
|
OModuleClient m_aModuleClient;
|
2001-03-16 09:22:00 -06:00
|
|
|
protected:
|
|
|
|
IndexFields m_aSavedValue;
|
|
|
|
|
|
|
|
IndexFields m_aFields; // !! order matters !!
|
|
|
|
ConstIndexFieldsIterator m_aSeekRow; // !!
|
|
|
|
|
2001-03-30 07:12:19 -06:00
|
|
|
Link m_aModifyHdl;
|
|
|
|
|
2001-06-29 02:45:10 -05:00
|
|
|
::svt::ListBoxControl* m_pSortingCell;
|
|
|
|
::svt::ListBoxControl* m_pFieldNameCell;
|
2001-03-16 09:22:00 -06:00
|
|
|
|
|
|
|
String m_sAscendingText;
|
|
|
|
String m_sDescendingText;
|
|
|
|
|
2001-03-30 07:12:19 -06:00
|
|
|
sal_Int32 m_nMaxColumnsInIndex;
|
2001-03-16 09:22:00 -06:00
|
|
|
|
|
|
|
public:
|
2001-03-30 07:12:19 -06:00
|
|
|
IndexFieldsControl( Window* _pParent, const ResId& _rId ,sal_Int32 _nMaxColumnsInIndex);
|
2001-03-16 09:22:00 -06:00
|
|
|
~IndexFieldsControl();
|
|
|
|
|
|
|
|
void Init(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rAvailableFields);
|
|
|
|
|
|
|
|
void initializeFrom(const IndexFields& _rFields);
|
|
|
|
void commitTo(IndexFields& _rFields);
|
|
|
|
|
|
|
|
sal_Bool SaveModified();
|
2001-05-02 05:47:20 -05:00
|
|
|
sal_Bool IsModified() const;
|
2001-03-16 09:22:00 -06:00
|
|
|
|
|
|
|
const IndexFields& GetSavedValue() const { return m_aSavedValue; }
|
|
|
|
void SaveValue() { m_aSavedValue = m_aFields; }
|
|
|
|
|
|
|
|
void SetModifyHdl(const Link& _rHdl) { m_aModifyHdl = _rHdl; }
|
|
|
|
Link GetModifyHdl() const { return m_aModifyHdl; }
|
2002-04-09 01:47:27 -05:00
|
|
|
virtual String GetCellText(long _nRow,sal_uInt16 nColId) const;
|
2001-03-16 09:22:00 -06:00
|
|
|
|
|
|
|
protected:
|
2001-06-29 02:45:10 -05:00
|
|
|
// EditBrowseBox overridables
|
2001-03-16 09:22:00 -06:00
|
|
|
virtual void PaintCell( OutputDevice& _rDev, const Rectangle& _rRect, sal_uInt16 _nColumnId ) const;
|
|
|
|
virtual sal_Bool SeekRow(long nRow);
|
|
|
|
virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId);
|
2002-03-19 00:21:30 -06:00
|
|
|
virtual sal_Bool IsTabAllowed(sal_Bool bForward) const;
|
2001-03-16 09:22:00 -06:00
|
|
|
|
2001-06-29 02:45:10 -05:00
|
|
|
::svt::CellController* GetController(long _nRow, sal_uInt16 _nColumnId);
|
|
|
|
void InitController(::svt::CellControllerRef&, long _nRow, sal_uInt16 _nColumnId);
|
2001-03-16 09:22:00 -06:00
|
|
|
|
|
|
|
protected:
|
2002-04-09 01:47:27 -05:00
|
|
|
String GetRowCellText(const ConstIndexFieldsIterator& _rRow,sal_uInt16 nColId) const;
|
2001-03-16 09:22:00 -06:00
|
|
|
sal_Bool implGetFieldDesc(long _nRow, ConstIndexFieldsIterator& _rPos);
|
|
|
|
|
|
|
|
sal_Bool isNewField() const { return GetCurRow() >= (sal_Int32)m_aFields.size(); }
|
|
|
|
|
|
|
|
DECL_LINK( OnListEntrySelected, ListBox* );
|
2006-06-19 21:17:52 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
using ::svt::EditBrowseBox::Init;
|
2001-03-16 09:22:00 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
//......................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//......................................................................
|
|
|
|
|
|
|
|
#endif // _DBAUI_INDEXFIELDSCONTROL_HXX_
|
|
|
|
|