20 #include <config_wasm_strip.h>
28 #include <unordered_map>
34 #include <rtl/ustrbuf.hxx>
52 if (nIndex > nCompare)
109 if ( tmpSelected >= 0 )
127 while(cChar <= sub->GetRangeMax() && nMapIndex == 0)
130 [&cChar](
const std::pair<const sal_Int32, sal_UCS4>& rItem) {
return rItem.second == cChar; });
132 nMapIndex = it->first;
181 for (i = n1; i <= n2; ++i)
188 std::unordered_map<sal_Int32, sal_UCS4>::const_iterator got =
m_aItemList.find (i);
196 buf.appendUtf32(sName);
197 OUString aCharStr(buf.makeStringAndClear());
199 int tx = x + (
nX - nTextWidth + 1) / 2;
200 int ty = y + (
nY - nTextHeight + 1) / 2;
201 Point aPointTxTy(tx, ty);
209 aPointTxTy.setX( x - aBoundRect.
Left() + (
nX - aBoundRect.
GetWidth() + 1) / 2 );
212 aBoundRect += aPointTxTy;
215 int nYLDelta = aBoundRect.
Top() - y;
216 int nYHDelta = (y +
nY) - aBoundRect.
Bottom();
218 aPointTxTy.AdjustY( -(nYLDelta - 1) );
219 else if (nYHDelta <= 0)
220 aPointTxTy.AdjustY(nYHDelta - 1 );
223 int nXLDelta = aBoundRect.
Left() - x;
224 int nXHDelta = (x +
nX) - aBoundRect.
Right();
226 aPointTxTy.AdjustX( -(nXLDelta - 1) );
227 else if (nXHDelta <= 0)
228 aPointTxTy.AdjustX(nXHDelta - 1 );
235 rRenderContext.
DrawText(aPointTxTy, aCharStr);
242 Point aPointUL(x + 1, y + 1);
249 rRenderContext.
DrawText(aPointTxTy, aCharStr);
264 rRenderContext.
DrawText(aPointTxTy, aCharStr);
352 else if (nOldPos !=
mxScrollArea->vadjustment_get_value())
375 assert(pItem->
m_xItem.is() &&
"No accessible created!");
376 Any aOldAny, aNewAny;
377 aNewAny <<= AccessibleStateType::FOCUSED;
380 pItem->
m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
382 aNewAny <<= AccessibleStateType::SELECTED;
383 pItem->
m_xItem->fireEvent( AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
396 ItemsMap::iterator aFind =
m_aItems.find(_nPos);
399 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
400 OSL_ENSURE(
m_xAccessible.is(),
"Who wants to create a child of my table without a parent?");
402 auto xItem = std::make_shared<svx::SvxShowCharSetItem>(*
this,
403 m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos));
404 aFind =
m_aItems.emplace(_nPos, xItem).first;
406 std::unordered_map<sal_Int32,sal_UCS4>::const_iterator got =
m_aItemList.find (_nPos);
408 buf.appendUtf32(got->second);
409 aFind->second->maText = buf.makeStringAndClear();
414 return aFind->second.get();
const Color & GetTextColor() const
const Color & GetShadowColor() const
Link< SvxShowCharSet *, void > aHighHdl
bool GetFontCharMap(FontCharMapRef &rxFontCharMap) const
void SetFontSize(const Size &)
VclPtr< VirtualDevice > mxVirDev
void SelectCharacter(const Subset *sub)
const Color & GetHighlightTextColor() const
virtual bool KeyInput(const KeyEvent &rKEvt) override
std::unique_ptr< weld::ScrolledWindow > mxScrollArea
void AppendCharToList(sal_UCS4 cChar)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
const Color & GetFaceColor() const
void SetWeight(FontWeight)
virtual void RecalculateFont(vcl::RenderContext &rRenderContext) override
sal_uInt16 GetCode() const
constexpr sal_uInt16 KEY_SPACE
SvxSearchCharSet(std::unique_ptr< weld::ScrolledWindow > pScrolledWindow, const VclPtr< VirtualDevice > &rDevice)
FontCharMapRef mxFontCharMap
const Color & GetFieldTextColor() const
constexpr sal_uInt16 KEY_UP
const Color & GetHighlightColor() const
virtual sal_UCS4 GetSelectCharacter() const override
constexpr sal_uInt16 KEY_END
constexpr tools::Long Width() const
virtual void SelectIndex(int index, bool bFocus=false) override
virtual void DrawChars_Impl(vcl::RenderContext &rRenderContext, int n1, int n2) override
const vcl::Font & GetFont() const
constexpr sal_uInt16 KEY_PAGEUP
const Color & GetLightColor() const
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, o3tl::span< const sal_Int32 > pDXArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
sal_uInt16 GetModifier() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
virtual svx::SvxShowCharSetItem * ImplGetItem(int _nPos) override
void DrawRect(const tools::Rectangle &rRect)
constexpr sal_uInt16 KEY_DOWN
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
virtual int LastInView() const override
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
constexpr sal_uInt16 KEY_HOME
const Color & GetLineColor() const
void SetTextColor(const Color &rColor)
constexpr sal_uInt16 KEY_PAGEDOWN
std::unordered_map< sal_Int32, sal_UCS4 > m_aItemList
virtual sal_Int32 getMaxCharCount() const override
sal_UCS4 GetRangeMin() const
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_RIGHT
void SetAlignment(TextAlign)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
const vcl::KeyCode & GetKeyCode() const
tools::Rectangle getGridRectangle(const Point &rPointUL, const Size &rOutputSize) const
Link< SvxShowCharSet *, void > aSelectHdl
void InitSettings(vcl::RenderContext &rRenderContext)
constexpr tools::Long Height() const
rtl::Reference< svx::SvxShowCharSetAcc > m_xAccessible
constexpr sal_uInt16 KEY_ESCAPE
void SetFont(const vcl::Font &rNewFont)
void SetTransparent(bool bTransparent)
tools::Long GetTextHeight() const
Simple struct to hold some information about the single items of the table.
constexpr sal_uInt16 KEY_LEFT
void getFavCharacterList()
Point MapIndexToPixel(int) const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const Color & GetFillColor() const
constexpr sal_uInt16 KEY_TAB
Link< SvxShowCharSet *, void > aPreSelectHdl
virtual ~SvxSearchCharSet() override
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)