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