1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_GLOSSARY_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_GLOSSARY_HXX
#include <vcl/edit.hxx>
#include <svtools/treelistbox.hxx>
#include <svx/stddlg.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/combobox.hxx>
#include <vcl/menubtn.hxx>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/container/XElementAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/text/XAutoTextContainer2.hpp>
#include <rtl/ustring.hxx>
#include <actctrl.hxx>
class SwGlossaryHdl;
class SwNewGlosNameDlg;
class SwWrtShell;
class SfxViewFrame;
class PopupMenu;
class Menu;
const short RET_EDIT = 100;
class SwGlTreeListBox : public SvTreeListBox
{
const OUString sReadonly;
SvTreeListEntry* pDragEntry;
virtual DragDropMode NotifyStartDrag( TransferDataContainer& rContainer,
SvTreeListEntry* ) SAL_OVERRIDE;
virtual bool NotifyAcceptDrop( SvTreeListEntry* ) SAL_OVERRIDE;
virtual TriState NotifyMoving( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
SvTreeListEntry*& rpNewParent,
sal_uLong& rNewChildPos
) SAL_OVERRIDE;
virtual TriState NotifyCopying( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
SvTreeListEntry*& rpNewParent,
sal_uLong& rNewChildPos) SAL_OVERRIDE;
TriState NotifyCopyingOrMoving( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
bool bIsMove);
public:
SwGlTreeListBox(vcl::Window* pParent, WinBits nBits);
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
void Clear();
};
class SwOneExampleFrame;
class SwGlossaryDlg : public SvxStandardDialog
{
friend class SwNewGlosNameDlg;
friend class SwGlTreeListBox;
VclPtr<CheckBox> m_pInsertTipCB;
VclPtr<Edit> m_pNameED;
VclPtr<FixedText> m_pShortNameLbl;
TextFilter m_aNoSpaceFilter;
VclPtr<Edit> m_pShortNameEdit;
VclPtr<SwGlTreeListBox> m_pCategoryBox;
VclPtr<CheckBox> m_pFileRelCB;
VclPtr<CheckBox> m_pNetRelCB;
VclPtr<vcl::Window> m_pExampleWIN;
VclPtr<PushButton> m_pInsertBtn;
VclPtr<MenuButton> m_pEditBtn;
VclPtr<PushButton> m_pBibBtn;
VclPtr<PushButton> m_pPathBtn;
OUString sReadonlyPath;
::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextContainer2 > m_xAutoText;
SwOneExampleFrame* pExampleFrame;
SwGlossaryHdl* pGlossaryHdl;
OUString sResumeGroup;
OUString sResumeShortName;
bool bResume;
const bool bSelection : 1;
bool bReadOnly : 1;
bool bIsOld : 1;
bool bIsDocReadOnly:1;
SwWrtShell* pSh;
void EnableShortName(bool bOn = true);
void ShowPreview();
DECL_LINK( NameModify, Edit * );
DECL_LINK( NameDoubleClick, SvTreeListBox * );
DECL_LINK( GrpSelect, SvTreeListBox * );
DECL_LINK( MenuHdl, Menu * );
DECL_LINK_TYPED( EnableHdl, Menu *, bool );
DECL_LINK_TYPED(BibHdl, Button *, void);
DECL_LINK_TYPED(EditHdl, MenuButton *, void);
DECL_LINK_TYPED(InsertHdl, Button *, void);
DECL_LINK_TYPED( PathHdl, Button *, void );
DECL_LINK_TYPED( CheckBoxHdl, Button*, void );
DECL_LINK( PreviewLoadedHdl, void * );
virtual void Apply() SAL_OVERRIDE;
void Init();
SvTreeListEntry* DoesBlockExist(const OUString& sBlock, const OUString& rShort);
void ShowAutoText(const OUString& rGroup, const OUString& rShortName);
void ResumeShowAutoText();
bool GetResumeData(OUString& rGroup, OUString& rShortName)
{rGroup = sResumeGroup; rShortName = sResumeShortName; return bResume;}
void SetResumeData(const OUString& rGroup, const OUString& rShortName)
{sResumeGroup = rGroup; sResumeShortName = rShortName; bResume = true;}
void ResetResumeData() {bResume = false;}
public:
SwGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell);
virtual ~SwGlossaryDlg();
virtual void dispose() SAL_OVERRIDE;
OUString GetCurrGrpName() const;
OUString GetCurrShortName() const
{
return m_pShortNameEdit->GetText();
}
static OUString GetCurrGroup();
static void SetActGroup(const OUString& rNewGroup);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|