summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2021-10-19 20:45:41 -0300
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2021-10-20 08:21:54 +0200
commit5c16ac64ef02481ccf19b65f5702caf4b67b888d (patch)
treecdb7dec6eb9171710800c2411139fc868a10a4c4 /offapi
parent279cc2aa9d8e5e53762352415c05c262fb1d906f (diff)
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 <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/com/sun/star/frame/XInfobarProvider.idl35
1 files changed, 34 insertions, 1 deletions
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.
+
+ <p> The example below adds a new infobar named MyInfoBar with type INFO and close (x) button.</p>
+ @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.
+
+ <p>Update the infobar and change the type to WARNING</p>
+ @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)
+
+ <p>Remove MyInfoBar infobar</p>
+ @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: */