xref: /trunk/main/sw/source/ui/inc/gloshdl.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _GLOSHDL_HXX
24cdf0e10cSrcweir #define _GLOSHDL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/string.hxx>
27cdf0e10cSrcweir #include "swdllapi.h"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir class SwWrtShell;
30cdf0e10cSrcweir class SwTextBlocks;
31cdf0e10cSrcweir class SvxMacro;
32cdf0e10cSrcweir class SwGlossaries;
33cdf0e10cSrcweir class SfxViewFrame;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir // CLASS -----------------------------------------------------------------
36cdf0e10cSrcweir class SW_DLLPUBLIC SwGlossaryHdl
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 	SwGlossaries&	rStatGlossaries;
40cdf0e10cSrcweir 	String			aCurGrp;
41cdf0e10cSrcweir 	SfxViewFrame*	pViewFrame;
42cdf0e10cSrcweir 	SwWrtShell* 	pWrtShell;
43cdf0e10cSrcweir 	SwTextBlocks*	pCurGrp;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 	SW_DLLPRIVATE void	_SetMacros(const String &rName,
46cdf0e10cSrcweir 					   const SvxMacro *pStart,
47cdf0e10cSrcweir 					   const SvxMacro *pEnd);
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	SW_DLLPRIVATE sal_Bool 	Expand( const String& rShortName,
50cdf0e10cSrcweir 					SwGlossaries* pGlossaries,
51cdf0e10cSrcweir                     SwTextBlocks *pGlossary );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir public:
54cdf0e10cSrcweir     sal_Bool    ConvertToNew(SwTextBlocks& rOld);
55cdf0e10cSrcweir 	void	GlossaryDlg();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	sal_uInt16	GetGroupCnt() const;
58cdf0e10cSrcweir 	String	GetGroupName( sal_uInt16, String* pTitle = 0 );
59cdf0e10cSrcweir 	sal_Bool	NewGroup(String & rGroupName, const String& rTitle);
60cdf0e10cSrcweir 	sal_Bool	DelGroup(const String &);
61cdf0e10cSrcweir 	sal_Bool	RenameGroup(const String & rOld, String& rNew, const String& rNewTitle);
62cdf0e10cSrcweir 	void	SetCurGroup(const String &aGrp, sal_Bool bApi = sal_False, sal_Bool bAlwaysCreateNew = sal_False);
63cdf0e10cSrcweir 
GetCurGroup() const64cdf0e10cSrcweir 	const String &GetCurGroup() const { return aCurGrp; }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	sal_uInt16	GetGlossaryCnt();
67cdf0e10cSrcweir 	String	GetGlossaryName(sal_uInt16);
68cdf0e10cSrcweir 	String	GetGlossaryShortName(const String &rName);
69cdf0e10cSrcweir 	String	GetGlossaryShortName(sal_uInt16);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	sal_Bool    Rename( const String& rOldShortName,  const String& rNewShortName,
72cdf0e10cSrcweir 						const String& rNewName);
73cdf0e10cSrcweir 	sal_Bool    CopyOrMove( const String& rSourceGroupName,  String& rSourceShortName,
74cdf0e10cSrcweir 						const String& rDestGroupName, const String& rLongName, sal_Bool bMove );
75cdf0e10cSrcweir 	sal_Bool	HasShortName(const String &rShortName) const;
76cdf0e10cSrcweir 	//wird NewGlossary vom Basic gerufen, dann soll dir zuvor eingestellte
77cdf0e10cSrcweir 	//Gruppe ggf. neu erstellt werden
78cdf0e10cSrcweir 	sal_Bool	NewGlossary(const String &rName, const String &rShortName,
79cdf0e10cSrcweir 				sal_Bool bApiCall = sal_False, sal_Bool bNoAttr = sal_False );
80cdf0e10cSrcweir 	sal_Bool	DelGlossary(const String&);
81cdf0e10cSrcweir 	sal_Bool 	CopyToClipboard(SwWrtShell& rSh, const String& rShortName);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     sal_Bool    ExpandGlossary();
84cdf0e10cSrcweir 	sal_Bool	InsertGlossary(const String &rName);
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	void	SetMacros(const String& rName,
87cdf0e10cSrcweir 					  const SvxMacro* pStart,
88cdf0e10cSrcweir 					  const SvxMacro* pEnd,
89cdf0e10cSrcweir 					  SwTextBlocks *pGlossary = 0 );
90cdf0e10cSrcweir 	void 	GetMacros(const String& rShortName,
91cdf0e10cSrcweir 					  SvxMacro& rStart,
92cdf0e10cSrcweir 					  SvxMacro& rEnd,
93cdf0e10cSrcweir 					  SwTextBlocks* pGlossary = 0 );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	sal_Bool	IsReadOnly( const String* = 0 ) const;
96cdf0e10cSrcweir 	sal_Bool	IsOld() const;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	sal_Bool 	FindGroupName(String & rGroup); // Gruppe ohne Pfadindex finden
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	sal_Bool 	ImportGlossaries( const String& rName );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir             SwGlossaryHdl(SfxViewFrame* pViewFrame, SwWrtShell *);
103cdf0e10cSrcweir 			~SwGlossaryHdl();
104cdf0e10cSrcweir };
105cdf0e10cSrcweir 
106cdf0e10cSrcweir #endif // _GLOSHDL_HXX
107