12#include <AccessibilityCheck.hxx>
19#include <officecfg/Office/Common.hxx>
27#include <com/sun/star/lang/IllegalArgumentException.hpp>
32 weld::Container* pParent, std::shared_ptr<sfx::AccessibilityIssue>
const& rAccessibilityIssue)
33 : m_xBuilder(
Application::CreateBuilder(pParent,
"svx/ui/accessibilitycheckentry.ui"))
34 ,
m_xContainer(m_xBuilder->weld_container(
"accessibilityCheckEntryBox"))
35 ,
m_xLabel(m_xBuilder->weld_label(
"accessibilityCheckEntryLabel"))
36 , m_xGotoButton(m_xBuilder->weld_link_button(
"accessibilityCheckEntryLinkButton"))
37 , m_xFixButton(m_xBuilder->weld_button(
"accessibilityCheckEntryFixButton"))
38 , m_pAccessibilityIssue(rAccessibilityIssue)
48 int nMaxWidth =
m_xGotoButton->get_approximate_digit_width() * 10;
74 m_pAccessibilityIssue->gotoIssue();
80 m_pAccessibilityIssue->quickFixIssue();
86 if (pParent ==
nullptr)
87 throw ::com::sun::star::lang::IllegalArgumentException(
88 "no parent window given to A11yCheckIssuesPanel::Create",
nullptr, 0);
89 return std::make_unique<A11yCheckIssuesPanel>(pParent, pBindings);
93 :
PanelLayout(pParent,
"A11yCheckIssuesPanel",
"modules/swriter/ui/a11ycheckissuespanel.ui")
94 , m_xExpanderDocument(m_xBuilder->weld_expander(
"expand_document"))
95 , m_xExpanderStyles(m_xBuilder->weld_expander(
"expand_styles"))
96 , m_xExpanderNoAlt(m_xBuilder->weld_expander(
"expand_no_alt"))
97 , m_xExpanderTable(m_xBuilder->weld_expander(
"expand_table"))
98 , m_xExpanderFormatting(m_xBuilder->weld_expander(
"expand_formatting"))
99 , m_xExpanderHyperlink(m_xBuilder->weld_expander(
"expand_hyperlink"))
100 , m_xExpanderFakes(m_xBuilder->weld_expander(
"expand_fakes"))
101 , m_xExpanderNumbering(m_xBuilder->weld_expander(
"expand_numbering"))
102 , m_xExpanderOther(m_xBuilder->weld_expander(
"expand_other"))
103 , m_xBoxDocument(m_xBuilder->weld_box(
"box_document"))
104 , m_xBoxStyles(m_xBuilder->weld_box(
"box_styles"))
105 , m_xBoxNoAlt(m_xBuilder->weld_box(
"box_no_alt"))
106 , m_xBoxTable(m_xBuilder->weld_box(
"box_table"))
107 , m_xBoxFormatting(m_xBuilder->weld_box(
"box_formatting"))
108 , m_xBoxHyperlink(m_xBuilder->weld_box(
"box_hyperlink"))
109 , m_xBoxFakes(m_xBuilder->weld_box(
"box_fakes"))
110 , m_xBoxNumbering(m_xBuilder->weld_box(
"box_numbering"))
111 , m_xBoxOther(m_xBuilder->weld_box(
"box_other"))
112 , mpBindings(pBindings)
116 , mbAutomaticCheckEnabled(false)
127 std::shared_ptr<comphelper::ConfigurationChanges> batch(
129 officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::set(
true, batch);
131 pBindings->
Invalidate(SID_ACCESSIBILITY_CHECK_ONLINE);
144 std::shared_ptr<comphelper::ConfigurationChanges> batch(
146 officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::set(
false, batch);
221 sal_Int32 iDocument = 0;
222 sal_Int32 iStyles = 0;
223 sal_Int32 iNoAlt = 0;
224 sal_Int32 iTable = 0;
225 sal_Int32 iFormatting = 0;
226 sal_Int32 iHyperlink = 0;
227 sal_Int32 iFakes = 0;
228 sal_Int32 iNumbering = 0;
229 sal_Int32 iOther = 0;
232 switch (pIssue->m_eIssueID)
239 = std::make_unique<AccessibilityCheckEntry>(
m_xBoxDocument.get(), pIssue);
247 auto xEntry = std::make_unique<AccessibilityCheckEntry>(
m_xBoxStyles.get(), pIssue);
248 m_xBoxStyles->reorder_child(xEntry->get_widget(), iStyles++);
257 auto xEntry = std::make_unique<AccessibilityCheckEntry>(
m_xBoxNoAlt.get(), pIssue);
258 m_xBoxNoAlt->reorder_child(xEntry->get_widget(), iNoAlt++);
265 auto xEntry = std::make_unique<AccessibilityCheckEntry>(
m_xBoxTable.get(), pIssue);
266 m_xBoxTable->reorder_child(xEntry->get_widget(), iTable++);
275 = std::make_unique<AccessibilityCheckEntry>(
m_xBoxFormatting.get(), pIssue);
285 = std::make_unique<AccessibilityCheckEntry>(
m_xBoxHyperlink.get(), pIssue);
294 auto xEntry = std::make_unique<AccessibilityCheckEntry>(
m_xBoxFakes.get(), pIssue);
295 m_xBoxFakes->reorder_child(xEntry->get_widget(), iFakes++);
303 = std::make_unique<AccessibilityCheckEntry>(
m_xBoxNumbering.get(), pIssue);
311 auto xEntry = std::make_unique<AccessibilityCheckEntry>(
m_xBoxOther.get(), pIssue);
312 m_xBoxOther->reorder_child(xEntry->get_widget(), iOther++);
319 SAL_WARN(
"sw.a11y",
"Invalid issue ID.");
void Invalidate(sal_uInt16 nId)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
SwDoc * GetDoc()
returns Doc. But be careful!
static std::shared_ptr< ConfigurationChanges > create()
std::unique_ptr< weld::Label > m_xLabel
AccessibilityIssueCollection & getIssueCollection()
std::vector< std::shared_ptr< AccessibilityIssue > > & getIssues()
#define FN_STAT_ACCESSIBILITY_CHECK
#define suppress_fun_call_w_exception(expr)
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Reference< XNameAccess > m_xContainer