Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <sfx2/docfac.hxx>
30 : : #include <sfx2/sfxmodelfactory.hxx>
31 : : #include "swdll.hxx"
32 : : #include "docsh.hxx"
33 : : #include "globdoc.hxx"
34 : : #include "wdocsh.hxx"
35 : : #include <osl/mutex.hxx>
36 : : #include <vcl/svapp.hxx>
37 : :
38 : : using namespace ::com::sun::star;
39 : :
40 : : //============================================================
41 : : // com.sun.star.comp.Writer.TextDocument
42 : :
43 : 70 : uno::Sequence< ::rtl::OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw()
44 : : {
45 : : // return only top level services here! All others must be
46 : : // resolved by rtti!
47 : 70 : uno::Sequence< ::rtl::OUString > aRet ( 1 );
48 [ + - ]: 70 : ::rtl::OUString* pArray = aRet.getArray();
49 [ + - ]: 70 : pArray[0] = ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.TextDocument" ) );
50 : :
51 : 70 : return aRet;
52 : : }
53 : :
54 : 144 : ::rtl::OUString SAL_CALL SwTextDocument_getImplementationName() throw()
55 : : {
56 : 144 : return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.TextDocument" ) );
57 : : }
58 : :
59 : 1318 : uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
60 : : const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags )
61 : : throw( uno::Exception )
62 : : {
63 [ + - ]: 1318 : SolarMutexGuard aGuard;
64 [ + - ]: 1318 : SwGlobals::ensure();
65 [ + - ][ + - ]: 1318 : SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
66 [ + - ][ + - ]: 1318 : return uno::Reference< uno::XInterface >( pShell->GetModel() );
67 : : }
68 : :
69 : : //============================================================
70 : : // com.sun.star.comp.Writer.WebDocument
71 : :
72 : 2 : uno::Sequence< ::rtl::OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw()
73 : : {
74 : : // return only top level services here! All others must be
75 : : // resolved by rtti!
76 : 2 : uno::Sequence< ::rtl::OUString > aRet ( 1 );
77 [ + - ]: 2 : ::rtl::OUString* pArray = aRet.getArray();
78 [ + - ]: 2 : pArray[0] = ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.WebDocument" ) );
79 : :
80 : 2 : return aRet;
81 : : }
82 : :
83 : 6 : ::rtl::OUString SAL_CALL SwWebDocument_getImplementationName() throw()
84 : : {
85 : 6 : return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.WebDocument" ) );
86 : : }
87 : :
88 : 4 : uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
89 : : const uno::Reference< lang::XMultiServiceFactory > & )
90 : : throw( uno::Exception )
91 : : {
92 [ + - ]: 4 : SolarMutexGuard aGuard;
93 [ + - ]: 4 : SwGlobals::ensure();
94 [ + - ][ + - ]: 4 : SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
95 [ + - ][ + - ]: 4 : return uno::Reference< uno::XInterface >( pShell->GetModel() );
96 : : }
97 : :
98 : : //============================================================
99 : : // com.sun.star.comp.Writer.GlobalDocument
100 : :
101 : 0 : uno::Sequence< ::rtl::OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw()
102 : : {
103 : 0 : uno::Sequence< ::rtl::OUString > aRet ( 1 );
104 [ # # ]: 0 : ::rtl::OUString* pArray = aRet.getArray();
105 [ # # ]: 0 : pArray[0] = ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.GlobalDocument" ) );
106 : :
107 : 0 : return aRet;
108 : : }
109 : :
110 : 2 : ::rtl::OUString SAL_CALL SwGlobalDocument_getImplementationName() throw()
111 : : {
112 : 2 : return ::rtl::OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.GlobalDocument" ) );
113 : : }
114 : :
115 : 0 : uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
116 : : const uno::Reference< lang::XMultiServiceFactory > &)
117 : : throw( uno::Exception )
118 : : {
119 [ # # ]: 0 : SolarMutexGuard aGuard;
120 [ # # ]: 0 : SwGlobals::ensure();
121 [ # # ][ # # ]: 0 : SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
122 [ # # ][ # # ]: 0 : return uno::Reference< uno::XInterface >( pShell->GetModel() );
123 : : }
124 : :
125 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|