Bump version to 6.4.7.2.M8
[LibreOffice.git] / svx / source / accessibility / AccessibleTextEventQueue.cxx
blob177950aac8ce08adbd2f4e8d41acba63c895ee3b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <memory>
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()
47 Clear();
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();
80 return aRes;
83 bool AccessibleTextEventQueue::IsEmpty() const
85 return maEventQueue.empty();
88 void AccessibleTextEventQueue::Clear()
90 // clear queue
91 for( auto p : maEventQueue)
92 delete p;
93 maEventQueue.clear();
96 } // end of namespace accessibility
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */