unoawt: completely separated the controller functionality of a wizard page from the wizard page itself,
by moving the canAdvance method from OWizardPage to the IWizardPage interface, which in this course has been renamed to IWizardPageController. This will later on allow to have implementations where the TabPage is provided by an external component (e.g. as UNO Service), but the controlling of those pages is still intercepted and handled internally.
This commit is contained in:
parent
5f135a5d49
commit
3f4c0ab3ae
10 changed files with 25 additions and 18 deletions
|
@ -188,12 +188,12 @@ namespace dbmm
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
sal_Bool SaveDBDocPage::commitPage( CommitPageReason _eReason )
|
||||
sal_Bool SaveDBDocPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
|
||||
{
|
||||
if ( !MacroMigrationPage::commitPage( _eReason ) )
|
||||
return sal_False;
|
||||
|
||||
if ( eTravelBackward == _eReason )
|
||||
if ( ::svt::WizardTypes::eTravelBackward == _eReason )
|
||||
return sal_True;
|
||||
|
||||
if ( !m_aLocationController.prepareCommit() )
|
||||
|
|
|
@ -109,11 +109,10 @@ namespace dbmm
|
|||
m_aLocationController;
|
||||
|
||||
protected:
|
||||
// OWizardPage overridables
|
||||
virtual void initializePage();
|
||||
virtual bool canAdvance() const;
|
||||
// IWizardPage overridables
|
||||
virtual sal_Bool commitPage( CommitPageReason _eReason );
|
||||
// IWizardPageController overridables
|
||||
virtual void initializePage();
|
||||
virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
|
||||
virtual bool canAdvance() const;
|
||||
|
||||
private:
|
||||
DECL_LINK( OnLocationModified, Edit* );
|
||||
|
|
|
@ -289,7 +289,7 @@ namespace dbaui
|
|||
callModifiedHdl();
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
sal_Bool OConnectionTabPageSetup::commitPage( CommitPageReason /*_eReason*/ )
|
||||
sal_Bool OConnectionTabPageSetup::commitPage( ::svt::WizardTypes::CommitPageReason /*_eReason*/ )
|
||||
{
|
||||
return commitURL();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace dbaui
|
|||
virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs);
|
||||
|
||||
virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
|
||||
virtual sal_Bool commitPage( CommitPageReason _eReason );
|
||||
virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
|
||||
|
||||
|
||||
inline void enableConnectionURL() { m_aConnectionURL.SetReadOnly(sal_False); }
|
||||
|
|
|
@ -201,11 +201,16 @@ namespace dbaui
|
|||
Reset(*m_pItemSetHelper->getOutputSet());
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
sal_Bool OGenericAdministrationPage::commitPage( CommitPageReason )
|
||||
sal_Bool OGenericAdministrationPage::commitPage( ::svt::WizardTypes::CommitPageReason )
|
||||
{
|
||||
return sal_True;
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
bool OGenericAdministrationPage::canAdvance() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, USHORT _nID, sal_Bool& _bChangedSomething, bool _bRevertValue )
|
||||
{
|
||||
if ( (_pCheckBox != NULL ) && ( _pCheckBox->GetState() != _pCheckBox->GetSavedValue() ) )
|
||||
|
|
|
@ -113,7 +113,8 @@ namespace dbaui
|
|||
//=========================================================================
|
||||
class IDatabaseSettingsDialog;
|
||||
class IItemSetHelper;
|
||||
class OGenericAdministrationPage : public SfxTabPage, public svt::IWizardPage
|
||||
class OGenericAdministrationPage :public SfxTabPage
|
||||
,public ::svt::IWizardPageController
|
||||
{
|
||||
private:
|
||||
Link m_aModifiedHandler; /// to be called if something on the page has been modified
|
||||
|
@ -165,9 +166,10 @@ namespace dbaui
|
|||
*/
|
||||
sal_Bool getSelectedDataSource(::rtl::OUString& _sReturn,::rtl::OUString& _sCurr);
|
||||
|
||||
// svt::IWizardPage
|
||||
// svt::IWizardPageController
|
||||
virtual void initializePage();
|
||||
virtual sal_Bool commitPage( CommitPageReason _eReason );
|
||||
virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
|
||||
virtual bool canAdvance() const;
|
||||
|
||||
void SetRoadmapStateValue( sal_Bool _bDoEnable ) { m_abEnableRoadmap = _bDoEnable; }
|
||||
bool GetRoadmapStateValue() const { return m_abEnableRoadmap; }
|
||||
|
|
|
@ -405,7 +405,7 @@ sal_Bool ODbTypeWizDialog::saveDatasource()
|
|||
return sal_True;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
IWizardPage* ODbTypeWizDialog::getWizardPage(TabPage* _pCurrentPage) const
|
||||
IWizardPageController* ODbTypeWizDialog::getPageController( TabPage* _pCurrentPage ) const
|
||||
{
|
||||
OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(_pCurrentPage);
|
||||
return pPage;
|
||||
|
|
|
@ -1078,7 +1078,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
|
|||
return aExistenceCheck.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
IWizardPage* ODbTypeWizDialogSetup::getWizardPage(TabPage* _pCurrentPage) const
|
||||
IWizardPageController* ODbTypeWizDialogSetup::getPageController( TabPage* _pCurrentPage ) const
|
||||
{
|
||||
OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(_pCurrentPage);
|
||||
return pPage;
|
||||
|
|
|
@ -111,8 +111,9 @@ protected:
|
|||
virtual TabPage* createPage(WizardState _nState);
|
||||
virtual WizardState determineNextState(WizardState _nCurrentState) const;
|
||||
virtual sal_Bool leaveState(WizardState _nState);
|
||||
virtual ::svt::IWizardPage* getWizardPage(TabPage* _pCurrentPage) const;
|
||||
virtual sal_Bool onFinish(sal_Int32 _nResult);
|
||||
virtual ::svt::IWizardPageController*
|
||||
getPageController( TabPage* _pCurrentPage ) const;
|
||||
virtual sal_Bool onFinish(sal_Int32 _nResult);
|
||||
|
||||
protected:
|
||||
inline sal_Bool isUIEnabled() const { return m_bUIEnabled; }
|
||||
|
|
|
@ -149,7 +149,7 @@ protected:
|
|||
virtual TabPage* createPage(WizardState _nState);
|
||||
virtual sal_Bool leaveState(WizardState _nState);
|
||||
virtual void enterState(WizardState _nState);
|
||||
virtual ::svt::IWizardPage* getWizardPage(TabPage* _pCurrentPage) const;
|
||||
virtual ::svt::IWizardPageController* getPageController( TabPage* _pCurrentPage ) const;
|
||||
virtual sal_Bool onFinish(sal_Int32 _nResult);
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue