Branch data Line data Source code
1 : : #ifndef INCLUDED_COM_SUN_STAR_SDB_APPLICATION_COPYTABLEWIZARD_HPP
2 : : #define INCLUDED_COM_SUN_STAR_SDB_APPLICATION_COPYTABLEWIZARD_HPP
3 : :
4 : : #include "sal/config.h"
5 : :
6 : : #include "com/sun/star/uno/RuntimeException.hpp"
7 : : #include "com/sun/star/sdb/application/XCopyTableWizard.hpp"
8 : : #include "com/sun/star/uno/DeploymentException.hpp"
9 : : #include "com/sun/star/beans/XPropertySet.hpp"
10 : : #include "com/sun/star/uno/Exception.hpp"
11 : : #include "com/sun/star/task/XInteractionHandler.hpp"
12 : : #include "com/sun/star/uno/XComponentContext.hpp"
13 : : #include "com/sun/star/lang/XMultiComponentFactory.hpp"
14 : : #include "com/sun/star/lang/WrappedTargetException.hpp"
15 : : #include "com/sun/star/lang/IllegalArgumentException.hpp"
16 : : #include "com/sun/star/sdbc/SQLException.hpp"
17 : : #include "com/sun/star/uno/Any.hxx"
18 : : #include "com/sun/star/uno/Reference.hxx"
19 : : #include "com/sun/star/uno/Sequence.hxx"
20 : : #include "cppu/unotype.hxx"
21 : : #include "rtl/ustring.h"
22 : : #include "rtl/ustring.hxx"
23 : :
24 : : namespace com { namespace sun { namespace star { namespace sdb { namespace application {
25 : :
26 : : class CopyTableWizard {
27 : : public:
28 : 0 : static ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard > create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& Source, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& Destination) {
29 [ # # ][ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
30 [ # # ]: 0 : if (!the_factory.is()) {
31 [ # # ][ # # ]: 0 : throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
32 : : }
33 [ # # ]: 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(2);
34 [ # # ][ # # ]: 0 : the_arguments[0] <<= Source;
35 [ # # ][ # # ]: 0 : the_arguments[1] <<= Destination;
36 : 0 : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard > the_instance;
37 : : try {
38 [ # # ][ # # ]: 0 : the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.application.CopyTableWizard")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
[ # # ][ # # ]
[ # # ]
39 : 0 : } catch (::com::sun::star::uno::RuntimeException &) {
40 : 0 : throw;
41 : 0 : } catch (::com::sun::star::lang::IllegalArgumentException &) {
42 : 0 : throw;
43 : 0 : } catch (::com::sun::star::sdbc::SQLException &) {
44 : 0 : throw;
45 : 0 : } catch (::com::sun::star::lang::WrappedTargetException &) {
46 : 0 : throw;
47 [ # # # # : 0 : } catch (::com::sun::star::uno::Exception & the_exception) {
# # ]
48 [ # # # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.sdb.application.CopyTableWizard of type com.sun.star.sdb.application.XCopyTableWizard: ")) + the_exception.Message, the_context);
49 : : }
50 [ # # ]: 0 : if (!the_instance.is()) {
51 [ # # ][ # # ]: 0 : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.sdb.application.CopyTableWizard of type com.sun.star.sdb.application.XCopyTableWizard")), the_context);
52 : : }
53 [ # # ]: 0 : return the_instance;
54 : : }
55 : :
56 : : static ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard > createWithInteractionHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& Source, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& Destination, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& InteractionHandler) {
57 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
58 : : if (!the_factory.is()) {
59 : : throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
60 : : }
61 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(3);
62 : : the_arguments[0] <<= Source;
63 : : the_arguments[1] <<= Destination;
64 : : the_arguments[2] <<= InteractionHandler;
65 : : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard > the_instance;
66 : : try {
67 : : the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XCopyTableWizard >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.application.CopyTableWizard")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
68 : : } catch (::com::sun::star::uno::RuntimeException &) {
69 : : throw;
70 : : } catch (::com::sun::star::lang::IllegalArgumentException &) {
71 : : throw;
72 : : } catch (::com::sun::star::sdbc::SQLException &) {
73 : : throw;
74 : : } catch (::com::sun::star::lang::WrappedTargetException &) {
75 : : throw;
76 : : } catch (::com::sun::star::uno::Exception & the_exception) {
77 : : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.sdb.application.CopyTableWizard of type com.sun.star.sdb.application.XCopyTableWizard: ")) + the_exception.Message, the_context);
78 : : }
79 : : if (!the_instance.is()) {
80 : : throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.sdb.application.CopyTableWizard of type com.sun.star.sdb.application.XCopyTableWizard")), the_context);
81 : : }
82 : : return the_instance;
83 : : }
84 : :
85 : : private:
86 : : CopyTableWizard(); // not implemented
87 : : CopyTableWizard(CopyTableWizard &); // not implemented
88 : : ~CopyTableWizard(); // not implemented
89 : : void operator =(CopyTableWizard); // not implemented
90 : : };
91 : :
92 : : } } } } }
93 : :
94 : : #endif // INCLUDED_COM_SUN_STAR_SDB_APPLICATION_COPYTABLEWIZARD_HPP
|