diff options
Diffstat (limited to 'svtools/workben/unodialog')
-rw-r--r-- | svtools/workben/unodialog/makefile.mk | 90 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.cxx | 113 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.hrc | 41 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.hxx | 65 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.src | 84 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeletonpages.cxx | 114 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeletonpages.hxx | 104 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_global.hrc | 54 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_module.cxx | 42 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_module.hxx | 45 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_services.cxx | 58 | ||||
-rw-r--r-- | svtools/workben/unodialog/unodialogsample.cxx | 214 |
12 files changed, 1024 insertions, 0 deletions
diff --git a/svtools/workben/unodialog/makefile.mk b/svtools/workben/unodialog/makefile.mk new file mode 100644 index 000000000000..f18feffce5c3 --- /dev/null +++ b/svtools/workben/unodialog/makefile.mk @@ -0,0 +1,90 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# 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. +# +#************************************************************************* + +PRJ=..$/.. +PRJINC=$(PRJ)/inc +PRJNAME=svtools +TARGET=udlg +USE_DEFFILE=TRUE + +ENABLE_EXCEPTIONS=TRUE +VISIBILITY_HIDDEN=TRUE + +# --- Settings ---------------------------------- + +.INCLUDE : settings.mk + +# --- Files ------------------------------------- + +# ... resource files ............................ + +SRS1NAME=$(TARGET) +SRC1FILES = \ + roadmapskeleton.src + +# ... object files ............................ +SLOFILES= $(SLO)$/unodialogsample.obj \ + $(SLO)$/roadmapskeleton.obj \ + $(SLO)$/roadmapskeletonpages.obj \ + $(SLO)$/udlg_module.obj \ + $(SLO)$/udlg_services.obj \ + +# --- library ----------------------------------- + +SHL1TARGET=$(TARGET)$(DLLPOSTFIX) +SHL1VERSIONMAP=$(SOLARENV)/src/component.map + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(SALLIB) \ + $(SVTOOLLIB) \ + $(VCLLIB) + +SHL1LIBS= $(SLB)$/$(TARGET).lib +SHL1IMPLIB= i$(TARGET) +SHL1DEPN= $(SHL1LIBS) +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +DEF1NAME= $(SHL1TARGET) + +# --- .res files ------------------------------- + +RES1FILELIST=\ + $(SRS)$/$(TARGET).srs + +RESLIB1NAME=$(TARGET) +RESLIB1IMAGES=$(PRJ)$/res +RESLIB1SRSFILES=$(RES1FILELIST) + +# --- Targets ---------------------------------- + +.INCLUDE : target.mk + diff --git a/svtools/workben/unodialog/roadmapskeleton.cxx b/svtools/workben/unodialog/roadmapskeleton.cxx new file mode 100644 index 000000000000..e3ed06707f14 --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeleton.cxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "udlg_module.hxx" +#include "udlg_global.hrc" +#include "roadmapskeleton.hrc" +#include "roadmapskeleton.hxx" +#include "roadmapskeletonpages.hxx" + +//........................................................................ +namespace udlg +{ +//........................................................................ + +#define STATE_WELCOME 0 +#define STATE_PREPARE 1 +#define STATE_SETUP 2 +#define STATE_FINISH 3 + +#define PATH_DEFAULT 1 + + //==================================================================== + //= RoadmapSkeletonDialog + //==================================================================== + //-------------------------------------------------------------------- + RoadmapSkeletonDialog::RoadmapSkeletonDialog( const ::comphelper::ComponentContext& _rContext, Window* _pParent ) + :RoadmapSkeletonDialog_Base( _pParent, UdlgResId( DLG_ROADMAP_SKELETON ) ) + ,m_aContext( _rContext ) + { + String sTitlePrepare( UdlgResId( STR_STATE_WELCOME ) ); + String sTitleStoreAs( UdlgResId( STR_STATE_PREPARE ) ); + String sTitleMigrate( UdlgResId( STR_STATE_SETUP ) ); + String sTitleSummary( UdlgResId( STR_STATE_FINISH ) ); + FreeResource(); + + describeState( STATE_WELCOME, sTitlePrepare, &WelcomePage::Create ); + describeState( STATE_PREPARE, sTitleStoreAs, &PreparationPage::Create ); + describeState( STATE_SETUP, sTitleMigrate, &SetupPage::Create ); + describeState( STATE_FINISH, sTitleSummary, &FinishPage::Create ); + + declarePath( PATH_DEFAULT, STATE_WELCOME, STATE_PREPARE, STATE_SETUP, STATE_FINISH, WZS_INVALID_STATE ); + + SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MAP_APPFONT ) ); + ShowButtonFixedLine( true ); + SetRoadmapInteractive( true ); + enableAutomaticNextButtonState(); + defaultButton( WZB_NEXT ); + enableButtons( WZB_FINISH, true ); + ActivatePage(); + } + + //-------------------------------------------------------------------- + RoadmapSkeletonDialog::~RoadmapSkeletonDialog() + { + } + + //-------------------------------------------------------------------- + void RoadmapSkeletonDialog::enterState( WizardState _nState ) + { + RoadmapSkeletonDialog_Base::enterState( _nState ); + } + + //-------------------------------------------------------------------- + sal_Bool RoadmapSkeletonDialog::prepareLeaveCurrentState( CommitPageReason _eReason ) + { + return RoadmapSkeletonDialog_Base::prepareLeaveCurrentState( _eReason ); + } + + //-------------------------------------------------------------------- + sal_Bool RoadmapSkeletonDialog::leaveState( WizardState _nState ) + { + return RoadmapSkeletonDialog_Base::leaveState( _nState ); + } + + //-------------------------------------------------------------------- + RoadmapSkeletonDialog::WizardState RoadmapSkeletonDialog::determineNextState( WizardState _nCurrentState ) const + { + return RoadmapSkeletonDialog_Base::determineNextState( _nCurrentState ); + } + + //-------------------------------------------------------------------- + sal_Bool RoadmapSkeletonDialog::onFinish() + { + return RoadmapSkeletonDialog_Base::onFinish(); + } + +//........................................................................ +} // namespace udlg +//........................................................................ diff --git a/svtools/workben/unodialog/roadmapskeleton.hrc b/svtools/workben/unodialog/roadmapskeleton.hrc new file mode 100644 index 000000000000..9b704e4a8f11 --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeleton.hrc @@ -0,0 +1,41 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#ifndef SVTOOLS_ROADMAPSKELETON_HRC +#define SVTOOLS_ROADMAPSKELETON_HRC + +#define TAB_PAGE_WIDTH 280 +#define TAB_PAGE_HEIGHT 185 + +//... strings ............................................................ + +#define STR_STATE_WELCOME 1 +#define STR_STATE_PREPARE 2 +#define STR_STATE_SETUP 3 +#define STR_STATE_FINISH 4 + +#endif // SVTOOLS_ROADMAPSKELETON_HRC diff --git a/svtools/workben/unodialog/roadmapskeleton.hxx b/svtools/workben/unodialog/roadmapskeleton.hxx new file mode 100644 index 000000000000..8859390c4b58 --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeleton.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#ifndef SVTOOLS_ROADMAPSKELETONDIALOG_HXX +#define SVTOOLS_ROADMAPSKELETONDIALOG_HXX + +#include <comphelper/componentcontext.hxx> +#include <svtools/roadmapwizard.hxx> + +//........................................................................ +namespace udlg +{ +//........................................................................ + + //==================================================================== + //= RoadmapSkeletonDialog + //==================================================================== + typedef ::svt::RoadmapWizard RoadmapSkeletonDialog_Base; + class RoadmapSkeletonDialog : public RoadmapSkeletonDialog_Base + { + public: + RoadmapSkeletonDialog( const ::comphelper::ComponentContext& _rContext, Window* _pParent ); + virtual ~RoadmapSkeletonDialog(); + + protected: + // OWizardMachine overridables + virtual void enterState( WizardState _nState ); + virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason ); + virtual sal_Bool leaveState( WizardState _nState ); + virtual WizardState determineNextState( WizardState _nCurrentState ) const; + virtual sal_Bool onFinish(); + + private: + ::comphelper::ComponentContext m_aContext; + }; + +//........................................................................ +} // namespace udlg +//........................................................................ + +#endif // SVTOOLS_ROADMAPSKELETONDIALOG_HXX diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src new file mode 100644 index 000000000000..797490273b5f --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeleton.src @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "udlg_global.hrc" +#include "roadmapskeleton.hrc" + +// ----------------------------------------------------------------------------- +ModalDialog DLG_ROADMAP_SKELETON +{ + OutputSize = TRUE ; + Moveable = TRUE; + Closeable = TRUE ; + Hide = TRUE; + + Text[ en-US ] = "Roadmap Skeleton Demo" ; + + String STR_STATE_WELCOME + { + Text [ en-US ] = "Welcome"; + }; + + String STR_STATE_PREPARE + { + Text [ en-US ] = "Prepare"; + }; + + String STR_STATE_SETUP + { + Text [ en-US ] = "Setup"; + }; + + String STR_STATE_FINISH + { + Text [ en-US ] = "Finish"; + }; +}; + +TabPage TP_WELCOME +{ + Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); + Hide = TRUE; +}; + +TabPage TP_PREPARE +{ + Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); + Hide = TRUE; +}; + +TabPage TP_SETUP +{ + Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); + Hide = TRUE; +}; + +TabPage TP_FINISH +{ + Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); + Hide = TRUE; +}; diff --git a/svtools/workben/unodialog/roadmapskeletonpages.cxx b/svtools/workben/unodialog/roadmapskeletonpages.cxx new file mode 100644 index 000000000000..9d9291f92da5 --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeletonpages.cxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "udlg_module.hxx" +#include "udlg_global.hrc" +#include "roadmapskeletonpages.hxx" +#include "roadmapskeleton.hxx" + +//........................................................................ +namespace udlg +{ +//........................................................................ + + //==================================================================== + //= RoadmapSkeletonPage + //==================================================================== + //-------------------------------------------------------------------- + RoadmapSkeletonPage::RoadmapSkeletonPage( RoadmapSkeletonDialog& _rParentDialog, const ResId& _rRes ) + :RoadmapSkeletonPage_Base( &_rParentDialog, _rRes ) + { + } + + //-------------------------------------------------------------------- + RoadmapSkeletonPage::~RoadmapSkeletonPage() + { + } + + //==================================================================== + //= WelcomePage + //==================================================================== + //-------------------------------------------------------------------- + WelcomePage::WelcomePage( RoadmapSkeletonDialog& _rParentDialog ) + :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_WELCOME ) ) + { + } + + //-------------------------------------------------------------------- + TabPage* WelcomePage::Create( ::svt::RoadmapWizard& _rParentDialog ) + { + return new WelcomePage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); + } + + //==================================================================== + //= PreparationPage + //==================================================================== + //-------------------------------------------------------------------- + PreparationPage::PreparationPage( RoadmapSkeletonDialog& _rParentDialog ) + :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_PREPARE ) ) + { + } + + //-------------------------------------------------------------------- + TabPage* PreparationPage::Create( ::svt::RoadmapWizard& _rParentDialog ) + { + return new PreparationPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); + } + + //==================================================================== + //= SetupPage + //==================================================================== + //-------------------------------------------------------------------- + SetupPage::SetupPage( RoadmapSkeletonDialog& _rParentDialog ) + :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_SETUP ) ) + { + } + + //-------------------------------------------------------------------- + TabPage* SetupPage::Create( ::svt::RoadmapWizard& _rParentDialog ) + { + return new SetupPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); + } + + //==================================================================== + //= FinishPage + //==================================================================== + //-------------------------------------------------------------------- + FinishPage::FinishPage( RoadmapSkeletonDialog& _rParentDialog ) + :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_FINISH ) ) + { + } + + //-------------------------------------------------------------------- + TabPage* FinishPage::Create( ::svt::RoadmapWizard& _rParentDialog ) + { + return new FinishPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); + } + +//........................................................................ +} // namespace udlg +//........................................................................ diff --git a/svtools/workben/unodialog/roadmapskeletonpages.hxx b/svtools/workben/unodialog/roadmapskeletonpages.hxx new file mode 100644 index 000000000000..6b1d9b01710d --- /dev/null +++ b/svtools/workben/unodialog/roadmapskeletonpages.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#ifndef SVTOOLS_ROADMAPSKELETONPAGES_HXX +#define SVTOOLS_ROADMAPSKELETONPAGES_HXX + +#include <svtools/wizardmachine.hxx> + +namespace svt +{ + class RoadmapWizard; +} + +//........................................................................ +namespace udlg +{ +//........................................................................ + + class RoadmapSkeletonDialog; + + //==================================================================== + //= RoadmapSkeletonPage + //==================================================================== + typedef ::svt::OWizardPage RoadmapSkeletonPage_Base; + class RoadmapSkeletonPage : public RoadmapSkeletonPage_Base + { + public: + RoadmapSkeletonPage( RoadmapSkeletonDialog& _rParentDialog, const ResId& _rRes ); + ~RoadmapSkeletonPage(); + }; + + //==================================================================== + //= WelcomePage + //==================================================================== + class WelcomePage : public RoadmapSkeletonPage + { + public: + WelcomePage( RoadmapSkeletonDialog& _rParentDialog ); + + static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); + }; + + //==================================================================== + //= PreparationPage + //==================================================================== + class PreparationPage : public RoadmapSkeletonPage + { + public: + PreparationPage( RoadmapSkeletonDialog& _rParentDialog ); + + static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); + }; + + //==================================================================== + //= SetupPage + //==================================================================== + class SetupPage : public RoadmapSkeletonPage + { + public: + SetupPage( RoadmapSkeletonDialog& _rParentDialog ); + + static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); + }; + + //==================================================================== + //= FinishPage + //==================================================================== + class FinishPage : public RoadmapSkeletonPage + { + public: + FinishPage( RoadmapSkeletonDialog& _rParentDialog ); + + static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); + }; + +//........................................................................ +} // namespace udlg +//........................................................................ + +#endif // SVTOOLS_ROADMAPSKELETONPAGES_HXX diff --git a/svtools/workben/unodialog/udlg_global.hrc b/svtools/workben/unodialog/udlg_global.hrc new file mode 100644 index 000000000000..572de306f0df --- /dev/null +++ b/svtools/workben/unodialog/udlg_global.hrc @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#ifndef SVTOOLS_UDLG_GLOBAL_HRC +#define SVTOOLS_UDLG_GLOBAL_HRC + +#include <svl/solar.hrc> + +//===================================================================== +//= bases +//===================================================================== +#define RID_UDLG_DIALOG_START RID_SVTOOLS_START + 0 +#define RID_UDLG_TAPPAGE_START RID_SVTOOLS_START + 0 + +//===================================================================== +//= dialogs +//===================================================================== + +#define DLG_ROADMAP_SKELETON RID_UDLG_DIALOG_START + 0 + +//===================================================================== +//= tab pages +//===================================================================== + +#define TP_WELCOME ( RID_UDLG_TAPPAGE_START + 0 ) +#define TP_PREPARE ( RID_UDLG_TAPPAGE_START + 1 ) +#define TP_SETUP ( RID_UDLG_TAPPAGE_START + 2 ) +#define TP_FINISH ( RID_UDLG_TAPPAGE_START + 3 ) + +#endif // SVTOOLS_UDLG_GLOBAL_HRC diff --git a/svtools/workben/unodialog/udlg_module.cxx b/svtools/workben/unodialog/udlg_module.cxx new file mode 100644 index 000000000000..da16bc5657ab --- /dev/null +++ b/svtools/workben/unodialog/udlg_module.cxx @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "udlg_module.hxx" + +#include <rtl/instance.hxx> + +//........................................................................ +namespace udlg +{ +//........................................................................ + + IMPLEMENT_MODULE( UdlgModule, "udlg" ); + +//........................................................................ +} // namespace udlg +//........................................................................ + diff --git a/svtools/workben/unodialog/udlg_module.hxx b/svtools/workben/unodialog/udlg_module.hxx new file mode 100644 index 000000000000..2f1b30d9afed --- /dev/null +++ b/svtools/workben/unodialog/udlg_module.hxx @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#ifndef SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX +#define SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX + +#include <unotools/componentresmodule.hxx> + +//........................................................................ +namespace udlg +{ +//........................................................................ + + DEFINE_MODULE( UdlgModule, UdlgClient, UdlgResId ) + +//........................................................................ +} // namespace udlg +//........................................................................ + +#endif // SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX + diff --git a/svtools/workben/unodialog/udlg_services.cxx b/svtools/workben/unodialog/udlg_services.cxx new file mode 100644 index 000000000000..b71dceed5eba --- /dev/null +++ b/svtools/workben/unodialog/udlg_services.cxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include "udlg_module.hxx" + +//........................................................................ +namespace udlg +{ +//........................................................................ + + //-------------------------------------------------------------------- + extern void createRegistryInfo_UnoDialogSkeleton(); + + static void initializeModule() + { + static bool bInitialized( false ); + if ( !bInitialized ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !bInitialized ) + { + createRegistryInfo_UnoDialogSkeleton(); + } + } + } + +//........................................................................ +} // namespace udlg +//........................................................................ + +IMPLEMENT_COMPONENT_LIBRARY_API( ::udlg::UdlgModule, ::udlg::initializeModule ) diff --git a/svtools/workben/unodialog/unodialogsample.cxx b/svtools/workben/unodialog/unodialogsample.cxx new file mode 100644 index 000000000000..4eadc646fef5 --- /dev/null +++ b/svtools/workben/unodialog/unodialogsample.cxx @@ -0,0 +1,214 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * 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. + * + ************************************************************************/ + +#include "udlg_module.hxx" +#include "roadmapskeleton.hxx" + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <comphelper/componentcontext.hxx> +#include "svtools/genericunodialog.hxx" + +//........................................................................ +namespace udlg +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::beans::XPropertySetInfo; + using ::com::sun::star::beans::Property; + /** === end UNO using === **/ + + //==================================================================== + //= UnoDialogSkeleton + //==================================================================== + class UnoDialogSkeleton; + typedef ::svt::OGenericUnoDialog UnoDialogSkeleton_Base; + typedef ::comphelper::OPropertyArrayUsageHelper< UnoDialogSkeleton > UnoDialogSkeleton_PBase; + + class UnoDialogSkeleton + :public UnoDialogSkeleton_Base + ,public UnoDialogSkeleton_PBase + ,public UdlgClient + { + public: + UnoDialogSkeleton( const Reference< XComponentContext >& _rxContext ); + + // XTypeProvider + virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() throw(RuntimeException); + virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException); + + // XPropertySet + virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(RuntimeException); + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; + + // helper for factories + static Reference< XInterface > SAL_CALL Create( const Reference< XComponentContext >& _rxContext ); + static ::rtl::OUString SAL_CALL getImplementationName_static() throw(RuntimeException); + static Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static() throw(RuntimeException); + + protected: + ~UnoDialogSkeleton(); + + protected: + virtual Dialog* createDialog( Window* _pParent ); + virtual void destroyDialog(); + + private: + ::comphelper::ComponentContext m_aContext; + }; + + //==================================================================== + //= UnoDialogSkeleton + //==================================================================== + //-------------------------------------------------------------------- + UnoDialogSkeleton::UnoDialogSkeleton( const Reference< XComponentContext >& _rxContext ) + :UnoDialogSkeleton_Base( _rxContext ) + ,m_aContext( _rxContext ) + { + } + + //-------------------------------------------------------------------- + UnoDialogSkeleton::~UnoDialogSkeleton() + { + // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor, + // so this virtual-method-call the base class does does not work, we're already dead then ... + if ( m_pDialog ) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( m_pDialog ) + destroyDialog(); + } + } + + //-------------------------------------------------------------------- + Reference< XInterface > SAL_CALL UnoDialogSkeleton::Create( const Reference< XComponentContext >& _rxContext ) + { + return *(new UnoDialogSkeleton( _rxContext ) ); + } + + //-------------------------------------------------------------------- + Dialog* UnoDialogSkeleton::createDialog( Window* _pParent ) + { + return new RoadmapSkeletonDialog( m_aContext, _pParent ); + } + + //-------------------------------------------------------------------- + void UnoDialogSkeleton::destroyDialog() + { + UnoDialogSkeleton_Base::destroyDialog(); + } + + //-------------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL UnoDialogSkeleton::getImplementationId() throw(RuntimeException) + { + static ::cppu::OImplementationId* pId = NULL; + if ( !pId ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !pId ) + { + static ::cppu::OImplementationId aId; + pId = &aId; + } + } + return pId->getImplementationId(); + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL UnoDialogSkeleton::getImplementationName_static() throw(RuntimeException) + { + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svtools.workben.UnoDialogSkeleton" ) ); + } + + //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL UnoDialogSkeleton::getSupportedServiceNames_static() throw(RuntimeException) + { + Sequence< ::rtl::OUString > aServices(1); + aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.example.UnoDialogSample" ) ); + return aServices; + } + + //-------------------------------------------------------------------- + ::rtl::OUString SAL_CALL UnoDialogSkeleton::getImplementationName() throw(RuntimeException) + { + return getImplementationName_static(); + } + + //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL UnoDialogSkeleton::getSupportedServiceNames() throw(RuntimeException) + { + return getSupportedServiceNames_static(); + } + + //-------------------------------------------------------------------- + Reference< XPropertySetInfo > SAL_CALL UnoDialogSkeleton::getPropertySetInfo() throw(RuntimeException) + { + return createPropertySetInfo( getInfoHelper() ); + } + + //-------------------------------------------------------------------- + ::cppu::IPropertyArrayHelper& SAL_CALL UnoDialogSkeleton::getInfoHelper() + { + return *const_cast< UnoDialogSkeleton* >( this )->getArrayHelper(); + } + + //-------------------------------------------------------------------- + ::cppu::IPropertyArrayHelper* UnoDialogSkeleton::createArrayHelper( ) const + { + Sequence< Property > aProps; + describeProperties( aProps ); + return new ::cppu::OPropertyArrayHelper( aProps ); + } + + //-------------------------------------------------------------------- + void createRegistryInfo_UnoDialogSkeleton() + { + static OAutoRegistration< UnoDialogSkeleton > aAutoRegistration; + } + +//........................................................................ +} // namespace udlg +//........................................................................ |