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 <tools/globname.hxx>
23 #include <sfx2/tabdlg.hxx>
24 
25 #include <vcl/customweld.hxx>
26 #include <vcl/edit.hxx>
27 #include <vcl/weld.hxx>
28 #include <sfx2/basedlgs.hxx>
29 
30 #include <SwCapObjType.hxx>
31 
32 class SwFieldMgr;
33 class SvTreeListEntry;
34 class SwWrtShell;
35 
37 {
38 public:
39  static OUString GetString(sal_uInt32 i);
40  static sal_uInt32 Count();
41  static FieldUnit GetValue(sal_uInt32 i);
42 };
43 
45 {
46 private:
47  OUString m_sLastGoodText;
48  OUString const m_sNone;
49 public:
50  TextFilterAutoConvert(const OUString &rNone)
51  : m_sNone(rNone)
52  {
53  }
54  virtual OUString filter(const OUString &rText) override;
55 };
56 
57 class SwLoadOptPage : public SfxTabPage
58 {
59 private:
61  sal_uInt16 m_nLastTab;
62  sal_Int32 m_nOldLinkMode;
63 
64  std::unique_ptr<weld::RadioButton> m_xAlwaysRB;
65  std::unique_ptr<weld::RadioButton> m_xRequestRB;
66  std::unique_ptr<weld::RadioButton> m_xNeverRB;
67 
68  std::unique_ptr<weld::CheckButton> m_xAutoUpdateFields;
69  std::unique_ptr<weld::CheckButton> m_xAutoUpdateCharts;
70 
71  std::unique_ptr<weld::ComboBox> m_xMetricLB;
72  std::unique_ptr<weld::Label> m_xTabFT;
73  std::unique_ptr<weld::MetricSpinButton> m_xTabMF;
74  std::unique_ptr<weld::CheckButton> m_xUseSquaredPageMode;
75  std::unique_ptr<weld::CheckButton> m_xUseCharUnit;
76  std::unique_ptr<weld::Entry> m_xWordCountED;
77  std::unique_ptr<weld::CheckButton> m_xShowStandardizedPageCount;
78  std::unique_ptr<weld::SpinButton> m_xStandardizedPageSizeNF;
79 
80  DECL_LINK(MetricHdl, weld::ComboBox&, void);
81  DECL_LINK(StandardizedPageCountCheckHdl, weld::Button&, void);
82 
83 public:
84  SwLoadOptPage(TabPageParent pParent, const SfxItemSet& rSet);
85  virtual ~SwLoadOptPage() override;
86 
87  static VclPtr<SfxTabPage> Create( TabPageParent pParent,
88  const SfxItemSet* rAttrSet);
89 
90  virtual bool FillItemSet( SfxItemSet* rSet ) override;
91  virtual void Reset( const SfxItemSet* rSet ) override;
92 };
93 
95 {
96 public:
97  SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet);
98 };
99 
101 {
102 private:
103  OUString maText;
106 
107  void ApplySettings(vcl::RenderContext& rRenderContext);
108 
109 public:
111  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
112  void SetPreviewText(const OUString& rText);
113  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
114 };
115 
117 {
118 private:
119  OUString const m_sSWTable;
120  OUString const m_sSWFrame;
121  OUString const m_sSWGraphic;
122  OUString const m_sOLE;
123 
124  OUString m_sIllustration;
125  OUString m_sTable;
126  OUString m_sText;
127  OUString m_sDrawing;
128 
129  OUString const m_sBegin;
130  OUString const m_sEnd;
131  OUString const m_sAbove;
132  OUString const m_sBelow;
133 
134  OUString const m_sNone;
135 
137 
138  std::unique_ptr<SwFieldMgr> pMgr;
139  bool bHTMLMode;
140 
142 
144  std::unique_ptr<weld::TreeView> m_xCheckLB;
145  std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder;
146 
147  std::unique_ptr<weld::Widget> m_xSettingsGroup;
148  std::unique_ptr<weld::ComboBox> m_xCategoryBox;
149  std::unique_ptr<weld::Label> m_xFormatText;
150  std::unique_ptr<weld::ComboBox> m_xFormatBox;
151  //#i61007# order of captions
152  std::unique_ptr<weld::Label> m_xNumberingSeparatorFT;
153  std::unique_ptr<weld::Entry> m_xNumberingSeparatorED;
154  std::unique_ptr<weld::Label> m_xTextText;
155  std::unique_ptr<weld::Entry> m_xTextEdit;
156  std::unique_ptr<weld::ComboBox> m_xPosBox;
157 
158  std::unique_ptr<weld::Widget> m_xNumCapt;
159  std::unique_ptr<weld::ComboBox> m_xLbLevel;
160  std::unique_ptr<weld::Entry> m_xEdDelim;
161 
162  std::unique_ptr<weld::Widget> m_xCategory;
163  std::unique_ptr<weld::ComboBox> m_xCharStyleLB;
164  std::unique_ptr<weld::CheckButton> m_xApplyBorderCB;
165  std::unique_ptr<weld::CustomWeld> m_xPreview;
166 
167  typedef std::pair<int, int> row_col;
168 
169  DECL_LINK(SelectHdl, weld::ComboBox&, void);
170  DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
171  DECL_LINK(ModifyEntryHdl, weld::Entry&, void);
172  DECL_LINK(ModifyComboHdl, weld::ComboBox&, void);
173  DECL_LINK(OrderHdl, weld::ComboBox&, void );
174  DECL_LINK(ShowEntryHdl, weld::TreeView&, void);
175  DECL_LINK(ToggleEntryHdl, const row_col&, void);
176  DECL_LINK(TextFilterHdl, OUString&, bool);
177 
178  void ModifyHdl();
179  void UpdateEntry(int nRow);
180  void DelUserData();
181  void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId = nullptr);
182  void SaveEntry(int nEntry);
183  void InvalidatePreview();
184 
185 public:
186  SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet);
187  virtual ~SwCaptionOptPage() override;
188  virtual void dispose() override;
189 
190  static VclPtr<SfxTabPage> Create(TabPageParent pParent,
191  const SfxItemSet* rAttrSet);
192 
193  virtual bool FillItemSet( SfxItemSet* rSet ) override;
194  virtual void Reset( const SfxItemSet* rSet ) override;
195 };
196 
197 #endif
198 
199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Widget > m_xSettingsGroup
Definition: optload.hxx:147
FieldUnit
std::unique_ptr< weld::Label > m_xTextText
Definition: optload.hxx:154
OUString const m_sSWTable
Definition: optload.hxx:119
std::unique_ptr< weld::RadioButton > m_xAlwaysRB
Definition: optload.hxx:64
std::unique_ptr< weld::ComboBox > m_xMetricLB
Definition: optload.hxx:71
sal_uIntPtr sal_uLong
std::unique_ptr< weld::ComboBox > m_xLbLevel
Definition: optload.hxx:159
std::unique_ptr< weld::Entry > m_xNumberingSeparatorED
Definition: optload.hxx:153
OUString const m_sNone
Definition: optload.hxx:134
std::unique_ptr< weld::SpinButton > m_xStandardizedPageSizeNF
Definition: optload.hxx:78
void ModifyHdl()
Definition: optload.cxx:819
SwWrtShell * m_pWrtShell
Definition: optload.hxx:60
std::pair< int, int > row_col
Definition: optload.hxx:167
OUString m_sText
Definition: optload.hxx:126
std::unique_ptr< weld::Label > m_xNumberingSeparatorFT
Definition: optload.hxx:152
OUString m_sDrawing
Definition: optload.hxx:127
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
std::unique_ptr< weld::Label > m_xTabFT
Definition: optload.hxx:72
std::unique_ptr< weld::ComboBox > m_xCharStyleLB
Definition: optload.hxx:163
std::unique_ptr< weld::Entry > m_xEdDelim
Definition: optload.hxx:160
std::unique_ptr< weld::RadioButton > m_xRequestRB
Definition: optload.hxx:65
virtual OUString filter(const OUString &rText) override
Definition: cption.cxx:92
std::unique_ptr< weld::CheckButton > m_xApplyBorderCB
Definition: optload.hxx:164
std::unique_ptr< weld::ComboBox > m_xCategoryBox
Definition: optload.hxx:148
DECL_LINK(MetricHdl, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > m_xLbCaptionOrder
Definition: optload.hxx:145
SwCaptionPreview m_aPreview
Definition: optload.hxx:143
OUString const m_sSWGraphic
Definition: optload.hxx:121
std::unique_ptr< weld::Widget > m_xNumCapt
Definition: optload.hxx:158
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:270
OUString const m_sNone
Definition: optload.hxx:48
DECL_LINK(SelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::MetricSpinButton > m_xTabMF
Definition: optload.hxx:73
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: optload.cxx:556
OUString maText
Definition: optload.hxx:103
static FieldUnit GetValue(sal_uInt32 i)
Definition: optload.cxx:79
SwCaptionOptDlg(weld::Window *pParent, const SfxItemSet &rSet)
Definition: optload.cxx:375
OUString m_sLastGoodText
Definition: optload.hxx:47
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:161
void InvalidatePreview()
Definition: optload.cxx:871
void SaveEntry(int nEntry)
Definition: optload.cxx:791
virtual void dispose() override
Definition: optload.cxx:548
std::unique_ptr< weld::RadioButton > m_xNeverRB
Definition: optload.hxx:66
std::unique_ptr< weld::ComboBox > m_xFormatBox
Definition: optload.hxx:150
std::unique_ptr< weld::CustomWeld > m_xPreview
Definition: optload.hxx:165
OUString m_sIllustration
Definition: optload.hxx:124
int i
vcl::Font maFont
Definition: optload.hxx:105
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: optload.cxx:150
std::unique_ptr< weld::TreeView > m_xCheckLB
Definition: optload.hxx:144
SwCaptionOptPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: optload.cxx:435
void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId=nullptr)
Definition: optload.cxx:643
SwLoadOptPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: optload.cxx:86
sal_uInt16 m_nLastTab
Definition: optload.hxx:61
std::unique_ptr< weld::ComboBox > m_xPosBox
Definition: optload.hxx:156
std::unique_ptr< weld::Widget > m_xCategory
Definition: optload.hxx:162
void DelUserData()
Definition: optload.cxx:662
std::unique_ptr< SwFieldMgr > pMgr
Definition: optload.hxx:138
void UpdateEntry(int nRow)
Definition: optload.cxx:671
OUString const m_sAbove
Definition: optload.hxx:131
std::unique_ptr< weld::CheckButton > m_xUseCharUnit
Definition: optload.hxx:75
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optload.cxx:562
std::unique_ptr< weld::CheckButton > m_xAutoUpdateFields
Definition: optload.hxx:68
OUString const m_sBegin
Definition: optload.hxx:129
int m_nPrevSelectedEntry
Definition: optload.hxx:136
bool mbFontInitialized
Definition: optload.hxx:104
std::unique_ptr< weld::Entry > m_xTextEdit
Definition: optload.hxx:155
std::unique_ptr< weld::CheckButton > m_xShowStandardizedPageCount
Definition: optload.hxx:77
virtual void Reset(const SfxItemSet *rSet) override
Definition: optload.cxx:586
OUString const m_sEnd
Definition: optload.hxx:130
static OUString GetString(sal_uInt32 i)
Definition: optload.cxx:72
std::unique_ptr< weld::CheckButton > m_xUseSquaredPageMode
Definition: optload.hxx:74
std::unique_ptr< weld::Entry > m_xWordCountED
Definition: optload.hxx:76
std::unique_ptr< weld::Label > m_xFormatText
Definition: optload.hxx:149
virtual ~SwLoadOptPage() override
Definition: optload.cxx:146
OUString const m_sBelow
Definition: optload.hxx:132
virtual ~SwCaptionOptPage() override
Definition: optload.cxx:543
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: optload.cxx:421
OUString m_sTable
Definition: optload.hxx:125
static sal_uInt32 Count()
Definition: optload.cxx:67
void SetPreviewText(const OUString &rText)
Definition: optload.cxx:405
void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: optload.cxx:389
TextFilterAutoConvert(const OUString &rNone)
Definition: optload.hxx:50
SwCapObjType
OUString const m_sOLE
Definition: optload.hxx:122
sal_Int32 m_nOldLinkMode
Definition: optload.hxx:62
std::unique_ptr< weld::CheckButton > m_xAutoUpdateCharts
Definition: optload.hxx:69
OUString const m_sSWFrame
Definition: optload.hxx:120
TextFilterAutoConvert m_aTextFilter
Definition: optload.hxx:141
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: optload.cxx:414