update dev300-m58
[ooovba.git] / sw / source / ui / inc / num.hxx
blobd321b4c57c26d604bb24c89c8a4335392ba2bab3
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: num.hxx,v $
10 * $Revision: 1.14 $
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 ************************************************************************/
30 #ifndef _NUM_HXX
31 #define _NUM_HXX
34 #include <sfx2/tabdlg.hxx>
35 #ifndef _MENUBTN_HXX //autogen
36 #include <vcl/menubtn.hxx>
37 #endif
38 #ifndef _FIELD_HXX //autogen
39 #include <vcl/field.hxx>
40 #endif
41 #ifndef _FIXED_HXX //autogen
42 #include <vcl/fixed.hxx>
43 #endif
44 #include <svtools/stdctrl.hxx>
45 #ifndef _BUTTON_HXX //autogen
46 #include <vcl/button.hxx>
47 #endif
48 #ifndef _LSTBOX_HXX //autogen
49 #include <vcl/lstbox.hxx>
50 #endif
51 #ifndef _EDIT_HXX //autogen
52 #include <vcl/edit.hxx>
53 #endif
54 #include <svx/stddlg.hxx>
55 #include <numprevw.hxx>
56 #include "numrule.hxx"
58 class SwWrtShell;
59 class SvxBrushItem;
60 class SwOutlineTabDialog;
63 /*-----------------13.02.97 14.02-------------------
65 --------------------------------------------------*/
67 struct SwBmpItemInfo
69 SvxBrushItem* pBrushItem;
70 USHORT nItemId;
74 /*-----------------07.02.97 15.37-------------------
76 --------------------------------------------------*/
77 #define NUM_PAGETYPE_BULLET 0
78 #define NUM_PAGETYPE_SINGLENUM 1
79 #define NUM_PAGETYPE_NUM 2
80 #define NUM_PAGETYPE_BMP 3
81 #define PAGETYPE_USER_START 10
83 /*-----------------03.12.97 10:18-------------------
85 --------------------------------------------------*/
86 class SwNumPositionTabPage : public SfxTabPage
88 FixedLine aPositionFL;
89 FixedLine aLevelFL;
90 MultiListBox aLevelLB;
92 // --> OD 2008-02-01 #newlistlevelattrs#
93 // former set of controls shown for numbering rules containing list level
94 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
95 FixedText aDistBorderFT;
96 MetricField aDistBorderMF;
97 CheckBox aRelativeCB;
98 FixedText aIndentFT;
99 MetricField aIndentMF;
100 FixedText aDistNumFT;
101 MetricField aDistNumMF;
102 FixedText aAlignFT;
103 ListBox aAlignLB;
104 // <--
106 // --> OD 2008-02-01 #newlistlevelattrs#
107 // new set of controls shown for numbering rules containing list level
108 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
109 FixedText aLabelFollowedByFT;
110 ListBox aLabelFollowedByLB;
111 FixedText aListtabFT;
112 MetricField aListtabMF;
113 FixedText aAlign2FT;
114 ListBox aAlign2LB;
115 FixedText aAlignedAtFT;
116 MetricField aAlignedAtMF;
117 FixedText aIndentAtFT;
118 MetricField aIndentAtMF;
119 // <--
121 PushButton aStandardPB;
123 NumberingPreview aPreviewWIN;
125 SwNumRule* pActNum;
126 SwNumRule* pSaveNum;
127 SwWrtShell* pWrtSh;
129 SwOutlineTabDialog* pOutlineDlg;
130 USHORT nActNumLvl;
132 BOOL bModified : 1;
133 BOOL bPreset : 1;
134 BOOL bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
135 // --> OD 2008-02-01 #newlistlevelattrs#
136 bool bLabelAlignmentPosAndSpaceModeActive;
137 // <--
139 void InitControls();
141 DECL_LINK( LevelHdl, ListBox * );
142 DECL_LINK( EditModifyHdl, Edit*);
143 DECL_LINK( DistanceHdl, MetricField * );
144 DECL_LINK( RelativeHdl, CheckBox * );
145 DECL_LINK( StandardHdl, PushButton * );
147 // --> OD 2008-02-01 #newlistlevelattrs#
148 void InitPosAndSpaceMode();
149 void ShowControlsDependingOnPosAndSpaceMode();
151 DECL_LINK( LabelFollowedByHdl_Impl, ListBox* );
152 DECL_LINK( ListtabPosHdl_Impl, MetricField* );
153 DECL_LINK( AlignAtHdl_Impl, MetricField* );
154 DECL_LINK( IndentAtHdl_Impl, MetricField* );
155 // <--
157 using SfxTabPage::ActivatePage;
158 using SfxTabPage::DeactivatePage;
160 public:
162 SwNumPositionTabPage(Window* pParent,
163 const SfxItemSet& rSet);
164 ~SwNumPositionTabPage();
166 virtual void ActivatePage(const SfxItemSet& rSet);
167 virtual int DeactivatePage(SfxItemSet *pSet);
168 virtual BOOL FillItemSet( SfxItemSet& rSet );
169 virtual void Reset( const SfxItemSet& rSet );
171 static SfxTabPage* Create( Window* pParent,
172 const SfxItemSet& rAttrSet);
174 void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
175 void SetWrtShell(SwWrtShell* pSh);
176 #if OSL_DEBUG_LEVEL > 1
177 void SetModified(BOOL bRepaint = TRUE);
178 #else
179 void SetModified(BOOL bRepaint = TRUE)
180 { bModified = TRUE;
181 if(bRepaint)
183 aPreviewWIN.SetLevel(nActNumLvl);
184 aPreviewWIN.Invalidate();
187 #endif
190 class SwSvxNumBulletTabDialog : public SfxTabDialog
192 SwWrtShell& rWrtSh;
194 String sRemoveText;
195 int nRetOptionsDialog;
197 protected:
198 virtual short Ok();
199 virtual void PageCreated(USHORT nPageId, SfxTabPage& rPage);
200 DECL_LINK(RemoveNumberingHdl, PushButton*);
201 public:
202 SwSvxNumBulletTabDialog(Window* pParent,
203 const SfxItemSet* pSwItemSet,
204 SwWrtShell &);
205 ~SwSvxNumBulletTabDialog();
207 #endif // _NUM_CXX