Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_OFFICE_QUICKSTART_HPP
2 : #define INCLUDED_COM_SUN_STAR_OFFICE_QUICKSTART_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include <cassert>
7 :
8 : #include "com/sun/star/beans/XFastPropertySet.hpp"
9 : #include "com/sun/star/uno/DeploymentException.hpp"
10 : #include "com/sun/star/uno/Exception.hpp"
11 : #include "com/sun/star/uno/RuntimeException.hpp"
12 : #include "com/sun/star/uno/XComponentContext.hpp"
13 : #include "com/sun/star/uno/Any.hxx"
14 : #include "com/sun/star/uno/Reference.hxx"
15 : #include "com/sun/star/uno/Sequence.hxx"
16 : #include "cppu/unotype.hxx"
17 : #include "rtl/ustring.h"
18 : #include "rtl/ustring.hxx"
19 : #include "sal/types.h"
20 :
21 : namespace com { namespace sun { namespace star { namespace office {
22 :
23 : class Quickstart {
24 : public:
25 : static ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > createDefault(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context) {
26 : assert(the_context.is());
27 : ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > the_instance;
28 : try {
29 : the_instance = ::com::sun::star::uno::Reference< css::beans::XFastPropertySet >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.office.Quickstart" ), ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >(), the_context), ::com::sun::star::uno::UNO_QUERY);
30 : } catch (const ::com::sun::star::uno::RuntimeException &) {
31 : throw;
32 : } catch (const ::com::sun::star::uno::Exception & the_exception) {
33 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet: " ) + the_exception.Message, the_context);
34 : }
35 : if (!the_instance.is()) {
36 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet" ), the_context);
37 : }
38 : return the_instance;
39 : }
40 :
41 0 : static ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > createAndSetVeto(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Bool p1, ::sal_Bool p2, ::sal_Bool DisableVeto) {
42 : assert(the_context.is());
43 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(3);
44 0 : the_arguments[0] <<= p1;
45 0 : the_arguments[1] <<= p2;
46 0 : the_arguments[2] <<= DisableVeto;
47 0 : ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > the_instance;
48 : try {
49 0 : the_instance = ::com::sun::star::uno::Reference< css::beans::XFastPropertySet >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.office.Quickstart" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
50 0 : } catch (const ::com::sun::star::uno::RuntimeException &) {
51 0 : throw;
52 0 : } catch (const ::com::sun::star::uno::Exception & the_exception) {
53 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet: " ) + the_exception.Message, the_context);
54 : }
55 0 : if (!the_instance.is()) {
56 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet" ), the_context);
57 : }
58 0 : return the_instance;
59 : }
60 :
61 0 : static ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > createStart(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Bool bQuickstart) {
62 : assert(the_context.is());
63 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(1);
64 0 : the_arguments[0] <<= bQuickstart;
65 0 : ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > the_instance;
66 : try {
67 0 : the_instance = ::com::sun::star::uno::Reference< css::beans::XFastPropertySet >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.office.Quickstart" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
68 0 : } catch (const ::com::sun::star::uno::RuntimeException &) {
69 0 : throw;
70 0 : } catch (const ::com::sun::star::uno::Exception & the_exception) {
71 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet: " ) + the_exception.Message, the_context);
72 : }
73 0 : if (!the_instance.is()) {
74 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet" ), the_context);
75 : }
76 0 : return the_instance;
77 : }
78 :
79 0 : static ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > createAutoStart(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Bool bQuickstart, ::sal_Bool bAutostart) {
80 : assert(the_context.is());
81 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(2);
82 0 : the_arguments[0] <<= bQuickstart;
83 0 : the_arguments[1] <<= bAutostart;
84 0 : ::com::sun::star::uno::Reference< css::beans::XFastPropertySet > the_instance;
85 : try {
86 0 : the_instance = ::com::sun::star::uno::Reference< css::beans::XFastPropertySet >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.office.Quickstart" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
87 0 : } catch (const ::com::sun::star::uno::RuntimeException &) {
88 0 : throw;
89 0 : } catch (const ::com::sun::star::uno::Exception & the_exception) {
90 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet: " ) + the_exception.Message, the_context);
91 : }
92 0 : if (!the_instance.is()) {
93 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.office.Quickstart of type com.sun.star.beans.XFastPropertySet" ), the_context);
94 : }
95 0 : return the_instance;
96 : }
97 :
98 : private:
99 : Quickstart(); // not implemented
100 : Quickstart(Quickstart &); // not implemented
101 : ~Quickstart(); // not implemented
102 : void operator =(Quickstart); // not implemented
103 : };
104 :
105 : } } } }
106 :
107 : #endif // INCLUDED_COM_SUN_STAR_OFFICE_QUICKSTART_HPP
|