fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / accessibility / AccessibleTextEventQueue.hxx
blob3087b4df4508f374657234d2cc112a9c9cff2c13
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 #ifndef _SVX_TEXT_CHANGED_QUEUE_HXX
21 #define _SVX_TEXT_CHANGED_QUEUE_HXX
23 #include <memory>
24 #include <list>
25 #include <algorithm>
26 #include <tools/solar.h>
27 #include <tools/rtti.hxx>
29 class SfxHint;
30 class SdrHint;
31 class TextHint;
32 class SvxViewHint;
33 class SvxEditSourceHint;
35 namespace accessibility
37 /** This class handles the notification events for the
38 AccessibleTextHelper class.
40 For various reasons, we cannot process EditEngine events as
41 they arrive, but have to queue and handle them in a batch.
43 class AccessibleTextEventQueue
45 public:
46 typedef ::std::list< SfxHint* > EventQueue;
48 AccessibleTextEventQueue();
49 ~AccessibleTextEventQueue();
51 /// Append event to end of queue
52 void Append( const SdrHint& rHint );
53 /// Append event to end of queue
54 void Append( const TextHint& rHint );
55 /// Append event to end of queue
56 void Append( const SvxViewHint& rHint );
57 /// Append event to end of queue
58 void Append( const SvxEditSourceHint& rHint );
60 /** Pop first queue element
62 return first queue element, ownership transfers to caller
64 ::std::auto_ptr< SfxHint > PopFront();
66 /** Apply functor to every queue member
68 @param rFunctor
69 Functor to apply. Functor receives queue element as
70 parameter: void func( const SfxHint* );
72 template < typename Functor > void ForEach( Functor& rFunctor ) const
74 // #109864# Make sure results are put back into rFunctor
75 rFunctor = ::std::for_each( maEventQueue.begin(), maEventQueue.end(), rFunctor );
78 /// Query whether queue is empty
79 bool IsEmpty() const;
81 /// Clear event queue
82 void Clear();
84 private:
85 EventQueue maEventQueue;
88 } // end of namespace accessibility
90 #endif /* _SVX_TEXT_CHANGED_QUEUE_HXX */
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */