update emoji autocorrect entries from po-files
[LibreOffice.git] / include / sfx2 / thumbnailviewitem.hxx
blob8929b8ed115a9c8ea0a02b15d8f87663a8ccfe3f
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SFX2_THUMBNAILVIEWITEM_HXX
21 #define INCLUDED_SFX2_THUMBNAILVIEWITEM_HXX
23 #include <basegfx/vector/b2dvector.hxx>
24 #include <drawinglayer/attribute/fontattribute.hxx>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <osl/mutex.hxx>
27 #include <vcl/bitmapex.hxx>
28 #include <vcl/vclmedit.hxx>
29 #include <sfx2/dllapi.h>
31 #include <com/sun/star/accessibility/XAccessible.hpp>
33 #define THUMBNAILVIEW_ITEM_NONEITEM 0xFFFE
35 const int THUMBNAILVIEW_ITEM_CORNER = 5;
37 class CheckBox;
38 namespace vcl { class Font; }
39 namespace vcl { class Window; }
40 class ThumbnailView;
42 namespace basegfx {
43 class B2DPolygon;
46 namespace drawinglayer {
47 namespace processor2d {
48 class BaseProcessor2D;
51 namespace primitive2d {
52 class PolygonHairlinePrimitive2D;
56 struct ThumbnailItemAttributes
58 sal_uInt32 nMaxTextLength;
59 basegfx::BColor aFillColor;
60 basegfx::BColor aTextColor;
61 basegfx::BColor aHighlightColor;
62 basegfx::BColor aHighlightTextColor;
63 double fHighlightTransparence;
64 basegfx::B2DVector aFontSize;
65 drawinglayer::attribute::FontAttribute aFontAttr;
68 class SFX2_DLLPUBLIC ThumbnailViewItem
70 public:
72 ThumbnailView &mrParent;
73 sal_uInt16 mnId;
74 bool mbVisible;
75 bool mbSelected;
76 bool mbHover;
77 BitmapEx maPreview1;
78 OUString maTitle;
79 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >* mpxAcc;
81 ThumbnailViewItem (ThumbnailView &rView, sal_uInt16 nId);
83 virtual ~ThumbnailViewItem ();
85 bool isVisible () const { return mbVisible; }
87 void show (bool bVisible);
89 bool isSelected () const { return mbSelected; }
91 void setSelection (bool state);
93 bool isHighlighted () const { return mbHover; }
95 void setHighlight (bool state);
97 /** Updates own highlight status based on the aPoint position.
99 Returns rectangle that needs to be invalidated.
101 virtual Rectangle updateHighlight(bool bVisible, const Point& rPoint);
103 /// Text to be used for the tooltip.
104 virtual OUString getHelpText() const;
106 virtual void setEditTitle (bool edit, bool bChangeFocus = true);
107 void updateTitleEditSize ();
108 void setTitle (const OUString& rTitle);
110 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
111 GetAccessible( bool bIsTransientChildrenDisabled );
113 void setDrawArea (const Rectangle &area);
115 const Rectangle& getDrawArea () const { return maDrawArea; }
116 Rectangle getTextArea () const;
118 virtual void calculateItemsPosition (const long nThumbnailHeight, const long nDisplayHeight,
119 const long nPadding, sal_uInt32 nMaxTextLength,
120 const ThumbnailItemAttributes *pAttrs);
122 const Point& getTextPos () const { return maTextPos; }
124 const Point& getPrev1Pos () const { return maPrev1Pos; }
126 void setSelectClickHdl (const Link<> &link);
128 virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
129 const ThumbnailItemAttributes *pAttrs);
130 void addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DSequence& rSeq);
132 static drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
133 createBorderLine (const basegfx::B2DPolygon &rPolygon);
135 virtual void MouseButtonUp(const MouseEvent&) {}
137 protected:
139 Point maTextPos;
140 Point maPrev1Pos;
141 Rectangle maDrawArea;
142 Link<> maClickHdl;
143 bool mbEditTitle;
144 VclPtr<VclMultiLineEdit> mpTitleED;
145 Rectangle maTextEditMaxArea;
148 #endif // INCLUDED_SFX2_THUMBNAILVIEWITEM_HXX
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */