xref: /trunk/main/sw/source/ui/globdoc/globdoc.cxx (revision efeef26f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 
29 #include <sot/clsids.hxx>
30 #include <unotools/moduleoptions.hxx>
31 
32 #include <unomid.h>
33 
34 #include "swtypes.hxx"
35 #include "shellio.hxx"
36 #include "globdoc.hxx"
37 #include "globdoc.hrc"
38 #include "cfgid.h"
39 
40 
41 /*--------------------------------------------------------------------
42 	Beschreibung:	Alle Filter registrieren
43  --------------------------------------------------------------------*/
44 
45 TYPEINIT1(SwGlobalDocShell, SwDocShell);
46 
47 //-------------------------------------------------------------------------
48 SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/GlobalDocument" )
49 
SwGlobalDocShell(SfxObjectCreateMode eMode)50 SwGlobalDocShell::SwGlobalDocShell(SfxObjectCreateMode eMode ) :
51 		SwDocShell(eMode)
52 {
53 }
54 
~SwGlobalDocShell()55 SwGlobalDocShell::~SwGlobalDocShell()
56 {
57 }
58 
FillClass(SvGlobalName * pClassName,sal_uInt32 * pClipFormat,String *,String * pLongUserName,String * pUserName,sal_Int32 nVersion,sal_Bool bTemplate) const59 void SwGlobalDocShell::FillClass( SvGlobalName * pClassName,
60 								   sal_uInt32 * pClipFormat,
61 								   String * /*pAppName*/,
62 								   String * pLongUserName,
63                                    String * pUserName,
64                                    sal_Int32 nVersion,
65                                    sal_Bool bTemplate /* = sal_False */) const
66 {
67     (void)bTemplate;
68     DBG_ASSERT( bTemplate == sal_False, "No template for Writer Global" );
69 
70 	if (nVersion == SOFFICE_FILEFORMAT_60)
71 	{
72 		*pClassName = SvGlobalName( SO3_SWGLOB_CLASSID_60 );
73 		*pClipFormat = SOT_FORMATSTR_ID_STARWRITERGLOB_60;
74 		*pLongUserName = SW_RESSTR(STR_WRITER_GLOBALDOC_FULLTYPE);
75 	}
76 	else if (nVersion == SOFFICE_FILEFORMAT_8)
77 	{
78 		*pClassName		= SvGlobalName( SO3_SWGLOB_CLASSID_60 );
79 		*pClipFormat	= SOT_FORMATSTR_ID_STARWRITERGLOB_8;
80 		*pLongUserName = SW_RESSTR(STR_WRITER_GLOBALDOC_FULLTYPE);
81 	}
82 
83 	*pUserName = SW_RESSTR(STR_HUMAN_SWGLOBDOC_NAME);
84 }
85 
86 
87 
88