summaryrefslogtreecommitdiff
path: root/include/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-25 18:19:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-26 10:41:52 +0200
commit8a05c64a5bbf9b6ad7af8e94e7b970f1323a22c5 (patch)
treead963de32713418067c5ae9ea4436ee28b175625 /include/sfx2
parent5406f8a3cd53ada63472bd62e5b9a886e2866c6f (diff)
starmath: create instances with uno constructors
See tdf#74608 for motivation. And adjust the sfx2 model factory code to cope with UNO constructor functions. Change-Id: I7e57fb3136ad0b3caadd511ea63cf98d3c03ab3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99446 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/sfxmodelfactory.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sfx2/sfxmodelfactory.hxx b/include/sfx2/sfxmodelfactory.hxx
index 1010fc0e3453..1096eca788b1 100644
--- a/include/sfx2/sfxmodelfactory.hxx
+++ b/include/sfx2/sfxmodelfactory.hxx
@@ -24,10 +24,12 @@
#include <com/sun/star/uno/Reference.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <functional>
namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::lang { class XSingleServiceFactory; }
namespace com::sun::star::uno { class XInterface; }
+namespace com::sun::star::uno { class XComponentContext; }
namespace com::sun::star::uno { template <class E> class Sequence; }
enum class SfxModelFlags
@@ -68,6 +70,16 @@ namespace sfx2
const css::uno::Sequence< OUString >& _rServiceNames
);
+ /**
+ * Intended to be called from UNO constructor functions
+ * This evaluates certain creation arguments (passed to createInstanceWithArguments)
+ * and passes them to the factory function of the derived class.
+ */
+ css::uno::Reference<css::uno::XInterface>
+ SFX2_DLLPUBLIC createSfxModelInstance(
+ const css::uno::Sequence<css::uno::Any> & rxArgs,
+ std::function<css::uno::Reference<css::uno::XInterface>( SfxModelFlags )> creationFunc
+ );
} // namespace sfx2