LibreOffice Module svx (master) 1
searchcharmap.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SVX_SEARCHCHARMAP_HXX
20#define INCLUDED_SVX_SEARCHCHARMAP_HXX
21
22#include <memory>
23
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>
30
31namespace svx { struct SvxShowCharSetItem; }
32namespace tools { class Rectangle; }
33namespace weld { class ScrolledWindow; }
34
35class Subset;
36
38{
39public:
40 SvxSearchCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow, const VclPtr<VirtualDevice> &rDevice);
41 virtual ~SvxSearchCharSet() override;
42
43 virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override;
44
45 void SelectCharacter( const Subset* sub);
46 virtual sal_UCS4 GetSelectCharacter() const override;
47
48 virtual svx::SvxShowCharSetItem* ImplGetItem( int _nPos ) override;
49 virtual int LastInView() const override;
50 virtual void SelectIndex( int index, bool bFocus = false ) override;
51 void AppendCharToList(sal_UCS4 cChar);
52 void ClearPreviousData();
53
54 virtual sal_Int32 getMaxCharCount() const override;
55
56private:
57 sal_Int32 nCount;
58
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;
62private:
63 virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
64 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
65 virtual bool KeyInput(const KeyEvent& rKEvt) override;
66};
67
68#endif
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unordered_map< sal_Int32, sal_UCS4 > m_aItemList
virtual sal_UCS4 GetSelectCharacter() const
Definition: charmap.cxx:656
virtual void RecalculateFont(vcl::RenderContext &rRenderContext)
Definition: charmap.cxx:664
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: charmap.cxx:456
virtual void SelectIndex(int index, bool bFocus=false)
Definition: charmap.cxx:705
virtual sal_Int32 getMaxCharCount() const
Definition: charmap.cxx:869
virtual void DrawChars_Impl(vcl::RenderContext &rRenderContext, int n1, int n2)
Definition: charmap.cxx:506
virtual bool KeyInput(const KeyEvent &) override
Definition: charmap.cxx:387
void SelectCharacter(sal_UCS4 cNew)
Definition: charmap.cxx:786
virtual svx::SvxShowCharSetItem * ImplGetItem(int _nPos)
Definition: charmap.cxx:848
virtual int LastInView() const
Definition: charmap.cxx:358
index
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:46
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
sal_uInt32 sal_UCS4
sal_Int32 _nPos