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 .
19 #ifndef INCLUDED_SVX_SEARCHCHARMAP_HXX
20 #define INCLUDED_SVX_SEARCHCHARMAP_HXX
24 #include <sal/types.h>
25 #include <svx/svxdllapi.h>
26 #include <svx/charmap.hxx>
27 #include <vcl/outdev.hxx>
28 #include <vcl/vclptr.hxx>
29 #include <unordered_map>
31 namespace svx
{ struct SvxShowCharSetItem
; }
32 namespace tools
{ class Rectangle
; }
33 namespace weld
{ class ScrolledWindow
; }
37 class SVX_DLLPUBLIC SvxSearchCharSet final
: public SvxShowCharSet
40 SvxSearchCharSet(std::unique_ptr
<weld::ScrolledWindow
> pScrolledWindow
, const VclPtr
<VirtualDevice
> &rDevice
);
41 virtual ~SvxSearchCharSet() override
;
43 virtual void RecalculateFont(vcl::RenderContext
& rRenderContext
) override
;
45 void SelectCharacter( const Subset
* sub
);
46 virtual sal_UCS4
GetSelectCharacter() const override
;
47 virtual sal_UCS4
GetCharFromIndex(int index
) const override
;
49 virtual svx::SvxShowCharSetItem
* ImplGetItem( int _nPos
) override
;
50 virtual int LastInView() const override
;
51 virtual void SelectIndex( int index
, bool bFocus
= false ) override
;
52 void AppendCharToList(sal_UCS4 cChar
);
53 void ClearPreviousData();
54 void UpdateScrollRange();
56 virtual sal_Int32
getMaxCharCount() const override
;
59 //index to char code mapping for the search
60 //to uniquely identify each appended element
61 std::unordered_map
<sal_Int32
, sal_UCS4
> m_aItemList
;
63 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
64 virtual bool KeyInput(const KeyEvent
& rKEvt
) override
;
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */