2009-08-26 13:11:27 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2009-08-26 13:11:27 +00:00
|
|
|
*
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
|
|
*
|
|
|
|
* This file is part of OpenOffice.org.
|
|
|
|
*
|
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2011-01-16 20:59:30 +01:00
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
#include <com/sun/star/awt/grid/XGridColumn.hpp>
|
|
|
|
#include <com/sun/star/lang/XEventListener.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
2011-01-16 20:59:30 +01:00
|
|
|
#include <com/sun/star/style/HorizontalAlignment.hpp>
|
|
|
|
|
2010-12-07 13:50:47 +01:00
|
|
|
#include <cppuhelper/basemutex.hxx>
|
2011-01-16 20:59:30 +01:00
|
|
|
#include <cppuhelper/compbase3.hxx>
|
|
|
|
#include <comphelper/componentguard.hxx>
|
2009-08-26 13:11:27 +00:00
|
|
|
#include <rtl/ref.hxx>
|
|
|
|
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
|
2011-01-16 20:59:30 +01:00
|
|
|
|
|
|
|
#include <vector>
|
2009-08-26 13:11:27 +00:00
|
|
|
|
|
|
|
namespace toolkit
|
|
|
|
{
|
|
|
|
|
2011-01-10 15:48:16 +01:00
|
|
|
typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::awt::grid::XGridColumn
|
2010-12-07 13:50:47 +01:00
|
|
|
, ::com::sun::star::lang::XServiceInfo
|
2011-01-10 15:48:16 +01:00
|
|
|
, ::com::sun::star::lang::XUnoTunnel
|
2010-12-07 13:50:47 +01:00
|
|
|
> GridColumn_Base;
|
|
|
|
class GridColumn :public ::cppu::BaseMutex
|
|
|
|
,public GridColumn_Base
|
2009-08-26 13:11:27 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GridColumn();
|
2011-01-03 23:14:55 +01:00
|
|
|
GridColumn( GridColumn const & i_copySource );
|
2009-08-26 13:11:27 +00:00
|
|
|
virtual ~GridColumn();
|
|
|
|
|
2010-12-07 13:50:47 +01:00
|
|
|
// ::com::sun::star::awt::grid::XGridColumn
|
2009-08-26 13:11:27 +00:00
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Int32 SAL_CALL getColumnWidth() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setColumnWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
|
2010-02-12 17:05:02 +01:00
|
|
|
virtual ::sal_Int32 SAL_CALL getPreferredWidth() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setPreferredWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Int32 SAL_CALL getMaxWidth() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setMaxWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Int32 SAL_CALL getMinWidth() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setMinWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Bool SAL_CALL getResizeable() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setResizeable(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
|
2009-08-26 13:11:27 +00:00
|
|
|
virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
|
2011-01-11 11:42:27 +01:00
|
|
|
virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setHelpText(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException);
|
2011-01-10 15:48:16 +01:00
|
|
|
virtual ::sal_Int32 SAL_CALL getIndex() throw (::com::sun::star::uno::RuntimeException);
|
2010-02-12 17:05:02 +01:00
|
|
|
virtual ::com::sun::star::style::HorizontalAlignment SAL_CALL getHorizontalAlign() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setHorizontalAlign(::com::sun::star::style::HorizontalAlignment align) throw (::com::sun::star::uno::RuntimeException);
|
2010-12-17 14:25:50 +01:00
|
|
|
virtual void SAL_CALL addGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeGridColumnListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::grid::XGridColumnListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
|
2010-12-07 13:50:47 +01:00
|
|
|
|
2011-01-16 20:59:30 +01:00
|
|
|
// OComponentHelper
|
|
|
|
virtual void SAL_CALL disposing();
|
2009-08-26 13:11:27 +00:00
|
|
|
|
2011-01-03 23:14:55 +01:00
|
|
|
// XCloneable (base of XGridColumn)
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
// XServiceInfo
|
2010-12-07 13:50:47 +01:00
|
|
|
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
|
2009-08-26 13:11:27 +00:00
|
|
|
|
2011-01-10 15:48:16 +01:00
|
|
|
// XUnoTunnel and friends
|
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& i_identifier ) throw(::com::sun::star::uno::RuntimeException);
|
|
|
|
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelId() throw();
|
|
|
|
static GridColumn* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_component );
|
|
|
|
|
|
|
|
// attribute access
|
|
|
|
void setIndex( sal_Int32 const i_index );
|
|
|
|
|
2009-08-26 13:11:27 +00:00
|
|
|
private:
|
2010-12-17 14:07:29 +01:00
|
|
|
void broadcast_changed(
|
2011-01-11 11:42:27 +01:00
|
|
|
sal_Char const * const i_asciiAttributeName,
|
2011-01-05 12:16:37 +01:00
|
|
|
::com::sun::star::uno::Any i_oldValue,
|
|
|
|
::com::sun::star::uno::Any i_newValue,
|
2011-01-16 20:59:30 +01:00
|
|
|
::comphelper::ComponentGuard& i_Guard
|
2010-12-17 14:07:29 +01:00
|
|
|
);
|
2010-03-22 11:17:10 +01:00
|
|
|
|
2011-01-11 11:42:27 +01:00
|
|
|
template< class TYPE >
|
|
|
|
void impl_set( TYPE & io_attribute, TYPE const & i_newValue, sal_Char const * i_attributeName )
|
|
|
|
{
|
2011-01-16 20:59:30 +01:00
|
|
|
::comphelper::ComponentGuard aGuard( *this, rBHelper );
|
2011-01-11 11:42:27 +01:00
|
|
|
if ( io_attribute == i_newValue )
|
|
|
|
return;
|
|
|
|
|
|
|
|
TYPE const aOldValue( io_attribute );
|
|
|
|
io_attribute = i_newValue;
|
|
|
|
broadcast_changed( i_attributeName, ::com::sun::star::uno::makeAny( aOldValue ), ::com::sun::star::uno::makeAny( io_attribute ), aGuard );
|
|
|
|
}
|
|
|
|
|
2010-12-07 13:50:47 +01:00
|
|
|
::com::sun::star::uno::Any m_aIdentifier;
|
|
|
|
sal_Int32 m_nIndex;
|
|
|
|
sal_Int32 m_nColumnWidth;
|
|
|
|
sal_Int32 m_nPreferredWidth;
|
|
|
|
sal_Int32 m_nMaxWidth;
|
|
|
|
sal_Int32 m_nMinWidth;
|
|
|
|
sal_Bool m_bResizeable;
|
|
|
|
::rtl::OUString m_sTitle;
|
2011-01-11 11:42:27 +01:00
|
|
|
::rtl::OUString m_sHelpText;
|
2010-12-07 13:50:47 +01:00
|
|
|
::com::sun::star::style::HorizontalAlignment m_eHorizontalAlign;
|
2009-08-26 13:11:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|