LibreOffice Module sw (master)  1
optload.hxx
Go to the documentation of this file.
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 INCLUDED_SW_SOURCE_UIBASE_INC_OPTLOAD_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_OPTLOAD_HXX
21 
22 #include <sfx2/tabdlg.hxx>
23 
24 #include <vcl/customweld.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/layout.hxx>
27 #include <vcl/lstbox.hxx>
28 #include <vcl/field.hxx>
29 #include <vcl/weld.hxx>
30 #include <svx/strarray.hxx>
31 #include <sfx2/basedlgs.hxx>
32 #include <svx/checklbx.hxx>
33 #include "caption.hxx"
34 
35 class SwFieldMgr;
36 class SvTreeListEntry;
37 class SwWrtShell;
38 
40 {
41 public:
42  static OUString GetString(sal_uInt32 i);
43  static sal_uInt32 Count();
44  static FieldUnit GetValue(sal_uInt32 i);
45 };
46 
48 {
49 private:
50  OUString m_sLastGoodText;
51  OUString const m_sNone;
52 public:
53  TextFilterAutoConvert(const OUString &rNone)
54  : m_sNone(rNone)
55  {
56  }
57  virtual OUString filter(const OUString &rText) override;
58 };
59 
60 class SwLoadOptPage : public SfxTabPage
61 {
62 private:
66 
69 
78 
80  sal_uInt16 m_nLastTab;
81  sal_Int32 m_nOldLinkMode;
82 
83  DECL_LINK(MetricHdl, ListBox&, void);
84  DECL_LINK(StandardizedPageCountCheckHdl, Button*, void);
85 
86 public:
87  SwLoadOptPage(vcl::Window* pParent, const SfxItemSet& rSet);
88  virtual ~SwLoadOptPage() override;
89  virtual void dispose() override;
90 
91  static VclPtr<SfxTabPage> Create( TabPageParent pParent,
92  const SfxItemSet* rAttrSet);
93 
94  virtual bool FillItemSet( SfxItemSet* rSet ) override;
95  virtual void Reset( const SfxItemSet* rSet ) override;
96 };
97 
99 {
100 public:
101  SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet);
102 };
103 
105 {
106 private:
107  OUString maText;
110 
111  void ApplySettings(vcl::RenderContext& rRenderContext);
112 
113 public:
115  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
116  void SetPreviewText(const OUString& rText);
117  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
118 };
119 
121 {
122 private:
123  OUString const m_sSWTable;
124  OUString const m_sSWFrame;
125  OUString const m_sSWGraphic;
126  OUString const m_sOLE;
127 
128  OUString m_sIllustration;
129  OUString m_sTable;
130  OUString m_sText;
131  OUString m_sDrawing;
132 
133  OUString const m_sBegin;
134  OUString const m_sEnd;
135  OUString const m_sAbove;
136  OUString const m_sBelow;
137 
138  OUString const m_sNone;
139 
141 
142  std::unique_ptr<SwFieldMgr> pMgr;
143  bool bHTMLMode;
144 
146 
148  std::unique_ptr<weld::TreeView> m_xCheckLB;
149  std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder;
150 
151  std::unique_ptr<weld::Widget> m_xSettingsGroup;
152  std::unique_ptr<weld::ComboBox> m_xCategoryBox;
153  std::unique_ptr<weld::Label> m_xFormatText;
154  std::unique_ptr<weld::ComboBox> m_xFormatBox;
155  //#i61007# order of captions
156  std::unique_ptr<weld::Label> m_xNumberingSeparatorFT;
157  std::unique_ptr<weld::Entry> m_xNumberingSeparatorED;
158  std::unique_ptr<weld::Label> m_xTextText;
159  std::unique_ptr<weld::Entry> m_xTextEdit;
160  std::unique_ptr<weld::ComboBox> m_xPosBox;
161 
162  std::unique_ptr<weld::Widget> m_xNumCapt;
163  std::unique_ptr<weld::ComboBox> m_xLbLevel;
164  std::unique_ptr<weld::Entry> m_xEdDelim;
165 
166  std::unique_ptr<weld::Widget> m_xCategory;
167  std::unique_ptr<weld::ComboBox> m_xCharStyleLB;
168  std::unique_ptr<weld::CheckButton> m_xApplyBorderCB;
169  std::unique_ptr<weld::CustomWeld> m_xPreview;
170 
171  typedef std::pair<int, int> row_col;
172 
173  DECL_LINK(SelectHdl, weld::ComboBox&, void);
174  DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
175  DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
176  DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
177  DECL_LINK(OrderHdl, weld::ComboBox&, void );
178  DECL_LINK(ShowEntryHdl, weld::TreeView&, void);
179  DECL_LINK(ToggleEntryHdl, const row_col&, void);
180  DECL_LINK(TextFilterHdl, OUString&, bool);
181 
182  void ModifyHdl();
183  void UpdateEntry(int nRow);
184  void DelUserData();
185  void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId = nullptr);
186  void SaveEntry(int nEntry);
187  void InvalidatePreview();
188 
189 public:
190  SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet);
191  virtual ~SwCaptionOptPage() override;
192  virtual void dispose() override;
193 
194  static VclPtr<SfxTabPage> Create(TabPageParent pParent,
195  const SfxItemSet* rAttrSet);
196 
197  virtual bool FillItemSet( SfxItemSet* rSet ) override;
198  virtual void Reset( const SfxItemSet* rSet ) override;
199 };
200 
201 #endif
202 
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Widget > m_xSettingsGroup
Definition: optload.hxx:151
FieldUnit
std::unique_ptr< weld::Label > m_xTextText
Definition: optload.hxx:158
OUString const m_sSWTable
Definition: optload.hxx:123
sal_uIntPtr sal_uLong
std::unique_ptr< weld::ComboBox > m_xLbLevel
Definition: optload.hxx:163
std::unique_ptr< weld::Entry > m_xNumberingSeparatorED
Definition: optload.hxx:157
VclPtr< Edit > m_pWordCountED
Definition: optload.hxx:75
OUString const m_sNone
Definition: optload.hxx:138
void ModifyHdl()
Definition: optload.cxx:841
SwWrtShell * m_pWrtShell
Definition: optload.hxx:79
std::pair< int, int > row_col
Definition: optload.hxx:171
OUString m_sText
Definition: optload.hxx:130
std::unique_ptr< weld::Label > m_xNumberingSeparatorFT
Definition: optload.hxx:156
OUString m_sDrawing
Definition: optload.hxx:131
VclPtr< RadioButton > m_pNeverRB
Definition: optload.hxx:65
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
std::unique_ptr< weld::ComboBox > m_xCharStyleLB
Definition: optload.hxx:167
std::unique_ptr< weld::Entry > m_xEdDelim
Definition: optload.hxx:164
virtual OUString filter(const OUString &rText) override
Definition: cption.cxx:92
std::unique_ptr< weld::CheckButton > m_xApplyBorderCB
Definition: optload.hxx:168
std::unique_ptr< weld::ComboBox > m_xCategoryBox
Definition: optload.hxx:152
std::unique_ptr< weld::ComboBox > m_xLbCaptionOrder
Definition: optload.hxx:149
SwCaptionPreview m_aPreview
Definition: optload.hxx:147
VclPtr< NumericField > m_pStandardizedPageSizeNF
Definition: optload.hxx:77
virtual void dispose() override
Definition: optload.cxx:153
OUString const m_sSWGraphic
Definition: optload.hxx:125
std::unique_ptr< weld::Widget > m_xNumCapt
Definition: optload.hxx:162
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:292
OUString const m_sNone
Definition: optload.hxx:51
DECL_LINK(SelectHdl, weld::ComboBox &, void)
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: optload.cxx:578
OUString maText
Definition: optload.hxx:107
static FieldUnit GetValue(sal_uInt32 i)
Definition: optload.cxx:79
SwCaptionOptDlg(weld::Window *pParent, const SfxItemSet &rSet)
Definition: optload.cxx:397
OUString m_sLastGoodText
Definition: optload.hxx:50
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:183
VclPtr< ListBox > m_pMetricLB
Definition: optload.hxx:70
void InvalidatePreview()
Definition: optload.cxx:893
void SaveEntry(int nEntry)
Definition: optload.cxx:813
virtual void dispose() override
Definition: optload.cxx:570
std::unique_ptr< weld::ComboBox > m_xFormatBox
Definition: optload.hxx:154
std::unique_ptr< weld::CustomWeld > m_xPreview
Definition: optload.hxx:169
OUString m_sIllustration
Definition: optload.hxx:128
VclPtr< CheckBox > m_pShowStandardizedPageCount
Definition: optload.hxx:76
SwLoadOptPage(vcl::Window *pParent, const SfxItemSet &rSet)
Definition: optload.cxx:86
int i
vcl::Font maFont
Definition: optload.hxx:109
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: optload.cxx:172
std::unique_ptr< weld::TreeView > m_xCheckLB
Definition: optload.hxx:148
VclPtr< CheckBox > m_pUseCharUnit
Definition: optload.hxx:74
SwCaptionOptPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: optload.cxx:457
void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId=nullptr)
Definition: optload.cxx:665
sal_uInt16 m_nLastTab
Definition: optload.hxx:80
std::unique_ptr< weld::ComboBox > m_xPosBox
Definition: optload.hxx:160
std::unique_ptr< weld::Widget > m_xCategory
Definition: optload.hxx:166
void DelUserData()
Definition: optload.cxx:684
VclPtr< MetricField > m_pTabMF
Definition: optload.hxx:72
std::unique_ptr< SwFieldMgr > pMgr
Definition: optload.hxx:142
VclPtr< RadioButton > m_pAlwaysRB
Definition: optload.hxx:63
void UpdateEntry(int nRow)
Definition: optload.cxx:693
VclPtr< FixedText > m_pTabFT
Definition: optload.hxx:71
OUString const m_sAbove
Definition: optload.hxx:135
VclPtr< CheckBox > m_pUseSquaredPageMode
Definition: optload.hxx:73
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:584
OUString const m_sBegin
Definition: optload.hxx:133
VclPtr< CheckBox > m_pAutoUpdateFields
Definition: optload.hxx:67
int m_nPrevSelectedEntry
Definition: optload.hxx:140
bool mbFontInitialized
Definition: optload.hxx:108
VclPtr< CheckBox > m_pAutoUpdateCharts
Definition: optload.hxx:68
std::unique_ptr< weld::Entry > m_xTextEdit
Definition: optload.hxx:159
DECL_LINK(MetricHdl, ListBox &, void)
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:608
OUString const m_sEnd
Definition: optload.hxx:134
static OUString GetString(sal_uInt32 i)
Definition: optload.cxx:72
std::unique_ptr< weld::Label > m_xFormatText
Definition: optload.hxx:153
virtual ~SwLoadOptPage() override
Definition: optload.cxx:148
OUString const m_sBelow
Definition: optload.hxx:136
virtual ~SwCaptionOptPage() override
Definition: optload.cxx:565
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: optload.cxx:443
OUString m_sTable
Definition: optload.hxx:129
static sal_uInt32 Count()
Definition: optload.cxx:67
void SetPreviewText(const OUString &rText)
Definition: optload.cxx:427
void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: optload.cxx:411
TextFilterAutoConvert(const OUString &rNone)
Definition: optload.hxx:53
SwCapObjType
OUString const m_sOLE
Definition: optload.hxx:126
VclPtr< RadioButton > m_pRequestRB
Definition: optload.hxx:64
sal_Int32 m_nOldLinkMode
Definition: optload.hxx:81
OUString const m_sSWFrame
Definition: optload.hxx:124
TextFilterAutoConvert m_aTextFilter
Definition: optload.hxx:145
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: optload.cxx:436