From d2b0dc2ee3de5158a1bf130e42bcfd46d997e74b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 25 May 2010 10:17:24 +0200 Subject: 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. --- extensions/source/abpilot/abpfinalpage.cxx | 4 ++-- extensions/source/abpilot/abpfinalpage.hxx | 2 +- extensions/source/abpilot/tableselectionpage.cxx | 2 +- extensions/source/abpilot/tableselectionpage.hxx | 2 +- extensions/source/abpilot/typeselectionpage.cxx | 2 +- extensions/source/abpilot/typeselectionpage.hxx | 2 +- extensions/source/dbpilots/commonpagesdbp.cxx | 4 ++-- extensions/source/dbpilots/commonpagesdbp.hxx | 4 ++-- extensions/source/dbpilots/controlwizard.cxx | 6 +++--- extensions/source/dbpilots/gridwizard.cxx | 2 +- extensions/source/dbpilots/gridwizard.hxx | 2 +- extensions/source/dbpilots/groupboxwiz.cxx | 20 ++++++++++---------- extensions/source/dbpilots/groupboxwiz.hxx | 11 ++++++----- extensions/source/dbpilots/listcombowizard.cxx | 8 ++++---- extensions/source/dbpilots/listcombowizard.hxx | 6 +++--- 15 files changed, 39 insertions(+), 38 deletions(-) (limited to 'extensions/source') diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index d633b597878d..2ffeb0d09739 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -141,12 +141,12 @@ namespace abp } //--------------------------------------------------------------------- - sal_Bool FinalPage::commitPage( CommitPageReason _eReason ) + sal_Bool FinalPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!AddressBookSourcePage::commitPage(_eReason)) return sal_False; - if ( ( eTravelBackward != _eReason ) + if ( ( ::svt::WizardTypes::eTravelBackward != _eReason ) && ( !m_aLocationController.prepareCommit() ) ) return sal_False; diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx index 415bc31f2bc1..27d6522d7df6 100644 --- a/extensions/source/abpilot/abpfinalpage.hxx +++ b/extensions/source/abpilot/abpfinalpage.hxx @@ -66,7 +66,7 @@ namespace abp protected: // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); // TabDialog overridables virtual void ActivatePage(); diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx index 0cefba92ab5a..869c806ea819 100644 --- a/extensions/source/abpilot/tableselectionpage.cxx +++ b/extensions/source/abpilot/tableselectionpage.cxx @@ -109,7 +109,7 @@ namespace abp } //--------------------------------------------------------------------- - sal_Bool TableSelectionPage::commitPage( CommitPageReason _eReason ) + sal_Bool TableSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!AddressBookSourcePage::commitPage(_eReason)) return sal_False; diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx index 36bc792fd0e7..d2d878c65d5f 100644 --- a/extensions/source/abpilot/tableselectionpage.hxx +++ b/extensions/source/abpilot/tableselectionpage.hxx @@ -51,7 +51,7 @@ namespace abp protected: // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); // TabDialog overridables virtual void ActivatePage(); diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index adc173f84290..fd83630e81d9 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -207,7 +207,7 @@ namespace abp } //--------------------------------------------------------------------- - sal_Bool TypeSelectionPage::commitPage( CommitPageReason _eReason ) + sal_Bool TypeSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!AddressBookSourcePage::commitPage(_eReason)) return sal_False; diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx index 18c8d6b9697d..9df17bb1d77f 100644 --- a/extensions/source/abpilot/typeselectionpage.hxx +++ b/extensions/source/abpilot/typeselectionpage.hxx @@ -83,7 +83,7 @@ namespace abp protected: // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); // TabDialog overridables virtual void ActivatePage(); diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 7b58c8de8560..88d8e2eb352e 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -164,7 +164,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool OTableSelectionPage::commitPage( CommitPageReason _eReason ) + sal_Bool OTableSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OControlWizardPage::commitPage(_eReason)) return sal_False; @@ -493,7 +493,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool ODBFieldPage::commitPage( CommitPageReason _eReason ) + sal_Bool ODBFieldPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OMaybeListSelectionPage::commitPage(_eReason)) return sal_False; diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 3cbe1ac2b514..a20587b36d72 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -64,7 +64,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); protected: DECL_LINK( OnListboxSelection, ListBox* ); @@ -131,7 +131,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); // own overridables virtual String& getDBFieldSetting() = 0; diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index b97eb60504b4..c5d816486ecc 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -156,7 +156,7 @@ namespace dbp _rList.Clear(); const ::rtl::OUString* pItems = _rItems.getConstArray(); const ::rtl::OUString* pEnd = pItems + _rItems.getLength(); - WizardState nPos; + ::svt::WizardTypes::WizardState nPos; sal_Int32 nIndex = 0; for (;pItems < pEnd; ++pItems, ++nIndex) { @@ -172,7 +172,7 @@ namespace dbp _rList.Clear(); const ::rtl::OUString* pItems = _rItems.getConstArray(); const ::rtl::OUString* pEnd = pItems + _rItems.getLength(); - WizardState nPos; + ::svt::WizardTypes::WizardState nPos; sal_Int32 nIndex = 0; for (;pItems < pEnd; ++pItems) { @@ -254,7 +254,7 @@ namespace dbp m_pFormDatasource->SetText(sDataSource); m_pFormTable->SetText(sCommand); - WizardState nCommandTypeResourceId = 0; + ::svt::WizardTypes::WizardState nCommandTypeResourceId = 0; switch (nCommandType) { case CommandType::TABLE: diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 6e28567aef62..ec42cf346450 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -362,7 +362,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool OGridFieldsSelection::commitPage( CommitPageReason _eReason ) + sal_Bool OGridFieldsSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OGridPage::commitPage(_eReason)) return sal_False; diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index d0f255ede729..1ab0d3186440 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -114,7 +114,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; protected: diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 7bf3138bf5fe..f35ed890fde5 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -79,7 +79,7 @@ namespace dbp } //--------------------------------------------------------------------- - OWizardPage* OGroupBoxWizard::createPage(WizardState _nState) + OWizardPage* OGroupBoxWizard::createPage(::svt::WizardTypes::WizardState _nState) { switch (_nState) { @@ -106,7 +106,7 @@ namespace dbp } //--------------------------------------------------------------------- - WizardTypes::WizardState OGroupBoxWizard::determineNextState( WizardState _nCurrentState ) const + WizardTypes::WizardState OGroupBoxWizard::determineNextState( ::svt::WizardTypes::WizardState _nCurrentState ) const { switch (_nCurrentState) { @@ -133,7 +133,7 @@ namespace dbp } //--------------------------------------------------------------------- - void OGroupBoxWizard::enterState(WizardState _nState) + void OGroupBoxWizard::enterState(::svt::WizardTypes::WizardState _nState) { // some stuff to do before calling the base class (modifying our settings) switch (_nState) @@ -265,7 +265,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool ORadioSelectionPage::commitPage( CommitPageReason _eReason ) + sal_Bool ORadioSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OGBWPage::commitPage(_eReason)) return sal_False; @@ -277,7 +277,7 @@ namespace dbp rSettings.aValues.clear(); rSettings.aLabels.reserve(m_aExistingRadios.GetEntryCount()); rSettings.aValues.reserve(m_aExistingRadios.GetEntryCount()); - for (WizardState i=0; i(getDialog())->getSettings(); } }; @@ -164,7 +164,8 @@ namespace dbp ListBox m_aOptions; StringArray m_aUncommittedValues; - WizardState m_nLastSelection; + ::svt::WizardTypes::WizardState + m_nLastSelection; public: OOptionValuesPage( OControlWizard* _pParent ); @@ -175,7 +176,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); void implTraveledOptions(); @@ -217,7 +218,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; }; diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 2e810654baa4..63659f613460 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -362,14 +362,14 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool OContentTableSelection::commitPage( CommitPageReason _eReason ) + sal_Bool OContentTableSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OLCPage::commitPage(_eReason)) return sal_False; OListComboSettings& rSettings = getSettings(); rSettings.sListContentTable = m_aSelectTable.GetSelectEntry(); - if (!rSettings.sListContentTable.Len() && (eTravelBackward != _eReason)) + if (!rSettings.sListContentTable.Len() && (::svt::WizardTypes::eTravelBackward != _eReason)) // need to select a table return sal_False; @@ -440,7 +440,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool OContentFieldSelection::commitPage( CommitPageReason _eReason ) + sal_Bool OContentFieldSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OLCPage::commitPage(_eReason)) return sal_False; @@ -518,7 +518,7 @@ namespace dbp } //--------------------------------------------------------------------- - sal_Bool OLinkFieldsPage::commitPage( CommitPageReason _eReason ) + sal_Bool OLinkFieldsPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) { if (!OLCPage::commitPage(_eReason)) return sal_False; diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index 7dcf32316236..c30a19a77a00 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -129,7 +129,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; protected: @@ -163,7 +163,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; }; @@ -190,7 +190,7 @@ namespace dbp // OWizardPage overridables virtual void initializePage(); - virtual sal_Bool commitPage( CommitPageReason _eReason ); + virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); virtual bool canAdvance() const; private: -- cgit