INTEGRATION: CWS eforms2 (1.48.52); FILE MERGED

2004/11/08 15:18:30 fs 1.48.52.16: #i10000# post-resync
2004/11/07 02:50:38 dvo 1.48.52.15: RESYNC: (1.53-1.54); FILE MERGED
2004/11/05 16:28:27 fs 1.48.52.14: #i36484# no form properties in XML form documents
2004/11/03 13:28:15 fs 1.48.52.13: DataNavigator only for eForms
2004/10/26 15:41:51 fs 1.48.52.12: #i33866# m_bXFormsMode superseded by m_eDocumentType (which is available now that we resynced) / don't allow conversion into unavailable controls in XForms mode
2004/10/14 10:32:17 dvo 1.48.52.11: resolve merge conflicts
2004/10/08 17:31:30 dvo 1.48.52.10: RESYNC: (1.52-1.53); FILE MERGED
2004/09/20 11:32:42 dvo 1.48.52.9: #i33874# disable non-XForms design-mode-switch in XForms mode
         (will become irrelevant when new form toolbar is in)
2004/08/11 18:04:46 dvo 1.48.52.8: #i31958# enable (old) design mode switch, because it is used by the XForms design mode switch
2004/08/05 09:51:24 dvo 1.48.52.7: #i31958# enable/disable certain form slots in XForms mode
2004/07/27 13:40:58 fs 1.48.52.6: RESYNC: (1.51-1.52); FILE MERGED
2004/07/22 09:58:02 fs 1.48.52.5: #i31762# #i11287# refined the selection handling
2004/07/21 15:20:15 fs 1.48.52.4: #i31762# no current object/control/form anymore, but a current selection
2004/07/08 10:03:00 fs 1.48.52.3: #i10000# corrected wrong post-resync conflict resolving
2004/06/25 14:26:55 dvo 1.48.52.2: RESYNC: (1.48-1.51); FILE MERGED
2004/06/09 13:34:33 pb 1.48.52.1: fix: #114856# the new xforms data navigator
This commit is contained in:
Oliver Bolte
2004-11-16 10:24:21 +00:00
parent 8c5454931d
commit a0c7b2bc45

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: fmshell.cxx,v $
*
* $Revision: 1.54 $
* $Revision: 1.55 $
*
* last change: $Author: pjunck $ $Date: 2004-10-22 11:53:26 $
* last change: $Author: obo $ $Date: 2004-11-16 11:24:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -255,7 +255,7 @@
#include <comphelper/processfactory.hxx>
#endif
#ifndef SVX_SOURCE_INC_FMDOCUMENTCLASSIFICATION_HXX
#include "fmdocumentclassification.hxx"
#include <fmdocumentclassification.hxx>
#endif
#ifndef IMPROVEFORMS_SVX_SOURCE_FORM_FORMTOOLBARS_HXX
#include "formtoolbars.hxx"
@@ -344,6 +344,8 @@ sal_uInt16 ControllerSlotMap[] = // slots des Controllers
SID_FM_AUTOCONTROLFOCUS,
SID_FM_SCROLLBAR,
SID_FM_SPINBUTTON,
SID_FM_SHOW_DATANAVIGATOR,
SID_FM_DATANAVIGATOR_CONTROL,
0
};
@@ -481,6 +483,7 @@ const sal_uInt32 FM_UI_FEATURE_TB_MORECONTROLS_GENERIC = 0x00001000;
const sal_uInt32 FM_UI_FEATURE_TB_FORMDESIGN_DBFORMS = 0x00002000;
const sal_uInt32 FM_UI_FEATURE_TB_FORMDESIGN_XFORMS = 0x00004000;
const sal_uInt32 FM_UI_FEATURE_TB_FORMDESIGN_GENERIC = 0x00008000;
const sal_uInt32 FM_UI_FEATURE_SHOW_DATANAVIGATOR = 0x00010000;
SFX_IMPL_INTERFACE(FmFormShell, SfxShell, SVX_RES(RID_STR_FORMSHELL))
{
@@ -500,6 +503,7 @@ SFX_IMPL_INTERFACE(FmFormShell, SfxShell, SVX_RES(RID_STR_FORMSHELL))
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_SHOW_PROPERTIES, FM_UI_FEATURE_SHOW_PROPERTIES);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_SHOW_FMEXPLORER, FM_UI_FEATURE_SHOW_EXPLORER);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_FILTER_NAVIGATOR, FM_UI_FEATURE_SHOW_FILTERNAVIGATOR);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(SID_FM_SHOW_DATANAVIGATOR, FM_UI_FEATURE_SHOW_DATANAVIGATOR);
// the usual "Controls" toolbars - one for each possible "forms module"
SFX_FEATURED_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD,
@@ -711,6 +715,10 @@ sal_Bool FmFormShell::HasUIFeature( sal_uInt32 nFeature )
{
bResult = m_pImpl->IsActiveControl( true );
}
else if ((nFeature & FM_UI_FEATURE_SHOW_DATANAVIGATOR) == FM_UI_FEATURE_SHOW_DATANAVIGATOR)
{
bResult = ( GetImpl()->getDocumentType() == eEnhancedForm );
}
else if ( ( nFeature & FM_UI_FEATURE_TB_CONTROLS_DBFORMS )
|| ( nFeature & FM_UI_FEATURE_TB_MORECONTROLS_DBFORMS )
|| ( nFeature & FM_UI_FEATURE_TB_FORMDESIGN_DBFORMS )
@@ -723,14 +731,14 @@ sal_Bool FmFormShell::HasUIFeature( sal_uInt32 nFeature )
|| ( nFeature & FM_UI_FEATURE_TB_FORMDESIGN_XFORMS )
)
{
bResult = ( GetImpl()->getDocumentType() == eElectronicForm );
bResult = ( GetImpl()->getDocumentType() == eEnhancedForm );
}
else if ( ( nFeature & FM_UI_FEATURE_TB_CONTROLS_GENERIC )
|| ( nFeature & FM_UI_FEATURE_TB_MORECONTROLS_GENERIC )
|| ( nFeature & FM_UI_FEATURE_TB_FORMDESIGN_GENERIC )
)
{
bResult = ( GetImpl()->getDocumentType() != eDatabaseForm ) && ( GetImpl()->getDocumentType() != eElectronicForm );
bResult = ( GetImpl()->getDocumentType() != eDatabaseForm ) && ( GetImpl()->getDocumentType() != eEnhancedForm );
}
return bResult;
@@ -967,8 +975,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_CONVERTTO_SCROLLBAR :
case SID_FM_CONVERTTO_SPINBUTTON :
case SID_FM_CONVERTTO_NAVIGATIONBAR :
GetImpl()->ExecuteControlConversionSlot(Reference< ::com::sun::star::form::XFormComponent > (GetImpl()->getCurControl(), UNO_QUERY),
nSlot);
GetImpl()->executeControlConversionSlot( nSlot );
// nach dem Konvertieren die Selektion neu bestimmern, da sich ja das selektierte Objekt
// geaendert hat
GetImpl()->SetSelection(GetFormView()->GetMarkedObjectList());
@@ -980,15 +987,11 @@ void FmFormShell::Execute(SfxRequest &rReq)
break;
case SID_FM_SHOW_PROPERTY_BROWSER:
{
SFX_REQUEST_ARG( rReq, pInterfaceItem, FmInterfaceItem, nSlot, sal_False );
SFX_REQUEST_ARG( rReq, pShowItem, SfxBoolItem, SID_FM_SHOW_PROPERTIES, sal_False );
Reference< XInterface > xInterface;
sal_Bool bShow = sal_True;
if( pShowItem )
if ( pShowItem )
bShow = pShowItem->GetValue();
if( pInterfaceItem )
xInterface = pInterfaceItem->GetInterface();
GetImpl()->ShowProperties( xInterface, bShow );
GetImpl()->ShowSelectionProperties( bShow );
rReq.Done();
} break;
@@ -998,26 +1001,32 @@ void FmFormShell::Execute(SfxRequest &rReq)
// PropertyBrowser anzeigen
SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot, sal_False);
sal_Bool bShow = pShowItem ? pShowItem->GetValue() : sal_True;
GetImpl()->setSelObject(GetImpl()->getCurForm());
GetImpl()->ShowProperties(GetImpl()->getCurForm(), bShow );
InterfaceBag aOnlyTheForm;
aOnlyTheForm.insert( Reference< XInterface >( GetImpl()->getCurrentForm(), UNO_QUERY ) );
GetImpl()->setCurrentSelection( aOnlyTheForm );
GetImpl()->ShowSelectionProperties( bShow );
rReq.Done();
} break;
case SID_FM_CTL_PROPERTIES:
{
GetImpl()->setSelObject(GetImpl()->getCurControl());
// PropertyBrowser anzeigen
SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSlot, sal_False);
sal_Bool bShow = pShowItem ? pShowItem->GetValue() : sal_True;
GetImpl()->ShowProperties( GetImpl()->getSelObject(), bShow );
OSL_ENSURE( GetImpl()->onlyControlsAreMarked(), "FmFormShell::Execute: ControlProperties should be disabled!" );
if ( bShow )
GetImpl()->selectLastMarkedControls();
GetImpl()->ShowSelectionProperties( bShow );
rReq.Done();
} break;
case SID_FM_SHOW_PROPERTIES:
case SID_FM_ADD_FIELD:
case SID_FM_FILTER_NAVIGATOR:
case SID_FM_SHOW_DATANAVIGATOR :
{
GetViewShell()->GetViewFrame()->ChildWindowExecute(rReq);
rReq.Done();
@@ -1029,12 +1038,16 @@ void FmFormShell::Execute(SfxRequest &rReq)
GetViewShell()->GetViewFrame()->ChildWindowExecute(rReq);
rReq.Done();
} break;
}
break;
case SID_FM_TAB_DIALOG:
{
GetImpl()->ExecuteTabOrderDialog( Reference< XTabControllerModel >( GetImpl()->getCurForm(), UNO_QUERY ) );
GetImpl()->ExecuteTabOrderDialog( Reference< XTabControllerModel >( GetImpl()->getCurrentForm(), UNO_QUERY ) );
rReq.Done();
} break;
}
break;
case SID_FM_DESIGN_MODE:
{
SFX_REQUEST_ARG(rReq, pDesignItem, SfxBoolItem, nSlot, sal_False);
@@ -1205,8 +1218,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
{
GetImpl()->startFiltering();
rReq.Done();
}
break;
} break;
}
}
@@ -1251,26 +1263,34 @@ void FmFormShell::GetState(SfxItemSet &rSet)
else
rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetOpenInDesignMode() ) );
break;
case SID_FM_SCROLLBAR:
case SID_FM_NAVIGATIONBAR:
case SID_FM_IMAGECONTROL:
case SID_FM_FILECONTROL:
case SID_FM_CURRENCYFIELD:
case SID_FM_PATTERNFIELD:
case SID_FM_DBGRID:
if ( GetImpl()->getDocumentType() == eEnhancedForm )
{
// in XForms mode, several controls are disabled:
rSet.DisableItem( nWhich );
break;
}
// NO break here!
case SID_FM_IMAGEBUTTON:
case SID_FM_RADIOBUTTON:
case SID_FM_COMBOBOX:
case SID_FM_NAVIGATIONBAR:
case SID_FM_GROUPBOX:
case SID_FM_CHECKBOX:
case SID_FM_PUSHBUTTON:
case SID_FM_FIXEDTEXT:
case SID_FM_LISTBOX:
case SID_FM_EDIT:
case SID_FM_DBGRID:
case SID_FM_IMAGEBUTTON:
case SID_FM_IMAGECONTROL:
case SID_FM_FILECONTROL:
case SID_FM_DATEFIELD:
case SID_FM_TIMEFIELD:
case SID_FM_NUMERICFIELD:
case SID_FM_CURRENCYFIELD:
case SID_FM_PATTERNFIELD:
case SID_FM_FORMATTEDFIELD:
case SID_FM_SCROLLBAR:
case SID_FM_SPINBUTTON:
if (!m_bDesignMode)
rSet.DisableItem( nWhich );
@@ -1306,6 +1326,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
} break;
case SID_FM_FMEXPLORER_CONTROL:
case SID_FM_DATANAVIGATOR_CONTROL :
{
if (!m_bDesignMode || !m_pFormView)
rSet.Put(SfxObjectItem(nWhich));
@@ -1317,17 +1338,24 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_SHOW_FMEXPLORER:
case SID_FM_SHOW_PROPERTIES:
case SID_FM_FILTER_NAVIGATOR:
case SID_FM_SHOW_DATANAVIGATOR:
{
if ( GetViewShell()->GetViewFrame()->KnowsChildWindow(nWhich) )
rSet.Put( SfxBoolItem( nWhich, GetViewShell()->GetViewFrame()->HasChildWindow(nWhich)) );
else
rSet.DisableItem(nWhich);
// special case for data navigator: enabled only in XForms
if( nWhich == SID_FM_SHOW_DATANAVIGATOR
&& ( GetImpl()->getDocumentType() != eEnhancedForm ) )
rSet.DisableItem( nWhich );
} break;
case SID_FM_SHOW_PROPERTY_BROWSER:
{
rSet.Put(SfxBoolItem(GetImpl()->IsPropBrwOpen()));
} break;
}
break;
case SID_FM_CTL_PROPERTIES:
{
@@ -1336,12 +1364,15 @@ void FmFormShell::GetState(SfxItemSet &rSet)
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurControl().is())
if ( !m_pFormView || !m_bDesignMode || !GetImpl()->onlyControlsAreMarked() )
rSet.DisableItem( nWhich );
else
{
sal_Bool bChecked = GetImpl()->IsPropBrwOpen() && (GetImpl()->getSelObject() == GetImpl()->getCurControl());
rSet.Put(SfxBoolItem(nWhich, bChecked));
sal_Bool bChecked = GetImpl()->IsPropBrwOpen() && !GetImpl()->isSolelySelected( GetImpl()->getCurrentForm() );
// if the property browser is open, and only controls are marked, and the current selection
// does not consist of only the current form, then the current selection is the (composition of)
// the currently marked controls
rSet.Put( SfxBoolItem( nWhich, bChecked ) );
}
} break;
@@ -1352,13 +1383,17 @@ void FmFormShell::GetState(SfxItemSet &rSet)
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurForm().is())
if ( GetImpl()->getDocumentType() == eEnhancedForm )
{
rSet.DisableItem( nWhich );
break;
}
if ( !m_pFormView || !m_bDesignMode || !GetImpl()->getCurrentForm().is() )
rSet.DisableItem( nWhich );
else
{
// aktuelle form
Reference< ::com::sun::star::form::XForm > xForm(GetImpl()->getSelObject(), UNO_QUERY);
sal_Bool bChecked = GetImpl()->IsPropBrwOpen() && xForm.is();
sal_Bool bChecked = GetImpl()->IsPropBrwOpen() && GetImpl()->isSolelySelected( GetImpl()->getCurrentForm() );
rSet.Put(SfxBoolItem(nWhich, bChecked));
}
} break;
@@ -1368,15 +1403,14 @@ void FmFormShell::GetState(SfxItemSet &rSet)
if (GetImpl()->IsSelectionUpdatePending())
GetImpl()->ForceUpdateSelection(sal_False);
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurForm().is() )
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurrentForm().is() )
rSet.DisableItem( nWhich );
break;
case SID_FM_CONFIG:
rSet.Put(SfxUInt16Item(nWhich, m_nLastSlot));
break;
case SID_FM_DESIGN_MODE:
if (!m_pFormView)
if (!m_pFormView || ( GetImpl()->getDocumentType() == eEnhancedForm ) )
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem(nWhich, m_bDesignMode) );
@@ -1406,50 +1440,53 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_CHANGECONTROLTYPE:
{
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurControl().is())
if ( !m_pFormView || !m_bDesignMode )
rSet.DisableItem( nWhich );
else
{
Reference< ::com::sun::star::form::XFormComponent > xSelAsComp(GetImpl()->getCurControl(), UNO_QUERY);
if (!xSelAsComp.is())
if ( !GetImpl()->canConvertCurrentSelectionToControl( OBJ_FM_FIXEDTEXT ) )
// if it cannot be converted to a fixed text, it is no single control
rSet.DisableItem( nWhich );
}
} break;
case SID_FM_CONVERTTO_FILECONTROL :
case SID_FM_CONVERTTO_CURRENCY :
case SID_FM_CONVERTTO_PATTERN :
case SID_FM_CONVERTTO_IMAGECONTROL :
case SID_FM_CONVERTTO_SCROLLBAR :
case SID_FM_CONVERTTO_NAVIGATIONBAR :
if ( GetImpl()->getDocumentType() == eEnhancedForm )
{
rSet.DisableItem( nWhich );
break;
}
// NO break here!
case SID_FM_CONVERTTO_IMAGEBUTTON :
case SID_FM_CONVERTTO_EDIT :
case SID_FM_CONVERTTO_BUTTON :
case SID_FM_CONVERTTO_BUTTON :
case SID_FM_CONVERTTO_FIXEDTEXT :
case SID_FM_CONVERTTO_LISTBOX :
case SID_FM_CONVERTTO_CHECKBOX :
case SID_FM_CONVERTTO_RADIOBUTTON :
case SID_FM_CONVERTTO_GROUPBOX :
case SID_FM_CONVERTTO_COMBOBOX :
case SID_FM_CONVERTTO_IMAGEBUTTON :
case SID_FM_CONVERTTO_FILECONTROL :
case SID_FM_CONVERTTO_DATE :
case SID_FM_CONVERTTO_TIME :
case SID_FM_CONVERTTO_NUMERIC :
case SID_FM_CONVERTTO_CURRENCY :
case SID_FM_CONVERTTO_PATTERN :
case SID_FM_CONVERTTO_IMAGECONTROL :
case SID_FM_CONVERTTO_FORMATTED :
case SID_FM_CONVERTTO_SCROLLBAR :
case SID_FM_CONVERTTO_SPINBUTTON :
case SID_FM_CONVERTTO_NAVIGATIONBAR :
{
if (!m_pFormView || !m_bDesignMode || !GetImpl()->getCurControl().is())
if ( !m_pFormView || !m_bDesignMode || !GetImpl()->canConvertCurrentSelectionToControl( nWhich ) )
rSet.DisableItem( nWhich );
else
{
Reference< ::com::sun::star::beans::XPropertySet > xSelProps(GetImpl()->getCurControl(), UNO_QUERY);
if (!xSelProps.is() || !GetImpl()->IsConversionPossible(xSelProps, nWhich))
// it isn't a form component
rSet.DisableItem( nWhich );
else
rSet.Put(SfxBoolItem(nWhich, sal_False));
// just to have a defined state (available and not checked)
rSet.Put( SfxBoolItem( nWhich, sal_False ) );
// just to have a defined state (available and not checked)
}
} break;
}
break;
}
nWhich = aIter.NextWhich();
}