1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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
33 // Display unicode emojis depending on the category
34 class ViewFilter_Category final
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
);
47 FILTER_CATEGORY mCategory
;
50 class EmojiView final
: public ThumbnailView
53 EmojiView(std::unique_ptr
<weld::ScrolledWindow
> xWindow
);
55 virtual ~EmojiView() override
;
57 // Fill view with emojis
60 void setInsertEmojiHdl(const Link
<ThumbnailViewItem
*, void>& rLink
);
62 void AppendItem(const OUString
& rTitle
, const OUString
& rCategory
, const OUString
& rName
);
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: */