lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / svx / searchcharmap.hxx
blobc5ca0f81f779be2cf9efb6ed3128aa9e1ba3ce15
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 #define COLUMN_COUNT 16
36 #define ROW_COUNT 8
38 class Subset;
40 class SVX_DLLPUBLIC SvxSearchCharSet final : public SvxShowCharSet
42 public:
43 SvxSearchCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow, const VclPtr<VirtualDevice> &rDevice);
44 virtual ~SvxSearchCharSet() override;
46 virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override;
48 void SelectCharacter( const Subset* sub);
49 virtual sal_UCS4 GetSelectCharacter() const override;
51 virtual svx::SvxShowCharSetItem* ImplGetItem( int _nPos ) override;
52 virtual int LastInView() const override;
53 virtual void SelectIndex( int index, bool bFocus = false ) override;
54 void AppendCharToList(sal_UCS4 cChar);
55 void ClearPreviousData();
57 virtual sal_Int32 getMaxCharCount() const override;
59 private:
60 sal_Int32 nCount;
62 //index to char code mapping for the search
63 //to uniquely identify each appended element
64 std::unordered_map<sal_Int32, sal_UCS4> m_aItemList;
65 private:
66 virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
67 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
68 virtual bool KeyInput(const KeyEvent& rKEvt) override;
71 #endif
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */