LibreOffice Module sw (master)  1
globdoc.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <comphelper/fileformat.h>
21 #include <comphelper/classids.hxx>
23 #include <osl/diagnose.h>
24 
25 #include <unomid.h>
26 
27 #include <swtypes.hxx>
28 #include <shellio.hxx>
29 #include <globdoc.hxx>
30 #include <strings.hrc>
31 
32 // Description: Register all filters
33 
34 
35 SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), "swriter/GlobalDocument" )
36 
38  SwDocShell(eMode)
39 {
40 }
41 
43 {
44 }
45 
47  SotClipboardFormatId * pClipFormat,
48  OUString * pLongUserName,
49  sal_Int32 nVersion,
50  bool bTemplate /* = false */) const
51 {
52  if (nVersion == SOFFICE_FILEFORMAT_60)
53  {
54  *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 );
55  *pClipFormat = SotClipboardFormatId::STARWRITERGLOB_60;
56  *pLongUserName = SwResId(STR_WRITER_GLOBALDOC_FULLTYPE);
57  OSL_ENSURE( !bTemplate, "No template for Writer Global" );
58  }
59  else if (nVersion == SOFFICE_FILEFORMAT_8)
60  {
61  *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 );
62  *pClipFormat = bTemplate ? SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE : SotClipboardFormatId::STARWRITERGLOB_8;
63  *pLongUserName = SwResId(STR_WRITER_GLOBALDOC_FULLTYPE);
64  }
65 }
66 
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pClipFormat, OUString *pLongUserName, sal_Int32 nFileFormat, bool bTemplate=false) const override
Definition: globdoc.cxx:46
SotClipboardFormatId
#define SO3_SWGLOB_CLASSID_60
#define SOFFICE_FILEFORMAT_60
SfxObjectCreateMode
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
virtual ~SwGlobalDocShell() override
Definition: globdoc.cxx:42
SFX_IMPL_OBJECTFACTORY(DrawDocShell, SvGlobalName(SO3_SIMPRESS_CLASSID),"simpress") void DrawDocShell
#define SOFFICE_FILEFORMAT_8