LibreOffice Module sw (master) 1
AccessibilityIssue.cxx
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 */
10
11#include <AccessibilityIssue.hxx>
12#include <wrtsh.hxx>
13#include <docsh.hxx>
14#include <comphelper/lok.hxx>
15
16namespace sw
17{
19 : sfx::AccessibilityIssue(eIssueID)
20 , m_eIssueObject(IssueObject::UNKNOWN)
21 , m_pDoc(nullptr)
22 , m_pNode(nullptr)
23 , m_nStart(0)
24 , m_nEnd(0)
25{
26}
27
29
30void AccessibilityIssue::setDoc(SwDoc& rDoc) { m_pDoc = &rDoc; }
31
32void AccessibilityIssue::setObjectID(OUString const& rID) { m_sObjectID = rID; }
33
35{
37 return true;
38 return false;
39}
40
42{
43 if (!m_pDoc)
44 return;
45
46 switch (m_eIssueObject)
47 {
50 {
51 SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
52 pWrtShell->GotoFly(m_sObjectID, FLYCNTTYPE_ALL, true);
54 pWrtShell->ShowCursor();
55 }
56 break;
58 {
59 SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
60 pWrtShell->GotoTable(m_sObjectID);
62 pWrtShell->ShowCursor();
63 }
64 break;
66 {
67 SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
68 SwContentNode* pContentNode = m_pNode->GetContentNode();
69 SwPosition aPoint(*pContentNode, m_nStart);
70 SwPosition aMark(*pContentNode, m_nEnd);
71 pWrtShell->EnterStdMode();
72 pWrtShell->StartAllAction();
73 SwPaM* pPaM = pWrtShell->GetCursor();
74 *pPaM->GetPoint() = aPoint;
75 pPaM->SetMark();
76 *pPaM->GetMark() = aMark;
77 pWrtShell->EndAllAction();
79 pWrtShell->ShowCursor();
80 }
81 break;
82 default:
83 break;
84 }
85}
86
87} // end sw namespace
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void ShowCursor()
Definition: crsrsh.cxx:2410
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:225
Definition: doc.hxx:194
SwDocShell * GetDocShell()
Definition: doc.hxx:1359
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void EndAllAction()
Definition: edws.cxx:97
SwContentNode * GetContentNode()
Definition: node.hxx:664
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
const SwPosition * GetPoint() const
Definition: pam.hxx:261
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
Definition: move.cxx:599
void EnterStdMode()
Definition: select.cxx:551
bool GotoTable(const OUString &rName)
Definition: move.cxx:693
AccessibilityIssue(sfx::AccessibilityIssueID eIssueID=sfx::AccessibilityIssueID::UNSPECIFIED)
void setIssueObject(IssueObject eIssueObject)
void gotoIssue() const override
bool canGotoIssue() const override
void setObjectID(OUString const &rID)
UNKNOWN
@ FLYCNTTYPE_ALL
Definition: flyenum.hxx:25
AccessibilityIssueID
Dialog to specify the properties of date form field.
Marks a position in the document model.
Definition: pam.hxx:37