Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _NUM_HXX
20 : #define _NUM_HXX
21 :
22 :
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"
35 :
36 : class SwWrtShell;
37 : class SvxBrushItem;
38 : class SwOutlineTabDialog;
39 :
40 : struct SwBmpItemInfo
41 : {
42 : SvxBrushItem* pBrushItem;
43 : sal_uInt16 nItemId;
44 : };
45 :
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
51 :
52 : class SwNumPositionTabPage : public SfxTabPage
53 : {
54 : ListBox* m_pLevelLB;
55 : VclFrame* m_pPositionFrame;
56 :
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;
68 :
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;
81 :
82 : PushButton* m_pStandardPB;
83 :
84 : NumberingPreview* m_pPreviewWIN;
85 :
86 : SwNumRule* pActNum;
87 : SwNumRule* pSaveNum;
88 : SwWrtShell* pWrtSh;
89 :
90 : SwOutlineTabDialog* pOutlineDlg;
91 : sal_uInt16 nActNumLvl;
92 :
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;
97 :
98 : void InitControls();
99 :
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 *);
105 :
106 : void InitPosAndSpaceMode();
107 : void ShowControlsDependingOnPosAndSpaceMode();
108 :
109 : DECL_LINK(LabelFollowedByHdl_Impl, void *);
110 : DECL_LINK( ListtabPosHdl_Impl, MetricField* );
111 : DECL_LINK( AlignAtHdl_Impl, MetricField* );
112 : DECL_LINK( IndentAtHdl_Impl, MetricField* );
113 :
114 : using SfxTabPage::ActivatePage;
115 : using SfxTabPage::DeactivatePage;
116 :
117 : public:
118 :
119 : SwNumPositionTabPage(Window* pParent,
120 : const SfxItemSet& rSet);
121 : ~SwNumPositionTabPage();
122 :
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 );
127 :
128 : static SfxTabPage* Create( Window* pParent,
129 : const SfxItemSet& rAttrSet);
130 :
131 0 : 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 0 : void SetModified(sal_Bool bRepaint = sal_True)
137 0 : { bModified = sal_True;
138 0 : if(bRepaint)
139 : {
140 0 : m_pPreviewWIN->SetLevel(nActNumLvl);
141 0 : m_pPreviewWIN->Invalidate();
142 : }
143 0 : }
144 : #endif
145 : };
146 :
147 : class SwSvxNumBulletTabDialog : public SfxTabDialog
148 : {
149 : SwWrtShell& rWrtSh;
150 :
151 : String sRemoveText;
152 :
153 : protected:
154 : virtual short Ok();
155 : virtual void PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
156 : DECL_LINK(RemoveNumberingHdl, void *);
157 : public:
158 : SwSvxNumBulletTabDialog(Window* pParent,
159 : const SfxItemSet* pSwItemSet,
160 : SwWrtShell &);
161 : ~SwSvxNumBulletTabDialog();
162 : };
163 : #endif // _NUM_HXX
164 :
165 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|