LibreOffice Module vcl (master) 1
fixed.cxx
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#include <vcl/cvtgrf.hxx>
21#include <vcl/decoview.hxx>
22#include <vcl/event.hxx>
23#include <vcl/toolkit/fixed.hxx>
24#include <vcl/settings.hxx>
25
26#include <comphelper/base64.hxx>
27#include <comphelper/string.hxx>
28#include <sal/log.hxx>
29#include <tools/json_writer.hxx>
30#include <tools/stream.hxx>
31
32#define FIXEDLINE_TEXT_BORDER 4
33
48
49static Point ImplCalcPos( WinBits nStyle, const Point& rPos,
50 const Size& rObjSize, const Size& rWinSize )
51{
52 tools::Long nX;
53 tools::Long nY;
54
55 if ( nStyle & WB_LEFT )
56 nX = 0;
57 else if ( nStyle & WB_RIGHT )
58 nX = rWinSize.Width()-rObjSize.Width();
59 else
60 nX = (rWinSize.Width()-rObjSize.Width())/2;
61
62 if ( nStyle & WB_TOP )
63 nY = 0;
64 else if ( nStyle & WB_BOTTOM )
65 nY = rWinSize.Height()-rObjSize.Height();
66 else
67 nY = (rWinSize.Height()-rObjSize.Height())/2;
68
69 Point aPos( nX+rPos.X(), nY+rPos.Y() );
70 return aPos;
71}
73void FixedText::ImplInit( vcl::Window* pParent, WinBits nStyle )
74{
75 nStyle = ImplInitStyle( nStyle );
76 Control::ImplInit( pParent, nStyle, nullptr );
78}
79
81{
82 if ( !(nStyle & WB_NOGROUP) )
83 nStyle |= WB_GROUP;
84 return nStyle;
85}
86
88{
89 return _rStyle.GetLabelFont();
90}
91
93{
94 return _rStyle.GetLabelTextColor();
95}
96
99 , m_nMaxWidthChars(-1)
100 , m_nMinWidthChars(-1)
101 , m_pMnemonicWindow(nullptr)
102{
103 ImplInit( pParent, nStyle );
104}
105
107{
109
110 if( ! (nWinStyle & WB_NOMULTILINE) )
111 nTextStyle |= DrawTextFlags::MultiLine;
112
113 if ( nWinStyle & WB_RIGHT )
114 nTextStyle |= DrawTextFlags::Right;
115 else if ( nWinStyle & WB_CENTER )
116 nTextStyle |= DrawTextFlags::Center;
117 else
118 nTextStyle |= DrawTextFlags::Left;
119 if ( nWinStyle & WB_BOTTOM )
120 nTextStyle |= DrawTextFlags::Bottom;
121 else if ( nWinStyle & WB_VCENTER )
122 nTextStyle |= DrawTextFlags::VCenter;
123 else
124 nTextStyle |= DrawTextFlags::Top;
125 if ( nWinStyle & WB_WORDBREAK )
126 nTextStyle |= DrawTextFlags::WordBreak;
127 if ( nWinStyle & WB_NOLABEL )
128 nTextStyle &= ~DrawTextFlags::Mnemonic;
129
130 return nTextStyle;
131}
132
133void FixedText::ImplDraw(OutputDevice* pDev, SystemTextColorFlags nSystemTextColorFlags,
134 const Point& rPos, const Size& rSize,
135 bool bFillLayout) const
136{
137 const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings();
138 WinBits nWinStyle = GetStyle();
139 OUString aText(GetText());
140 DrawTextFlags nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
141 Point aPos = rPos;
142
143 if ( nWinStyle & WB_EXTRAOFFSET )
144 aPos.AdjustX(2 );
145
146 if ( nWinStyle & WB_PATHELLIPSIS )
147 {
149 nTextStyle |= DrawTextFlags::PathEllipsis;
150 }
151 if ( !IsEnabled() )
152 nTextStyle |= DrawTextFlags::Disable;
153 if ( (nSystemTextColorFlags & SystemTextColorFlags::Mono) ||
154 (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono) )
155 nTextStyle |= DrawTextFlags::Mono;
156
157 if( bFillLayout )
158 mxLayoutData->m_aDisplayText.clear();
159
160 const tools::Rectangle aRect(aPos, rSize);
161 DrawControlText(*pDev, aRect, aText, nTextStyle,
162 bFillLayout ? &mxLayoutData->m_aUnicodeBoundRects : nullptr,
163 bFillLayout ? &mxLayoutData->m_aDisplayText : nullptr);
164}
165
167{
168 Control::ApplySettings(rRenderContext);
169
170 vcl::Window* pParent = GetParent();
171 bool bEnableTransparent = true;
173 {
176 SetPaintTransparent(false);
177
179 rRenderContext.SetBackground(GetControlBackground());
180 else
181 rRenderContext.SetBackground(pParent->GetBackground());
182
183 if (rRenderContext.IsBackground())
184 bEnableTransparent = false;
185 }
186
187 if (bEnableTransparent)
188 {
192 rRenderContext.SetBackground();
193 }
194}
195
197{
199}
200
201void FixedText::Draw( OutputDevice* pDev, const Point& rPos,
202 SystemTextColorFlags nFlags )
203{
204 ApplySettings(*pDev);
205
206 Point aPos = pDev->LogicToPixel( rPos );
207 Size aSize = GetSizePixel();
208 vcl::Font aFont = GetDrawPixelFont( pDev );
209
210 pDev->Push();
211 pDev->SetMapMode();
212 pDev->SetFont( aFont );
213 if ( nFlags & SystemTextColorFlags::Mono )
214 pDev->SetTextColor( COL_BLACK );
215 else
216 pDev->SetTextColor( GetTextColor() );
217 pDev->SetTextFillColor();
218
219 bool bBorder = (GetStyle() & WB_BORDER);
220 bool bBackground = IsControlBackground();
221 if ( bBorder || bBackground )
222 {
223 tools::Rectangle aRect( aPos, aSize );
224 if ( bBorder )
225 {
226 ImplDrawFrame( pDev, aRect );
227 }
228 if ( bBackground )
229 {
231 pDev->DrawRect( aRect );
232 }
233 }
234
235 ImplDraw( pDev, nFlags, aPos, aSize );
236 pDev->Pop();
237}
238
240{
242 Invalidate();
243}
244
246{
248
252 {
253 if ( IsReallyVisible() && IsUpdateMode() )
254 Invalidate();
255 }
256 else if ( nType == StateChangedType::Style )
257 {
261 {
263 Invalidate();
264 }
265 }
266 else if ( (nType == StateChangedType::Zoom) ||
268 {
270 Invalidate();
271 }
273 {
275 Invalidate();
276 }
278 {
280 Invalidate();
281 }
282}
283
285{
286 Control::DataChanged( rDCEvt );
287
288 if ( (rDCEvt.GetType() == DataChangedEventType::FONTS) ||
291 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
292 {
294 Invalidate();
295 }
296}
297
298Size FixedText::getTextDimensions(Control const *pControl, const OUString &rTxt, tools::Long nMaxWidth)
299{
300 DrawTextFlags nStyle = ImplGetTextStyle( pControl->GetStyle() );
301 if ( !( pControl->GetStyle() & WB_NOLABEL ) )
302 nStyle |= DrawTextFlags::Mnemonic;
303
304 return pControl->GetTextRect(tools::Rectangle( Point(), Size(nMaxWidth, 0x7fffffff)),
305 rTxt, nStyle).GetSize();
306}
307
309{
310 Size aSize = getTextDimensions(pControl, pControl->GetText(), nMaxWidth);
311
312 if ( pControl->GetStyle() & WB_EXTRAOFFSET )
313 aSize.AdjustWidth(2 );
314
315 // GetTextRect cannot take an empty string
316 if ( aSize.Width() < 0 )
317 aSize.setWidth( 0 );
318 if ( aSize.Height() <= 0 )
319 aSize.setHeight( pControl->GetTextHeight() );
320
321 return aSize;
322}
323
325{
326 return CalcWindowSize( CalcMinimumTextSize ( this, nMaxWidth ) );
327}
328
330{
331 sal_Int32 nMaxAvailWidth = 0x7fffffff;
332 if (m_nMaxWidthChars != -1)
333 {
334 OUStringBuffer aBuf(m_nMaxWidthChars);
336 nMaxAvailWidth = getTextDimensions(this,
337 aBuf.makeStringAndClear(), 0x7fffffff).Width();
338 }
339 Size aRet = CalcMinimumSize(nMaxAvailWidth);
340 if (m_nMinWidthChars != -1)
341 {
342 OUStringBuffer aBuf(m_nMinWidthChars);
344 Size aMinAllowed = getTextDimensions(this,
345 aBuf.makeStringAndClear(), 0x7fffffff);
346 aRet.setWidth(std::max(aMinAllowed.Width(), aRet.Width()));
347 }
348 return aRet;
349}
350
352{
353 mxLayoutData.emplace();
355 //const_cast<FixedText*>(this)->Invalidate();
356}
357
358void FixedText::setMaxWidthChars(sal_Int32 nWidth)
359{
360 if (nWidth != m_nMaxWidthChars)
361 {
362 m_nMaxWidthChars = nWidth;
363 queue_resize();
364 }
365}
366
367void FixedText::setMinWidthChars(sal_Int32 nWidth)
368{
369 if (nWidth != m_nMinWidthChars)
370 {
371 m_nMinWidthChars = nWidth;
372 queue_resize();
373 }
374}
375
376bool FixedText::set_property(const OString &rKey, const OUString &rValue)
377{
378 if (rKey == "max-width-chars")
379 setMaxWidthChars(rValue.toInt32());
380 else if (rKey == "width-chars")
381 setMinWidthChars(rValue.toInt32());
382 else if (rKey == "ellipsize")
383 {
384 WinBits nBits = GetStyle();
385 nBits &= ~WB_PATHELLIPSIS;
386 if (rValue != "none")
387 {
388 SAL_WARN_IF(rValue != "end", "vcl.layout", "Only endellipsis support for now");
389 nBits |= WB_PATHELLIPSIS;
390 }
391 SetStyle(nBits);
392 }
393 else
394 return Control::set_property(rKey, rValue);
395 return true;
396}
397
399{
401 if (pWindow)
402 return pWindow;
403 return get_mnemonic_widget();
404}
405
407{
408 if (pWindow == m_pMnemonicWindow)
409 return;
411 {
412 vcl::Window *pTempReEntryGuard = m_pMnemonicWindow;
413 m_pMnemonicWindow = nullptr;
414 pTempReEntryGuard->remove_mnemonic_label(this);
415 }
416 m_pMnemonicWindow = pWindow;
419}
420
422{
423 disposeOnce();
424}
425
427{
428 set_mnemonic_widget(nullptr);
431}
432
434 : Edit(pParent, nStyle)
435{
436 // no border
438 // read-only
439 SetReadOnly();
440 // make it transparent
443}
444
446{
447 rRenderContext.SetBackground();
448}
449
451{
453 // clear cursor
454 Invalidate();
455}
456
458{
459 Edit::DumpAsPropertyTree(rJsonWriter);
460 rJsonWriter.put("type", "fixedtext");
461 rJsonWriter.put("selectable", true);
462}
463
465{
466 nStyle = ImplInitStyle( nStyle );
467 Control::ImplInit( pParent, nStyle, nullptr );
469}
470
472{
473 if ( !(nStyle & WB_NOGROUP) )
474 nStyle |= WB_GROUP;
475 return nStyle;
476}
477
479{
480 return _rStyle.GetGroupFont();
481}
482
484{
485 return _rStyle.GetGroupTextColor();
486}
487
489{
490 // we need to measure according to the window, not according to the
491 // RenderContext we paint to
492 Size aOutSize = GetOutputSizePixel();
493
494 OUString aText = GetText();
495 WinBits nWinStyle = GetStyle();
496
497 DecorationView aDecoView(&rRenderContext);
498 if (aText.isEmpty())
499 {
500 if (nWinStyle & WB_VERT)
501 {
502 tools::Long nX = (aOutSize.Width() - 1) / 2;
503 aDecoView.DrawSeparator(Point(nX, 0), Point(nX, aOutSize.Height() - 1));
504 }
505 else
506 {
507 tools::Long nY = (aOutSize.Height() - 1) / 2;
508 aDecoView.DrawSeparator(Point(0, nY), Point(aOutSize.Width() - 1, nY), false);
509 }
510 }
511 else if (nWinStyle & WB_VERT)
512 {
513 tools::Long nWidth = rRenderContext.GetTextWidth(aText);
514 rRenderContext.Push(vcl::PushFlags::FONT);
515 vcl::Font aFont(rRenderContext.GetFont());
516 aFont.SetOrientation(900_deg10);
517 SetFont(aFont);
518 Point aStartPt(aOutSize.Width() / 2, aOutSize.Height() - 1);
519 if (nWinStyle & WB_VCENTER)
520 aStartPt.AdjustY( -((aOutSize.Height() - nWidth) / 2) );
521 Point aTextPt(aStartPt);
522 aTextPt.AdjustX( -(GetTextHeight() / 2) );
523 rRenderContext.DrawText(aTextPt, aText, 0, aText.getLength());
524 rRenderContext.Pop();
525 if (aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER)
526 aDecoView.DrawSeparator(Point(aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER),
527 Point(aStartPt.X(), aOutSize.Height() - 1));
528 if (aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0)
529 aDecoView.DrawSeparator(Point(aStartPt.X(), 0),
530 Point(aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER));
531 }
532 else
533 {
535 tools::Rectangle aRect(0, 0, aOutSize.Width(), aOutSize.Height());
536 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
537 if (nWinStyle & WB_CENTER)
538 nStyle |= DrawTextFlags::Center;
539
540 if (!IsEnabled())
541 nStyle |= DrawTextFlags::Disable;
542 if (GetStyle() & WB_NOLABEL)
543 nStyle &= ~DrawTextFlags::Mnemonic;
544 if (rStyleSettings.GetOptions() & StyleSettingsOptions::Mono)
545 nStyle |= DrawTextFlags::Mono;
546
547 aRect = DrawControlText(*GetOutDev(), aRect, aText, nStyle, nullptr, nullptr);
548
549 tools::Long nTop = aRect.Top() + ((aRect.GetHeight() - 1) / 2);
550 aDecoView.DrawSeparator(Point(aRect.Right() + FIXEDLINE_TEXT_BORDER, nTop), Point(aOutSize.Width() - 1, nTop), false);
551 if (aRect.Left() > FIXEDLINE_TEXT_BORDER)
552 aDecoView.DrawSeparator(Point(0, nTop), Point(aRect.Left() - FIXEDLINE_TEXT_BORDER, nTop), false);
553 }
554}
555
558{
559 ImplInit( pParent, nStyle );
560 SetSizePixel( Size( 2, 2 ) );
561}
562
564{
565 mxLayoutData.emplace();
566 const_cast<FixedLine*>(this)->Invalidate();
567}
568
570{
571 Control::ApplySettings(rRenderContext);
572
573 vcl::Window* pParent = GetParent();
575 {
579 rRenderContext.SetBackground();
580 }
581 else
582 {
585 SetPaintTransparent(false);
586
588 rRenderContext.SetBackground(GetControlBackground());
589 else
590 rRenderContext.SetBackground(pParent->GetBackground());
591 }
592}
593
595{
596 ImplDraw(rRenderContext);
597}
598
600{
601}
602
604{
606 Invalidate();
607}
608
610{
612
616 {
617 if ( IsReallyVisible() && IsUpdateMode() )
618 Invalidate();
619 }
620 else if ( nType == StateChangedType::Style )
621 {
625 Invalidate();
626 }
627 else if ( (nType == StateChangedType::Zoom) ||
630 {
632 Invalidate();
633 }
635 {
637 Invalidate();
638 }
640 {
642 Invalidate();
643 }
644}
645
647{
648 Control::DataChanged( rDCEvt );
649
650 if ( (rDCEvt.GetType() == DataChangedEventType::FONTS) ||
653 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
654 {
656 Invalidate();
657 }
658}
659
661{
663}
664
666{
667 Control::DumpAsPropertyTree(rJsonWriter);
668 rJsonWriter.put("type", "separator");
669 rJsonWriter.put("orientation", (GetStyle() & WB_VERT) ? "vertical" : "horizontal");
670}
671
673{
674 nStyle = ImplInitStyle( nStyle );
675 Control::ImplInit( pParent, nStyle, nullptr );
677}
678
680{
681 if ( !(nStyle & WB_NOGROUP) )
682 nStyle |= WB_GROUP;
683 return nStyle;
684}
685
688{
689 ImplInit( pParent, nStyle );
690}
691
692void FixedBitmap::ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize )
693{
694 // do we have a Bitmap?
695 if ( !maBitmap.IsEmpty() )
696 {
697 if ( GetStyle() & WB_SCALE )
698 pDev->DrawBitmapEx( rPos, rSize, maBitmap );
699 else
700 {
701 Point aPos = ImplCalcPos( GetStyle(), rPos, maBitmap.GetSizePixel(), rSize );
702 pDev->DrawBitmapEx( aPos, maBitmap );
703 }
704 }
705}
706
708{
709 vcl::Window* pParent = GetParent();
711 {
715 rRenderContext.SetBackground();
716 }
717 else
718 {
721 SetPaintTransparent(false);
722
724 rRenderContext.SetBackground(GetControlBackground());
725 else
726 rRenderContext.SetBackground(pParent->GetBackground());
727 }
728}
729
731{
732 ImplDraw(&rRenderContext, Point(), GetOutputSizePixel());
733}
734
735void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos,
737{
738 Point aPos = pDev->LogicToPixel( rPos );
739 Size aSize = GetSizePixel();
740 tools::Rectangle aRect( aPos, aSize );
741
742 pDev->Push();
743 pDev->SetMapMode();
744
745 // Border
746 if ( GetStyle() & WB_BORDER )
747 {
748 DecorationView aDecoView( pDev );
749 aRect = aDecoView.DrawFrame( aRect, DrawFrameStyle::DoubleIn );
750 }
751 pDev->IntersectClipRegion( aRect );
752 ImplDraw( pDev, aRect.TopLeft(), aRect.GetSize() );
753
754 pDev->Pop();
755}
756
758{
760 Invalidate();
761}
762
764{
766
767 if ( (nType == StateChangedType::Data) ||
769 {
770 if ( IsReallyVisible() && IsUpdateMode() )
771 Invalidate();
772 }
773 else if ( nType == StateChangedType::Style )
774 {
778 Invalidate();
779 }
781 {
783 Invalidate();
784 }
785}
786
788{
789 Control::DataChanged( rDCEvt );
790
791 if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
792 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
793 {
795 Invalidate();
796 }
797}
798
799void FixedBitmap::SetBitmap( const BitmapEx& rBitmap )
800{
801 maBitmap = rBitmap;
803 queue_resize();
804}
805
807{
808 nStyle = ImplInitStyle( nStyle );
809 Control::ImplInit( pParent, nStyle, nullptr );
811}
812
814{
815 if ( !(nStyle & WB_NOGROUP) )
816 nStyle |= WB_GROUP;
817 return nStyle;
818}
819
822{
823 ImplInit( pParent, nStyle );
824}
825
827 const Point& rPos, const Size& rSize )
828{
830 if ( !IsEnabled() )
831 nStyle |= DrawImageFlags::Disable;
832
833 Image *pImage = &maImage;
834
835 // do we have an image?
836 if ( !(!(*pImage)) )
837 {
838 if ( GetStyle() & WB_SCALE )
839 pDev->DrawImage( rPos, rSize, *pImage, nStyle );
840 else
841 {
842 Point aPos = ImplCalcPos( GetStyle(), rPos, pImage->GetSizePixel(), rSize );
843 pDev->DrawImage( aPos, *pImage, nStyle );
844 }
845 }
846}
847
849{
850 vcl::Window* pParent = GetParent();
851 if (pParent && pParent->IsChildTransparentModeEnabled() && !IsControlBackground())
852 {
856 rRenderContext.SetBackground();
857 }
858 else
859 {
862 SetPaintTransparent(false);
863
865 rRenderContext.SetBackground(GetControlBackground());
866 else if (pParent)
867 rRenderContext.SetBackground(pParent->GetBackground());
868 }
869}
870
871
873{
874 ImplDraw(&rRenderContext, Point(), GetOutputSizePixel());
875}
876
878{
879 return maImage.GetSizePixel();
880}
881
882void FixedImage::Draw( OutputDevice* pDev, const Point& rPos,
884{
885 Point aPos = pDev->LogicToPixel( rPos );
886 Size aSize = GetSizePixel();
887 tools::Rectangle aRect( aPos, aSize );
888
889 pDev->Push();
890 pDev->SetMapMode();
891
892 // Border
893 if ( GetStyle() & WB_BORDER )
894 {
895 ImplDrawFrame( pDev, aRect );
896 }
897 pDev->IntersectClipRegion( aRect );
898 ImplDraw( pDev, aRect.TopLeft(), aRect.GetSize() );
899
900 pDev->Pop();
901}
902
904{
906 Invalidate();
907}
908
910{
912
916 {
917 if ( IsReallyVisible() && IsUpdateMode() )
918 Invalidate();
919 }
920 else if ( nType == StateChangedType::Style )
921 {
925 Invalidate();
926 }
928 {
930 Invalidate();
931 }
932}
933
935{
936 Control::DataChanged( rDCEvt );
937
938 if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
939 (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
940 {
942 Invalidate();
943 }
944}
945
946void FixedImage::SetImage( const Image& rImage )
947{
948 if ( rImage != maImage )
949 {
950 maImage = rImage;
952 queue_resize();
953 }
954}
955
956Image FixedImage::loadThemeImage(const OUString &rFileName)
957{
958 return Image(StockImage::Yes, rFileName);
959}
960
961bool FixedImage::set_property(const OString &rKey, const OUString &rValue)
962{
963 if (rKey == "icon-size")
964 {
965 WinBits nBits = GetStyle();
966 nBits &= ~WB_SMALLSTYLE;
967 if (rValue == "2")
968 nBits |= WB_SMALLSTYLE;
969 SetStyle(nBits);
970 }
971 else
972 return Control::set_property(rKey, rValue);
973 return true;
974}
975
977{
978 Control::DumpAsPropertyTree(rJsonWriter);
979 rJsonWriter.put("id", get_id());
980 rJsonWriter.put("type", "image");
981 if (!!maImage)
982 {
983 SvMemoryStream aOStm(6535, 6535);
985 {
986 css::uno::Sequence<sal_Int8> aSeq( static_cast<sal_Int8 const *>(aOStm.GetData()), aOStm.Tell());
987 OStringBuffer aBuffer("data:image/png;base64,");
989 rJsonWriter.put("image", aBuffer);
990 }
991 }
992}
993
994
995/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawImageFlags
DrawTextFlags
SystemTextColorFlags
const StyleSettings & GetStyleSettings() const
bool IsEmpty() const
Definition: BitmapEx.cxx:177
const Size & GetSizePixel() const
Definition: bitmapex.hxx:72
Definition: ctrl.hxx:82
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: ctrl.cxx:414
std::optional< vcl::ControlLayoutData > mxLayoutData
Definition: ctrl.hxx:84
tools::Rectangle DrawControlText(OutputDevice &_rTargetDevice, const tools::Rectangle &_rRect, const OUString &_rStr, DrawTextFlags _nStyle, std::vector< tools::Rectangle > *_pVector, OUString *_pDisplayText, const Size *i_pDeviceSize=nullptr) const
draws the given text onto the given device
Definition: ctrl.cxx:429
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:257
virtual void Resize() override
Definition: ctrl.cxx:75
SAL_DLLPRIVATE void ImplDrawFrame(OutputDevice *pDev, tools::Rectangle &rRect)
draws a frame around the give rectangle, onto the given device
Definition: ctrl.cxx:332
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: ctrl.cxx:59
DataChangedEventType GetType() const
Definition: event.hxx:362
AllSettingsFlags GetFlags() const
Definition: event.hxx:363
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
Definition: decoview.cxx:804
void DrawSeparator(const Point &rStart, const Point &rStop, bool bVertical=true)
Definition: decoview.cxx:973
Definition: edit.hxx:56
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: edit.cxx:2920
virtual void LoseFocus() override
Definition: edit.cxx:1902
virtual void SetReadOnly(bool bReadOnly=true)
Definition: edit.cxx:2351
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: fixed.cxx:730
virtual void ApplySettings(vcl::RenderContext &) override
Definition: fixed.cxx:707
virtual void StateChanged(StateChangedType nType) override
Definition: fixed.cxx:763
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, const Point &rPos, const Size &rSize)
Definition: fixed.cxx:692
void SetBitmap(const BitmapEx &rBitmap)
Definition: fixed.cxx:799
FixedBitmap(vcl::Window *pParent, WinBits nStyle=0)
Definition: fixed.cxx:686
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: fixed.cxx:787
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
Definition: fixed.cxx:735
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:672
virtual void Resize() override
Definition: fixed.cxx:757
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
Definition: fixed.cxx:679
BitmapEx maBitmap
Definition: fixed.hxx:122
void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: fixed.cxx:976
virtual Size GetOptimalSize() const override
Definition: fixed.cxx:877
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: fixed.cxx:934
virtual void Resize() override
Definition: fixed.cxx:903
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:806
virtual void ApplySettings(vcl::RenderContext &) override
Definition: fixed.cxx:848
FixedImage(vcl::Window *pParent, WinBits nStyle=0)
Definition: fixed.cxx:820
virtual void StateChanged(StateChangedType nType) override
Definition: fixed.cxx:909
Image maImage
Definition: fixed.hxx:147
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
Definition: fixed.cxx:813
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, const Point &rPos, const Size &rSize)
Definition: fixed.cxx:826
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
Definition: fixed.cxx:882
static Image loadThemeImage(const OUString &rFileName)
Definition: fixed.cxx:956
void SetImage(const Image &rImage)
Definition: fixed.cxx:946
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: fixed.cxx:961
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: fixed.cxx:872
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: fixed.cxx:594
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
Definition: fixed.cxx:471
SAL_DLLPRIVATE void ImplDraw(vcl::RenderContext &rRenderContext)
Definition: fixed.cxx:488
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:464
virtual void Resize() override
Definition: fixed.cxx:603
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: fixed.cxx:665
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
Definition: fixed.cxx:599
virtual void FillLayoutData() const override
Definition: fixed.cxx:563
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: fixed.cxx:646
virtual void StateChanged(StateChangedType nType) override
Definition: fixed.cxx:609
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const override
Definition: fixed.cxx:478
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const override
Definition: fixed.cxx:483
virtual Size GetOptimalSize() const override
Definition: fixed.cxx:660
virtual void ApplySettings(vcl::RenderContext &) override
Definition: fixed.cxx:569
FixedLine(vcl::Window *pParent, WinBits nStyle=WB_HORZ)
Definition: fixed.cxx:556
static Size getTextDimensions(Control const *pControl, const OUString &rTxt, tools::Long nMaxWidth)
Definition: fixed.cxx:298
VclPtr< vcl::Window > m_pMnemonicWindow
Definition: fixed.hxx:36
virtual void StateChanged(StateChangedType nType) override
Definition: fixed.cxx:245
virtual Size GetOptimalSize() const override
Definition: fixed.cxx:329
virtual ~FixedText() override
Definition: fixed.cxx:421
virtual vcl::Window * getAccessibleRelationLabelFor() const override
Definition: fixed.cxx:398
void setMaxWidthChars(sal_Int32 nWidth)
Definition: fixed.cxx:358
virtual void Resize() override
Definition: fixed.cxx:239
static Size CalcMinimumTextSize(Control const *pControl, tools::Long nMaxWidth=0x7fffffff)
Definition: fixed.cxx:308
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const override
Definition: fixed.cxx:87
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: fixed.cxx:376
sal_Int32 m_nMinWidthChars
Definition: fixed.hxx:35
void set_mnemonic_widget(vcl::Window *pWindow)
Definition: fixed.cxx:406
FixedText(vcl::Window *pParent, WinBits nStyle=0)
Definition: fixed.cxx:97
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: fixed.cxx:166
sal_Int32 m_nMaxWidthChars
Definition: fixed.hxx:34
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: fixed.cxx:284
void setMinWidthChars(sal_Int32 nWidth)
Definition: fixed.cxx:367
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:73
virtual void FillLayoutData() const override
Definition: fixed.cxx:351
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, SystemTextColorFlags nSystemTextColorFlags, const Point &rPos, const Size &rSize, bool bFillLayout=false) const
Definition: fixed.cxx:133
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
Definition: fixed.cxx:80
vcl::Window * get_mnemonic_widget() const
Definition: fixed.hxx:76
Size CalcMinimumSize(tools::Long nMaxWidth=0x7fffffff) const
Definition: fixed.cxx:324
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: fixed.cxx:426
static SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle(WinBits nWinBits)
Definition: fixed.cxx:106
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: fixed.cxx:196
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const override
Definition: fixed.cxx:92
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
Definition: fixed.cxx:201
static ErrCode Export(SvStream &rOStm, const Graphic &rGraphic, ConvertDataFormat nFormat)
Definition: cvtgrf.cxx:51
Definition: image.hxx:40
BitmapEx GetBitmapEx() const
Definition: Image.cxx:94
Size GetSizePixel() const
Definition: Image.cxx:86
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:171
const vcl::Font & GetFont() const
Definition: outdev.hxx:530
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
Definition: bitmapex.cxx:33
void SetFont(const vcl::Font &rNewFont)
Definition: outdev/font.cxx:56
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
void SetMapMode()
Definition: map.cxx:654
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
Width of the text.
Definition: text.cxx:886
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void SetFillColor()
Definition: fill.cxx:29
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:938
void SetTextFillColor()
Definition: text.cxx:734
bool IsBackground() const
Definition: outdev.hxx:527
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:33
void SetBackground()
Definition: background.cxx:27
void Pop()
Definition: stack.cxx:92
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)
Definition: text.cxx:797
const AllSettings & GetSettings() const
Definition: outdev.hxx:289
void IntersectClipRegion(const tools::Rectangle &rRect)
virtual void ApplySettings(vcl::RenderContext &) override
Definition: fixed.cxx:445
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: fixed.cxx:457
SelectableFixedText(vcl::Window *pParent, WinBits nStyle)
Definition: fixed.cxx:433
virtual void LoseFocus() override
Definition: fixed.cxx:450
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetGroupTextColor() const
StyleSettingsOptions GetOptions() const
const Color & GetLabelTextColor() const
const vcl::Font & GetLabelFont() const
const vcl::Font & GetGroupFont() const
const void * GetData()
sal_uInt64 Tell() const
void clear()
Definition: vclptr.hxx:190
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
void put(const char *pPropName, const OUString &rPropValue)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
void SetOrientation(Degree10 nLineOrientation)
Definition: font/font.cxx:227
virtual vcl::Window * getAccessibleRelationLabelFor() const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: window3.cxx:201
const Wallpaper & GetBackground() const
Definition: window3.cxx:63
void SetStyle(WinBits nStyle)
Definition: window.cxx:1964
void SetFont(const vcl::Font &rNewFont)
Definition: window3.cxx:59
bool IsReallyVisible() const
Definition: window2.cxx:1131
vcl::Window * GetParent() const
Definition: window2.cxx:1121
WinBits GetPrevStyle() const
Definition: window2.cxx:982
const OUString & get_id() const
Get the ID of the window.
Definition: window.cxx:3934
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1286
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1351
void SetControlBackground()
Definition: window2.cxx:521
bool IsUpdateMode() const
Definition: window2.cxx:1197
bool IsChildTransparentModeEnabled() const
Definition: window2.cxx:1051
void remove_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2011
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
Definition: window2.cxx:577
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
WinBits GetStyle() const
Definition: window2.cxx:977
Size CalcWindowSize(const Size &rOutSz) const
Definition: window2.cxx:561
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
const Color & GetTextColor() const
Definition: window3.cxx:109
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: window.cxx:3363
virtual Size GetSizePixel() const
Definition: window.cxx:2404
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsControlBackground() const
Definition: window2.cxx:1111
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
virtual bool set_property(const OString &rKey, const OUString &rValue)
Definition: window2.cxx:1476
const Color & GetControlBackground() const
Definition: window2.cxx:1106
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual OUString GetText() const
Definition: window.cxx:3060
void SetBorderStyle(WindowBorderStyle nBorderStyle)
Definition: window.cxx:1996
void add_mnemonic_label(FixedText *pLabel)
Definition: window2.cxx:2002
bool IsEnabled() const
Definition: window2.cxx:1146
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
Definition: window.cxx:940
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1046
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
Definition: window.cxx:3897
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define ERRCODE_NONE
constexpr auto FIXEDLINE_VIEW_STYLE
Definition: fixed.cxx:39
constexpr auto FIXEDTEXT_VIEW_STYLE
Definition: fixed.cxx:34
constexpr auto FIXEDBITMAP_VIEW_STYLE
Definition: fixed.cxx:40
static Point ImplCalcPos(WinBits nStyle, const Point &rPos, const Size &rObjSize, const Size &rWinSize)
Definition: fixed.cxx:49
constexpr auto FIXEDIMAGE_VIEW_STYLE
Definition: fixed.cxx:44
#define FIXEDLINE_TEXT_BORDER
Definition: fixed.cxx:32
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
aBuf
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
const sal_Int16 FIXEDLINE
long Long
QPRO_FUNC_TYPE nType
signed char sal_Int8
StateChangedType
Definition: window.hxx:291
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_TOP
Definition: wintypes.hxx:149
WinBits const WB_VCENTER
Definition: wintypes.hxx:150
WinBits const WB_VERT
Definition: wintypes.hxx:145
WinBits const WB_EXTRAOFFSET
Definition: wintypes.hxx:191
WinBits const WB_CENTER
Definition: wintypes.hxx:147
WinBits const WB_SCALE
Definition: wintypes.hxx:205
WindowType
Definition: wintypes.hxx:27
WinBits const WB_NOLABEL
Definition: wintypes.hxx:157
WinBits const WB_3DLOOK
Definition: wintypes.hxx:118
WinBits const WB_GROUP
Definition: wintypes.hxx:142
WinBits const WB_RIGHT
Definition: wintypes.hxx:148
WinBits const WB_PATHELLIPSIS
Definition: wintypes.hxx:190
WinBits const WB_BORDER
Definition: wintypes.hxx:115
WinBits const WB_WORDBREAK
Definition: wintypes.hxx:156
WinBits const WB_SMALLSTYLE
Definition: wintypes.hxx:184
WinBits const WB_NOGROUP
Definition: wintypes.hxx:143
WinBits const WB_NOMULTILINE
Definition: wintypes.hxx:192
WinBits const WB_BOTTOM
Definition: wintypes.hxx:151
WinBits const WB_LEFT
Definition: wintypes.hxx:146
std::unique_ptr< char[]> aBuffer