Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
TextInteractorMixins.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Frameworks_Led_TextInteractorMixins_h_
5#define _Stroika_Frameworks_Led_TextInteractorMixins_h_ 1
6
7#include "Stroika/Frameworks/StroikaPreComp.h"
8
9/*
10@MODULE: TextInteractorMixins
11@DESCRIPTION:
12 <p>TextInteractorMixins are some templates that help deal with some of the drugery of C++ mixins.</p>
13
14 */
15
16#include "Stroika/Frameworks/Led/TextInteractor.h"
17
18namespace Stroika::Frameworks::Led {
19
20#if qStroika_Frameworks_Led_SupportGDI
21 DISABLE_COMPILER_MSC_WARNING_START (4250) // inherits via dominance warning
22
23 /*
24 @CLASS: InteractorImagerMixinHelper<IMAGER>
25 @BASES: virtual @'TextInteractor', IMAGER
26 @DESCRIPTION: <p>A utility class to facilitate mixing together Interactors with particular
27 chosen TextImager subclasses.</p>
28 <p>This class is mostly an implementation detail, and shouldn't be of interest to Led users, unless
29 they are creating a new TextImager subclass (which isn't also already a subclass of TextInteractor;
30 this should be rare).</p>
31 */
32 template <typename IMAGER>
33 class InteractorImagerMixinHelper : public virtual TextInteractor, public IMAGER {
34 private:
35 using inherited = void*; // prevent accidental references to this name in subclasses to base class name
36
37 protected:
38 InteractorImagerMixinHelper () = default;
39
40 /*
41 * Must combine behaviors of different mixins.
42 */
43 public:
44 virtual void Draw (const Led_Rect& subsetToDraw, bool printing) override;
45 virtual void AboutToUpdateText (const MarkerOwner::UpdateInfo& updateInfo) override;
46 virtual void DidUpdateText (const UpdateInfo& updateInfo) noexcept override;
47
48 protected:
49 virtual void HookLosingTextStore () override;
50 virtual void HookGainedNewTextStore () override;
51
52 /*
53 * Disambiguate overloads than can happen down both base class chains.
54 */
55 public:
56 using TextInteractor::ScrollByIfRoom;
57 using TextInteractor::ScrollSoShowing;
58 using TextInteractor::SetWindowRect;
59 };
60
61 /*
62 @CLASS: InteractorInteractorMixinHelper<INTERACTOR1,INTERACTOR2>
63 @BASES: INTERACTOR1, INTERACTOR2
64 @DESCRIPTION: <p>A utility class to facilitate mixing together two Interactors.</p>
65 <p>This class is mostly an implementation detail, and shouldn't be of interest to Led users, unless
66 they are creating a new direct TextImagerInteractor subclass (which should be rare).</p>
67 */
68 template <typename INTERACTOR1, typename INTERACTOR2>
69 class InteractorInteractorMixinHelper : public INTERACTOR1, public INTERACTOR2 {
70 private:
71 using inherited = void*; // prevent accidental references to this name in subclasses to base class name
72
73 protected:
74 InteractorInteractorMixinHelper ();
75
76 protected:
77 virtual void HookLosingTextStore () override;
78 virtual void HookGainedNewTextStore () override;
79
80 public:
81 using INTERACTOR1::SetWindowRect; // Should both be the same - but arbitrarily pick one
82
83 nonvirtual void Invariant ()
84 {
85 INTERACTOR1::Invariant ();
86 INTERACTOR2::Invariant ();
87 }
88
89 public:
90 virtual void DidUpdateText (const MarkerOwner::UpdateInfo& updateInfo) noexcept override;
91 };
92 DISABLE_COMPILER_MSC_WARNING_END (4250) // inherits via dominance warning
93#endif
94
95}
96
97/*
98 ********************************************************************************
99 ***************************** Implementation Details ***************************
100 ********************************************************************************
101 */
102#include "TextInteractorMixIns.inl"
103
104#endif /*_Stroika_Frameworks_Led_TextInteractorMixins_h_*/