diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-20 12:45:50 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-20 12:45:50 +0200 |
commit | 3edcb9564ce9b11d75f76eff6c2eef7f830803ba (patch) | |
tree | d19a7feb5c548b93110523b8a66e85d7e8706c60 | |
parent | 9a40f47ebf9f07f5cae092ddd84280c2e21e515f (diff) |
unoawt: UNO API for generic wizards, wrapping around the existing C++ RoadmapWizard
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/Wizard.idl | 75 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/WizardButton.idl | 53 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/WizardTravelType.idl | 51 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/XWizard.idl | 72 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/XWizardController.idl | 75 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/XWizardPage.idl | 83 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/makefile.mk | 8 |
7 files changed, 416 insertions, 1 deletions
diff --git a/offapi/com/sun/star/ui/dialogs/Wizard.idl b/offapi/com/sun/star/ui/dialogs/Wizard.idl new file mode 100644 index 000000000000..36c0f17dedb5 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/Wizard.idl @@ -0,0 +1,75 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_Wizard_idl__ +#define __com_sun_star_ui_dialogs_Wizard_idl__ + +#include <com/sun/star/ui/dialogs/XWizard.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +interface XWizardController; + +//================================================================================================================== + +/** + */ +service Wizard : XWizard +{ + /** creates a wizard with a single execution path + @param PageIds + the IDs of the pages which constitute the execution path. IDs must be in ascending order. + */ + createSinglePathWizard( + [in] sequence< short > PageIds, + [in] XWizardController Controller + ) + raises ( ::com::sun::star::lang::IllegalArgumentException + ); + + /** creates a wizard with a multiple possible execution paths + + @param PageIds + the IDs of the pages which constitute the execution paths. IDs in each path must be in ascending order. + */ + createMultiplePathsWizard( + [in] sequence< sequence< short > > PageIds, + [in] XWizardController Controller + ) + raises ( ::com::sun::star::lang::IllegalArgumentException + ); +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/WizardButton.idl b/offapi/com/sun/star/ui/dialogs/WizardButton.idl new file mode 100644 index 000000000000..3169adeab95c --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/WizardButton.idl @@ -0,0 +1,53 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_WizardButton_idl__ +#define __com_sun_star_ui_dialogs_WizardButton_idl__ + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +//================================================================================================================== + +/** + */ +constants WizardButton +{ + const short NEXT = 1; + const short PREVIOUS = 2; + const short FINISH = 3; + const short CANCEL = 4; + const short HELP = 5; +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/WizardTravelType.idl b/offapi/com/sun/star/ui/dialogs/WizardTravelType.idl new file mode 100644 index 000000000000..9efd822ffe33 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/WizardTravelType.idl @@ -0,0 +1,51 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_WizardTravelType_idl__ +#define __com_sun_star_ui_dialogs_WizardTravelType_idl__ + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +//================================================================================================================== + +/** + */ +constants WizardTravelType +{ + const short FORWARD = 1; + const short BACKWARD = 2; + const short FINISH = 3; +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/XWizard.idl b/offapi/com/sun/star/ui/dialogs/XWizard.idl new file mode 100644 index 000000000000..76b4af66ffa1 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XWizard.idl @@ -0,0 +1,72 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_XWizard_idl__ +#define __com_sun_star_ui_dialogs_XWizard_idl__ + +#include <com/sun/star/ui/dialogs/XExecutableDialog.idl> + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +//================================================================================================================== + +/** + */ +interface XWizard +{ + interface XExecutableDialog; + + void enableButton( [in] short WizardButton, [in] boolean Enable ); + void setDefaultButton( [in] short WizardButton ); + + boolean travelNext(); + boolean travelPrevious(); + + /** updates the wizard elements which are related to traveling. + + <p>For instance, the <code>Next</code> button is disabled if the current page's <member>XWizardPage::canAdvance</member> + method returns <FALSE/>.</p> + + <p>You usually call this method from within a wizard page whose state changed in a way that it affects the + user's ability to reach other pages.</p> + */ + void updateTravelUI(); + + boolean advanceTo( [in] short PageId ); + boolean goBackTo( [in] short PageId ); + + short getCurrentPage(); +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/XWizardController.idl b/offapi/com/sun/star/ui/dialogs/XWizardController.idl new file mode 100644 index 000000000000..e38bcb1a5f1f --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XWizardController.idl @@ -0,0 +1,75 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_XWizardController_idl__ +#define __com_sun_star_ui_dialogs_XWizardController_idl__ + +#include <com/sun/star/ui/dialogs/XWizardPage.idl> + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +interface XWizard; + +//================================================================================================================== + +/** + */ +interface XWizardController +{ + XWizardPage createPage( [in] ::com::sun::star::awt::XWindow ParentWindow, [in] short PageId ); + + string getPageTitle( [in] short PageId ); + + boolean canAdvance(); + + void onActivatePage( [in] short PageId ); + + /** called when the current page is about to be left + + <p>In opposite to <member>XWizardPage::commitPage</member>, <code>confirmDeactivatePage</code> is intended for checking + conditions which involve more than the state of the currently active page.</p> + + @param PageId + the ID of the page which is about to be left. + @param Reason + is one of the <type>WizardTravelType</type> contants denoting the reason why the page is about to be left. + */ + boolean confirmDeactivatePage( [in] short PageId, [in] short Reason ); + + void onDeactivatePage( [in] short PageId ); + + boolean confirmFinish(); +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/XWizardPage.idl b/offapi/com/sun/star/ui/dialogs/XWizardPage.idl new file mode 100644 index 000000000000..8e0ea1b6be67 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XWizardPage.idl @@ -0,0 +1,83 @@ +/************************************************************************* + * 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 __com_sun_star_ui_dialogs_XWizardPage_idl__ +#define __com_sun_star_ui_dialogs_XWizardPage_idl__ + +#include <com/sun/star/awt/XWindow.idl> + +//================================================================================================================== + +module com { module sun { module star { module ui { module dialogs { + +//================================================================================================================== + +/** + */ +interface XWizardPage : ::com::sun::star::lang::XComponent +{ + /** provides read-only access to the window of the page + */ + [attribute, readonly] ::com::sun::star::awt::XWindow Window; + + /** called when the page is activated + */ + void activatePage(); + + /** is called when the page is about to be left + + <p>An implementation can veto the leave by returning <FALSE/> here. Usually, the decision about this + depends on the current state of the page.</p> + + <p>Note that <member>XWizardPage::commitPage</member> is called before <member>XWizardController::confirmDeactivatePage</member> + gets called.</p> + + @param Reason + is one of the <type>WizardTravelType</type> contants denoting the reason why the page should be + committed. + */ + boolean commitPage( [in] short Reason ); + + /** determines whether it is allowed to travel to a later page in the wizard + + <p>You should base this decision on the state of the page only, not on a global state of the wizard. Usually, + you return <FALSE/> here if and only if not all necessary input on the page has been provided by the user, + or the provided input is not valid.</p> + + <p>If checked for validity is expensive, or if you prefer giving your user more detailed feedback on validity + than a disabled <code>Next</code> button in the wizard, then move your checks to the <member>commitPage</member> + method.</p> + */ + boolean canAdvance(); +}; + +//================================================================================================================== + +}; }; }; }; }; + +//================================================================================================================== + +#endif diff --git a/offapi/com/sun/star/ui/dialogs/makefile.mk b/offapi/com/sun/star/ui/dialogs/makefile.mk index fa11ba35e173..07d762fb0ec6 100644 --- a/offapi/com/sun/star/ui/dialogs/makefile.mk +++ b/offapi/com/sun/star/ui/dialogs/makefile.mk @@ -64,7 +64,13 @@ IDLFILES=\ XControlInformation.idl \ XAsynchronousExecutableDialog.idl \ XDialogClosedListener.idl \ - DialogClosedEvent.idl + DialogClosedEvent.idl \ + XWizard.idl \ + XWizardController.idl \ + Wizard.idl \ + XWizardPage.idl \ + WizardButton.idl \ + WizardTravelType.idl # ------------------------------------------------------------------ |