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 void UpdateScrollRange();
54
55 virtual sal_Int32 getMaxCharCount() const override;
56
57private:
58 //index to char code mapping for the search
59 //to uniquely identify each appended element
60 std::unordered_map<sal_Int32, sal_UCS4> m_aItemList;
61private:
62 virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
63 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
64 virtual bool KeyInput(const KeyEvent& rKEvt) override;
65};
66
67#endif
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unordered_map< sal_Int32, sal_UCS4 > m_aItemList
virtual sal_UCS4 GetSelectCharacter() const
Definition: charmap.cxx:667
virtual void RecalculateFont(vcl::RenderContext &rRenderContext)
Definition: charmap.cxx:675
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: charmap.cxx:454
virtual void SelectIndex(int index, bool bFocus=false)
Definition: charmap.cxx:717
virtual sal_Int32 getMaxCharCount() const
Definition: charmap.cxx:882
virtual void DrawChars_Impl(vcl::RenderContext &rRenderContext, int n1, int n2)
Definition: charmap.cxx:504
virtual bool KeyInput(const KeyEvent &) override
Definition: charmap.cxx:383
void SelectCharacter(sal_UCS4 cNew)
Definition: charmap.cxx:799
virtual svx::SvxShowCharSetItem * ImplGetItem(int _nPos)
Definition: charmap.cxx:861
virtual int LastInView() const
Definition: charmap.cxx:354
index
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:44
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
sal_uInt32 sal_UCS4
sal_Int32 _nPos