#include <rechtext.h>
Inheritance diagram for TextAttrRecordHandler:
Public Member Functions | |
TextAttrRecordHandler () | |
~TextAttrRecordHandler () | |
UINT32 * | GetTagList () |
Functions to describe text object records for debugging purposesReturns an array of records handled by this class. | |
BOOL | HandleRecord (CXaraFileRecord *pCXaraFileRecord) |
Handles reading a text attribute record from a CXaraFile. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (TextAttrRecordHandler) | |
BOOL | ReadTextStoryVanilla (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextString (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextKern (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextCaret (CXaraFileRecord *PCXaraFileRecord) |
BOOL | ReadTextLineSpaceRatio (CXaraFileRecord *pCXaraFileRecord) |
Read text attributes for the new file format. | |
BOOL | ReadTextLineSpaceAbsolute (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextJustificationLeft (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextJustificationCentre (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextJustificationRight (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextJustificationFull (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextFontSize (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextFontTypeface (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextBoldOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextBoldOff (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextItalicOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextItalicOff (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextUnderlineOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextUnderlineOff (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextScriptOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextScriptOff (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextSuperscriptOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextSubscriptOn (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextTracking (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextAspectRatio (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextBaseline (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextLeftIndent (CXaraFileRecord *pCXaraFileRecord) |
Read text attributes for the new file format. | |
BOOL | ReadTextRightIndent (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextFirstIndent (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextRuler (CXaraFileRecord *pCXaraFileRecord) |
BOOL | ReadTextInvalid (CXaraFileRecord *pCXaraFileRecord) |
Definition at line 210 of file rechtext.h.
|
Definition at line 216 of file rechtext.h.
|
|
Definition at line 217 of file rechtext.h.
|
|
|
|
|
Handles reading a text attribute record from a CXaraFile.
Implements CXaraFileRecordHandler. Definition at line 1074 of file rechtext.cpp. 01075 { 01076 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord==NULL"); 01077 01078 BOOL ok; 01079 01080 switch (pCXaraFileRecord->GetTag()) 01081 { 01082 case TAG_TEXT_LINESPACE_RATIO : ok = ReadTextLineSpaceRatio(pCXaraFileRecord); break; 01083 case TAG_TEXT_LINESPACE_ABSOLUTE : ok = ReadTextLineSpaceAbsolute(pCXaraFileRecord); break; 01084 case TAG_TEXT_JUSTIFICATION_LEFT : ok = ReadTextJustificationLeft(pCXaraFileRecord); break; 01085 case TAG_TEXT_JUSTIFICATION_CENTRE : ok = ReadTextJustificationCentre(pCXaraFileRecord); break; 01086 case TAG_TEXT_JUSTIFICATION_RIGHT : ok = ReadTextJustificationRight(pCXaraFileRecord); break; 01087 case TAG_TEXT_JUSTIFICATION_FULL : ok = ReadTextJustificationFull(pCXaraFileRecord); break; 01088 case TAG_TEXT_FONT_SIZE : ok = ReadTextFontSize(pCXaraFileRecord); break; 01089 case TAG_TEXT_FONT_TYPEFACE : ok = ReadTextFontTypeface(pCXaraFileRecord); break; 01090 case TAG_TEXT_BOLD_ON : ok = ReadTextBoldOn(pCXaraFileRecord); break; 01091 case TAG_TEXT_BOLD_OFF : ok = ReadTextBoldOff(pCXaraFileRecord); break; 01092 case TAG_TEXT_ITALIC_ON : ok = ReadTextItalicOn(pCXaraFileRecord); break; 01093 case TAG_TEXT_ITALIC_OFF : ok = ReadTextItalicOff(pCXaraFileRecord); break; 01094 case TAG_TEXT_UNDERLINE_ON : ok = ReadTextUnderlineOn(pCXaraFileRecord); break; 01095 case TAG_TEXT_UNDERLINE_OFF : ok = ReadTextUnderlineOff(pCXaraFileRecord); break; 01096 case TAG_TEXT_SCRIPT_ON : ok = ReadTextScriptOn(pCXaraFileRecord); break; 01097 case TAG_TEXT_SCRIPT_OFF : ok = ReadTextScriptOff(pCXaraFileRecord); break; 01098 case TAG_TEXT_SUPERSCRIPT_ON : ok = ReadTextSuperscriptOn(pCXaraFileRecord); break; 01099 case TAG_TEXT_SUBSCRIPT_ON : ok = ReadTextSubscriptOn(pCXaraFileRecord); break; 01100 case TAG_TEXT_TRACKING : ok = ReadTextTracking(pCXaraFileRecord); break; 01101 case TAG_TEXT_ASPECT_RATIO : ok = ReadTextAspectRatio(pCXaraFileRecord); break; 01102 case TAG_TEXT_BASELINE : ok = ReadTextBaseline(pCXaraFileRecord); break; 01103 case TAG_TEXT_LEFT_INDENT : ok = ReadTextLeftIndent(pCXaraFileRecord); break; 01104 case TAG_TEXT_RIGHT_INDENT : ok = ReadTextRightIndent(pCXaraFileRecord); break; 01105 case TAG_TEXT_FIRST_INDENT : ok = ReadTextFirstIndent(pCXaraFileRecord); break; 01106 case TAG_TEXT_RULER : ok = ReadTextRuler(pCXaraFileRecord); break; 01107 default : ok = ReadTextInvalid(pCXaraFileRecord); break; 01108 } 01109 01110 return ok; 01111 }
|
|
Definition at line 1459 of file rechtext.cpp. 01460 { 01461 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01462 01463 BOOL ok = TRUE; 01464 AttrTxtAspectRatio *pAttr = new AttrTxtAspectRatio(); 01465 FIXED16 AspectRatio; 01466 01467 if (ok) ok = pCXaraFileRecord->ReadFIXED16(&AspectRatio); 01468 01469 pAttr->Value.AspectRatio = AspectRatio; 01470 01471 if (ok) ok = InsertNode(pAttr); 01472 01473 return ok; 01474 }
|
|
Definition at line 1476 of file rechtext.cpp. 01477 { 01478 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01479 01480 BOOL ok = TRUE; 01481 AttrTxtBaseLine *pAttr = new AttrTxtBaseLine(); 01482 MILLIPOINT BaseLine; 01483 01484 if (ok) ok = pCXaraFileRecord->ReadINT32(&BaseLine); 01485 01486 pAttr->Value.Value = BaseLine; 01487 01488 if (ok) ok = InsertNode(pAttr); 01489 01490 return ok; 01491 }
|
|
Definition at line 1307 of file rechtext.cpp. 01308 { 01309 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01310 01311 BOOL ok = TRUE; 01312 AttrTxtBold *pAttr = new AttrTxtBold(); 01313 01314 pAttr->Value.BoldOn = FALSE; 01315 01316 if (ok) ok = InsertNode(pAttr); 01317 01318 return ok; 01319 }
|
|
Definition at line 1293 of file rechtext.cpp. 01294 { 01295 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01296 01297 BOOL ok = TRUE; 01298 AttrTxtBold *pAttr = new AttrTxtBold(); 01299 01300 pAttr->Value.BoldOn = TRUE; 01301 01302 if (ok) ok = InsertNode(pAttr); 01303 01304 return ok; 01305 }
|
|
|
|
Definition at line 1534 of file rechtext.cpp. 01535 { 01536 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01537 01538 AttrTxtFirstIndent *pAttr = new AttrTxtFirstIndent(); 01539 MILLIPOINT Value; 01540 01541 BOOL ok = pCXaraFileRecord->ReadINT32(&Value); 01542 pAttr->Value.Value = Value; 01543 if (ok) ok = InsertNode(pAttr); 01544 return ok; 01545 }
|
|
Definition at line 1244 of file rechtext.cpp. 01245 { 01246 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01247 01248 BOOL ok = TRUE; 01249 AttrTxtFontSize *pAttr = new AttrTxtFontSize(); 01250 MILLIPOINT Size; 01251 01252 if (ok) ok = pCXaraFileRecord->ReadINT32(&Size); 01253 01254 pAttr->Value.FontSize = Size; 01255 01256 if (ok) ok = InsertNode(pAttr); 01257 01258 return ok; 01259 }
|
|
Definition at line 1261 of file rechtext.cpp. 01262 { 01263 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter pCXaraFileRecord==NULL."); 01264 01265 BOOL ok = TRUE; 01266 01267 INT32 RecordNumber; 01268 01269 if (ok) ok = pCXaraFileRecord->ReadINT32(&RecordNumber); 01270 01271 FontComponent *pFontComponent = GetFontComponent(); 01272 01273 WORD FontHandle; 01274 BOOL IsBold; 01275 BOOL IsItalic; 01276 01277 if (ok) ok = pFontComponent->GetFontInformation(RecordNumber, &FontHandle, &IsBold, &IsItalic); 01278 01279 if (ok) 01280 { 01281 AttrTxtFontTypeface *pAttr = new AttrTxtFontTypeface(); 01282 01283 pAttr->Value.HTypeface = FontHandle; 01284 pAttr->Value.IsBold = IsBold; 01285 pAttr->Value.IsItalic = IsItalic; 01286 01287 ok = InsertNode(pAttr); 01288 } 01289 01290 return ok; 01291 }
|
|
Definition at line 1589 of file rechtext.cpp.
|
|
Definition at line 1335 of file rechtext.cpp. 01336 { 01337 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01338 01339 BOOL ok = TRUE; 01340 AttrTxtItalic *pAttr = new AttrTxtItalic(); 01341 01342 pAttr->Value.ItalicOn = FALSE; 01343 01344 if (ok) ok = InsertNode(pAttr); 01345 01346 return ok; 01347 }
|
|
Definition at line 1321 of file rechtext.cpp. 01322 { 01323 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01324 01325 BOOL ok = TRUE; 01326 AttrTxtItalic *pAttr = new AttrTxtItalic(); 01327 01328 pAttr->Value.ItalicOn = TRUE; 01329 01330 if (ok) ok = InsertNode(pAttr); 01331 01332 return ok; 01333 }
|
|
Definition at line 1202 of file rechtext.cpp. 01203 { 01204 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01205 01206 BOOL ok = TRUE; 01207 AttrTxtJustification *pAttr = new AttrTxtJustification(); 01208 01209 pAttr->Value.justification = JCENTRE; 01210 01211 if (ok) ok = InsertNode(pAttr); 01212 01213 return ok; 01214 }
|
|
Definition at line 1230 of file rechtext.cpp. 01231 { 01232 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01233 01234 BOOL ok = TRUE; 01235 AttrTxtJustification *pAttr = new AttrTxtJustification(); 01236 01237 pAttr->Value.justification = JFULL; 01238 01239 if (ok) ok = InsertNode(pAttr); 01240 01241 return ok; 01242 }
|
|
Definition at line 1188 of file rechtext.cpp. 01189 { 01190 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01191 01192 BOOL ok = TRUE; 01193 AttrTxtJustification *pAttr = new AttrTxtJustification(); 01194 01195 pAttr->Value.justification = JLEFT; 01196 01197 if (ok) ok = InsertNode(pAttr); 01198 01199 return ok; 01200 }
|
|
Definition at line 1216 of file rechtext.cpp. 01217 { 01218 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01219 01220 BOOL ok = TRUE; 01221 AttrTxtJustification *pAttr = new AttrTxtJustification(); 01222 01223 pAttr->Value.justification = JRIGHT; 01224 01225 if (ok) ok = InsertNode(pAttr); 01226 01227 return ok; 01228 }
|
|
|
|
Read text attributes for the new file format.
Definition at line 1508 of file rechtext.cpp. 01509 { 01510 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01511 01512 AttrTxtLeftMargin *pAttr = new AttrTxtLeftMargin(); 01513 MILLIPOINT Value; 01514 01515 BOOL ok = pCXaraFileRecord->ReadINT32(&Value); 01516 pAttr->Value.Value = Value; 01517 if (ok) ok = InsertNode(pAttr); 01518 return ok; 01519 }
|
|
Definition at line 1169 of file rechtext.cpp. 01170 { 01171 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01172 01173 BOOL ok = TRUE; 01174 AttrTxtLineSpace *pAttr = new AttrTxtLineSpace(); 01175 MILLIPOINT Value; 01176 01177 if (ok) ok = pCXaraFileRecord->ReadINT32(&Value); 01178 01179 pAttr->Value.IsRatio = FALSE; 01180 pAttr->Value.Value = Value; 01181 pAttr->Value.Ratio = 0; 01182 01183 if (ok) ok = InsertNode(pAttr); 01184 01185 return ok; 01186 }
|
|
Read text attributes for the new file format.
Definition at line 1150 of file rechtext.cpp. 01151 { 01152 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01153 01154 BOOL ok = TRUE; 01155 AttrTxtLineSpace *pAttr = new AttrTxtLineSpace(); 01156 FIXED16 Ratio; 01157 01158 if (ok) ok = pCXaraFileRecord->ReadFIXED16(&Ratio); 01159 01160 pAttr->Value.IsRatio = TRUE; 01161 pAttr->Value.Value = 0; 01162 pAttr->Value.Ratio = Ratio; 01163 01164 if (ok) ok = InsertNode(pAttr); 01165 01166 return ok; 01167 }
|
|
Definition at line 1521 of file rechtext.cpp. 01522 { 01523 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01524 01525 AttrTxtRightMargin *pAttr = new AttrTxtRightMargin(); 01526 MILLIPOINT Value; 01527 01528 BOOL ok = pCXaraFileRecord->ReadINT32(&Value); 01529 pAttr->Value.Value = Value; 01530 if (ok) ok = InsertNode(pAttr); 01531 return ok; 01532 }
|
|
Definition at line 1547 of file rechtext.cpp. 01548 { 01549 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01550 01551 AttrTxtRuler *pAttr = new AttrTxtRuler(); 01552 01553 UINT16 NumEntries; 01554 BOOL ok = pCXaraFileRecord->ReadUINT16(&NumEntries); 01555 TRACEUSER("wuerthne", _T("reading ruler attribute with %d entries"), NumEntries); 01556 while(ok && NumEntries--) 01557 { 01558 BYTE TypeAndFlags; 01559 MILLIPOINT Position; 01560 WCHAR DecimalPointChar = WCHAR(0); 01561 WCHAR TabFillerChar = WCHAR(0); 01562 ok = pCXaraFileRecord->ReadBYTE(&TypeAndFlags); 01563 01564 BOOL HasTabFiller = TypeAndFlags & 4; 01565 TxtTabType Type = TxtTabType(TypeAndFlags & 3); 01566 01567 if (ok) ok = pCXaraFileRecord->ReadINT32(&Position); 01568 if (TxtTabType(Type) == DecimalTab && ok) 01569 ok = pCXaraFileRecord->ReadWCHAR(&DecimalPointChar); 01570 if (HasTabFiller && ok) ok = pCXaraFileRecord->ReadWCHAR(&TabFillerChar); 01571 if (ok) pAttr->Value.AddTabStop(TxtTabType(Type), Position, DecimalPointChar, TabFillerChar); 01572 } 01573 01574 if (ok) ok = InsertNode(pAttr); 01575 return ok; 01576 }
|
|
Definition at line 1397 of file rechtext.cpp. 01398 { 01399 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01400 01401 BOOL ok = TRUE; 01402 AttrTxtScript *pAttr = new AttrTxtScript(); 01403 01404 pAttr->Value.Offset = 0; 01405 pAttr->Value.Size = 1; 01406 01407 if (ok) ok = InsertNode(pAttr); 01408 01409 return ok; 01410 }
|
|
Definition at line 1377 of file rechtext.cpp. 01378 { 01379 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01380 01381 BOOL ok = TRUE; 01382 AttrTxtScript *pAttr = new AttrTxtScript(); 01383 FIXED16 Offset; 01384 FIXED16 Size; 01385 01386 if (ok) ok = pCXaraFileRecord->ReadFIXED16(&Offset); 01387 if (ok) ok = pCXaraFileRecord->ReadFIXED16(&Size); 01388 01389 pAttr->Value.Offset = Offset; 01390 pAttr->Value.Size = Size; 01391 01392 if (ok) ok = InsertNode(pAttr); 01393 01394 return ok; 01395 }
|
|
|
|
|
|
Definition at line 1427 of file rechtext.cpp. 01428 { 01429 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01430 01431 BOOL ok = TRUE; 01432 AttrTxtScript *pAttr = new AttrTxtScript(); 01433 01434 pAttr->Value.Offset = FIXED16(Text_SubScriptOffset); 01435 pAttr->Value.Size = FIXED16(Text_SubScriptSize); 01436 01437 if (ok) ok = InsertNode(pAttr); 01438 01439 return ok; 01440 }
|
|
Definition at line 1412 of file rechtext.cpp. 01413 { 01414 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01415 01416 BOOL ok = TRUE; 01417 AttrTxtScript *pAttr = new AttrTxtScript(); 01418 01419 pAttr->Value.Offset = FIXED16(Text_SuperScriptOffset); 01420 pAttr->Value.Size = FIXED16(Text_SuperScriptSize); 01421 01422 if (ok) ok = InsertNode(pAttr); 01423 01424 return ok; 01425 }
|
|
Definition at line 1442 of file rechtext.cpp. 01443 { 01444 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01445 01446 BOOL ok = TRUE; 01447 AttrTxtTracking *pAttr = new AttrTxtTracking(); 01448 MILLIPOINT Tracking; 01449 01450 if (ok) ok = pCXaraFileRecord->ReadINT32(&Tracking); 01451 01452 pAttr->Value.Tracking = Tracking; 01453 01454 if (ok) ok = InsertNode(pAttr); 01455 01456 return ok; 01457 }
|
|
Definition at line 1363 of file rechtext.cpp. 01364 { 01365 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01366 01367 BOOL ok = TRUE; 01368 AttrTxtUnderline *pAttr = new AttrTxtUnderline(); 01369 01370 pAttr->Value.Underlined = FALSE; 01371 01372 if (ok) ok = InsertNode(pAttr); 01373 01374 return ok; 01375 }
|
|
Definition at line 1349 of file rechtext.cpp. 01350 { 01351 ERROR2IF(pCXaraFileRecord==NULL, FALSE, "Parameter CXaraFileRecord == NULL."); 01352 01353 BOOL ok = TRUE; 01354 AttrTxtUnderline *pAttr = new AttrTxtUnderline(); 01355 01356 pAttr->Value.Underlined = TRUE; 01357 01358 if (ok) ok = InsertNode(pAttr); 01359 01360 return ok; 01361 }
|