fix build
[LibreOffice.git] / include / svx / searchcharmap.hxx
blobb07d58a4c8ad0f7f80e42f1cdaae6af508b60b32
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 .
19 #ifndef INCLUDED_SVX_SEARCHCHARMAP_HXX
20 #define INCLUDED_SVX_SEARCHCHARMAP_HXX
22 #include <memory>
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; }
35 class Subset;
37 class SVX_DLLPUBLIC SvxSearchCharSet final : public SvxShowCharSet
39 public:
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;
58 private:
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;
62 private:
63 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
64 virtual bool KeyInput(const KeyEvent& rKEvt) override;
67 #endif
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */