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/.
10 #ifndef INCLUDED_SFX2_SOURCE_INC_EMOJIVIEW_HXX
11 #define INCLUDED_SFX2_SOURCE_INC_EMOJIVIEW_HXX
13 #include <sfx2/thumbnailview.hxx>
15 //unicode item defines
16 #define ITEM_MAX_WIDTH 30
17 #define ITEM_MAX_HEIGHT 30
18 #define ITEM_PADDING 5
19 #define ITEM_MAX_TEXT_LENGTH 10
21 enum class FILTER_CATEGORY
34 // Display unicode emojis depending on the category
35 class ViewFilter_Category final
39 ViewFilter_Category (FILTER_CATEGORY rCategory
)
40 : mCategory(rCategory
)
43 bool operator () (const ThumbnailViewItem
*pItem
);
45 static bool isFilteredCategory(FILTER_CATEGORY filter
, const OUString
&rCategory
);
49 FILTER_CATEGORY
const mCategory
;
53 class EmojiView final
: public ThumbnailView
56 EmojiView ( vcl::Window
* pParent
);
58 virtual ~EmojiView () override
;
60 // Fill view with emojis
63 void setInsertEmojiHdl (const Link
<ThumbnailViewItem
*, void> &rLink
);
65 void AppendItem(const OUString
&rTitle
, const OUString
&rCategory
, const OUString
&rName
);
68 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
70 virtual void KeyInput( const KeyEvent
& rKEvt
) override
;
72 virtual void ApplySettings(vcl::RenderContext
& rRenderContext
) override
;
74 std::string msJSONData
;
76 Link
<ThumbnailViewItem
*, void> maInsertEmojiHdl
;
79 #endif // INCLUDED_SFX2_SOURCE_INC_EMOJIVIEW_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */