xref: /AOO41X/main/sw/source/ui/inc/regionsw.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
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 #ifndef _REGIONSW_HXX
24 #define _REGIONSW_HXX
25 
26 #include <hintids.hxx>
27 #include <vcl/field.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <vcl/edit.hxx>
30 #include <vcl/button.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/combobox.hxx>
33 #include <vcl/group.hxx>
34 #include <svtools/svtreebx.hxx>
35 #include <sfx2/basedlgs.hxx>
36 #include <sfx2/tabdlg.hxx>
37 #include <editeng/brshitem.hxx>
38 
39 #include <condedit.hxx>
40 #include <section.hxx>
41 #include <fmtclds.hxx>
42 #include <fmtftntx.hxx>
43 #include <fmtclbl.hxx>
44 #include <numberingtypelistbox.hxx>
45 #include <editeng/frmdiritem.hxx>
46 #include <vcl/image.hxx>
47 #include <svx/paraprev.hxx>
48 #include <editeng/lrspitem.hxx>
49 
50 
51 class SwWrtShell;
52 class EditRegionDlg;
53 
54 namespace sfx2
55 {
56     class DocumentInserter;
57     class FileDialogHelper;
58 }
59 
60 /*************************************************************************
61     Dialog "Bereiche bearbeiten"
62 *************************************************************************/
63 
64 class SectRepr;
65 typedef SectRepr* SectReprPtr;
66 SV_DECL_PTRARR_SORT( SectReprArr, SectReprPtr, 0, 4 )
67 
68 class SwEditRegionDlg : public SfxModalDialog
69 {
70     FixedLine       aNameFL;
71     Edit            aCurName;
72     SvTreeListBox   aTree;
73 
74     FixedLine       aLinkFL;
75     TriStateBox     aFileCB;
76     CheckBox        aDDECB;
77     FixedText       aFileNameFT;
78     FixedText       aDDECommandFT;
79     Edit            aFileNameED;
80     PushButton      aFilePB;
81     FixedText       aSubRegionFT;
82     ComboBox        aSubRegionED;
83     bool            bSubRegionsFilled;
84 
85     FixedLine       aProtectFL;
86     TriStateBox     aProtectCB;
87     CheckBox        aPasswdCB;
88     PushButton      aPasswdPB;
89 
90     FixedLine       aHideFL;
91     TriStateBox     aHideCB;
92     FixedText       aConditionFT;
93     ConditionEdit   aConditionED;
94 
95     // --> FME 2004-06-22 #114856# edit in readonly sections
96     FixedLine       aPropertiesFL;
97     TriStateBox     aEditInReadonlyCB;
98     // <--
99 
100     OKButton        aOK;
101     CancelButton    aCancel;
102     PushButton      aOptionsPB;
103     PushButton      aDismiss;
104     HelpButton      aHelp;
105     ImageList       aImageIL;
106     ImageList       aImageILH;
107 
108     SwWrtShell&             rSh;
109     SectReprArr             aSectReprArr;
110     SvLBoxEntry*            pAktEntry;
111     const SwSection*        pCurrSect;
112     sfx2::DocumentInserter* m_pDocInserter;
113     Window*                 m_pOldDefDlgParent;
114 
115     sal_Bool            bDontCheckPasswd :1;
116     sal_Bool            bWeb            :1;
117 
118 
119     Image  BuildBitmap(sal_Bool bProtect,sal_Bool bHidden,sal_Bool bHighContrast);
120 
121     void    RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry);
122     sal_uInt16  FindArrPos(const SwSectionFmt* pFmt);
123 
124     DECL_LINK( GetFirstEntryHdl, SvTreeListBox * );
125     DECL_LINK( DeselectHdl, SvTreeListBox * );
126 
127     DECL_LINK( OkHdl, CheckBox * );
128     DECL_LINK( NameEditHdl, Edit * );
129     DECL_LINK( ConditionEditHdl, Edit * );
130 
131     DECL_LINK( ChangePasswdHdl, Button * );
132     DECL_LINK( ChangeProtectHdl, TriStateBox * );
133     DECL_LINK( ChangeHideHdl, TriStateBox * );
134     // --> FME 2004-06-22 #114856# edit in readonly sections
135     DECL_LINK( ChangeEditInReadonlyHdl, TriStateBox * );
136     // <--
137     DECL_LINK( ChangeDismissHdl, CheckBox * );
138     DECL_LINK( UseFileHdl, CheckBox* );
139     DECL_LINK( FileSearchHdl, PushButton* );
140     DECL_LINK( OptionsHdl, PushButton* );
141     DECL_LINK( FileNameHdl, Edit* );
142     DECL_LINK( DDEHdl, CheckBox* );
143     DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* );
144     DECL_LINK( SubRegionEventHdl, VclWindowEvent * );
145 
146     sal_Bool CheckPasswd(CheckBox* pBox = 0);
147 
148 public:
149     SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh );
150     virtual ~SwEditRegionDlg();
151 
152     void    SelectSection(const String& rSectionName);
153 
154 };
155 /*************************************************************************
156     Dialog "Bereich einfuegen"
157 *************************************************************************/
158 
159 /* -----------------21.05.99 11:05-------------------
160  *
161  * --------------------------------------------------*/
162 class SwInsertSectionTabPage : public SfxTabPage
163 {
164     FixedLine       aNameFL;
165     ComboBox        aCurName;
166 
167     FixedLine       aLinkFL;
168     CheckBox        aFileCB;
169     CheckBox        aDDECB;
170     FixedText       aDDECommandFT;
171     FixedText       aFileNameFT;
172     Edit            aFileNameED;
173     PushButton      aFilePB;
174     FixedText       aSubRegionFT;
175     ComboBox        aSubRegionED;
176 
177     FixedLine       aProtectFL;
178     CheckBox        aProtectCB;
179     CheckBox        aPasswdCB;
180     PushButton      aPasswdPB;
181 
182     FixedLine       aHideFL;
183     CheckBox        aHideCB;
184     FixedText       aConditionFT;
185     ConditionEdit   aConditionED;
186 
187     // --> FME 2004-06-22 #114856# edit in readonly sections
188     FixedLine       aPropertiesFL;
189     CheckBox        aEditInReadonlyCB;
190     // <--
191 
192     String          m_sFileName;
193     String          m_sFilterName;
194     String          m_sFilePasswd;
195 
196 //  SwFmtCol*       pCols;
197     ::com::sun::star::uno::Sequence <sal_Int8 > m_aNewPasswd;
198     SwWrtShell*             m_pWrtSh;
199     sfx2::DocumentInserter* m_pDocInserter;
200     Window*                 m_pOldDefDlgParent;
201 
202     DECL_LINK( ChangeHideHdl, CheckBox * );
203     // --> FME 2004-06-22 #114856# edit in readonly sections
204     DECL_LINK( ChangeEditInReadonlyHdl, CheckBox * );
205     // <--
206     DECL_LINK( ChangeProtectHdl, CheckBox * );
207     DECL_LINK( ChangePasswdHdl, Button * );
208     DECL_LINK( NameEditHdl, Edit * );
209     DECL_LINK( UseFileHdl, CheckBox* );
210     DECL_LINK( FileSearchHdl, PushButton* );
211     DECL_LINK( DDEHdl, CheckBox* );
212     DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* );
213 
214 public:
215     SwInsertSectionTabPage(Window *pParent, const SfxItemSet &rAttrSet);
216     virtual ~SwInsertSectionTabPage();
217 
218     void    SetWrtShell(SwWrtShell& rSh);
219 
220     virtual sal_Bool        FillItemSet( SfxItemSet& );
221     virtual void        Reset( const SfxItemSet& );
222 
223     static SfxTabPage*  Create( Window* pParent,
224                                 const SfxItemSet& rAttrSet);
225 };
226 
227 class SwSectionFtnEndTabPage : public SfxTabPage
228 {
229     FixedLine       aFtnFL;
230     CheckBox        aFtnNtAtTextEndCB;
231 
232     CheckBox        aFtnNtNumCB;
233     FixedText       aFtnOffsetLbl;
234     NumericField    aFtnOffsetFld;
235 
236     CheckBox        aFtnNtNumFmtCB;
237     FixedText       aFtnPrefixFT;
238     Edit            aFtnPrefixED;
239     SwNumberingTypeListBox   aFtnNumViewBox;
240     FixedText       aFtnSuffixFT;
241     Edit            aFtnSuffixED;
242 
243     FixedLine       aEndFL;
244     CheckBox        aEndNtAtTextEndCB;
245 
246     CheckBox        aEndNtNumCB;
247     FixedText       aEndOffsetLbl;
248     NumericField    aEndOffsetFld;
249 
250     CheckBox        aEndNtNumFmtCB;
251     FixedText       aEndPrefixFT;
252     Edit            aEndPrefixED;
253     SwNumberingTypeListBox   aEndNumViewBox;
254     FixedText       aEndSuffixFT;
255     Edit            aEndSuffixED;
256 
257 
258     DECL_LINK( FootEndHdl, CheckBox * );
259     void ResetState( sal_Bool bFtn, const SwFmtFtnEndAtTxtEnd& );
260 
261 public:
262     SwSectionFtnEndTabPage( Window *pParent, const SfxItemSet &rAttrSet );
263     virtual ~SwSectionFtnEndTabPage();
264 
265     virtual sal_Bool        FillItemSet( SfxItemSet& );
266     virtual void        Reset( const SfxItemSet& );
267 
268     static SfxTabPage*  Create( Window* pParent,
269                                 const SfxItemSet& rAttrSet);
270 };
271 /* -----------------13.06.2003 09:51-----------------
272 
273  --------------------------------------------------*/
274 class SwSectionIndentTabPage : public SfxTabPage
275 {
276     FixedLine           aIndentFL;
277     FixedText           aBeforeFT;
278     MetricField         aBeforeMF;
279     FixedText           aAfterFT;
280     MetricField         aAfterMF;
281 
282     SvxParaPrevWindow   aPreviewWin;
283 
284     DECL_LINK(IndentModifyHdl, MetricField*);
285 public:
286     SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet );
287     virtual ~SwSectionIndentTabPage();
288 
289     virtual sal_Bool        FillItemSet( SfxItemSet& );
290     virtual void        Reset( const SfxItemSet& );
291 
292     static SfxTabPage*  Create( Window* pParent,
293                                 const SfxItemSet& rAttrSet);
294 
295     void    SetWrtShell(SwWrtShell& rSh);
296 };
297 
298 /* -----------------21.05.99 13:07-------------------
299  *
300  * --------------------------------------------------*/
301 class SwInsertSectionTabDialog : public SfxTabDialog
302 {
303     SwWrtShell&     rWrtSh;
304     ::std::auto_ptr<SwSectionData> m_pSectionData;
305 
306 protected:
307     virtual void    PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
308     virtual short   Ok();
309 public:
310     SwInsertSectionTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
311     virtual ~SwInsertSectionTabDialog();
312 
313     void        SetSectionData(SwSectionData const& rSect);
GetSectionData()314     SwSectionData * GetSectionData() { return m_pSectionData.get(); }
315 };
316 
317 /* -----------------21.05.99 13:07-------------------
318  *
319  * --------------------------------------------------*/
320 class SwSectionPropertyTabDialog : public SfxTabDialog
321 {
322     SwWrtShell& rWrtSh;
323 protected:
324     virtual void    PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
325 public:
326     SwSectionPropertyTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
327     virtual ~SwSectionPropertyTabDialog();
328 };
329 
330 #endif
331 
332 
333