LibreOffice Module svx (master)
1
svx
source
accessibility
AccessibleTextEventQueue.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
* 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
20
#include <memory>
21
#include "
AccessibleTextEventQueue.hxx
"
22
23
#include <
editeng/unoedhlp.hxx
>
24
#include <
svx/svdmodel.hxx
>
25
#include <
svx/svdpntv.hxx
>
26
27
namespace
accessibility
28
{
29
30
31
// EventQueue implementation
32
33
34
AccessibleTextEventQueue::AccessibleTextEventQueue
()
35
{
36
}
37
38
AccessibleTextEventQueue::~AccessibleTextEventQueue
()
39
{
40
Clear
();
41
}
42
43
void
AccessibleTextEventQueue::Append
(
const
SdrHint
& rHint )
44
{
45
// only enqueue the events we actually care about in
46
// AccessibleTextHelper_Impl::ProcessQueue(), because
47
// the cost of some events adds up.
48
auto
eKind = rHint.
GetKind
();
49
if
(eKind ==
SdrHintKind::BeginEdit
50
|| eKind ==
SdrHintKind::EndEdit
)
51
maEventQueue
.push_back(
new
SdrHint
( rHint ) );
52
}
53
54
void
AccessibleTextEventQueue::Append
(
const
TextHint
& rHint )
55
{
56
maEventQueue
.push_back(
new
TextHint
( rHint ) );
57
}
58
59
void
AccessibleTextEventQueue::Append
(
const
SvxViewChangedHint
& rHint )
60
{
61
maEventQueue
.push_back(
new
SvxViewChangedHint
( rHint ) );
62
}
63
64
void
AccessibleTextEventQueue::Append
(
const
SvxEditSourceHint
& rHint )
65
{
66
maEventQueue
.push_back(
new
SvxEditSourceHint
( rHint ) );
67
}
68
69
::std::unique_ptr< SfxHint >
AccessibleTextEventQueue::PopFront
()
70
{
71
::std::unique_ptr< SfxHint > aRes( *(
maEventQueue
.begin()) );
72
maEventQueue
.pop_front();
73
return
aRes;
74
}
75
76
bool
AccessibleTextEventQueue::IsEmpty
()
const
77
{
78
return
maEventQueue
.empty();
79
}
80
81
void
AccessibleTextEventQueue::Clear
()
82
{
83
// clear queue
84
for
(
auto
p
:
maEventQueue
)
85
delete
p
;
86
maEventQueue
.clear();
87
}
88
89
}
// end of namespace accessibility
90
91
92
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AccessibleTextEventQueue.hxx
SdrHint
Definition:
svdmodel.hxx:119
SdrHint::GetKind
SdrHintKind GetKind() const
Definition:
svdmodel.hxx:133
SvxEditSourceHint
SvxViewChangedHint
Definition:
svdpntv.hxx:74
TextHint
accessibility::AccessibleTextEventQueue::Clear
void Clear()
Clear event queue.
Definition:
AccessibleTextEventQueue.cxx:81
accessibility::AccessibleTextEventQueue::Append
void Append(const SdrHint &rHint)
Append event to end of queue.
Definition:
AccessibleTextEventQueue.cxx:43
accessibility::AccessibleTextEventQueue::PopFront
::std::unique_ptr< SfxHint > PopFront()
Pop first queue element.
Definition:
AccessibleTextEventQueue.cxx:69
accessibility::AccessibleTextEventQueue::AccessibleTextEventQueue
AccessibleTextEventQueue()
Definition:
AccessibleTextEventQueue.cxx:34
accessibility::AccessibleTextEventQueue::maEventQueue
EventQueue maEventQueue
Definition:
AccessibleTextEventQueue.hxx:83
accessibility::AccessibleTextEventQueue::IsEmpty
bool IsEmpty() const
Query whether queue is empty.
Definition:
AccessibleTextEventQueue.cxx:76
accessibility::AccessibleTextEventQueue::~AccessibleTextEventQueue
~AccessibleTextEventQueue()
Definition:
AccessibleTextEventQueue.cxx:38
p
void * p
accessibility
svdmodel.hxx
SdrHintKind::EndEdit
@ EndEdit
SdrHintKind::BeginEdit
@ BeginEdit
svdpntv.hxx
unoedhlp.hxx
Generated on Sun Jul 30 2023 04:27:45 for LibreOffice Module svx (master) by
1.9.3