LibreOffice Module sfx2 (master) 1
thumbnailviewitem.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
20#pragma once
21
24#include <vcl/bitmapex.hxx>
25#include <sfx2/dllapi.h>
26#include <rtl/ref.hxx>
27
28namespace com::sun::star::accessibility { class XAccessible; }
29namespace drawinglayer::primitive2d { class Primitive2DContainer; }
30
31#define THUMBNAILVIEW_ITEM_NONEITEM 0xFFFE
32
34
35class ThumbnailView;
36class MouseEvent;
37
38namespace basegfx {
39 class B2DPolygon;
40}
41
42namespace drawinglayer {
43 namespace processor2d {
44 class BaseProcessor2D;
45 }
46 namespace primitive2d {
47 class PolygonHairlinePrimitive2D;
48 }
49}
50
52{
53 sal_uInt32 nMaxTextLength;
63};
64
66{
67public:
68
70 sal_uInt16 mnId;
74 bool mbHover;
77 OUString maTitle;
78 OUString maHelpText;
79 css::uno::Reference< css::accessibility::XAccessible > mxAcc;
80
84
85 ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId);
86
87 virtual ~ThumbnailViewItem ();
88
89 bool isVisible () const { return mbVisible; }
90
91 void show (bool bVisible);
92
93 bool isSelected () const { return mbSelected; }
94
95 void setSelection (bool state);
96
97 bool isHighlighted () const { return mbHover; }
98
99 void setHighlight (bool state);
100
101 bool isPinned () const { return mbPinned; }
102
107 virtual tools::Rectangle updateHighlight(bool bVisible, const Point& rPoint);
108
110
111 void setHelpText (const OUString &sText) { maHelpText = sText; }
112
113 virtual OUString getHelpText() const { return maHelpText; };
114 OUString const & getTitle() const { return maTitle; };
115
116 void setTitle (const OUString& rTitle);
117
118 css::uno::Reference< css::accessibility::XAccessible > const &
119 GetAccessible( bool bIsTransientChildrenDisabled );
120
121 void setDrawArea (const tools::Rectangle &area);
122
123 const tools::Rectangle& getDrawArea () const { return maDrawArea; }
124
125 void calculateItemsPosition (const tools::Long nThumbnailHeight,
126 const tools::Long nPadding, sal_uInt32 nMaxTextLength,
127 const ThumbnailItemAttributes *pAttrs);
128
129 virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
130 const ThumbnailItemAttributes *pAttrs);
131 void addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DContainer& rSeq);
132
134 createBorderLine (const basegfx::B2DPolygon &rPolygon);
135
136 virtual void MouseButtonUp(const MouseEvent&) {}
137
138protected:
139
144};
145
146/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void MouseButtonUp(const MouseEvent &)
virtual OUString getHelpText() const
bool isHighlighted() const
OUString const & getTitle() const
css::uno::Reference< css::accessibility::XAccessible > mxAcc
BitmapEx maPinnedDocumentBitmapHiglighted
ThumbnailView & mrParent
void setHelpText(const OUString &sText)
Text to be used for the tooltip.
tools::Rectangle maDrawArea
const tools::Rectangle & getDrawArea() const
Class to display thumbnails with their names below their respective icons.
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
OUString maTitle
Definition: doctempl.cxx:108
long Long
basegfx::BColor aSelectHighlightColor
basegfx::BColor aSelectHighlightTextColor
basegfx::B2DVector aFontSize
basegfx::BColor aHighlightTextColor
basegfx::BColor aHighlightColor
drawinglayer::attribute::FontAttribute aFontAttr
bool mbVisible
const int THUMBNAILVIEW_ITEM_CORNER