nss: upgrade to release 3.73
[LibreOffice.git] / sfx2 / inc / emojiview.hxx
blob52bb47bf0bc028670deb60bc18bb050160b6e408
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/.
8 */
10 #pragma once
12 #include <sfx2/thumbnailview.hxx>
14 //unicode item defines
15 #define ITEM_MAX_WIDTH 30
16 #define ITEM_MAX_HEIGHT 30
17 #define ITEM_PADDING 5
18 #define ITEM_MAX_TEXT_LENGTH 10
20 enum class FILTER_CATEGORY
22 PEOPLE,
23 NATURE,
24 FOOD,
25 ACTIVITY,
26 TRAVEL,
27 OBJECTS,
28 SYMBOLS,
29 FLAGS,
30 UNICODE9
33 // Display unicode emojis depending on the category
34 class ViewFilter_Category final
36 public:
37 ViewFilter_Category(FILTER_CATEGORY rCategory)
38 : mCategory(rCategory)
42 bool operator()(const ThumbnailViewItem* pItem);
44 static bool isFilteredCategory(FILTER_CATEGORY filter, const OUString& rCategory);
46 private:
47 FILTER_CATEGORY mCategory;
50 class EmojiView final : public ThumbnailView
52 public:
53 EmojiView(std::unique_ptr<weld::ScrolledWindow> xWindow);
55 virtual ~EmojiView() override;
57 // Fill view with emojis
58 void Populate();
60 void setInsertEmojiHdl(const Link<ThumbnailViewItem*, void>& rLink);
62 void AppendItem(const OUString& rTitle, const OUString& rCategory, const OUString& rName);
64 private:
65 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
67 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
69 virtual bool KeyInput(const KeyEvent& rKEvt) override;
71 std::string msJSONData;
73 Link<ThumbnailViewItem*, void> maInsertEmojiHdl;
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */