1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sfx2/docfac.hxx>
21 #include <sfx2/sfxmodelfactory.hxx>
24 #include "globdoc.hxx"
26 #include <osl/mutex.hxx>
27 #include <vcl/svapp.hxx>
29 using namespace ::com::sun::star
;
31 //============================================================
32 // com.sun.star.comp.Writer.TextDocument
34 uno::Sequence
< OUString
> SAL_CALL
SwTextDocument_getSupportedServiceNames() throw()
36 // return only top level services here! All others must be
38 uno::Sequence
< OUString
> aRet ( 1 );
39 OUString
* pArray
= aRet
.getArray();
40 pArray
[0] = OUString( "com.sun.star.text.TextDocument" );
45 OUString SAL_CALL
SwTextDocument_getImplementationName() throw()
47 return OUString( "com.sun.star.comp.Writer.TextDocument" );
50 uno::Reference
< uno::XInterface
> SAL_CALL
SwTextDocument_createInstance(
51 const uno::Reference
< lang::XMultiServiceFactory
>&, const sal_uInt64 _nCreationFlags
)
52 throw( uno::Exception
)
54 SolarMutexGuard aGuard
;
56 SfxObjectShell
* pShell
= new SwDocShell( _nCreationFlags
);
57 return uno::Reference
< uno::XInterface
>( pShell
->GetModel() );
60 //============================================================
61 // com.sun.star.comp.Writer.WebDocument
63 uno::Sequence
< OUString
> SAL_CALL
SwWebDocument_getSupportedServiceNames() throw()
65 // return only top level services here! All others must be
67 uno::Sequence
< OUString
> aRet ( 1 );
68 OUString
* pArray
= aRet
.getArray();
69 pArray
[0] = OUString( "com.sun.star.text.WebDocument" );
74 OUString SAL_CALL
SwWebDocument_getImplementationName() throw()
76 return OUString( "com.sun.star.comp.Writer.WebDocument" );
79 uno::Reference
< uno::XInterface
> SAL_CALL
SwWebDocument_createInstance(
80 const uno::Reference
< lang::XMultiServiceFactory
> & )
81 throw( uno::Exception
)
83 SolarMutexGuard aGuard
;
85 SfxObjectShell
* pShell
= new SwWebDocShell( SFX_CREATE_MODE_STANDARD
);
86 return uno::Reference
< uno::XInterface
>( pShell
->GetModel() );
89 //============================================================
90 // com.sun.star.comp.Writer.GlobalDocument
92 uno::Sequence
< OUString
> SAL_CALL
SwGlobalDocument_getSupportedServiceNames() throw()
94 uno::Sequence
< OUString
> aRet ( 1 );
95 OUString
* pArray
= aRet
.getArray();
96 pArray
[0] = OUString( "com.sun.star.text.GlobalDocument" );
101 OUString SAL_CALL
SwGlobalDocument_getImplementationName() throw()
103 return OUString( "com.sun.star.comp.Writer.GlobalDocument" );
106 uno::Reference
< uno::XInterface
> SAL_CALL
SwGlobalDocument_createInstance(
107 const uno::Reference
< lang::XMultiServiceFactory
> &)
108 throw( uno::Exception
)
110 SolarMutexGuard aGuard
;
112 SfxObjectShell
* pShell
= new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD
);
113 return uno::Reference
< uno::XInterface
>( pShell
->GetModel() );
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */