4#ifndef _Stroika_Frameworks_Led_HandySimple_h_
5#define _Stroika_Frameworks_Led_HandySimple_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
18#include "Stroika/Frameworks/Led/ChunkedArrayTextStore.h"
19#include "Stroika/Frameworks/Led/GDI.h"
20#include "Stroika/Frameworks/Led/WordProcessor.h"
22namespace Stroika::Frameworks::Led {
24 template <
typename WORDWRAPPEDTEXTIMAGER,
typename SIMPLETEXTIMAGER,
typename TEXTSTORE>
25 Led_Size GetTextExtent (Tablet* tablet,
const Led_tString& text,
const Led_Rect& r,
bool wordWrap);
27 template <
typename WORDWRAPPEDTEXTIMAGER,
typename SIMPLETEXTIMAGER,
typename TEXTSTORE>
28 void DrawTextBox (Tablet* tablet,
const Led_tString& text,
const Led_Rect& r,
bool wordWrap);
51 template <
typename TEXTSTORE = ChunkedArrayTextStore,
typename WORDPROCESSOR = WordProcessor>
52 class WaterMarkHelper {
54 WaterMarkHelper (
const Led_tString& watermMarkText);
58 nonvirtual Color GetWatermarkColor ()
const;
59 nonvirtual
void SetWatermarkColor (
const Color& c);
62 Color fWatermarkColor;
65 nonvirtual
void DrawWatermark (Tablet* tablet,
const Led_Rect& intoRect,
const Led_Rect& subsetToDraw);
68 struct MyTrivImager :
public TrivialImager_Interactor<TEXTSTORE, WORDPROCESSOR> {
69 using inherited = TrivialImager_Interactor<TEXTSTORE, WORDPROCESSOR>;
70 MyTrivImager (Tablet* t, Led_Rect bounds,
const Led_tString& initialText)
71 : inherited (t, bounds, initialText)
77 this->SetImageUsingOffscreenBitmaps (
false);
79 virtual void EraseBackground ([[maybe_unused]] Tablet* tablet, [[maybe_unused]]
const Led_Rect& subsetToDraw, [[maybe_unused]]
bool printing)
override
85 virtual void GetLayoutMargins (
typename WORDPROCESSOR::RowReference row, CoordinateType* lhs, CoordinateType* rhs)
const override
91 inherited::GetLayoutMargins (row, &l, &r);
92 r = max (
static_cast<CoordinateType
> (this->GetWindowRect ().GetWidth ()), l + 1);
104 Led_tString fWatermarkText;
105 MyTrivImager* fCachedImager;
106 Led_Rect fCachedIntoRect;
107 Tablet* fCachedIntoTablet;
117#include "HandySimple.inl"