1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gloshdl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <tools/string.hxx>
42 // CLASS -----------------------------------------------------------------
43 class SW_DLLPUBLIC SwGlossaryHdl
46 SwGlossaries
& rStatGlossaries
;
48 SfxViewFrame
* pViewFrame
;
49 SwWrtShell
* pWrtShell
;
50 SwTextBlocks
* pCurGrp
;
52 SW_DLLPRIVATE
void _SetMacros(const String
&rName
,
53 const SvxMacro
*pStart
,
54 const SvxMacro
*pEnd
);
56 SW_DLLPRIVATE BOOL
Expand( const String
& rShortName
,
57 SwGlossaries
* pGlossaries
,
58 SwTextBlocks
*pGlossary
);
61 BOOL
ConvertToNew(SwTextBlocks
& rOld
);
64 USHORT
GetGroupCnt() const;
65 String
GetGroupName( USHORT
, String
* pTitle
= 0 );
66 BOOL
NewGroup(String
& rGroupName
, const String
& rTitle
);
67 BOOL
DelGroup(const String
&);
68 BOOL
RenameGroup(const String
& rOld
, String
& rNew
, const String
& rNewTitle
);
69 void SetCurGroup(const String
&aGrp
, BOOL bApi
= FALSE
, BOOL bAlwaysCreateNew
= FALSE
);
71 const String
&GetCurGroup() const { return aCurGrp
; }
73 USHORT
GetGlossaryCnt();
74 String
GetGlossaryName(USHORT
);
75 String
GetGlossaryShortName(const String
&rName
);
76 String
GetGlossaryShortName(USHORT
);
78 BOOL
Rename( const String
& rOldShortName
, const String
& rNewShortName
,
79 const String
& rNewName
);
80 BOOL
CopyOrMove( const String
& rSourceGroupName
, String
& rSourceShortName
,
81 const String
& rDestGroupName
, const String
& rLongName
, BOOL bMove
);
82 BOOL
HasShortName(const String
&rShortName
) const;
83 //wird NewGlossary vom Basic gerufen, dann soll dir zuvor eingestellte
84 //Gruppe ggf. neu erstellt werden
85 BOOL
NewGlossary(const String
&rName
, const String
&rShortName
,
86 BOOL bApiCall
= FALSE
, BOOL bNoAttr
= FALSE
);
87 BOOL
DelGlossary(const String
&);
88 BOOL
CopyToClipboard(SwWrtShell
& rSh
, const String
& rShortName
);
90 BOOL
ExpandGlossary();
91 BOOL
InsertGlossary(const String
&rName
);
93 void SetMacros(const String
& rName
,
94 const SvxMacro
* pStart
,
96 SwTextBlocks
*pGlossary
= 0 );
97 void GetMacros(const String
& rShortName
,
100 SwTextBlocks
* pGlossary
= 0 );
102 BOOL
IsReadOnly( const String
* = 0 ) const;
105 BOOL
FindGroupName(String
& rGroup
); // Gruppe ohne Pfadindex finden
107 BOOL
ImportGlossaries( const String
& rName
);
109 SwGlossaryHdl(SfxViewFrame
* pViewFrame
, SwWrtShell
*);
113 #endif // _GLOSHDL_HXX