From 5c16ac64ef02481ccf19b65f5702caf4b67b888d Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Tue, 19 Oct 2021 20:45:41 -0300 Subject: tdf#129209 Doc't XInfobarProvider.idl Add examples in .idl file Change-Id: Iea12d3088ec0006731b16e9009008fbe5793f33d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123868 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas --- offapi/com/sun/star/frame/XInfobarProvider.idl | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'offapi') diff --git a/offapi/com/sun/star/frame/XInfobarProvider.idl b/offapi/com/sun/star/frame/XInfobarProvider.idl index 889be2aa4bcd..b04f50b9e70b 100644 --- a/offapi/com/sun/star/frame/XInfobarProvider.idl +++ b/offapi/com/sun/star/frame/XInfobarProvider.idl @@ -58,6 +58,18 @@ interface XInfobarProvider: uno::XInterface @throws com::sun::star::lang::IllegalArgumentException If an Infobar with the same ID already exists, or infobarType contains an invalid value. + +

The example below adds a new infobar named MyInfoBar with type INFO and close (x) button.

+ @code{.bas} + Sub AddInfobar + Dim buttons(1) as new com.sun.star.beans.StringPair + buttons(0).first = "Close doc" + buttons(0).second = ".uno:CloseDoc" + buttons(1).first = "Paste into doc" + buttons(1).second = ".uno:Paste" + ThisComponent.getCurrentController().appendInfobar("MyInfoBar", "Hello world", "Things happened. What now?", com.sun.star.frame.InfobarType.INFO, buttons, true) + End Sub + @endcode */ void appendInfobar( [in] string id, @@ -77,6 +89,13 @@ interface XInfobarProvider: uno::XInterface If no such Infobar exists (it might have been closed by the user already) @throws com::sun::star::lang::IllegalArgumentException If infobarType contains an invalid value. + +

Update the infobar and change the type to WARNING

+ @code{.bas} + Sub UpdateInfobar + ThisComponent.getCurrentController().updateInfobar("MyInfoBar", "WARNING","Do not read this message.", com.sun.star.frame.InfobarType.WARNING) + End Sub + @endcode */ void updateInfobar( [in] string id, @@ -92,7 +111,15 @@ interface XInfobarProvider: uno::XInterface @throws com::sun::star::container::NoSuchElementException If no such Infobar exists (it might have been closed by the user already) + +

Remove MyInfoBar infobar

+ @code{.bas} + Sub RemoveInfobar + ThisComponent.getCurrentController().removeInfobar("MyInfoBar") + End Sub + @endcode */ + void removeInfobar([in] string id) raises(com::sun::star::container::NoSuchElementException); /** Check if Infobar exists. @@ -101,6 +128,12 @@ interface XInfobarProvider: uno::XInterface The ID which was used when creating this Infobar. @since LibreOffice 7.0 + + @code{.bas} + Function HasMyInfobar as boolean + hasMyInfoBar = ThisComponent.getCurrentController().hasInfobar("MyInfoBar") + End Function + @endcode */ boolean hasInfobar([in] string id); }; @@ -110,4 +143,4 @@ interface XInfobarProvider: uno::XInterface #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit