1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sfx2/tabdlg.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/fixed.hxx>
26 #include <svtools/ctrlbox.hxx>
28 /*--------------------------------------------------------------------
29 Description: TabPage Format/(Styles/)Page/Text grid
30 --------------------------------------------------------------------*/
31 class SwTextGridPage
: public SfxTabPage
33 RadioButton
* m_pNoGridRB
;
34 RadioButton
* m_pLinesGridRB
;
35 RadioButton
* m_pCharsGridRB
;
36 CheckBox
* m_pSnapToCharsCB
;
38 SwPageGridExample
* m_pExampleWN
;
40 VclFrame
* m_pLayoutFL
;
41 NumericField
* m_pLinesPerPageNF
;
42 FixedText
* m_pLinesRangeFT
;
44 MetricField
* m_pTextSizeMF
;
46 FixedText
* m_pCharsPerLineFT
;
47 NumericField
* m_pCharsPerLineNF
;
48 FixedText
* m_pCharsRangeFT
;
50 FixedText
* m_pCharWidthFT
;
51 MetricField
* m_pCharWidthMF
;
53 FixedText
* m_pRubySizeFT
;
54 MetricField
* m_pRubySizeMF
;
56 CheckBox
* m_pRubyBelowCB
;
58 VclFrame
* m_pDisplayFL
;
60 CheckBox
* m_pDisplayCB
;
62 ColorListBox
* m_pColorLB
;
64 sal_Int32 m_nRubyUserValue
;
65 sal_Bool m_bRubyUserValue
;
68 sal_Bool m_bSquaredMode
;
69 sal_Bool m_bHRulerChanged
;
70 sal_Bool m_bVRulerChanged
;
72 SwTextGridPage(Window
*pParent
, const SfxItemSet
&rSet
);
75 void UpdatePageSize(const SfxItemSet
& rSet
);
76 void PutGridItem(SfxItemSet
& rSet
);
77 void SetLinesOrCharsRanges(FixedText
& rField
, const sal_Int32 nValue
);
79 DECL_LINK(GridTypeHdl
, RadioButton
*);
80 DECL_LINK(CharorLineChangedHdl
, SpinField
*);
81 DECL_LINK(TextSizeChangedHdl
, SpinField
*);
82 DECL_LINK(GridModifyHdl
, void*);
83 DECL_LINK(DisplayGridHdl
, void *);
85 using SfxTabPage::ActivatePage
;
86 using SfxTabPage::DeactivatePage
;
89 static SfxTabPage
*Create(Window
*pParent
, const SfxItemSet
&rSet
);
90 static sal_uInt16
* GetRanges();
92 virtual sal_Bool
FillItemSet(SfxItemSet
&rSet
);
93 virtual void Reset(const SfxItemSet
&rSet
);
95 virtual void ActivatePage( const SfxItemSet
& rSet
);
96 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */