bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / num.hxx
blob2af7c5f6e357a621d96a222d026202df3a99c098
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _NUM_HXX
20 #define _NUM_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <vcl/menubtn.hxx>
25 #include <vcl/field.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/layout.hxx>
28 #include <svtools/stdctrl.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/lstbox.hxx>
31 #include <vcl/edit.hxx>
32 #include <svx/stddlg.hxx>
33 #include <numprevw.hxx>
34 #include "numrule.hxx"
36 class SwWrtShell;
37 class SvxBrushItem;
38 class SwOutlineTabDialog;
40 struct SwBmpItemInfo
42 SvxBrushItem* pBrushItem;
43 sal_uInt16 nItemId;
46 #define NUM_PAGETYPE_BULLET 0
47 #define NUM_PAGETYPE_SINGLENUM 1
48 #define NUM_PAGETYPE_NUM 2
49 #define NUM_PAGETYPE_BMP 3
50 #define PAGETYPE_USER_START 10
52 class SwNumPositionTabPage : public SfxTabPage
54 ListBox* m_pLevelLB;
55 VclFrame* m_pPositionFrame;
57 // former set of controls shown for numbering rules containing list level
58 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
59 FixedText* m_pDistBorderFT;
60 MetricField* m_pDistBorderMF;
61 CheckBox* m_pRelativeCB;
62 FixedText* m_pIndentFT;
63 MetricField* m_pIndentMF;
64 FixedText* m_pDistNumFT;
65 MetricField* m_pDistNumMF;
66 FixedText* m_pAlignFT;
67 ListBox* m_pAlignLB;
69 // new set of controls shown for numbering rules containing list level
70 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
71 FixedText* m_pLabelFollowedByFT;
72 ListBox* m_pLabelFollowedByLB;
73 FixedText* m_pListtabFT;
74 MetricField* m_pListtabMF;
75 FixedText* m_pAlign2FT;
76 ListBox* m_pAlign2LB;
77 FixedText* m_pAlignedAtFT;
78 MetricField* m_pAlignedAtMF;
79 FixedText* m_pIndentAtFT;
80 MetricField* m_pIndentAtMF;
82 PushButton* m_pStandardPB;
84 NumberingPreview* m_pPreviewWIN;
86 SwNumRule* pActNum;
87 SwNumRule* pSaveNum;
88 SwWrtShell* pWrtSh;
90 SwOutlineTabDialog* pOutlineDlg;
91 sal_uInt16 nActNumLvl;
93 sal_Bool bModified : 1;
94 sal_Bool bPreset : 1;
95 sal_Bool bInInintControl : 1; // work around modify-error; should be resolved from 391 on
96 bool bLabelAlignmentPosAndSpaceModeActive;
98 void InitControls();
100 DECL_LINK( LevelHdl, ListBox * );
101 DECL_LINK(EditModifyHdl, void *);
102 DECL_LINK( DistanceHdl, MetricField * );
103 DECL_LINK( RelativeHdl, CheckBox * );
104 DECL_LINK(StandardHdl, void *);
106 void InitPosAndSpaceMode();
107 void ShowControlsDependingOnPosAndSpaceMode();
109 DECL_LINK(LabelFollowedByHdl_Impl, void *);
110 DECL_LINK( ListtabPosHdl_Impl, MetricField* );
111 DECL_LINK( AlignAtHdl_Impl, MetricField* );
112 DECL_LINK( IndentAtHdl_Impl, MetricField* );
114 using SfxTabPage::ActivatePage;
115 using SfxTabPage::DeactivatePage;
117 public:
119 SwNumPositionTabPage(Window* pParent,
120 const SfxItemSet& rSet);
121 ~SwNumPositionTabPage();
123 virtual void ActivatePage(const SfxItemSet& rSet);
124 virtual int DeactivatePage(SfxItemSet *pSet);
125 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
126 virtual void Reset( const SfxItemSet& rSet );
128 static SfxTabPage* Create( Window* pParent,
129 const SfxItemSet& rAttrSet);
131 void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
132 void SetWrtShell(SwWrtShell* pSh);
133 #ifdef DBG_UTIL
134 void SetModified(sal_Bool bRepaint = sal_True);
135 #else
136 void SetModified(sal_Bool bRepaint = sal_True)
137 { bModified = sal_True;
138 if(bRepaint)
140 m_pPreviewWIN->SetLevel(nActNumLvl);
141 m_pPreviewWIN->Invalidate();
144 #endif
147 class SwSvxNumBulletTabDialog : public SfxTabDialog
149 SwWrtShell& rWrtSh;
150 sal_uInt16 m_nSingleNumPageId;
151 sal_uInt16 m_nBulletPageId;
152 sal_uInt16 m_nOptionsPageId;
153 sal_uInt16 m_nPositionPageId;
155 protected:
156 virtual short Ok();
157 virtual void PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
158 DECL_LINK(RemoveNumberingHdl, void *);
159 public:
160 SwSvxNumBulletTabDialog(Window* pParent,
161 const SfxItemSet* pSwItemSet,
162 SwWrtShell &);
163 ~SwSvxNumBulletTabDialog();
165 #endif // _NUM_HXX
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */