summaryrefslogtreecommitdiff
path: root/oovbaapi
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2022-11-03 17:59:14 -0400
committerMiklos Vajna <vmiklos@collabora.com>2022-11-15 11:07:06 +0100
commitb8fa94b28a2fbf75edc0d31fbf776d40a227e794 (patch)
tree82298b4d48c17251242faa4f09a143f7fe3a3320 /oovbaapi
parent55c2e9e7e24a4bc2016fc54a5ffaf22aa094eb58 (diff)
tdf#151548 vba FormFields: Add basic word::XDropDown support
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba This now allows MS Word Basic legacy list box form fields to be controlled by VBA basic. -allows getting and setting the text string/list entry -allows adding and deleting list entries Change-Id: Ia772c62395c40a6aa0afae2549f15f4ea3304dbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142396 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oovbaapi')
-rw-r--r--oovbaapi/UnoApi_oovbaapi.mk3
-rw-r--r--oovbaapi/ooo/vba/word/XDropDown.idl31
-rw-r--r--oovbaapi/ooo/vba/word/XListEntries.idl25
-rw-r--r--oovbaapi/ooo/vba/word/XListEntry.idl27
4 files changed, 86 insertions, 0 deletions
diff --git a/oovbaapi/UnoApi_oovbaapi.mk b/oovbaapi/UnoApi_oovbaapi.mk
index 6d83196dbcf6..331cf4937e32 100644
--- a/oovbaapi/UnoApi_oovbaapi.mk
+++ b/oovbaapi/UnoApi_oovbaapi.mk
@@ -1052,6 +1052,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,oovbaapi,ooo/vba/word,\
XDocument \
XDocumentOutgoing \
XDocuments \
+ XDropDown \
XField \
XFields \
XFind \
@@ -1063,6 +1064,8 @@ $(eval $(call gb_UnoApi_add_idlfiles,oovbaapi,ooo/vba/word,\
XGlobals \
XHeaderFooter \
XHeadersFooters \
+ XListEntries \
+ XListEntry \
XListFormat \
XListGalleries \
XListGallery \
diff --git a/oovbaapi/ooo/vba/word/XDropDown.idl b/oovbaapi/ooo/vba/word/XDropDown.idl
new file mode 100644
index 000000000000..d22f2c3299a3
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XDropDown.idl
@@ -0,0 +1,31 @@
+/* -*- 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/.
+ */
+
+module ooo { module vba { module word {
+
+interface XDropDown
+{
+ interface ooo::vba::XHelperInterface;
+ interface com::sun::star::script::XDefaultProperty;
+
+ /// Default member: True if the specified form field object is a valid drop down form field.
+ [attribute, readonly] boolean Valid;
+
+ /// Returns or sets a number that represents the default drop-down index.
+ [attribute] long Default;
+ /// Returns or sets the index of the selected item in a drop-down form field.
+ [attribute] long Value;
+
+ /// Returns a ListEntries collection that represents all the items in a DropDown object.
+ any ListEntries( [in] any Index );
+};
+
+}; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oovbaapi/ooo/vba/word/XListEntries.idl b/oovbaapi/ooo/vba/word/XListEntries.idl
new file mode 100644
index 000000000000..5db6b7bd4eb2
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XListEntries.idl
@@ -0,0 +1,25 @@
+/* -*- 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/.
+ */
+
+module ooo { module vba { module word {
+
+interface XListEntry;
+interface XListEntries
+{
+ interface ooo::vba::XCollection;
+
+ /// Returns a ListEntry object that represents an item added to a drop-down form field.
+ XListEntry Add( [in] string Name, [in] /*optional long*/ any Index ) raises ( com::sun::star::script::BasicErrorException );
+ /// Removes all items from the drop-down form field.
+ void Clear();
+};
+
+}; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oovbaapi/ooo/vba/word/XListEntry.idl b/oovbaapi/ooo/vba/word/XListEntry.idl
new file mode 100644
index 000000000000..753538a1786f
--- /dev/null
+++ b/oovbaapi/ooo/vba/word/XListEntry.idl
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+module ooo { module vba { module word {
+
+interface XListEntry
+{
+ interface ooo::vba::XHelperInterface;
+
+ /// Returns the position of an item in a collection.
+ [attribute, readonly] long Index;
+ /// Returns or sets the name of the specified object.
+ [attribute] string Name;
+
+ /// Deletes the list entry.
+ void Delete();
+};
+
+}; }; };
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */