1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "AccessibleTextEventQueue.hxx"
22 #include <svx/unoshape.hxx>
23 #include <editeng/unolingu.hxx>
24 #include <editeng/unotext.hxx>
26 #include <editeng/unoedhlp.hxx>
27 #include <editeng/unopracc.hxx>
28 #include <svx/svdmodel.hxx>
29 #include <svx/svdpntv.hxx>
30 #include <editeng/editdata.hxx>
31 #include <editeng/editeng.hxx>
32 #include <editeng/editview.hxx>
34 namespace accessibility
38 // EventQueue implementation
41 AccessibleTextEventQueue::AccessibleTextEventQueue()
45 AccessibleTextEventQueue::~AccessibleTextEventQueue()
50 void AccessibleTextEventQueue::Append( const SdrHint
& rHint
)
52 // only enqueue the events we actually care about in
53 // AccessibleTextHelper_Impl::ProcessQueue(), because
54 // the cost of some events adds up.
55 auto eKind
= rHint
.GetKind();
56 if (eKind
== SdrHintKind::BeginEdit
57 || eKind
== SdrHintKind::EndEdit
)
58 maEventQueue
.push_back( new SdrHint( rHint
) );
61 void AccessibleTextEventQueue::Append( const TextHint
& rHint
)
63 maEventQueue
.push_back( new TextHint( rHint
) );
66 void AccessibleTextEventQueue::Append( const SvxViewChangedHint
& rHint
)
68 maEventQueue
.push_back( new SvxViewChangedHint( rHint
) );
71 void AccessibleTextEventQueue::Append( const SvxEditSourceHint
& rHint
)
73 maEventQueue
.push_back( new SvxEditSourceHint( rHint
) );
76 ::std::unique_ptr
< SfxHint
> AccessibleTextEventQueue::PopFront()
78 ::std::unique_ptr
< SfxHint
> aRes( *(maEventQueue
.begin()) );
79 maEventQueue
.pop_front();
83 bool AccessibleTextEventQueue::IsEmpty() const
85 return maEventQueue
.empty();
88 void AccessibleTextEventQueue::Clear()
91 for( auto p
: maEventQueue
)
96 } // end of namespace accessibility
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */