Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
StyledTextEmbeddedObjects.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Frameworks_Led_StyledTextEmbeddedObjects_h_
5#define _Stroika_Frameworks_Led_StyledTextEmbeddedObjects_h_ 1
6
7#include "Stroika/Frameworks/StroikaPreComp.h"
8
9#include <memory>
10
11#include "Stroika/Frameworks/Led/StyledTextImager.h"
12#include "Stroika/Frameworks/Led/TextInteractor.h"
13
14/*
15@MODULE: StyledTextEmbeddedObjects
16@DESCRIPTION:
17 <p>This module introduces a whole bunch of classes which leverage the Led @'Marker', and particularly the
18 Led 'StyledTextImager::StyleMarker' mechanism - to implement visual object embedding within the text.</p>
19 <p>The objects we embed are of type @'SimpleEmbeddedObjectStyleMarker'. But this module also contains other classes
20 to support the creation of these embedding markers, to get them properly inserted into the text. And this module
21 contains many @'SimpleEmbeddedObjectStyleMarker' subclasses, such as @'StandardDIBStyleMarker', which utilize this
22 mechanism to display a particular data type as an embedding.</p>
23 */
24
25namespace Stroika::Frameworks::Led {
26
27#if qStroika_Frameworks_Led_SupportGDI
28 using Led_PrivateEmbeddingTag = char[10];
29
30/*
31 * qOverrideDefaultSentinelValue allows you to use a different value for the sentinel than
32 * the default of zero. NB, that zero is a good default choice because it isn't a valid
33 * character code, and nearly all other (if not all other) choices are valid characters
34 * which you might be confusing with a sentinel.
35 */
36#if qOverrideDefaultSentinelValue
37 constexpr Led_tChar kEmbeddingSentinelChar = qOverrideDefaultSentinelValue;
38#else
39 constexpr Led_tChar kEmbeddingSentinelChar = '\0';
40#endif
41
42 // Its up to you in your application for each one of these you want to support to add a line such
43 // as:
44 //
45 // EmbeddedObjectCreatorRegistry::Get ().AddAssoc (CL::PICT, StandardMacPictureStyleMarker::Creator);
46 //
47 // For each of the marker types you want automatically taken care of. All the default ones,
48 // are added automatlicly by default. If you don't like these, you can use SetAssocList to replace
49 // them.
50 //
51 //
52 class SimpleEmbeddedObjectStyleMarker;
53
54 /*
55 @CLASS: EmbeddedObjectCreatorRegistry
56 @DESCRIPTION:
57 <p>Class which manages the registry of mappings from clipboard and Led private file format magic tag strings,
58 to function pointers capable of reading these objects from RAM or a flavor package.</p>
59 */
60 class EmbeddedObjectCreatorRegistry {
61 public:
62 EmbeddedObjectCreatorRegistry ();
63
64 public:
65 static EmbeddedObjectCreatorRegistry& Get (); // build one if doesn't exist yet, and return ref to it
66 private:
67 public: //tmphack - til I can fix the code that references this... -- LGP 2012-09-11
68 static EmbeddedObjectCreatorRegistry* sThe;
69
70 public:
71 struct Assoc {
72 private:
73 union {
74 Led_ClipFormat fFormatTag; // use if fFormatTagCount==1
75 const Led_ClipFormat* fFormatTags; // use if fFormatTagCount>1
76 };
77
78 public:
79 size_t fFormatTagCount;
80 Led_PrivateEmbeddingTag fEmbeddingTag;
81 SimpleEmbeddedObjectStyleMarker* (*fReadFromMemory) (const char* embeddingTag, const void* data, size_t len);
82 SimpleEmbeddedObjectStyleMarker* (*fReadFromFlavorPackage) (ReaderFlavorPackage& flavorPackage);
83
84 public:
85 nonvirtual Led_ClipFormat GetIthFormat (size_t i) const;
86
87 private:
88 friend class EmbeddedObjectCreatorRegistry;
89 };
90
91 public:
92 nonvirtual void AddAssoc (Assoc assoc);
93 nonvirtual void AddAssoc (const char* embeddingTag,
94 SimpleEmbeddedObjectStyleMarker* (*memReader) (const char* embeddingTag, const void* data, size_t len));
95 nonvirtual void AddAssoc (Led_ClipFormat clipFormat, const char* embeddingTag,
96 SimpleEmbeddedObjectStyleMarker* (*memReader) (const char* embeddingTag, const void* data, size_t len),
97 SimpleEmbeddedObjectStyleMarker* (*packageReader) (ReaderFlavorPackage& flavorPackage));
98 nonvirtual void AddAssoc (const Led_ClipFormat* clipFormats, size_t clipFormatCount, const char* embeddingTag,
99 SimpleEmbeddedObjectStyleMarker* (*memReader) (const char* embeddingTag, const void* data, size_t len),
100 SimpleEmbeddedObjectStyleMarker* (*packageReader) (ReaderFlavorPackage& flavorPackage));
101 nonvirtual const vector<Assoc>& GetAssocList () const;
102 nonvirtual void SetAssocList (const vector<Assoc>& assocList);
103 nonvirtual void AddStandardTypes ();
104 nonvirtual bool Lookup (const char* embeddingTag, Assoc* result) const;
105
106 private:
107 vector<Assoc> fAssocList;
108
109 friend struct FooBarBlatzRegistryCleanupHack;
110 };
111
112 const Led_Size kDefaultEmbeddingMargin = Led_Size (4, 4); // space left around embedding so you can see selected.
113 // Not needed for all embeddings, but often helpful
114
115 /*
116 @CLASS: SimpleEmbeddedObjectStyleMarker
117 @BASES: @'StyledTextImager::StyleMarker'
118 @DESCRIPTION: <p>An abstract class which contains most of the functionality for supporting Led embeddings in a Styled Text
119 document.</p>
120 <p>All the various kinds of embeddings Led supports are subclasses of this class.</p>
121 <p>See @'InsertEmbeddingForExistingSentinel' and @'AddEmbedding' for more details on how to add these markers to the
122 text. These utilities are not <em>needed</em> - but can simplify the process of adding embeddings.</p>
123 <p>Also, to understand more about how these work, see @'StyledTextImager::StyleMarker' for more details.</p>
124 <p>(NEED LOTS MORE DETAILS - THIS IS IMPORTANT)</p>
125 */
126 class SimpleEmbeddedObjectStyleMarker : public StyleMarker {
127 private:
128 using inherited = StyleMarker;
129
130 protected:
131 SimpleEmbeddedObjectStyleMarker () = default;
132
133 public:
134 enum {
135 eEmbeddedObjectPriority = eBaselinePriority + 100
136 };
137 virtual int GetPriority () const override;
138
139 // Subclasses simply must override DrawSegment and MeasureSegmentWidth/MeasureSegmentHeight
140 // the rest we can default properly here
141 public:
142 virtual DistanceType MeasureSegmentBaseLine (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
143
144 public:
145 virtual void DidUpdateText (const MarkerOwner::UpdateInfo& updateInfo) noexcept override;
146
147 // Native clip format writing support
148 public:
149 class SinkStream {
150 public:
151 virtual void write (const void* buffer, size_t bytes) = 0;
152 };
153 virtual const char* GetTag () const = 0;
154 virtual void Write (SinkStream& sink) = 0;
155 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) = 0;
156
157 // Click in embedding processing
158 // HandleClick () by default, does nothing on single click, and on double click calls Open method - which in turn by
159 // default does nothing. HandleClick returns false if it EATS the click. If it returns true if the click
160 // should be handled as it normally would
161 public:
162 virtual bool HandleClick (Led_Point clickedAt, unsigned clickCount);
163 virtual bool HandleOpen ();
164
165 public:
166 enum PrivateCmdNumber {
167 eMinPrivateCmdNum = 1,
168 eOpenCmdNum = eMinPrivateCmdNum,
169 eMaxPrivateCmdNum = 100
170 };
171 virtual vector<PrivateCmdNumber> GetCmdNumbers () const;
172 virtual bool IsCmdEnabled (PrivateCmdNumber cmd) const;
173 virtual SDKString GetCmdText (PrivateCmdNumber cmd);
174 virtual void DoCommand (PrivateCmdNumber cmd);
175
176 public:
177 struct CommandNames;
178
179 // This class builds commands with command names. The UI may wish to change these
180 // names (eg. to customize for particular languages, etc)
181 // Just patch these strings here, and commands will be created with these names.
182 // (These names appear in text of undo menu item)
183 public:
184 static const CommandNames& GetCommandNames ();
185 static void SetCommandNames (const CommandNames& cmdNames);
186 static CommandNames MakeDefaultCommandNames ();
187
188 private:
189 static CommandNames sCommandNames;
190 };
191
192 /*
193 @CLASS: SimpleEmbeddedObjectStyleMarker::CommandNames
194 @DESCRIPTION: <p>Command names for each of the user-visible commands produced by the
195 @'SimpleEmbeddedObjectStyleMarker' module.</p>
196 */
197 struct SimpleEmbeddedObjectStyleMarker::CommandNames {
198 SDKString fOpenCommandName;
199 };
200
201#if qStroika_Foundation_Common_Platform_Windows
202 /*
203 @CLASS: StandardMacPictureStyleMarker
204 @BASES: @'SimpleEmbeddedObjectStyleMarker'
205 @DESCRIPTION: <p>A Macintosh format picture embedding.</p>
206 */
207 class StandardMacPictureStyleMarker : public SimpleEmbeddedObjectStyleMarker {
208 private:
209 using inherited = SimpleEmbeddedObjectStyleMarker;
210
211 public:
212#if qStroika_Foundation_Common_Platform_Windows
213 using PictureHandle = HANDLE;
214#endif
215
216 public:
217 static const Led_ClipFormat kClipFormat;
218 static const Led_PrivateEmbeddingTag kEmbeddingTag;
219
220 public:
221 StandardMacPictureStyleMarker (const Led_Picture* pictData, size_t picSize);
222 ~StandardMacPictureStyleMarker ();
223
224 public:
225 static SimpleEmbeddedObjectStyleMarker* mk (const char* embeddingTag, const void* data, size_t len);
226 static SimpleEmbeddedObjectStyleMarker* mk (ReaderFlavorPackage& flavorPackage);
227
228#if qStroika_Foundation_Common_Platform_Windows
229 static const Led_DIB* sUnsupportedFormatPict; // Must be set externally by user of this class before we ever build one of these
230 // objects, or an assert error.
231 // Reason for this design is we need access to some pict resource, but we don't want
232 // Led to depend on any such things (would make build/distr/name conflicts etc
233 // more complex). So in main, if you ever plan to use these, then load resource and assign
234 // to this member.
235#endif
236 public:
237 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
238 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
239 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
240 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
241 const Led_tChar* text, DistanceType* distanceResults) const override;
242 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
243
244 public:
245 virtual const char* GetTag () const override;
246 virtual void Write (SinkStream& sink) override;
247 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
248
249 public:
250 nonvirtual PictureHandle GetPictureHandle () const;
251 nonvirtual size_t GetPictureByteSize () const;
252
253 private:
254 PictureHandle fPictureHandle;
255#if qStroika_Foundation_Common_Platform_Windows
256 size_t fPictureSize;
257#endif
258 };
259#endif
260
261 /*
262 @CLASS: StandardDIBStyleMarker
263 @BASES: @'SimpleEmbeddedObjectStyleMarker'
264 @DESCRIPTION: <p>A Windows DIB (Device Independent Bitmap) picture embedding. Note that this can still be
265 portably displayed on both Mac and Windows.</p>
266 */
267 class StandardDIBStyleMarker : public SimpleEmbeddedObjectStyleMarker {
268 private:
269 using inherited = SimpleEmbeddedObjectStyleMarker;
270
271 public:
272 static const Led_ClipFormat kClipFormat;
273 static const Led_PrivateEmbeddingTag kEmbeddingTag;
274
275 public:
276 StandardDIBStyleMarker (const Led_DIB* dibData);
277 ~StandardDIBStyleMarker ();
278
279 public:
280 static SimpleEmbeddedObjectStyleMarker* mk (const char* embeddingTag, const void* data, size_t len);
281 static SimpleEmbeddedObjectStyleMarker* mk (ReaderFlavorPackage& flavorPackage);
282
283 public:
284 public:
285 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
286 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
287 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
288 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
289 const Led_tChar* text, DistanceType* distanceResults) const override;
290 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
291
292 public:
293 virtual const char* GetTag () const override;
294 virtual void Write (SinkStream& sink) override;
295 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
296
297 public:
298 nonvirtual const Led_DIB* GetDIBData () const;
299
300 private:
301 Led_DIB* fDIBData;
302 };
303
304 /*
305 @CLASS: StandardURLStyleMarker
306 @BASES: @'SimpleEmbeddedObjectStyleMarker'
307 @DESCRIPTION: <p>A URL object. Double click on this to open the URL.</p>
308 */
309 class StandardURLStyleMarker : public SimpleEmbeddedObjectStyleMarker {
310 private:
311 using inherited = SimpleEmbeddedObjectStyleMarker;
312
313 public:
314 static const Led_ClipFormat kURLDClipFormat;
315#if qStroika_Foundation_Common_Platform_Windows
316 static const Led_ClipFormat kWin32URLClipFormat;
317#endif
318 static const Led_PrivateEmbeddingTag kEmbeddingTag;
319
320 StandardURLStyleMarker (const Led_URLD& urlData);
321 ~StandardURLStyleMarker ();
322
323 public:
324 static SimpleEmbeddedObjectStyleMarker* mk (const char* embeddingTag, const void* data, size_t len);
325 static SimpleEmbeddedObjectStyleMarker* mk (ReaderFlavorPackage& flavorPackage);
326
327 public:
328 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
329 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
330 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
331 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
332 const Led_tChar* text, DistanceType* distanceResults) const override;
333 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
334
335 public:
336 virtual const char* GetTag () const override;
337 virtual void Write (SinkStream& sink) override;
338 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
339
340 public:
341 virtual bool HandleOpen () override;
342
343 public:
344 virtual vector<PrivateCmdNumber> GetCmdNumbers () const override;
345 virtual bool IsCmdEnabled (PrivateCmdNumber cmd) const override;
346
347 public:
348 nonvirtual const Led_URLD& GetURLData () const;
349 nonvirtual void SetURLData (const Led_URLD& urlData);
350
351 private:
352 Led_URLD fURLData;
353
354 protected:
355 nonvirtual Led_tString GetDisplayString () const;
356 nonvirtual FontSpecification GetDisplayFont (const StyleRunElement& runElement) const;
357 };
358
359#if qStroika_Foundation_Common_Platform_Windows
360 class StandardMacPictureWithURLStyleMarker : public SimpleEmbeddedObjectStyleMarker {
361 private:
362 using inherited = SimpleEmbeddedObjectStyleMarker;
363
364 public:
365 static const Led_ClipFormat kClipFormats[];
366 static const size_t kClipFormatCount;
367 static const Led_PrivateEmbeddingTag kEmbeddingTag;
368 static const Led_PrivateEmbeddingTag kOld1EmbeddingTag;
369
370 public:
371 StandardMacPictureWithURLStyleMarker (const Led_Picture* pictData, size_t picSize, const Led_URLD& urlData);
372 ~StandardMacPictureWithURLStyleMarker ();
373
374 public:
375 static SimpleEmbeddedObjectStyleMarker* mk (const char* embeddingTag, const void* data, size_t len);
376 static SimpleEmbeddedObjectStyleMarker* mk (ReaderFlavorPackage& flavorPackage);
377
378 public:
379 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
380 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
381 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
382 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
383 const Led_tChar* text, DistanceType* distanceResults) const override;
384 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
385
386 public:
387 virtual const char* GetTag () const override;
388 virtual void Write (SinkStream& sink) override;
389 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
390
391 public:
392 virtual bool HandleOpen () override;
393
394 public:
395 virtual vector<PrivateCmdNumber> GetCmdNumbers () const override;
396 virtual bool IsCmdEnabled (PrivateCmdNumber cmd) const override;
397
398 private:
399 Led_URLD fURLData;
400
401 public:
402 nonvirtual StandardMacPictureStyleMarker::PictureHandle GetPictureHandle () const;
403 nonvirtual size_t GetPictureByteSize () const;
404 nonvirtual const Led_URLD& GetURLData () const;
405 nonvirtual void SetURLData (const Led_URLD& urlData);
406
407 private:
408 StandardMacPictureStyleMarker::PictureHandle fPictureHandle;
409#if qStroika_Foundation_Common_Platform_Windows
410 size_t fPictureSize;
411#endif
412 };
413
414 class StandardDIBWithURLStyleMarker : public SimpleEmbeddedObjectStyleMarker {
415 private:
416 using inherited = SimpleEmbeddedObjectStyleMarker;
417
418 public:
419 static const Led_ClipFormat kClipFormats[];
420 static const size_t kClipFormatCount;
421 static const Led_PrivateEmbeddingTag kEmbeddingTag;
422
423 public:
424 StandardDIBWithURLStyleMarker (const Led_DIB* dibData, const Led_URLD& urlData);
425 ~StandardDIBWithURLStyleMarker ();
426
427 public:
428 static SimpleEmbeddedObjectStyleMarker* mk (const char* embeddingTag, const void* data, size_t len);
429 static SimpleEmbeddedObjectStyleMarker* mk (ReaderFlavorPackage& flavorPackage);
430
431 public:
432 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
433 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
434 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
435 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
436 const Led_tChar* text, DistanceType* distanceResults) const override;
437 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
438
439 public:
440 virtual const char* GetTag () const override;
441 virtual void Write (SinkStream& sink) override;
442 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
443
444 public:
445 virtual bool HandleOpen () override;
446
447 public:
448 virtual vector<PrivateCmdNumber> GetCmdNumbers () const override;
449 virtual bool IsCmdEnabled (PrivateCmdNumber cmd) const override;
450
451 public:
452 nonvirtual const Led_DIB* GetDIBData () const;
453
454 private:
455 Led_DIB* fDIBData;
456
457 public:
458 nonvirtual const Led_URLD& GetURLData () const;
459 nonvirtual void SetURLData (const Led_URLD& urlData);
460
461 private:
462 Led_URLD fURLData;
463 };
464
465 /*
466 @CLASS: StandardUnknownTypeStyleMarker
467 @BASES: @'SimpleEmbeddedObjectStyleMarker'
468 @DESCRIPTION: <p>Use to represent visually embeddings which we've read from a file, and want to keep track of, but
469 don't know how to display.</p>
470 */
471 class StandardUnknownTypeStyleMarker : public SimpleEmbeddedObjectStyleMarker {
472 private:
473 using inherited = SimpleEmbeddedObjectStyleMarker;
474
475 public:
476 static const Led_PrivateEmbeddingTag kDefaultEmbeddingTag;
477
478 public:
479 StandardUnknownTypeStyleMarker (Led_ClipFormat format, const char* embeddingTag, const void* unknownTypeData, size_t nBytes,
480 const Led_DIB* dib = nullptr);
481 ~StandardUnknownTypeStyleMarker ();
482
483 public:
484#if qStroika_Foundation_Common_Platform_Windows
485 static const Led_DIB* sUnknownPict;
486#endif
487
488 public:
489 virtual void DrawSegment (const StyledTextImager* imager, const StyleRunElement& runElement, Tablet* tablet, size_t from, size_t to,
490 const TextLayoutBlock& text, const Led_Rect& drawInto, const Led_Rect& /*invalidRect*/,
491 CoordinateType useBaseLine, DistanceType* pixelsDrawn) override;
492 virtual void MeasureSegmentWidth (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to,
493 const Led_tChar* text, DistanceType* distanceResults) const override;
494 virtual DistanceType MeasureSegmentHeight (const StyledTextImager* imager, const StyleRunElement& runElement, size_t from, size_t to) const override;
495
496 public:
497 virtual const char* GetTag () const override;
498 virtual void Write (SinkStream& sink) override;
499 virtual void ExternalizeFlavors (WriterFlavorPackage& flavorPackage) override;
500
501 public:
502 nonvirtual TWIPS_Point GetShownSize () const;
503 nonvirtual void SetShownSize (TWIPS_Point size);
504 nonvirtual TWIPS_Point CalcDefaultShownSize ();
505 static TWIPS_Point CalcStaticDefaultShownSize ();
506
507 private:
508 TWIPS_Point fShownSize;
509
510 public:
511 nonvirtual const void* GetData () const;
512 nonvirtual size_t GetDataLength () const;
513
514 private:
515 void* fData;
516 size_t fLength;
517 Led_ClipFormat fFormat;
518 Led_PrivateEmbeddingTag fEmbeddingTag;
519 unique_ptr<Led_DIB> fDisplayDIB;
520 };
521
522#if qStroika_Frameworks_Led_SupportGDI
523
524 /*
525 @METHOD: InsertEmbeddingForExistingSentinel
526 @DESCRIPTION: <p>Utility method to insert the given embedding (@'SimpleEmbeddedObjectStyleMarker') into the given
527 @'TextStore', at a given position in the text. To use this routine, the sentinel character must already
528 be present. Use @'AddEmbedding' if the sentinel has not yet been added.</p>
529 */
530 void InsertEmbeddingForExistingSentinel (SimpleEmbeddedObjectStyleMarker* embedding, TextStore& textStore, size_t insertAt,
531 MarkerOwner* ownerForEmbedding);
532
533 /*
534 @METHOD: AddEmbedding
535 @DESCRIPTION: <p>Utility method to insert the given embedding (@'SimpleEmbeddedObjectStyleMarker') into the given
536 @'TextStore', at a given position in the text. This routine, adds a sentinel character at that position. If
537 the sentinel character is already there, use @'InsertEmbeddingForExistingSentinel'.</p>
538 <p>Actually, this function isn't strictly needed. But there is alot of mumbo-jumbo that needs to be
539 done when adding embeddings (e.g. DoAboutToUpdateCalls etc), and this packages up all those things and
540 avoids you from having todo them in a bunch of places.</p>
541 */
542 void AddEmbedding (SimpleEmbeddedObjectStyleMarker* embedding, TextStore& textStore, size_t insertAt, MarkerOwner* ownerForEmbedding);
543#endif
544#endif
545#endif
546
547}
548
549/*
550 ********************************************************************************
551 ***************************** Implementation Details ***************************
552 ********************************************************************************
553 */
554#include "StyledTextEmbeddedObjects.inl"
555
556#endif /*_Stroika_Frameworks_Led_StyledTextEmbeddedObjects_h_*/
basic_string< SDKChar > SDKString
Definition SDKString.h:38