Kaydet (Commit) 595e1c2e authored tarafından Frank Schoenheit [fs]'s avatar Frank Schoenheit [fs]

#i68332# use css.form.runtime.FormFeature, instead of SFX slot IDs (where possible so far)

üst a7b054e6
......@@ -509,7 +509,7 @@ IMPL_LINK( OButtonControl, OnClick, void*, EMPTYARG )
void OButtonControl::actionPerformed_Impl( sal_Bool _bNotifyListener, const ::com::sun::star::awt::MouseEvent& _rEvt )
{
{
sal_Int32 nFeatureId = -1;
sal_Int16 nFeatureId = -1;
{
::osl::MutexGuard aGuard( m_aMutex );
nFeatureId = m_nTargetUrlFeatureId;
......@@ -636,7 +636,7 @@ sal_Bool SAL_CALL OButtonControl::setModel( const Reference< XControlModel >& _r
//------------------------------------------------------------------------------
void OButtonControl::modelFeatureUrlPotentiallyChanged( )
{
sal_Int32 nOldUrlFeatureId = m_nTargetUrlFeatureId;
sal_Int16 nOldUrlFeatureId = m_nTargetUrlFeatureId;
// doe we have another TargetURL now? If so, we need to update our dispatches
m_nTargetUrlFeatureId = getModelUrlFeatureId( );
......@@ -675,9 +675,9 @@ namespace
}
//------------------------------------------------------------------------------
sal_Int32 OButtonControl::getModelUrlFeatureId( ) const
sal_Int16 OButtonControl::getModelUrlFeatureId( ) const
{
sal_Int32 nFeatureId = -1;
sal_Int16 nFeatureId = -1;
// some URL related properties of the model
::rtl::OUString sUrl;
......@@ -717,14 +717,14 @@ void SAL_CALL OButtonControl::setDesignMode( sal_Bool _bOn ) throw( RuntimeExcep
}
//------------------------------------------------------------------------------
void OButtonControl::getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds )
void OButtonControl::getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds )
{
if ( -1 != m_nTargetUrlFeatureId )
_rFeatureIds.push_back( m_nTargetUrlFeatureId );
}
//------------------------------------------------------------------
void OButtonControl::featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled )
void OButtonControl::featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled )
{
if ( _nFeatureId == m_nTargetUrlFeatureId )
{
......@@ -754,7 +754,7 @@ void OButtonControl::allFeatureStatesChanged( )
}
//------------------------------------------------------------------
bool OButtonControl::isEnabled( sal_Int32 _nFeatureId ) const
bool OButtonControl::isEnabled( sal_Int16 _nFeatureId ) const
{
if ( const_cast< OButtonControl* >( this )->isDesignMode() )
// TODO: the model property?
......
......@@ -131,7 +131,7 @@ class OButtonControl :public OButtonControl_BASE
{
private:
sal_uInt32 m_nClickEvent;
sal_Int32 m_nTargetUrlFeatureId;
sal_Int16 m_nTargetUrlFeatureId;
/// caches the value of the "Enabled" property of our model
sal_Bool m_bEnabledByPropertyValue;
......@@ -176,10 +176,10 @@ public:
protected:
// OFormNavigationHelper overriables
virtual void getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds );
virtual void featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled );
virtual void getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds );
virtual void featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled );
virtual void allFeatureStatesChanged( );
virtual bool isEnabled( sal_Int32 _nFeatureId ) const;
virtual bool isEnabled( sal_Int16 _nFeatureId ) const;
// XDispatchProviderInterception disambiguaiton
virtual void SAL_CALL registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException);
......@@ -198,7 +198,7 @@ private:
/** retrieves the feature id (see OFormNavigationHelper) of the TargetURL of
the model.
*/
sal_Int32 getModelUrlFeatureId( ) const;
sal_Int16 getModelUrlFeatureId( ) const;
/** starts or stops listening for changes in model properties we're interested in
*/
......
......@@ -49,7 +49,7 @@ namespace frm
@param _nFeatureId
the id of the feature to dispatch
*/
virtual void dispatch( sal_Int32 _nFeatureId ) const = 0;
virtual void dispatch( sal_Int16 _nFeatureId ) const = 0;
/** dispatches a feature, with an additional named parameter
......@@ -63,14 +63,14 @@ namespace frm
the value of the parameter of the dispatch call
*/
virtual void dispatchWithArgument(
sal_Int32 _nFeatureId,
sal_Int16 _nFeatureId,
const sal_Char* _pParamName,
const ::com::sun::star::uno::Any& _rParamValue
) const = 0;
/** checks whether a given feature is enabled
*/
virtual bool isEnabled( sal_Int32 _nFeatureId ) const = 0;
virtual bool isEnabled( sal_Int16 _nFeatureId ) const = 0;
/** returns the boolean state of a feature
......@@ -81,7 +81,7 @@ namespace frm
This method allows retrieving status information about features which have an additional
boolean information associated with it.
*/
virtual bool getBooleanState( sal_Int32 _nFeatureId ) const = 0;
virtual bool getBooleanState( sal_Int16 _nFeatureId ) const = 0;
/** returns the string state of a feature
......@@ -92,7 +92,7 @@ namespace frm
This method allows retrieving status information about features which have an additional
string information associated with it.
*/
virtual ::rtl::OUString getStringState( sal_Int32 _nFeatureId ) const = 0;
virtual ::rtl::OUString getStringState( sal_Int16 _nFeatureId ) const = 0;
/** returns the integer state of a feature
......@@ -103,7 +103,7 @@ namespace frm
This method allows retrieving status information about features which have an additional
integer information associated with it.
*/
virtual sal_Int32 getIntegerState( sal_Int32 _nFeatureId ) const = 0;
virtual sal_Int32 getIntegerState( sal_Int16 _nFeatureId ) const = 0;
};
//.........................................................................
......
......@@ -71,7 +71,7 @@ namespace frm
FeatureInfo() : bCachedState( sal_False ) { }
};
typedef ::std::map< sal_Int32, FeatureInfo > FeatureMap;
typedef ::std::map< sal_Int16, FeatureInfo > FeatureMap;
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
......@@ -106,12 +106,12 @@ namespace frm
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
// IFeatureDispatcher
virtual void dispatch( sal_Int32 _nFeatureId ) const;
virtual void dispatchWithArgument( sal_Int32 _nFeatureId, const sal_Char* _pParamName, const ::com::sun::star::uno::Any& _rParamValue ) const;
virtual bool isEnabled( sal_Int32 _nFeatureId ) const;
virtual bool getBooleanState( sal_Int32 _nFeatureId ) const;
virtual ::rtl::OUString getStringState( sal_Int32 _nFeatureId ) const;
virtual sal_Int32 getIntegerState( sal_Int32 _nFeatureId ) const;
virtual void dispatch( sal_Int16 _nFeatureId ) const;
virtual void dispatchWithArgument( sal_Int16 _nFeatureId, const sal_Char* _pParamName, const ::com::sun::star::uno::Any& _rParamValue ) const;
virtual bool isEnabled( sal_Int16 _nFeatureId ) const;
virtual bool getBooleanState( sal_Int16 _nFeatureId ) const;
virtual ::rtl::OUString getStringState( sal_Int16 _nFeatureId ) const;
virtual sal_Int32 getIntegerState( sal_Int16 _nFeatureId ) const;
// own overridables
/** is called when the interceptors have.
......@@ -134,7 +134,7 @@ namespace frm
determines if the features is enabled or disabled
@see getBooleanState
*/
virtual void featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled );
virtual void featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled );
/** notification for (potential) changes in the state of all features
<p>The base class implementation does nothing. Derived classes could force
......@@ -149,7 +149,7 @@ namespace frm
the array of features to support. Out parameter to fill by the derivee's implementation
@pure
*/
virtual void getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds ) = 0;
virtual void getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds ) = 0;
protected:
/** update all our dispatches which are controlled by our dispatch interceptors
......@@ -205,7 +205,7 @@ namespace frm
@complexity O(log n)
@return NULL if the given id is not a known feature id (which is a valid usage)
*/
const char* getFeatureURLAscii( sal_Int32 _nFeatureId );
const char* getFeatureURLAscii( sal_Int16 _nFeatureId );
/** retrieves the feature URL belonging to an feature id
......@@ -214,7 +214,7 @@ namespace frm
<TRUE/> if and only if the given id is a known feature id
(which is a valid usage)
*/
bool getFeatureURL( sal_Int32 _nFeatureId, ::com::sun::star::util::URL& /* [out] */ _rURL );
bool getFeatureURL( sal_Int16 _nFeatureId, ::com::sun::star::util::URL& /* [out] */ _rURL );
/** retrieves the feature id belonging to an feature URL
......@@ -223,7 +223,7 @@ namespace frm
the id of the feature URL, or -1 if the URl is not known
(which is a valid usage)
*/
sal_Int32 getFeatureId( const ::rtl::OUString& _rCompleteURL );
sal_Int16 getFeatureId( const ::rtl::OUString& _rCompleteURL );
private:
OFormNavigationMapper( ); // never implemented
......
......@@ -40,6 +40,7 @@
/** === begin UNO includes === **/
#include <com/sun/star/awt/XView.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/form/runtime/FormFeature.hpp>
/** === end UNO includes === **/
#include <tools/debug.hxx>
......@@ -62,6 +63,7 @@ namespace frm
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
#define FORWARD_TO_PEER_1( unoInterface, method, param1 ) \
Reference< unoInterface > xTypedPeer( getPeer(), UNO_QUERY ); \
......@@ -456,7 +458,7 @@ namespace frm
}
//------------------------------------------------------------------
void ONavigationBarPeer::featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled )
void ONavigationBarPeer::featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled )
{
// enable this button on the toolbox
NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
......@@ -465,15 +467,15 @@ namespace frm
pNavBar->enableFeature( _nFeatureId, _bEnabled );
// is it a feature with additional state information?
if ( _nFeatureId == SID_FM_FORM_FILTERED )
if ( _nFeatureId == FormFeature::ToggleApplyFilter )
{ // additional boolean state
pNavBar->checkFeature( _nFeatureId, getBooleanState( _nFeatureId ) );
}
else if ( _nFeatureId == SID_FM_RECORD_TOTAL )
else if ( _nFeatureId == FormFeature::TotalRecords )
{
pNavBar->setFeatureText( _nFeatureId, getStringState( _nFeatureId ) );
}
else if ( _nFeatureId == SID_FM_RECORD_ABSOLUTE )
else if ( _nFeatureId == FormFeature::MoveAbsolute )
{
pNavBar->setFeatureText( _nFeatureId, String::CreateFromInt32( getIntegerState( _nFeatureId ) ) );
}
......@@ -496,7 +498,7 @@ namespace frm
}
//------------------------------------------------------------------
bool ONavigationBarPeer::isEnabled( sal_Int32 _nFeatureId ) const
bool ONavigationBarPeer::isEnabled( sal_Int16 _nFeatureId ) const
{
if ( const_cast< ONavigationBarPeer* >( this )->isDesignMode() )
return false;
......@@ -524,27 +526,27 @@ namespace frm
}
//------------------------------------------------------------------
void ONavigationBarPeer::getSupportedFeatures( ::std::vector< sal_Int32 >& _rFeatureIds )
void ONavigationBarPeer::getSupportedFeatures( ::std::vector< sal_Int16 >& _rFeatureIds )
{
_rFeatureIds.push_back( SID_FM_RECORD_ABSOLUTE );
_rFeatureIds.push_back( SID_FM_RECORD_TOTAL );
_rFeatureIds.push_back( SID_FM_RECORD_FIRST );
_rFeatureIds.push_back( SID_FM_RECORD_PREV );
_rFeatureIds.push_back( SID_FM_RECORD_NEXT );
_rFeatureIds.push_back( SID_FM_RECORD_LAST );
_rFeatureIds.push_back( SID_FM_RECORD_SAVE );
_rFeatureIds.push_back( SID_FM_RECORD_UNDO );
_rFeatureIds.push_back( SID_FM_RECORD_NEW );
_rFeatureIds.push_back( SID_FM_RECORD_DELETE );
_rFeatureIds.push_back( SID_FM_REFRESH );
_rFeatureIds.push_back( SID_FM_REFRESH_FORM_CONTROL );
_rFeatureIds.push_back( SID_FM_SORTUP );
_rFeatureIds.push_back( SID_FM_SORTDOWN );
_rFeatureIds.push_back( SID_FM_ORDERCRIT );
_rFeatureIds.push_back( SID_FM_AUTOFILTER );
_rFeatureIds.push_back( SID_FM_FILTERCRIT );
_rFeatureIds.push_back( SID_FM_FORM_FILTERED );
_rFeatureIds.push_back( SID_FM_REMOVE_FILTER_SORT );
_rFeatureIds.push_back( FormFeature::MoveAbsolute );
_rFeatureIds.push_back( FormFeature::TotalRecords );
_rFeatureIds.push_back( FormFeature::MoveToFirst );
_rFeatureIds.push_back( FormFeature::MoveToPrevious );
_rFeatureIds.push_back( FormFeature::MoveToNext );
_rFeatureIds.push_back( FormFeature::MoveToLast );
_rFeatureIds.push_back( FormFeature::SaveRecordChanges );
_rFeatureIds.push_back( FormFeature::UndoRecordChanges );
_rFeatureIds.push_back( FormFeature::MoveToInsertRow );
_rFeatureIds.push_back( FormFeature::DeleteRecord );
_rFeatureIds.push_back( FormFeature::ReloadForm );
_rFeatureIds.push_back( FormFeature::RefreshCurrentControl );
_rFeatureIds.push_back( FormFeature::SortAscending );
_rFeatureIds.push_back( FormFeature::SortDescending );
_rFeatureIds.push_back( FormFeature::InteractiveSort );
_rFeatureIds.push_back( FormFeature::AutoFilter );
_rFeatureIds.push_back( FormFeature::InteractiveFilter );
_rFeatureIds.push_back( FormFeature::ToggleApplyFilter );
_rFeatureIds.push_back( FormFeature::RemoveFilterAndSort );
}
//.........................................................................
......
......@@ -144,12 +144,12 @@ namespace frm
// OFormNavigationHelper overriables
virtual void interceptorsChanged( );
virtual void featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled );
virtual void featureStateChanged( sal_Int16 _nFeatureId, sal_Bool _bEnabled );
virtual void allFeatureStatesChanged( );
virtual void getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds );
virtual void getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds );
// IFeatureDispatcher overriables
virtual bool isEnabled( sal_Int32 _nFeatureId ) const;
virtual bool isEnabled( sal_Int16 _nFeatureId ) const;
};
//.........................................................................
......
......@@ -86,15 +86,15 @@ namespace frm
/** enables or disables a given feature
*/
void enableFeature( sal_Int32 _nFeatureId, bool _bEnabled );
void enableFeature( sal_Int16 _nFeatureId, bool _bEnabled );
/** checks or unchecks a given feature
*/
void checkFeature( sal_Int32 _nFeatureId, bool _bEnabled );
void checkFeature( sal_Int16 _nFeatureId, bool _bEnabled );
/** sets the text of a given feature
*/
void setFeatureText( sal_Int32 _nFeatureId, const ::rtl::OUString& _rText );
void setFeatureText( sal_Int16 _nFeatureId, const ::rtl::OUString& _rText );
/** retrieves the current image size
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment