From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001
From: Daniel Baumann The broadcaster who sends such event, must send the dialog as the source. These constants are used to specify extended controls of a FilePicker dialog.
+ A FilePicker service may be initialized so that it has additional controls
+ extending the set of common controls a FilePicker usually supports. Notes for the implementation of a FileSave dialog:
+ The implementation of a FileSave dialog should automatically check
+ for existence of a file and issue a warning if a file with the same
+ name already exist. The user options are stored inside the com::sun::star::document::MediaDescriptor
+ and can be queried from the com::sun::star::document::MediaDescriptor by
+ the component that implements com::sun::star::document::XFilter. The application will set the com::sun::star::document::MediaDescriptor
+ using the interface com::sun::star::beans::XPropertyAccess and then
+ call XExecutableDialog::execute(). If that method returns Otherwise, the filter operation is canceled. Use this interface to access user interface controls supported
+ by the implementing service. The supported controls, control
+ properties and the appropriate values are documented in the
+ description of the implementing service. Registered listeners will be notified with a
+ DialogClosedEvent when a XAsynchronousExecutableDialog is closed. If the multi-selection mode is enabled, multiple files
+ may be selected by the user else only one file selection at a time is possible A value of `TRUE` enables the multi-selection mode. A value of `FALSE` disables the multi-selection mode, this is the default. Specifies the default file name, displayed when the FilePicker
+ is shown. The implementation may accept any string, and does not
+ have to check for a valid file name or if the file really exists.
+ If the user closed the dialog with cancel an empty sequence will be
+ returned. If the dialog is in execution mode and a single file is selected
+ the complete URL of this file will be returned. If the dialog is in execution mode and the selected file name is false
+ or any other error occurs an empty sequence will be returned. The complete path of the file or directory currently selected
+ in URL format. This always returns only the first entry of the sequence.
+ Notes for the implementation of a FileSave dialog:If there exists
+ a checkbox "Automatic File Extension" which is checked and a valid filter is currently selected
+ the dialog may automatically add an extension to the selected file name.
+ ExecutableDialogResults::OK
,
+ the application will retrieve the changed com::sun::star::document::MediaDescriptor
+ back using the interface com::sun::star::beans::XPropertyAccess. The filter
+ operation is then continued, using the new com::sun::star::document::MediaDescriptor.ExecutableDialogResults::OK
,
+ the options can be retrieved by calling
+ com::sun::star::beans::XPropertyAccess::getPropertyValues.
+ */
+ interface ::com::sun::star::ui::dialogs::XExecutableDialog;
+};
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/ui/dialogs/FolderPicker.idl b/offapi/com/sun/star/ui/dialogs/FolderPicker.idl
new file mode 100644
index 000000000..a283c6085
--- /dev/null
+++ b/offapi/com/sun/star/ui/dialogs/FolderPicker.idl
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_ui_dialogs_FolderPicker_idl__
+#define __com_sun_star_ui_dialogs_FolderPicker_idl__
+
+#include
+
+ */
+ const short FILESAVE_AUTOEXTENSION_PASSWORD = 2;
+
+ /** A FileSave dialog with additional controls.
+
+
+ */
+ const short FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS = 3;
+
+ /** A FileSave dialog with additional controls.
+
+
+ */
+ const short FILESAVE_AUTOEXTENSION_SELECTION = 4;
+
+ /** A FileSave dialog with additional controls.
+
+
+ */
+ const short FILESAVE_AUTOEXTENSION_TEMPLATE = 5;
+
+ /** A FileOpen dialog with additional controls.
+
+
+ */
+ const short FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE = 6;
+
+ /** A FileOpen dialog with additional controls.
+
+
+ */
+ const short FILEOPEN_PLAY = 7;
+
+ /** A FileOpen dialog with additional controls.
+
+
+ */
+ const short FILEOPEN_READONLY_VERSION = 8;
+
+ /** A FileOpen dialog with additional controls.
+
+
+ */
+ const short FILEOPEN_LINK_PREVIEW = 9;
+
+ /** A FileSave dialog with additional controls.
+
+
+ */
+ const short FILESAVE_AUTOEXTENSION = 10;
+
+ /** A FileOpen dialog with additional controls.
+
+
+
+ @since LibreOffice 5.3
+ */
+ const short FILEOPEN_PREVIEW = 11;
+
+ /** A FileOpen dialog with additional controls.
+
+
+
+ @since LibreOffice 5.3
+ */
+ const short FILEOPEN_LINK_PLAY = 12;
+
+ /** A FileOpen dialog with additional controls.
+
+
+
+ @since LibreOffice 6.1
+ */
+ const short FILEOPEN_LINK_PREVIEW_IMAGE_ANCHOR = 13;
+};
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 000000000..f7156496a
--- /dev/null
+++ b/offapi/com/sun/star/ui/dialogs/Wizard.idl
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_ui_dialogs_Wizard_idl__
+#define __com_sun_star_ui_dialogs_Wizard_idl__
+
+#include
+
+
If the user closed the dialog with cancel an empty sequence will be returned.
+If the user closed the dialog with OK a list of all selected files will be returned.
+ + @attention ++ Instead to the method getFiles() of base interface XFilePicker the new method return + full qualified URLs for every selected file. +
+ + @returns +A list of all selected file as complete URLs.
+Notes for the implementation of a FileSave dialog:If there exists + a checkbox "Automatic File Extension" which is checked and a valid filter is currently selected + the dialog may automatically add an extension to the selected file name(s).
+ */ + sequence< string > getSelectedFiles(); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl b/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl new file mode 100644 index 000000000..d2ee0e2d7 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilePicker3.idl @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XFilePicker3_idl__ +#define __com_sun_star_ui_dialogs_XFilePicker3_idl__ + +#includeThis may be useful for automatic test tools for instance.
+ */ + interface com::sun::star::util::XCancellable; + + /** For shutdown and listener support. + */ + interface com::sun::star::lang::XComponent; + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilePickerControlAccess.idl b/offapi/com/sun/star/ui/dialogs/XFilePickerControlAccess.idl new file mode 100644 index 000000000..e50db024c --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilePickerControlAccess.idl @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XFilePickerControlAccess_idl__ +#define __com_sun_star_ui_dialogs_XFilePickerControlAccess_idl__ + +#includeA FilePicker may contain additional elements according to the needs + of the different applications. These additional elements can be + addressed by this interface.
+ + @see com::sun::star::ui::dialogs::FilePicker +*/ +published interface XFilePickerControlAccess: com::sun::star::ui::dialogs::XFilePicker +{ + +/** Set the value of an additional element within a FilePicker. + + @param ControlId + Identifies the element which value is to be set. + + @param aControlAction + Specifies an action to perform with the given value. + aControlAction has to be one of the values defined in ControlActions. + Not all of the values are valid for all controls. + To add a new filter to the FilePicker use the interface XFilterManager, but + optionally an implementation may also support adding new filter using this + method. + + @param aValue + The value to set. For checkboxes aValue should be a boolean value that + should be `TRUE` if the checkbox should be checked and `FALSE` otherwise. + + @see com::sun::star::ui::dialogs::CommonFilePickerElementIds + @see com::sun::star::ui::dialogs::ExtendedFilePickerElementIds + @see com::sun::star::ui::dialogs::ControlActions +*/ +void setValue( [in] short ControlId, [in] short aControlAction, [in] any aValue ); + +/** Get the value of an additional element within a FilePicker + + @param aControlId + Identifies the element for which value is requested. + + @param aControlAction + Specifies which value to retrieve. + aControlAction has to be one of the values defined in ControlActions. + Not all of the values are valid for all controls. + + @returns + The value of the specified element. If the specified control + is a checkbox the returned value is a boolean that is `TRUE` + if the checkbox is checked `FALSE` otherwise. + If the specified element doesn't exist or the specified element + doesn't support the specified control action an empty any will be + returned. + + @see com::sun::star::ui::dialogs::CommonFilePickerElementIds + @see com::sun::star::ui::dialogs::ExtendedFilePickerElementIds + @see com::sun::star::ui::dialogs::ControlActions +*/ +any getValue( [in] short aControlId, [in] short aControlAction ); + +/** Set the label of the specified element. If the specified element + doesn't support setting a label, this method has no effect. + + @param aControlId + Identifies the element for which the label should be set. + + @param aLabel + The label to be set. + + @see com::sun::star::ui::dialogs::CommonFilePickerElementIds + @see com::sun::star::ui::dialogs::ExtendedFilePickerElementIds +*/ +void setLabel( [in] short aControlId, [in] string aLabel ); + +/** Returns the label of the specified element. + + @param aControlId + Identifies the element for which the label should be returned. + + @returns + The label of the specified element or an empty string if + the specified element has no or supports no label or the + specified element doesn't exist. + + @see com::sun::star::ui::dialogs::CommonFilePickerElementIds + @see com::sun::star::ui::dialogs::ExtendedFilePickerElementIds +*/ +string getLabel( [in] short aControlId ); + +/** Enables or disables a control. + + @param ControlId + Identifies the control. + + @param bEnable +If `TRUE` the specified control will be enabled.
+If `FALSE` the specified control will be disabled.
+ + @see com::sun::star::ui::dialogs::CommonFilePickerElementIds + @see com::sun::star::ui::dialogs::ExtendedFilePickerElementIds +*/ +void enableControl( [in] short ControlId, [in] boolean bEnable ); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilePickerListener.idl b/offapi/com/sun/star/ui/dialogs/XFilePickerListener.idl new file mode 100644 index 000000000..21d82c810 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilePickerListener.idl @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XFilePickerListener_idl__ +#define __com_sun_star_ui_dialogs_XFilePickerListener_idl__ + +#includeThe XFilePickerListener interface must be implemented by + the clients of the FilePicker service which need to be informed about + events while the FilePicker service is displayed.
+*/ + +published interface XFilePickerListener: com::sun::star::lang::XEventListener +{ + /** A client receives this event if the file selection within the + FilePicker service dialog changes. + + @param aEvent + of type FilePickerEvent that describes the event + + @see com::sun::star::ui::dialogs::FilePickerEvent + */ + void fileSelectionChanged( [in] FilePickerEvent aEvent ); + + + /** A client receives this event if the directory selection within the + FilePicker dialog changes. + + @param aEvent + Of type FilePickerEvent that describes the event. + + @see com::sun::star::ui::dialogs::FilePickerEvent + */ + void directoryChanged( [in] FilePickerEvent aEvent ); + + /** A client receives this event if the F1 key or the help button was + pressed. + + @param aEvent + of type FilePickerEvent that describes the event + + @returns + A help string which the FilePicker dialog should use to display + a help for a specific control. If the returned string is empty it is + undefined how the FilePicker implementation will behave. + It may show a message "no help available" or may show no + help at all. + + @see com::sun::star::ui::dialogs::FilePickerEvent + */ + string helpRequested( [in] FilePickerEvent aEvent ); + + /** A client receives this event if the state of a control within the + FilePicker service dialog changes. + + @param aEvent + of type FilePickerEvent that describes the event. + + @see com::sun::star::ui::dialogs::FilePickerEvent + */ + void controlStateChanged( [in] FilePickerEvent aEvent ); + + /** A client receives this event if the size of the FilePicker dialog + has changed. If the FilePicker dialog contains a preview the client + may ask for the new dimension of the preview area. + */ + void dialogSizeChanged( ); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilePickerNotifier.idl b/offapi/com/sun/star/ui/dialogs/XFilePickerNotifier.idl new file mode 100644 index 000000000..9c20dc932 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilePickerNotifier.idl @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XFilePickerNotifier_idl__ +#define __com_sun_star_ui_dialogs_XFilePickerNotifier_idl__ + +#includeInvalid interfaces or NULL values will be ignored.
+ */ + void addFilePickerListener( [in] XFilePickerListener xListener ); + + /** Interface for clients to unregister as XFilePickerListener. + + @param xListener + The XFilePickerListener interface of the listener that + wants to receive events of type FilePickerEvent. +Invalid interfaces or NULL values will be ignored.
+ */ + void removeFilePickerListener( [in] XFilePickerListener xListener ); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilePreview.idl b/offapi/com/sun/star/ui/dialogs/XFilePreview.idl new file mode 100644 index 000000000..baaa033db --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilePreview.idl @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XFilePreview_idl__ +#define __com_sun_star_ui_dialogs_XFilePreview_idl__ + +#includeA value of `FALSE` hides the preview window.
+ + @returns + A value of `TRUE` on success. +A value of `FALSE` if the operation fails for any reason or the preview + implementation doesn't support hiding the preview.
+ */ + boolean setShowState( [in] boolean bShowState ); + + /** Returns the current show state of the preview. + + @returns + A value of `TRUE` if the preview window is visible. +A value of `FALSE` if the preview window is invisible.
+ */ + boolean getShowState( ); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XFilterGroupManager.idl b/offapi/com/sun/star/ui/dialogs/XFilterGroupManager.idl new file mode 100644 index 000000000..2776717a5 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XFilterGroupManager.idl @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_ui_dialogs_XFilterGroupManager_idl__ +#define __com_sun_star_ui_dialogs_XFilterGroupManager_idl__ + +#includeIt is implementation dependent how the filter groups are presented to the user.
+ It is not even guaranteed that the groups are visualized: implementations are free to simply
+ append all the filters separately, with ignoring the group title.
This may be useful for automatic test tools for instance.
+ */ + interface com::sun::star::util::XCancellable; +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/ui/dialogs/XSLTFilterDialog.idl b/offapi/com/sun/star/ui/dialogs/XSLTFilterDialog.idl new file mode 100644 index 000000000..7eea2ebd7 --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XSLTFilterDialog.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XSLTFilterDialog_idl__ +#define __com_sun_star_ui_dialogs_XSLTFilterDialog_idl__ + +#includeA wizard is a dialog which guides the user through a number of tasks (usually input of data), which the user can + accomplish either sequentially or out-of-order. For this, a wizard is comprised of a number of tab pages, + each page representing a single step.
+ +Sequential navigation in a wizard is done via a Next and a Back button. Non-sequential navigation + is done via a roadmap, which is displayed on the left hand side of the wizard dialog, lists all available + steps, and allows jumping to a certain step (where the creator of the wizard can restrict the available steps + depending on the current situation in the wizard, see below).
+ +A sequence of steps in a wizard dialog is called a path. A given wizard can support one or multiple paths, + which are declared at the time of construction of the wizard.
+ +In the simplest case, where the wizard supports only one path, all available steps are displayed in the roadmap, + and the user can simply travel through them as desired.
+ +If the wizard is more complex, and supports multiple paths, things become more complicated. In a given situation
+ of the wizard, where the user is at step k of the current path, the potential or conflicting
+ paths are those whose first k steps are the same as in the current path. Obviously, there's at least one
+ potential path in every situation: the current one. If there is more than one, then the future steps in the dialog
+ are not finally decided. In such a case, the roadmap will display future steps up to the point where the potential
+ paths diverge, and then an item ...
indicating that the order of steps is undecided.
An XWizardController can declare a certain path as active path by calling the activatePath() + method. Usually, this is done depending on user input. For instance, your wizard could have radio buttons on the + first page which effectively decide about which path to take in the wizard.
+ +Single steps in the wizard can be freely enabled and disabled, using the enablePage() method. + Disabled pages are skipped during sequential traveling, and not selectable in the roadmap.
+ +The state of the Next button in the dialog will be automatically maintained in most situations, + depending on the results of calls to the XWizardController::canAdvance() and XWizardPage::canAdvance() + methods. More sophisticated wizard logic, however, will need manual calls to the enableButton() method. + Also, the Finish button needs to be maintained by the wizard's controller, too, as it cannot be decided + generically in which situations it should be enabled or disabled.
+ + @see XWizardController + @see XWizardPage + + @since OOo 3.3 + */ +interface XWizard +{ + interface XExecutableDialog; + + /** is the help URL of the wizard's main window. + */ + [attribute] string HelpURL; + + [attribute, readonly] ::com::sun::star::awt::XWindow + DialogWindow; + + /** provides access to the current page of the wizard + */ + XWizardPage + getCurrentPage(); + + /** enables or disables a certain button in the wizard + +Normally, you will want to use this method for the Finish button only: The Next + and Back buttons are usually maintained automatically, the Help and Cancel + buttons are unlikely to ever being disabled.
+ + @param WizardButton + denotes the button to enable or disable, as one of the WizardButton constants. Must not be + WizardButton::NONE. + @param Enable + specifies whether the button should be enabled (`TRUE`) or disabled (`FALSE`) + */ + void enableButton( [in] short WizardButton, [in] boolean Enable ); + + /** sets a button in the wizard as default button + +In general, the default button in a wizard is the one which is activated when the user presses + the return key while the focus is in a control which does not handle this key itself (such as + ordinary input controls).
+ +You can use this method, for instance, to make the Next button the default button on all pages + except the last one, where Finish should be defaulted.
+ */ + void setDefaultButton( [in] short WizardButton ); + + /** travels to the next page, if possible + +Calling this method is equivalent to the user pressing the Next button in the wizard. Consequently, + the method will fail if in the current state of the wizard, it is not allowed to advance to a next page.
+ */ + boolean travelNext(); + + /** travels to the next page, if possible + +Calling this method is equivalent to the user pressing the Back button in the wizard.
+ */ + boolean travelPrevious(); + + /** enables or disables the given page + +You can use this method when not all pages of your wizard are necessarily needed in all cases. For instance, + assume that your first wizard page contains a check box, which the user can check to enter additional data. + If you place this data on the second page, then you will want to enable this second page if and only if the + checkbox is checked.
+ +If a page is disabled, it can reached neither by clicking the respective item in the wizard's roadmap, + nor by sequential traveling. Still, the page's item is displayed in the roadmap, though disabled.
+ + @throws ::com::sun::star::container::NoSuchElementException + if there is no page with the given ID + @throws ::com::sun::star::util::InvalidStateException + if the page shall be disabled, but is active currently. + */ + void enablePage( [in] short PageID, [in] boolean Enable ) + raises ( ::com::sun::star::container::NoSuchElementException + , ::com::sun::star::util::InvalidStateException ); + + /** updates the wizard elements which are related to traveling. + +For instance, the Next button is disabled if the current page's XWizardPage::canAdvance() + method returns `FALSE`.
+ +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.
+ */ + void updateTravelUI(); + + /** advances to the given page, if possible. + +Calling this method is equivalent to the user repeatedly pressing the Next button, until the + given page is reached. Consequently, the method will fail if one of the intermediate pages does not allow + advancing to the next page.
+ */ + boolean advanceTo( [in] short PageId ); + + /** goes back to the given page, if possible. + +Calling this method is equivalent to the user repeatedly pressing the Back button, until the + given page is reached.
+ */ + boolean goBackTo( [in] short PageId ); + + /** activates a path + +If the wizard has been created with multiple paths of control flow, then this method allows switching to + another path.
+ +You can only activate a path which shares the first k
pages with the path
+ which is previously active (if any), where k
is the index of the current page within the current
+ path.
Example: Say you have paths, (0,1,2,5)
and (0,1,4,5)
(with
+ the numbers denoting page IDs). This means that after page 1
, you either continue with page
+ 2
or state 4
,and after this, you finish in state 5
.
+ Now if the first path is active, and your current state is 1
, then you can easily switch to the
+ second path, since both paths start with (0,1)
.
+ However, if your current state is 2
, then you can not switch to the second path anymore.
If `TRUE`, the path will be completely activated, even if it is a conflicting path (i.e. there is another
+ path which shares the first k
states with the to-be-activated path.)
If `FALSE`, then the new path is checked for conflicts with other paths. If such conflicts exists, the path + is not completely activated, but only up to the point where it does not conflict.
+ +In this latter case, you need another activatePath method (usually triggered by the user doing some decisions + and entering some data on the reachable pages) before the wizard can actually be finished.
+ +With the paths in the example above, if you activate the second path, then only steps 0
and
+ 1
are activated, since they are common to both paths. Steps 2
, 4
,
+ and 5
are not reachable, yet.
Wizard pages are created on demand, when the respective page is reached during traveling through the + wizard. Effectively, this means the method is called at most once for each possible page ID.
+ + @param ParentWindow + the parent window to use for the page window + @param PageId + the ID of the page. + @return + the requested page. + */ + XWizardPage createPage( [in] ::com::sun::star::awt::XWindow ParentWindow, [in] short PageId ); + + /** provides the title of a page given by ID + +The page titles are displayed in the wizard's roadmap.
+ */ + string getPageTitle( [in] short PageId ); + + boolean canAdvance(); + + /** called when a new page in the wizard is being activated + */ + void onActivatePage( [in] short PageId ); + + /** called when a page in the wizard is being deactivated + */ + void onDeactivatePage( [in] short PageId ); + + /** called when the wizard is about to be finished. + +This method allows the controller to do any final checks, and ultimately veto finishing the wizard.
+ */ + boolean confirmFinish(); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 000000000..c7c1be2fa --- /dev/null +++ b/offapi/com/sun/star/ui/dialogs/XWizardPage.idl @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_ui_dialogs_XWizardPage_idl__ +#define __com_sun_star_ui_dialogs_XWizardPage_idl__ + +#includeWithin a wizard, no two pages are allowed to have the same ID.
+ */ + [attribute, readonly] short PageId; + + /** called when the page is activated + */ + void activatePage(); + + /** is called when the page is about to be left + +An implementation can veto the leave by returning `FALSE` here. Usually, the decision about this + depends on the current state of the page.
+ + @param Reason + is one of the WizardTravelType constants 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 + +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.
+ +If checked for validity is expensive, or if you prefer giving your user more detailed feedback on validity
+ than a disabled Next
button in the wizard, then move your checks to the commitPage()
+ method.