merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / inc / outline.hxx
blobe99aa6b4a23c557f56d499efa6067214400f0b3b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: outline.hxx,v $
10 * $Revision: 1.11 $
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 _OUTLINE_HXX
31 #define _OUTLINE_HXX
33 #include <sfx2/tabdlg.hxx>
36 #include <vcl/menu.hxx>
38 #ifndef _BUTTON_HXX //autogen
39 #include <vcl/button.hxx>
40 #endif
41 #include <svtools/stdctrl.hxx>
43 #ifndef _FIXED_HXX //autogen
44 #include <vcl/fixed.hxx>
45 #endif
47 #ifndef _LSTBOX_HXX //autogen
48 #include <vcl/lstbox.hxx>
49 #endif
51 #ifndef _EDIT_HXX //autogen
52 #include <vcl/edit.hxx>
53 #endif
55 #ifndef _FIELD_HXX //autogen
56 #include <vcl/field.hxx>
57 #endif
59 #include "swtypes.hxx" //fuer MAXLEVEL
60 #include <numprevw.hxx>
61 #include <numberingtypelistbox.hxx>
63 class SwWrtShell;
64 class SwNumRule;
65 class SwChapterNumRules;
67 /* -----------------07.07.98 13:38-------------------
69 * --------------------------------------------------*/
70 class SwOutlineTabDialog : public SfxTabDialog
72 static USHORT nNumLevel;
74 String aNullStr;
75 String aCollNames[MAXLEVEL];
76 PopupMenu aFormMenu;
78 SwWrtShell& rWrtSh;
79 SwNumRule* pNumRule;
80 SwChapterNumRules* pChapterNumRules;
82 BOOL bModified : 1;
84 protected:
85 DECL_LINK( CancelHdl, Button * );
86 DECL_LINK( FormHdl, Button * );
87 DECL_LINK( MenuSelectHdl, Menu * );
89 virtual void PageCreated(USHORT nPageId, SfxTabPage& rPage);
90 virtual short Ok();
92 public:
93 SwOutlineTabDialog(Window* pParent,
94 const SfxItemSet* pSwItemSet,
95 SwWrtShell &);
96 ~SwOutlineTabDialog();
98 SwNumRule* GetNumRule() {return pNumRule;}
99 USHORT GetLevel(const String &rFmtName) const;
100 String* GetCollNames() {return aCollNames;}
102 static USHORT GetActNumLevel() {return nNumLevel;}
103 static void SetActNumLevel(USHORT nSet) {nNumLevel = nSet;}
105 /* -----------------07.07.98 13:47-------------------
107 * --------------------------------------------------*/
108 class SwOutlineSettingsTabPage : public SfxTabPage
110 ListBox aLevelLB;
111 FixedLine aLevelFL;
113 FixedText aCollLbl;
114 ListBox aCollBox;
115 FixedText aNumberLbl;
116 SwNumberingTypeListBox aNumberBox;
117 FixedText aCharFmtFT;
118 ListBox aCharFmtLB;
119 FixedText aAllLevelFT;
120 NumericField aAllLevelNF;
121 FixedText aDelim;
122 FixedText aPrefixFT;
123 Edit aPrefixED;
124 FixedText aSuffixFT;
125 Edit aSuffixED;
126 FixedText aStartLbl;
127 NumericField aStartEdit;
128 FixedLine aNumberFL;
129 NumberingPreview aPreviewWIN;
131 String aNoFmtName;
132 String aSaveCollNames[MAXLEVEL];
133 SwWrtShell* pSh;
134 SwNumRule* pNumRule;
135 String* pCollNames;
136 USHORT nActLevel;
138 DECL_LINK( LevelHdl, ListBox * );
139 DECL_LINK( ToggleComplete, NumericField * );
140 DECL_LINK( CollSelect, ListBox * );
141 DECL_LINK( CollSelectGetFocus, ListBox * );
142 DECL_LINK( NumberSelect, SwNumberingTypeListBox * );
143 DECL_LINK( DelimModify, Edit * );
144 DECL_LINK( StartModified, NumericField * );
145 DECL_LINK( CharFmtHdl, ListBox * );
147 void Update();
149 void SetModified(){aPreviewWIN.Invalidate();}
150 void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
152 using SfxTabPage::ActivatePage;
153 using SfxTabPage::DeactivatePage;
155 public:
156 SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet);
157 ~SwOutlineSettingsTabPage();
159 void SetWrtShell(SwWrtShell* pShell);
161 virtual void ActivatePage(const SfxItemSet& rSet);
162 virtual int DeactivatePage(SfxItemSet *pSet);
164 virtual BOOL FillItemSet( SfxItemSet& rSet );
165 virtual void Reset( const SfxItemSet& rSet );
166 static SfxTabPage* Create( Window* pParent,
167 const SfxItemSet& rAttrSet);
169 #endif