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: glossary.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 #ifndef _EDIT_HXX //autogen
34 #include <vcl/edit.hxx>
36 #include <svtools/svtreebx.hxx>
37 #include <svx/stddlg.hxx>
39 #ifndef _BUTTON_HXX //autogen
40 #include <vcl/button.hxx>
42 #include <vcl/fixed.hxx>
44 #ifndef _BUTTON_HXX //autogen
45 #include <vcl/button.hxx>
48 #ifndef _FIXED_HXX //autogen
49 #include <vcl/fixed.hxx>
52 #ifndef _COMBOBOX_HXX //autogen
53 #include <vcl/combobox.hxx>
56 #ifndef _MENUBTN_HXX //autogen
57 #include <vcl/menubtn.hxx>
59 #include <com/sun/star/container/XEnumerationAccess.hpp>
60 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
61 #include <com/sun/star/container/XNameAccess.hpp>
62 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
63 #include <com/sun/star/container/XEnumeration.hpp>
64 #include <com/sun/star/container/XElementAccess.hpp>
65 #include <com/sun/star/container/XIndexAccess.hpp>
67 #include <actctrl.hxx>
70 class SwNewGlosNameDlg
;
76 const short RET_EDIT
= 100;
78 //------------------------------------------------------------------
80 class SwGlTreeListBox
: public SvTreeListBox
82 const String sReadonly
;
84 SvLBoxEntry
* pDragEntry
;
86 virtual DragDropMode
NotifyStartDrag( TransferDataContainer
& rContainer
,
88 virtual sal_Bool
NotifyAcceptDrop( SvLBoxEntry
* );
90 virtual sal_Bool
NotifyMoving( SvLBoxEntry
* pTarget
,
92 SvLBoxEntry
*& rpNewParent
,
95 virtual sal_Bool
NotifyCopying( SvLBoxEntry
* pTarget
,
97 SvLBoxEntry
*& rpNewParent
,
100 SwGlTreeListBox(Window
* pParent
, const ResId
& rResId
);
102 virtual void RequestHelp( const HelpEvent
& rHEvt
);
106 //------------------------------------------------------------------
107 class SwOneExampleFrame
;
108 class SwGlossaryDlg
: public SvxStandardDialog
110 friend class SwNewGlosNameDlg
;
111 friend class SwGlTreeListBox
;
113 CheckBox aInsertTipCB
;
116 FixedText aShortNameLbl
;
117 NoSpaceEdit aShortNameEdit
;
118 SwGlTreeListBox aCategoryBox
;
119 FixedLine aRelativeFL
;
123 Window aExampleDummyWIN
;
124 CheckBox aShowExampleCB
;
126 CancelButton aCloseBtn
;
132 String sReadonlyPath
;
134 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> _xAutoText
;
135 SwOneExampleFrame
* pExampleFrame
;
138 SwGlossaryHdl
* pGlossaryHdl
;
141 String sResumeShortName
;
145 const sal_Bool bSelection
: 1;
146 sal_Bool bReadOnly
: 1;
148 sal_Bool bIsDocReadOnly
:1;
152 void EnableShortName(sal_Bool bOn
= sal_True
);
154 DECL_LINK( NameModify
, Edit
* );
155 DECL_LINK( NameDoubleClick
, SvTreeListBox
* );
156 DECL_LINK( GrpSelect
, SvTreeListBox
* );
157 DECL_LINK( MenuHdl
, Menu
* );
158 DECL_LINK( EnableHdl
, Menu
* );
159 DECL_LINK( BibHdl
, Button
* );
160 DECL_LINK( EditHdl
, Button
* );
161 DECL_LINK( PathHdl
, Button
* );
162 DECL_LINK( CheckBoxHdl
, CheckBox
* );
163 DECL_LINK( ShowPreviewHdl
, CheckBox
* );
164 DECL_LINK( PreviewLoadedHdl
, void * );
167 virtual void Apply();
169 SvLBoxEntry
* DoesBlockExist(const String
& sBlock
, const String
& rShort
);
170 void ShowAutoText(const String
& rGroup
, const String
& rShortName
);
171 void ResumeShowAutoText();
173 BOOL
GetResumeData(String
& rGroup
, String
& rShortName
)
174 {rGroup
= sResumeGroup
; rShortName
= sResumeShortName
; return bResume
;}
175 void SetResumeData(const String
& rGroup
, const String
& rShortName
)
176 {sResumeGroup
= rGroup
; sResumeShortName
= rShortName
; bResume
= TRUE
;}
177 void ResetResumeData() {bResume
= FALSE
;}
179 SwGlossaryDlg(SfxViewFrame
* pViewFrame
, SwGlossaryHdl
* pGlosHdl
, SwWrtShell
*pWrtShell
);
181 String
GetCurrGrpName() const;
182 inline String
GetCurrLongName() const;
183 inline String
GetCurrShortName() const;
184 static String
GetCurrGroup();
185 static void SetActGroup(const String
& rNewGroup
);
186 static String
GetExtension();
189 inline String
SwGlossaryDlg::GetCurrLongName() const
191 return aNameED
.GetText();
193 inline String
SwGlossaryDlg::GetCurrShortName() const
195 return aShortNameEdit
.GetText();