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 * /*pAppName*/,
49  OUString * pLongUserName,
50  OUString * pUserName,
51  sal_Int32 nVersion,
52  bool bTemplate /* = false */) const
53 {
54  if (nVersion == SOFFICE_FILEFORMAT_60)
55  {
56  *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 );
57  *pClipFormat = SotClipboardFormatId::STARWRITERGLOB_60;
58  *pLongUserName = SwResId(STR_WRITER_GLOBALDOC_FULLTYPE);
59  OSL_ENSURE( !bTemplate, "No template for Writer Global" );
60  }
61  else if (nVersion == SOFFICE_FILEFORMAT_8)
62  {
63  *pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 );
64  *pClipFormat = bTemplate ? SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE : SotClipboardFormatId::STARWRITERGLOB_8;
65  *pLongUserName = SwResId(STR_WRITER_GLOBALDOC_FULLTYPE);
66  }
67 
68  *pUserName = SwResId(STR_HUMAN_SWGLOBDOC_NAME);
69 }
70 
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SotClipboardFormatId
#define SO3_SWGLOB_CLASSID_60
#define SOFFICE_FILEFORMAT_60
SfxObjectCreateMode
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pClipFormat, OUString *pAppName, OUString *pLongUserName, OUString *pUserName, sal_Int32 nFileFormat, bool bTemplate=false) const override
Definition: globdoc.cxx:46
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
virtual ~SwGlobalDocShell() override
Definition: globdoc.cxx:42
SFX_IMPL_OBJECTFACTORY(DrawDocShell, SvGlobalName(SO3_SIMPRESS_CLASSID),"simpress") void DrawDocShell
#define SOFFICE_FILEFORMAT_8