txtattr.h

Go to the documentation of this file.
00001 // $Id: txtattr.h 1535 2006-07-25 16:50:32Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 //This file contains a definition of the TextStory attributes, both the Attribute
00100 //value classes and the Node classes
00101 
00102 // ** Important **
00103 //Here are some naming conventions for you to break, there a bit odd but at least they conform
00104 //to the way other attribs have been named. 
00105 
00106 //All attribute values have the form Txt<AttribName>Attribute
00107 //All attribute nodes have the form AttrTxt<AttribName>
00108   
00109 // Here is a list of the attributes defined in this file
00110 
00111 //Value Class                       Node Class                  New file format export class                  
00112 
00113 //TxtFontTypefaceAttribute          AttrTxtFontTypeface         CXaraFileTxtFontTypeface
00114 //TxtBoldAttribute                  AttrTxtBold                 CXaraFileTxtBold
00115 //TxtItalicAttribute                AttrTxtItalic               CXaraFileTxtItalic
00116 //TxtUnderlineAttribute             AttrTxtUnderline            CXaraFileTxtUnderline
00117 //TxtAspectRatioAttribute           AttrTxtAspectRatio          CXaraFileTxtAspectRatio
00118 //TxtJustificationAttribute         AttrTxtJustification        CXaraFileTxtJustification
00119 //TxtTrackingAttribute              AttrTxtTracking             CXaraFileTxtTracking
00120 //TxtFontSizeAttribute              AttrTxtFontSize             CXaraFileTxtFontSize
00121 //TxtScriptAttribute                AttrTxtScript               CXaraFileTxtScript
00122 //TxtBaseLineAttribute              AttrTxtBaseLine             CXaraFileTxtBaseLine
00123 //TxtLineSpaceAttribute             AttrTxtLineSpace            CXaraFileTxtLineSpace
00124 
00125 // The export code for the new file format has been placed in separate classes, in another
00126 // file, to avoid the monster rebuilds generated when this file gets changed.
00127 
00128 /*
00129 */
00130 
00131 #ifndef INC_TXTATTR
00132 #define INC_TXTATTR
00133 
00134 #include "node.h"
00135 #include "attrval.h"
00136 #include "nodeattr.h"
00137 #include "trans2d.h"
00138 #include "fixed16.h"
00139 
00140 #include <list>
00141 
00142 enum Justification { JLEFT, JRIGHT, JCENTRE, JFULL }; 
00143 enum TxtTabType { LeftTab, RightTab, CentreTab, DecimalTab };
00144     
00145 // Attribute Value classes
00146 
00147 /********************************************************************************************
00148 
00149 >   class TxtBaseClassAttribute : public AttributeValue
00150             
00151     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00152     Created:    07/03/95
00153     Purpose:    The base class from which all text attributes are derived
00154     SeeAlso:    AttrTxtFontTypeface
00155 
00156 ********************************************************************************************/
00157 
00158 class TxtBaseClassAttribute : public AttributeValue
00159 {
00160     CC_DECLARE_DYNAMIC(TxtBaseClassAttribute)
00161 public:
00162     // Constructor
00163     TxtBaseClassAttribute() {};
00164 
00165     virtual void Restore(RenderRegion *, BOOL) = 0;
00166 };
00167 
00168 /********************************************************************************************
00169 
00170 >   class TxtFontTypefaceAttribute : public TxtBaseClassAttribute
00171             
00172     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00173     Created:    07/03/95
00174     Purpose:    Specifies a FontTypeface. Note that only a handle to the Typeface is
00175                 stored in the attribute, not the full string description.
00176     SeeAlso:    AttrTxtFontTypeface
00177 
00178 ********************************************************************************************/
00179 
00180 class TxtFontTypefaceAttribute : public TxtBaseClassAttribute
00181 {
00182     CC_DECLARE_DYNCREATE(TxtFontTypefaceAttribute)
00183 public:
00184     // Constructors
00185     TxtFontTypefaceAttribute();
00186     TxtFontTypefaceAttribute(UINT32 TypefaceHandle);
00187 
00188     virtual void Restore (RenderRegion *, BOOL);
00189     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00190 
00191     virtual void SimpleCopy(AttributeValue *);
00192     virtual NodeAttribute *MakeNode();
00193 
00194     BOOL IsDifferent(AttributeValue *pAttr);
00195 
00196     virtual TxtFontTypefaceAttribute& operator=(TxtFontTypefaceAttribute& Attrib);
00197     INT32 operator==(const TxtFontTypefaceAttribute& Attrib);
00198  
00199 
00200     // The typeface handle
00201     WORD HTypeface;
00202     BOOL IsBold;
00203     BOOL IsItalic;
00204 
00205     static BOOL Init();
00206 };  
00207 
00208 /********************************************************************************************
00209 
00210 >   class TxtFontSizeAttribute : public TxtBaseClassAttribute
00211             
00212     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00213     Created:    07/03/95
00214     Purpose:    Specifies the size of a font
00215     SeeAlso:    AttrTxtFontTypeface
00216 
00217 ********************************************************************************************/
00218 
00219 class TxtFontSizeAttribute : public TxtBaseClassAttribute
00220 {
00221     CC_DECLARE_DYNCREATE(TxtFontSizeAttribute)
00222 public:
00223     // Constructors
00224     TxtFontSizeAttribute();
00225     TxtFontSizeAttribute(MILLIPOINT FontSize);
00226 
00227     virtual void Restore (RenderRegion *, BOOL);
00228     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00229 
00230     virtual void SimpleCopy(AttributeValue *);
00231     virtual NodeAttribute *MakeNode();
00232 
00233     BOOL IsDifferent(AttributeValue *pAttr);
00234 
00235     virtual TxtFontSizeAttribute& operator=(TxtFontSizeAttribute& Attrib);
00236     INT32 operator==(const TxtFontSizeAttribute& Attrib);
00237 
00238     // The typeface handle
00239     MILLIPOINT FontSize;
00240 
00241     static BOOL Init();
00242 };  
00243 
00244 
00245 
00246 /********************************************************************************************
00247 
00248 >   class TxtBoldAttribute : public TxtBaseClassAttribute
00249 
00250     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00251     Created:    13/3/95
00252     Purpose:    This text attribute specifies the BOLD state (on/off)
00253     SeeAlso:    -
00254 
00255 ********************************************************************************************/
00256 
00257 
00258 class TxtBoldAttribute : public TxtBaseClassAttribute
00259 {
00260     CC_DECLARE_DYNCREATE(TxtBoldAttribute)
00261 public:
00262     // Constructors
00263     TxtBoldAttribute();
00264     TxtBoldAttribute(BOOL boldOn);
00265 
00266     virtual void Restore (RenderRegion *, BOOL);
00267     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00268 
00269     virtual void SimpleCopy(AttributeValue *);
00270     virtual NodeAttribute *MakeNode();
00271 
00272     BOOL IsDifferent(AttributeValue *pAttr);
00273 
00274     virtual TxtBoldAttribute& operator=(TxtBoldAttribute& Attrib); 
00275     INT32 operator==(const TxtBoldAttribute& Attrib);
00276 
00277 
00278     BOOL BoldOn;
00279 
00280     static BOOL Init();
00281 };
00282 
00283 /********************************************************************************************
00284 
00285 >   class TxtItalicAttribute : public TxtBaseClassAttribute
00286 
00287     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00288     Created:    13/3/95
00289     Purpose:    This text attribute specifies the ITALIC state (on/off)
00290     SeeAlso:    -
00291 
00292 ********************************************************************************************/
00293 
00294 
00295 class TxtItalicAttribute : public TxtBaseClassAttribute
00296 {
00297     CC_DECLARE_DYNCREATE(TxtItalicAttribute)
00298 public:
00299     // Constructors
00300     TxtItalicAttribute();
00301     TxtItalicAttribute(BOOL italicOn);
00302 
00303     virtual void Restore (RenderRegion *, BOOL);
00304     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00305 
00306     virtual void SimpleCopy(AttributeValue *);
00307     virtual NodeAttribute *MakeNode();
00308 
00309     BOOL IsDifferent(AttributeValue *pAttr);
00310 
00311     virtual TxtItalicAttribute& operator=(TxtItalicAttribute& Attrib); 
00312     INT32 operator==(const TxtItalicAttribute& Attrib);
00313 
00314 
00315     // The typeface handle
00316     BOOL ItalicOn;
00317 
00318     static BOOL Init();
00319 };  
00320 
00321 /********************************************************************************************
00322 
00323 >   class TxtUnderlineAttribute : public TxtBaseClassAttribute
00324 
00325     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00326     Created:    13/3/95
00327     Purpose:    This text attribute specifies if text is underlined or not
00328     SeeAlso:    -
00329 
00330 ********************************************************************************************/
00331 
00332 
00333 class TxtUnderlineAttribute : public TxtBaseClassAttribute
00334 {
00335     CC_DECLARE_DYNCREATE(TxtUnderlineAttribute)
00336 public:                                               
00337     TxtUnderlineAttribute();
00338     TxtUnderlineAttribute(BOOL underlined);
00339 
00340     virtual void Restore (RenderRegion *, BOOL);
00341     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00342 
00343     virtual void SimpleCopy(AttributeValue *);
00344     virtual NodeAttribute *MakeNode();
00345 
00346     BOOL IsDifferent(AttributeValue *pAttr);
00347 
00348     virtual TxtUnderlineAttribute& operator=(TxtUnderlineAttribute& Attrib); 
00349     INT32 operator==(const TxtUnderlineAttribute& Attrib);
00350 
00351     BOOL Underlined;
00352 
00353     static BOOL Init();
00354 };  
00355 
00356 /********************************************************************************************
00357 
00358 >   class TxtJustificationAttribute : public TxtBaseClassAttribute
00359 
00360     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00361     Created:    13/3/95
00362     Purpose:    This text attribute specifies the current text justification
00363     SeeAlso:    -
00364 
00365 ********************************************************************************************/
00366 
00367 
00368 class TxtJustificationAttribute : public TxtBaseClassAttribute
00369 {
00370     CC_DECLARE_DYNCREATE(TxtJustificationAttribute)
00371 public:
00372     // Constructors
00373     TxtJustificationAttribute();
00374     TxtJustificationAttribute(Justification Value);
00375 
00376     virtual void Restore (RenderRegion *, BOOL);
00377     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00378 
00379     virtual void SimpleCopy(AttributeValue *);
00380     virtual NodeAttribute *MakeNode();
00381 
00382     BOOL IsDifferent(AttributeValue *pAttr);
00383 
00384     virtual TxtJustificationAttribute& operator=(TxtJustificationAttribute& Attrib);
00385     INT32 operator==(const TxtJustificationAttribute& Attrib);
00386 
00387     static BOOL Init();
00388 
00389     Justification justification;  // JLEFT, JRIGHT, JCENTRE or JFULL
00390 };  
00391 
00392 
00393     
00394 /********************************************************************************************
00395 
00396 >   class TxtTrackingAttribute: public TxtBaseClassAttribute
00397 
00398     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00399     Created:    13/3/95
00400     Purpose:    This text attribute specifies a spacing between characters, it can be
00401                 positive or negative.
00402     SeeAlso:    -
00403 
00404 ********************************************************************************************/
00405 
00406 
00407 class TxtTrackingAttribute : public TxtBaseClassAttribute
00408 {
00409     CC_DECLARE_DYNCREATE(TxtTrackingAttribute)
00410 public:
00411     // Constructors
00412     TxtTrackingAttribute();
00413     TxtTrackingAttribute(MILLIPOINT tracking);
00414 
00415     virtual void Restore (RenderRegion *, BOOL);
00416     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00417 
00418     virtual void SimpleCopy(AttributeValue *);
00419     virtual NodeAttribute *MakeNode();
00420 
00421     BOOL IsDifferent(AttributeValue *pAttr);
00422 
00423     virtual TxtTrackingAttribute& operator=(TxtTrackingAttribute& Attrib);
00424     INT32 operator==(const TxtTrackingAttribute& Attrib);
00425  
00426 
00427     static BOOL Init();
00428 
00429     MILLIPOINT Tracking; 
00430 };  
00431 
00432 /********************************************************************************************
00433 
00434 >   class TxtAspectRatioAttribute: public TxtBaseClassAttribute
00435 
00436     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00437     Created:    13/3/95
00438     Purpose:    This text attribute specifies the aspect ratio of characters
00439     SeeAlso:    -
00440 
00441 ********************************************************************************************/
00442 
00443 
00444 class TxtAspectRatioAttribute : public TxtBaseClassAttribute
00445 {
00446     CC_DECLARE_DYNCREATE(TxtAspectRatioAttribute)
00447 public:
00448     // Constructors
00449     TxtAspectRatioAttribute();
00450     TxtAspectRatioAttribute(FIXED16 aspect);
00451 
00452     virtual void Restore (RenderRegion *, BOOL);
00453     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00454 
00455     virtual void SimpleCopy(AttributeValue *);
00456     virtual NodeAttribute *MakeNode();
00457 
00458     BOOL IsDifferent(AttributeValue *pAttr);
00459 
00460     virtual TxtAspectRatioAttribute& operator=(TxtAspectRatioAttribute& Attrib);
00461     INT32 operator==(const TxtAspectRatioAttribute& Attrib);
00462  
00463     static BOOL Init();
00464 
00465     FIXED16 AspectRatio;
00466 };  
00467 
00468 /********************************************************************************************
00469 
00470 >   class TxtScriptAttribute: public TxtBaseClassAttribute
00471 
00472     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00473     Created:    13/3/95
00474     Purpose:    This text attribute specifies the superscript/subscript value of a char
00475     SeeAlso:    -
00476 
00477 ********************************************************************************************/
00478 
00479 
00480 class TxtScriptAttribute : public TxtBaseClassAttribute
00481 {
00482     CC_DECLARE_DYNCREATE(TxtScriptAttribute)
00483 public:
00484     // Constructors
00485     TxtScriptAttribute();
00486     TxtScriptAttribute(FIXED16 offset, FIXED16 size);
00487 
00488     virtual void Restore (RenderRegion *, BOOL);
00489     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00490 
00491     virtual void SimpleCopy(AttributeValue *);
00492     virtual NodeAttribute *MakeNode();
00493 
00494     BOOL IsDifferent(AttributeValue *pAttr);
00495 
00496     virtual TxtScriptAttribute& operator=(TxtScriptAttribute& Attrib);
00497     INT32 operator==(const TxtScriptAttribute& Attrib);
00498  
00499     static BOOL Init();
00500 
00501     FIXED16 Offset; // Relative to height of char +/-
00502     FIXED16 Size;   // Ralative to font size 
00503 };  
00504 
00505 /********************************************************************************************
00506 
00507 >   class TxtBaseLineAttribute: public TxtBaseClassAttribute
00508 
00509     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00510     Created:    13/3/95
00511     Purpose:    This text attribute specifies the aspect ratio of characters
00512     SeeAlso:    -
00513 
00514 ********************************************************************************************/
00515 
00516 
00517 class TxtBaseLineAttribute : public TxtBaseClassAttribute
00518 {
00519     CC_DECLARE_DYNCREATE(TxtBaseLineAttribute)
00520 public:
00521     // Constructors
00522     TxtBaseLineAttribute();
00523     TxtBaseLineAttribute(MILLIPOINT value);
00524 
00525     virtual void Restore (RenderRegion *, BOOL);
00526     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00527 
00528     virtual void SimpleCopy(AttributeValue *);
00529     virtual NodeAttribute *MakeNode();
00530 
00531     BOOL IsDifferent(AttributeValue *pAttr);
00532 
00533     virtual TxtBaseLineAttribute& operator=(TxtBaseLineAttribute& Attrib);
00534     INT32 operator==(const TxtBaseLineAttribute& Attrib);
00535  
00536     static BOOL Init();
00537 
00538     MILLIPOINT Value;  // Absolute offset from base line of line
00539 };  
00540 
00541 /********************************************************************************************
00542 
00543 >   class TxtLineSpaceAttribute: public TxtBaseClassAttribute
00544 
00545     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00546     Created:    13/3/95
00547     Purpose:    This text attribute specifies the aspect ratio of characters
00548     SeeAlso:    -
00549 
00550 ********************************************************************************************/
00551 
00552 
00553 class TxtLineSpaceAttribute : public TxtBaseClassAttribute
00554 {
00555     CC_DECLARE_DYNCREATE(TxtLineSpaceAttribute)
00556 public:
00557     // Constructors
00558     TxtLineSpaceAttribute();
00559     TxtLineSpaceAttribute(MILLIPOINT Value);
00560     TxtLineSpaceAttribute(FIXED16 Ratio);
00561 
00562     virtual void Restore (RenderRegion *, BOOL);
00563     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00564 
00565     virtual void SimpleCopy(AttributeValue *);
00566     virtual NodeAttribute *MakeNode();
00567 
00568     BOOL IsDifferent(AttributeValue *pAttr);
00569 
00570     virtual TxtLineSpaceAttribute& operator=(TxtLineSpaceAttribute& Attrib);
00571     INT32 operator==(const TxtLineSpaceAttribute& Attrib);
00572  
00573     static BOOL Init();
00574     
00575     BOOL IsARatio() const;
00576 
00577 
00578     BOOL IsRatio:1;
00579 
00580     MILLIPOINT Value; // Absolute distance between lines
00581     FIXED16 Ratio;
00582     
00583 };
00584 
00585 /********************************************************************************************
00586 
00587 >   class TxtTabStop
00588 
00589     Author:     Martin Wuerthner <xara@mw-software.com>
00590     Created:    13/6/06
00591     Purpose:    This type represents a tab stop (part of a ruler attribute)
00592 
00593 ********************************************************************************************/
00594 
00595 class TxtTabStop
00596 {
00597 public:
00598     // standard constructor - fills in decimal point and tab chars automatically
00599     TxtTabStop(TxtTabType TheType, MILLIPOINT ThePosition);
00600     // full constructor
00601     TxtTabStop(TxtTabType TheType, MILLIPOINT ThePosition, WCHAR DecimalPointChar, WCHAR TabFillerChar);
00602 
00603     // accessor functions
00604     inline TxtTabType GetType() const { return mType; }
00605     void SetType(TxtTabType TheType);
00606     inline MILLIPOINT GetPosition() const { return mPosition; }
00607     inline void SetPosition(MILLIPOINT ThePosition) { mPosition = ThePosition; }
00608     inline WCHAR GetDecimalPointChar() const { return mDecimalPointChar; }
00609     inline void SetDecimalPointChar(WCHAR DecimalPointChar) { mDecimalPointChar = DecimalPointChar; }
00610     inline WCHAR GetTabFillerChar() const { return mTabFillerChar; }
00611     inline void SetTabFillerChar(WCHAR TheChar) { mTabFillerChar = TheChar; }
00612 
00613  private:
00614     TxtTabType mType;
00615     MILLIPOINT mPosition;
00616     WCHAR mDecimalPointChar;  // the character to align to (for decimal tabs only)
00617     WCHAR mTabFillerChar;     // the tab filler character (0 for none)
00618 };
00619 
00620 // comparison operators
00621 BOOL operator==(const TxtTabStop& t1, const TxtTabStop& t2);
00622 BOOL operator!=(const TxtTabStop& t1, const TxtTabStop& t2);
00623 
00624 typedef list<TxtTabStop> TxtRuler;
00625 
00626 // iterators for the tab stop list used by TxtRulerAttribute
00627 typedef list<TxtTabStop>::iterator TxtTabStopIterator;
00628 typedef list<TxtTabStop>::const_iterator const_TxtTabStopIterator;
00629 
00630 /********************************************************************************************
00631 
00632 >   class TxtRulerAttribute: public TxtBaseClassAttribute
00633 
00634     Author:     Martin Wuerthner <xara@mw-software.com>
00635     Created:    13/6/06
00636     Purpose:    This text attribute specifies the ruler (i.e., tab stops)
00637                 Conceptually, a ruler is just a pointer to a sorted list of tab stops.              
00638     SeeAlso:    -
00639 
00640 ********************************************************************************************/
00641 
00642 class TxtRulerAttribute : public TxtBaseClassAttribute
00643 {
00644     CC_DECLARE_DYNCREATE(TxtRulerAttribute)
00645 public:
00646     // Constructor
00647     TxtRulerAttribute();
00648     ~TxtRulerAttribute();
00649 
00650     virtual void Restore (RenderRegion *, BOOL);
00651     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00652 
00653     virtual void SimpleCopy(AttributeValue *);
00654     virtual NodeAttribute *MakeNode();
00655 
00656     BOOL IsDifferent(AttributeValue *pAttr);
00657 
00658     virtual TxtRulerAttribute& operator=(TxtRulerAttribute& Attrib);
00659     INT32 operator==(const TxtRulerAttribute& Attrib);
00660 
00661     // access functions for the tab stop list
00662     void AddTabStop(TxtTabType Type, MILLIPOINT Position);
00663     void AddTabStop(TxtTabType Type, MILLIPOINT Position, WCHAR DecimalPointChar, WCHAR TabFillerChar);
00664     void AddTabStop(TxtTabStop TabStop);
00665     void FindTabStop (MILLIPOINT MinPos, TxtTabType* pType, MILLIPOINT* pPos, WCHAR* pDecimalPointChar) const;
00666     const_TxtTabStopIterator begin() const { return Value->begin(); }
00667     const_TxtTabStopIterator end() const { return Value->end(); }
00668     TxtTabStopIterator begin() { return Value->begin(); }
00669     TxtTabStopIterator end() { return Value->end(); }
00670     INT32 NumTabStops() const { return Value->size(); }
00671 
00672     static BOOL Init();
00673     static void FindTabStopInRuler(const TxtRuler* pRuler, MILLIPOINT MinPos,
00674                                    TxtTabType* pType, MILLIPOINT* pPos, WCHAR* pDecimalPointChar);
00675     // the actual value is a pointer to a list of tab stops
00676     // this means that we will have to take care when destructing/copying
00677     // objects of this class
00678     TxtRuler* Value;
00679 private:
00680     // prevent accidental copy construction
00681     TxtRulerAttribute(const TxtRulerAttribute&);
00682 };
00683 
00684 /********************************************************************************************
00685 
00686 >   class TxtLeftMarginAttribute: public TxtBaseClassAttribute
00687 
00688     Author:     Martin Wuerthner <xara@mw-software.com>
00689     Created:    13/6/06
00690     Purpose:    This text attribute specifies the left margin
00691     SeeAlso:    -
00692 
00693 ********************************************************************************************/
00694 
00695 class TxtLeftMarginAttribute : public TxtBaseClassAttribute
00696 {
00697     CC_DECLARE_DYNCREATE(TxtLeftMarginAttribute)
00698 public:
00699     // Constructors
00700     TxtLeftMarginAttribute();
00701     TxtLeftMarginAttribute(MILLIPOINT value);
00702 
00703     virtual void Restore (RenderRegion *, BOOL);
00704     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00705 
00706     virtual void SimpleCopy(AttributeValue *);
00707     virtual NodeAttribute *MakeNode();
00708 
00709     BOOL IsDifferent(AttributeValue *pAttr);
00710 
00711     virtual TxtLeftMarginAttribute& operator=(TxtLeftMarginAttribute& Attrib);
00712     INT32 operator==(const TxtLeftMarginAttribute& Attrib);
00713 
00714     static BOOL Init();
00715 
00716     MILLIPOINT Value;
00717 };
00718 
00719 /********************************************************************************************
00720 
00721 >   class TxtRightMarginAttribute: public TxtBaseClassAttribute
00722 
00723     Author:     Martin Wuerthner <xara@mw-software.com>
00724     Created:    13/6/06
00725     Purpose:    This text attribute specifies the right margin
00726     SeeAlso:    -
00727 
00728 ********************************************************************************************/
00729 
00730 class TxtRightMarginAttribute : public TxtBaseClassAttribute
00731 {
00732     CC_DECLARE_DYNCREATE(TxtRightMarginAttribute)
00733 public:
00734     // Constructors
00735     TxtRightMarginAttribute();
00736     TxtRightMarginAttribute(MILLIPOINT value);
00737 
00738     virtual void Restore (RenderRegion *, BOOL);
00739     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00740 
00741     virtual void SimpleCopy(AttributeValue *);
00742     virtual NodeAttribute *MakeNode();
00743 
00744     BOOL IsDifferent(AttributeValue *pAttr);
00745 
00746     virtual TxtRightMarginAttribute& operator=(TxtRightMarginAttribute& Attrib);
00747     INT32 operator==(const TxtRightMarginAttribute& Attrib);
00748 
00749     static BOOL Init();
00750 
00751     MILLIPOINT Value;
00752 };
00753 
00754 /********************************************************************************************
00755 
00756 >   class TxtFirstIndentAttribute: public TxtBaseClassAttribute
00757 
00758     Author:     Martin Wuerthner <xara@mw-software.com>
00759     Created:    13/6/06
00760     Purpose:    This text attribute specifies the first line indent
00761     SeeAlso:    -
00762 
00763 ********************************************************************************************/
00764 
00765 class TxtFirstIndentAttribute : public TxtBaseClassAttribute
00766 {
00767     CC_DECLARE_DYNCREATE(TxtFirstIndentAttribute)
00768 public:
00769     // Constructors
00770     TxtFirstIndentAttribute();
00771     TxtFirstIndentAttribute(MILLIPOINT value);
00772 
00773     virtual void Restore (RenderRegion *, BOOL);
00774     virtual void Render(RenderRegion *pRegion, BOOL Temp = FALSE);
00775 
00776     virtual void SimpleCopy(AttributeValue *);
00777     virtual NodeAttribute *MakeNode();
00778 
00779     BOOL IsDifferent(AttributeValue *pAttr);
00780 
00781     virtual TxtFirstIndentAttribute& operator=(TxtFirstIndentAttribute& Attrib);
00782     INT32 operator==(const TxtFirstIndentAttribute& Attrib);
00783 
00784     static BOOL Init();
00785 
00786     MILLIPOINT Value;
00787 };
00788 
00789 // ---------------------------------------------------------------------------------------------
00790 // Attribute Node classes
00791 
00792 /***********************************************************************************************
00793 
00794 >   class AttrTxtBase : public NodeAttribute
00795 
00796     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00797     Created:    07/03/95
00798     Purpose:    AttrTxtBase is the base class from which all text attribute nodes are derived
00799 
00800 ***********************************************************************************************/
00801 
00802 class AttrTxtBase : public NodeAttribute
00803 {
00804     CC_DECLARE_DYNCREATE(AttrTxtBase)
00805 
00806 public:
00807     // Constructors
00808     AttrTxtBase();
00809     AttrTxtBase(Node* ContextNode,  
00810                 AttachNodeDirection Direction,    
00811                 BOOL Locked=FALSE, 
00812                 BOOL Mangled=FALSE,  
00813                 BOOL Marked=FALSE, 
00814                 BOOL Selected=FALSE);
00815 
00816     virtual BOOL IsKindOfTextAttribute() const { return TRUE; }
00817 
00818     virtual BOOL EffectsParentBounds() { return TRUE; };
00819     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect) { return; }
00820 
00821 };
00822 
00823 /***********************************************************************************************
00824 
00825 >   class AttrTxtFontTypeface : public AttrTxtBase
00826 
00827     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00828     Created:    07/03/95
00829     Purpose:    AttrTxtFontTypeface specifies a font typeface
00830 
00831 ***********************************************************************************************/
00832 
00833 class AttrTxtFontTypeface : public AttrTxtBase
00834 {
00835     CC_DECLARE_DYNCREATE(AttrTxtFontTypeface)
00836 
00837 public:
00838     // Constructors
00839     AttrTxtFontTypeface(); 
00840     AttrTxtFontTypeface(Node* ContextNode,  
00841                         AttachNodeDirection Direction,    
00842                         BOOL Locked=FALSE, 
00843                         BOOL Mangled=FALSE,  
00844                         BOOL Marked=FALSE, 
00845                         BOOL Selected=FALSE);
00846              
00847 
00848     void Render( RenderRegion* pRender );
00849 
00850     Node* SimpleCopy();                         // Copies a node
00851 
00852     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
00853 
00854     virtual UINT32 GetAttrNameID(void); 
00855     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTFONTTYPEFACE; }
00856 
00857     //void ShowDebugTreeDetails() const;            // Debugging function
00858 
00859     void GetDebugDetails(StringBase* Str);
00860 
00861     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
00862 
00863     virtual AttributeValue* GetAttributeValue() { return &Value; }
00864 
00865     void SetBold(BOOL State)    { Value.IsBold = State; }
00866     void SetItalic(BOOL State)  { Value.IsItalic = State; }
00867     BOOL IsBold()               { return Value.IsBold; }
00868     BOOL IsItalic()             { return Value.IsItalic; }
00869     BOOL IsATypeface() const    { return TRUE; }
00870 
00871     // needs to be called _everytime_ objects of this type get created or updated.
00872     void UpdateCachedData();
00873     
00874     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00875 
00876 private:
00877     void CopyNodeContents( AttrTxtFontTypeface* NodeCopy );
00878 
00879 // Version 2 file format functions
00880 public:
00881     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00882     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00883 
00884 public:
00885     TxtFontTypefaceAttribute Value;
00886 };
00887 
00888 
00889 /***********************************************************************************************
00890 
00891 >   class AttrTxtBold : public AttrTxtBase
00892 
00893     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00894     Created:    07/03/95
00895     Purpose:    AttrTxtBold specifies if text is bold or not
00896 
00897 ***********************************************************************************************/
00898 
00899 class AttrTxtBold : public AttrTxtBase
00900 {
00901     CC_DECLARE_DYNCREATE(AttrTxtBold)
00902 
00903 public:
00904     // Constructors
00905     AttrTxtBold(); 
00906     AttrTxtBold(Node* ContextNode,  
00907                 AttachNodeDirection Direction,    
00908                 BOOL Locked=FALSE, 
00909                 BOOL Mangled=FALSE,  
00910                 BOOL Marked=FALSE, 
00911                 BOOL Selected=FALSE);
00912              
00913 
00914     void Render( RenderRegion* pRender );
00915 
00916     Node* SimpleCopy();                         // Copies a node
00917 
00918     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
00919 
00920     virtual UINT32 GetAttrNameID(void); 
00921     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTBOLD; }
00922 
00923     //void ShowDebugTreeDetails() const;            // Debugging function
00924 
00925     void GetDebugDetails(StringBase* Str);
00926 
00927     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
00928 
00929     virtual AttributeValue* GetAttributeValue() { return &Value; }
00930 
00931     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00932 
00933 private:
00934     void CopyNodeContents( AttrTxtBold* NodeCopy );
00935 
00936 // Version 2 file format functions
00937 public:
00938     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00939     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00940 
00941 public:
00942     TxtBoldAttribute Value;
00943 };
00944 
00945 
00946 /***********************************************************************************************
00947 
00948 >   class AttrTxtItalic : public AttrTxtBase
00949 
00950     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00951     Created:    07/03/95
00952     Purpose:    AttrTxtFontTypeface specifies if text is italic or not
00953 
00954 ***********************************************************************************************/
00955 
00956 class AttrTxtItalic : public AttrTxtBase
00957 {
00958     CC_DECLARE_DYNCREATE(AttrTxtItalic)
00959 
00960 public:
00961     // Constructors
00962     AttrTxtItalic(); 
00963     AttrTxtItalic(Node* ContextNode,  
00964                     AttachNodeDirection Direction,    
00965                     BOOL Locked=FALSE, 
00966                     BOOL Mangled=FALSE,  
00967                     BOOL Marked=FALSE, 
00968                     BOOL Selected=FALSE);
00969              
00970 
00971     void Render( RenderRegion* pRender );
00972 
00973     Node* SimpleCopy();                         // Copies a node
00974 
00975     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
00976 
00977     virtual UINT32 GetAttrNameID(void); 
00978     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTITALIC; }
00979 
00980     //void ShowDebugTreeDetails() const;            // Debugging function
00981 
00982     void GetDebugDetails(StringBase* Str);
00983 
00984     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
00985 
00986     virtual AttributeValue* GetAttributeValue() { return &Value; }
00987 
00988     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00989 
00990 private:
00991     void CopyNodeContents( AttrTxtItalic* NodeCopy );
00992 
00993 // Version 2 file format functions
00994 public:
00995     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00996     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
00997 
00998 public:
00999     TxtItalicAttribute Value;
01000 };
01001 
01002 
01003 /***********************************************************************************************
01004 
01005 >   class AttrTxtUnderline : public AttrTxtBase
01006 
01007     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01008     Created:    07/03/95
01009     Purpose:    AttrTxtUnderline specifies if text is underlined or not
01010 
01011 ***********************************************************************************************/
01012 
01013 class AttrTxtUnderline : public AttrTxtBase
01014 {
01015     CC_DECLARE_DYNCREATE(AttrTxtUnderline)
01016 
01017 public:
01018     // Constructors
01019     AttrTxtUnderline(); 
01020     AttrTxtUnderline(Node* ContextNode,  
01021                     AttachNodeDirection Direction,    
01022                     BOOL Locked=FALSE, 
01023                     BOOL Mangled=FALSE,  
01024                     BOOL Marked=FALSE, 
01025                     BOOL Selected=FALSE);
01026              
01027 
01028     void Render( RenderRegion* pRender );
01029 
01030     Node* SimpleCopy();                         // Copies a node
01031 
01032     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01033 
01034     virtual UINT32 GetAttrNameID(void); 
01035     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTUNDERLINE; }
01036 
01037     //void ShowDebugTreeDetails() const;            // Debugging function
01038 
01039     void GetDebugDetails(StringBase* Str);
01040 
01041     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01042 
01043     virtual AttributeValue* GetAttributeValue() { return &Value; }
01044 
01045     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01046 
01047 private:
01048     void CopyNodeContents( AttrTxtUnderline* NodeCopy );
01049 
01050 // Version 2 file format functions
01051 public:
01052     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01053     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01054 
01055 public:
01056     TxtUnderlineAttribute Value;
01057 };
01058 
01059 
01060 /***********************************************************************************************
01061 
01062 >   class AttrTxtAspectRatio : public AttrTxtBase
01063 
01064     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01065     Created:    07/03/95
01066     Purpose:    AttrTxtAspectRatio specifies the aspect ratio of text
01067 
01068 ***********************************************************************************************/
01069 
01070 class AttrTxtAspectRatio : public AttrTxtBase
01071 {
01072     CC_DECLARE_DYNCREATE(AttrTxtAspectRatio)
01073 
01074 public:
01075     // Constructors
01076     AttrTxtAspectRatio(); 
01077     AttrTxtAspectRatio(Node* ContextNode,  
01078                         AttachNodeDirection Direction,    
01079                         BOOL Locked=FALSE, 
01080                         BOOL Mangled=FALSE,  
01081                         BOOL Marked=FALSE, 
01082                         BOOL Selected=FALSE);
01083              
01084 
01085     void Render( RenderRegion* pRender );
01086 
01087     Node* SimpleCopy();                         // Copies a node
01088 
01089     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01090 
01091     virtual UINT32 GetAttrNameID(void); 
01092     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTASPECTRATIO; }
01093 
01094     //void ShowDebugTreeDetails() const;            // Debugging function
01095 
01096     void GetDebugDetails(StringBase* Str);
01097 
01098     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01099 
01100     virtual AttributeValue* GetAttributeValue() { return &Value; }
01101     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01102 
01103     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01104 
01105 private:
01106     void CopyNodeContents( AttrTxtAspectRatio* NodeCopy );
01107 
01108 // Version 2 file format functions
01109 public:
01110     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01111     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01112 
01113 public:
01114     TxtAspectRatioAttribute Value;
01115 };
01116 
01117 
01118 /***********************************************************************************************
01119 
01120 >   class AttrTxtJustification : public AttrTxtBase
01121 
01122     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01123     Created:    07/03/95
01124     Purpose:    AttrTxtJustification specifies how text is justified
01125 
01126 ***********************************************************************************************/
01127 
01128 class AttrTxtJustification : public AttrTxtBase
01129 {
01130     CC_DECLARE_DYNCREATE(AttrTxtJustification)
01131 
01132 public:
01133     // Constructors
01134     AttrTxtJustification(); 
01135     AttrTxtJustification(Node* ContextNode,  
01136                         AttachNodeDirection Direction,    
01137                         BOOL Locked=FALSE, 
01138                         BOOL Mangled=FALSE,  
01139                         BOOL Marked=FALSE, 
01140                         BOOL Selected=FALSE);
01141              
01142 
01143     void Render( RenderRegion* pRender );
01144 
01145     Node* SimpleCopy();                         // Copies a node
01146 
01147     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01148 
01149     virtual UINT32 GetAttrNameID(void); 
01150 
01151     //void ShowDebugTreeDetails() const;            // Debugging function
01152 
01153     void GetDebugDetails(StringBase* Str);
01154 
01155     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01156 
01157     virtual AttributeValue* GetAttributeValue() { return &Value; }
01158     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTJUSTIFICATION; }
01159 
01160     virtual BOOL IsALineLevelAttrib() {return TRUE;};
01161 
01162     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01163 
01164 private:
01165     void CopyNodeContents( AttrTxtJustification* NodeCopy );
01166 
01167 // Version 2 file format functions
01168 public:
01169     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01170     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01171 
01172 public:
01173     TxtJustificationAttribute Value;
01174 };
01175 
01176 
01177 /***********************************************************************************************
01178 
01179 >   class AttrTxtTracking : public AttrTxtBase
01180 
01181     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01182     Created:    07/03/95
01183     Purpose:    AttrTxtTracking specifies text tracking
01184 
01185 ***********************************************************************************************/
01186 
01187 class AttrTxtTracking : public AttrTxtBase
01188 {
01189     CC_DECLARE_DYNCREATE(AttrTxtTracking)
01190 
01191 public:
01192     // Constructors
01193     AttrTxtTracking(); 
01194     AttrTxtTracking(Node* ContextNode,  
01195                         AttachNodeDirection Direction,    
01196                         BOOL Locked=FALSE, 
01197                         BOOL Mangled=FALSE,  
01198                         BOOL Marked=FALSE, 
01199                         BOOL Selected=FALSE);
01200              
01201 
01202     void Render( RenderRegion* pRender );
01203 
01204     Node* SimpleCopy();                         // Copies a node
01205 
01206     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01207 
01208     virtual UINT32 GetAttrNameID(void); 
01209     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTTRACKING; }
01210 
01211     //void ShowDebugTreeDetails() const;            // Debugging function
01212 
01213     void GetDebugDetails(StringBase* Str);
01214 
01215     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01216 
01217     virtual AttributeValue* GetAttributeValue() { return &Value; }
01218 
01219     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01220 
01221 private:
01222     void CopyNodeContents( AttrTxtTracking* NodeCopy );
01223 
01224 // Version 2 file format functions
01225 public:
01226     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01227     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01228 
01229 public:
01230     TxtTrackingAttribute Value;
01231 };
01232 
01233 
01234 /***********************************************************************************************
01235 
01236 >   class AttrTxtFontSize : public AttrTxtBase
01237 
01238     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01239     Created:    07/03/95
01240     Purpose:    AttrTxtFontSize: specifies the size of a font (height)
01241 
01242 ***********************************************************************************************/
01243 
01244 class AttrTxtFontSize : public AttrTxtBase
01245 {
01246     CC_DECLARE_DYNCREATE(AttrTxtFontSize)
01247 
01248 public:
01249     // Constructors
01250     AttrTxtFontSize(); 
01251     AttrTxtFontSize(Node* ContextNode,  
01252                         AttachNodeDirection Direction,    
01253                         BOOL Locked=FALSE, 
01254                         BOOL Mangled=FALSE,  
01255                         BOOL Marked=FALSE, 
01256                         BOOL Selected=FALSE);
01257              
01258 
01259     void Render( RenderRegion* pRender );
01260 
01261     Node* SimpleCopy();                         // Copies a node
01262 
01263     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01264 
01265     virtual UINT32 GetAttrNameID(void); 
01266     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTFONTSIZE; }
01267 
01268     //void ShowDebugTreeDetails() const;            // Debugging function
01269 
01270     void GetDebugDetails(StringBase* Str);
01271 
01272     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01273 
01274     virtual AttributeValue* GetAttributeValue() { return &Value; }
01275 
01276     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01277 
01278     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01279 
01280 private:
01281     void CopyNodeContents( AttrTxtFontSize* NodeCopy );
01282 
01283 // Version 2 file format functions
01284 public:
01285     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01286     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01287 
01288 public:
01289     TxtFontSizeAttribute Value;
01290 };
01291 
01292 
01293 /***********************************************************************************************
01294 
01295 >   class AttrTxtScript : public AttrTxtBase
01296 
01297     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01298     Created:    07/03/95
01299     Purpose:    AttrTxtScript: Specifies sub/super script
01300 
01301 ***********************************************************************************************/
01302 
01303 class AttrTxtScript : public AttrTxtBase
01304 {
01305     CC_DECLARE_DYNCREATE(AttrTxtScript)
01306 
01307 public:
01308     // Constructors
01309     AttrTxtScript(); 
01310     AttrTxtScript(Node* ContextNode,  
01311                         AttachNodeDirection Direction,    
01312                         BOOL Locked=FALSE, 
01313                         BOOL Mangled=FALSE,  
01314                         BOOL Marked=FALSE, 
01315                         BOOL Selected=FALSE);
01316              
01317 
01318     void Render( RenderRegion* pRender );
01319 
01320     Node* SimpleCopy();                         // Copies a node
01321 
01322     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01323 
01324     virtual UINT32 GetAttrNameID(void); 
01325     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTSCRIPT; }
01326 
01327     //void ShowDebugTreeDetails() const;            // Debugging function
01328 
01329     void GetDebugDetails(StringBase* Str);
01330 
01331     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01332 
01333     virtual AttributeValue* GetAttributeValue() { return &Value; }
01334 
01335     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01336 
01337 private:
01338     void CopyNodeContents( AttrTxtScript* NodeCopy );
01339 
01340 // Version 2 file format functions
01341 public:
01342     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01343     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01344 
01345 public:
01346     TxtScriptAttribute Value;
01347 };
01348 
01349 
01350 /***********************************************************************************************
01351 
01352 >   class AttrTxtBaseLine : public AttrTxtBase
01353 
01354     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01355     Created:    07/03/95
01356     Purpose:    AttrTxtBaseLine: specifies an absolute offset from the base-line
01357 
01358 ***********************************************************************************************/
01359 
01360 class AttrTxtBaseLine : public AttrTxtBase
01361 {
01362     CC_DECLARE_DYNCREATE(AttrTxtBaseLine)
01363 
01364 public:
01365     // Constructors
01366     AttrTxtBaseLine(); 
01367     AttrTxtBaseLine(Node* ContextNode,  
01368                         AttachNodeDirection Direction,    
01369                         BOOL Locked=FALSE, 
01370                         BOOL Mangled=FALSE,  
01371                         BOOL Marked=FALSE, 
01372                         BOOL Selected=FALSE);
01373              
01374 
01375     void Render( RenderRegion* pRender );
01376 
01377     Node* SimpleCopy();                         // Copies a node
01378 
01379     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01380 
01381     virtual UINT32 GetAttrNameID(void); 
01382     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTBASELINE; }
01383 
01384     //void ShowDebugTreeDetails() const;            // Debugging function
01385 
01386     void GetDebugDetails(StringBase* Str);
01387 
01388     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01389 
01390     virtual AttributeValue* GetAttributeValue() { return &Value; }
01391 
01392     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01393 
01394     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01395 
01396 private:
01397     void CopyNodeContents( AttrTxtBaseLine* NodeCopy );
01398 
01399 // Version 2 file format functions
01400 public:
01401     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01402     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01403 
01404 public:
01405     TxtBaseLineAttribute Value;
01406 };
01407 
01408 /***********************************************************************************************
01409 
01410 >   class AttrTxtLeftMargin : public AttrTxtBase
01411 
01412     Author:     Martin Wuerthner <xara@mw-software.com>
01413     Created:    13/06/06
01414     Purpose:    AttrTxtLeftMargin: specifies the left margin
01415 
01416 ***********************************************************************************************/
01417 
01418 class AttrTxtLeftMargin : public AttrTxtBase
01419 {
01420     CC_DECLARE_DYNCREATE(AttrTxtLeftMargin)
01421 
01422 public:
01423     // Constructors
01424     AttrTxtLeftMargin() {}
01425     AttrTxtLeftMargin(Node* ContextNode,  
01426                         AttachNodeDirection Direction,    
01427                         BOOL Locked=FALSE, 
01428                         BOOL Mangled=FALSE,  
01429                         BOOL Marked=FALSE, 
01430                         BOOL Selected=FALSE);
01431 
01432     void Render( RenderRegion* pRender );
01433 
01434     Node* SimpleCopy();                         // Copies a node
01435 
01436     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01437 
01438     virtual UINT32 GetAttrNameID(void); 
01439     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTLEFTMARGIN; }
01440 
01441     void GetDebugDetails(StringBase* Str);
01442 
01443     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01444 
01445     virtual AttributeValue* GetAttributeValue() { return &Value; }
01446     virtual BOOL IsALineLevelAttrib() { return TRUE; }
01447 
01448     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01449 
01450     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01451 
01452 private:
01453     void CopyNodeContents( AttrTxtLeftMargin* NodeCopy );
01454 
01455 // Version 2 file format functions
01456 public:
01457     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01458     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01459 
01460 public:
01461     TxtLeftMarginAttribute Value;
01462 };
01463 
01464 /***********************************************************************************************
01465 
01466 >   class AttrTxtRightMargin : public AttrTxtBase
01467 
01468     Author:     Martin Wuerthner <xara@mw-software.com>
01469     Created:    13/06/06
01470     Purpose:    AttrTxtRightMargin: specifies the right margin
01471 
01472 ***********************************************************************************************/
01473 
01474 class AttrTxtRightMargin : public AttrTxtBase
01475 {
01476     CC_DECLARE_DYNCREATE(AttrTxtRightMargin)
01477 
01478 public:
01479     // Constructors
01480     AttrTxtRightMargin() {}
01481     AttrTxtRightMargin(Node* ContextNode,  
01482                         AttachNodeDirection Direction,    
01483                         BOOL Locked=FALSE, 
01484                         BOOL Mangled=FALSE,  
01485                         BOOL Marked=FALSE, 
01486                         BOOL Selected=FALSE);
01487 
01488     void Render( RenderRegion* pRender );
01489 
01490     Node* SimpleCopy();                         // Copies a node
01491 
01492     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01493 
01494     virtual UINT32 GetAttrNameID(void); 
01495     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTRIGHTMARGIN; }
01496 
01497     void GetDebugDetails(StringBase* Str);
01498 
01499     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01500 
01501     virtual AttributeValue* GetAttributeValue() { return &Value; }
01502     virtual BOOL IsALineLevelAttrib() { return TRUE; }
01503 
01504     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01505 
01506     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01507 
01508 private:
01509     void CopyNodeContents( AttrTxtRightMargin* NodeCopy );
01510 
01511 // Version 2 file format functions
01512 public:
01513     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01514     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01515 
01516 public:
01517     TxtRightMarginAttribute Value;
01518 };
01519 
01520 /***********************************************************************************************
01521 
01522 >   class AttrTxtFirstIndent : public AttrTxtBase
01523 
01524     Author:     Martin Wuerthner <xara@mw-software.com>
01525     Created:    13/06/06
01526     Purpose:    AttrTxtFirstIndent: specifies the first line indent
01527 
01528 ***********************************************************************************************/
01529 
01530 class AttrTxtFirstIndent : public AttrTxtBase
01531 {
01532     CC_DECLARE_DYNCREATE(AttrTxtFirstIndent)
01533 
01534 public:
01535     // Constructors
01536     AttrTxtFirstIndent() {}
01537     AttrTxtFirstIndent(Node* ContextNode,  
01538                         AttachNodeDirection Direction,    
01539                         BOOL Locked=FALSE, 
01540                         BOOL Mangled=FALSE,  
01541                         BOOL Marked=FALSE, 
01542                         BOOL Selected=FALSE);
01543 
01544     void Render( RenderRegion* pRender );
01545 
01546     Node* SimpleCopy();                         // Copies a node
01547 
01548     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01549 
01550     virtual UINT32 GetAttrNameID(void); 
01551     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTFIRSTINDENT; }
01552 
01553     void GetDebugDetails(StringBase* Str);
01554 
01555     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01556 
01557     virtual AttributeValue* GetAttributeValue() { return &Value; }
01558     virtual BOOL IsALineLevelAttrib() { return TRUE; }
01559 
01560     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01561 
01562     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01563 
01564 private:
01565     void CopyNodeContents( AttrTxtFirstIndent* NodeCopy );
01566 
01567 // Version 2 file format functions
01568 public:
01569     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01570     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01571 
01572 public:
01573     TxtFirstIndentAttribute Value;
01574 };
01575 
01576 /***********************************************************************************************
01577 
01578 >   class AttrTxtRuler : public AttrTxtBase
01579 
01580     Author:     Martin Wuerthner <xara@mw-software.com>
01581     Created:    13/06/06
01582     Purpose:    AttrTxtRuler: specifies the ruler
01583 
01584 ***********************************************************************************************/
01585 
01586 class AttrTxtRuler : public AttrTxtBase
01587 {
01588     CC_DECLARE_DYNCREATE(AttrTxtRuler)
01589 
01590 public:
01591     // Constructors
01592     AttrTxtRuler() {}
01593     AttrTxtRuler(Node* ContextNode,  
01594                         AttachNodeDirection Direction,    
01595                         BOOL Locked=FALSE, 
01596                         BOOL Mangled=FALSE,  
01597                         BOOL Marked=FALSE, 
01598                         BOOL Selected=FALSE);
01599 
01600     void Render( RenderRegion* pRender );
01601 
01602     Node* SimpleCopy();                         // Copies a node
01603 
01604     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01605 
01606     virtual UINT32 GetAttrNameID(void); 
01607     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTRULER; }
01608 
01609     void GetDebugDetails(StringBase* Str);
01610 
01611     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01612 
01613     virtual AttributeValue* GetAttributeValue() { return &Value; }
01614     virtual BOOL IsALineLevelAttrib() { return TRUE; }
01615 
01616     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01617 
01618     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01619 
01620 private:
01621     void CopyNodeContents( AttrTxtRuler* NodeCopy );
01622 
01623 // Version 2 file format functions
01624 public:
01625     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01626     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01627 
01628 public:
01629     TxtRulerAttribute Value;
01630 };
01631 
01632 
01633 /***********************************************************************************************
01634 
01635 >   class AttrTxtLineSpace : public AttrTxtBase
01636 
01637     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01638     Created:    07/03/95
01639     Purpose:    AttrTxtLineSpace: specifies the size of a font (height)
01640 
01641 ***********************************************************************************************/
01642 
01643 class AttrTxtLineSpace : public AttrTxtBase
01644 {
01645     CC_DECLARE_DYNCREATE(AttrTxtLineSpace)
01646 
01647 public:
01648     // Constructors
01649     AttrTxtLineSpace();
01650     AttrTxtLineSpace(MILLIPOINT Value);
01651     AttrTxtLineSpace(FIXED16 Ratio);
01652  
01653     AttrTxtLineSpace(Node* ContextNode,  
01654                         AttachNodeDirection Direction,    
01655                         BOOL Locked=FALSE, 
01656                         BOOL Mangled=FALSE,  
01657                         BOOL Marked=FALSE, 
01658                         BOOL Selected=FALSE);
01659              
01660 
01661     void Render( RenderRegion* pRender );
01662 
01663     Node* SimpleCopy();                         // Copies a node
01664 
01665     virtual INT32 operator==(const NodeAttribute& NodeAttrib); 
01666 
01667     virtual UINT32 GetAttrNameID(void); 
01668     virtual AttrIndex GetAttributeIndex () { return ATTR_TXTLINESPACE; }
01669 
01670     //void ShowDebugTreeDetails() const;            // Debugging function
01671 
01672     void GetDebugDetails(StringBase* Str);
01673 
01674     virtual UINT32 GetNodeSize() const;             // Returns size of node in bytes
01675 
01676     virtual AttributeValue* GetAttributeValue() { return &Value; }
01677 
01678     virtual BOOL IsALineLevelAttrib() {return TRUE;};
01679 
01680     BOOL IsARatio() { return Value.IsARatio(); }
01681 
01682     virtual void BaseLineRelativeTransform(FIXED16 Scale, FIXED16 Aspect);
01683 
01684     virtual void PolyCopyNodeContents(NodeRenderable* pNodeCopy);
01685 
01686 private:
01687     void CopyNodeContents( AttrTxtLineSpace* NodeCopy );
01688 
01689 // Version 2 file format functions
01690 public:
01691     virtual BOOL WritePreChildrenWeb(BaseCamelotFilter* pFilter);
01692     virtual BOOL WritePreChildrenNative(BaseCamelotFilter* pFilter);
01693 
01694 public:
01695     TxtLineSpaceAttribute Value;
01696 };
01697 
01698 /********************************************************************************************
01699 
01700 >   class CharDescription : public CCObject
01701 
01702     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01703     Created:    18/3/95
01704     Purpose:    The CharDescription structure is used to identify a character within the
01705                 FontCache.
01706     SeeAlso:    FontCache
01707 
01708 ********************************************************************************************/
01709 
01710 /********************************************************************************************
01711 
01712 >   WCHAR CharDescription::GetCharCode()
01713 
01714 
01715     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01716     Created:    20/3/95
01717     Inputs:     -
01718     Outputs:    -
01719     Returns:    UNICODE char code
01720     Purpose:    To extract the CharCode from a CharDescription
01721     Errors:     -
01722     SeeAlso:    -
01723 
01724 ********************************************************************************************/
01725 
01726 /********************************************************************************************
01727 
01728 >   WORD CharDescription:: GetTypefaceHandle()
01729 
01730 
01731     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01732     Created:    20/3/95
01733     Inputs:     -
01734     Outputs:    -
01735     Returns:    The typeface handle
01736     Purpose:    To extract the Typeface Handle from a CharDescription
01737     Errors:     -
01738     SeeAlso:    -
01739 
01740 ********************************************************************************************/
01741 
01742 
01743 /********************************************************************************************
01744 
01745 >   BOOL CharDescription:: GetBold()
01746 
01747 
01748     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01749     Created:    20/3/95
01750     Inputs:     -
01751     Outputs:    -
01752     Returns:    The bold state
01753     Purpose:    To extract the Bold state from a CharDescription
01754     Errors:     -
01755     SeeAlso:    -
01756 
01757 ********************************************************************************************/
01758 
01759 
01760 /********************************************************************************************
01761 
01762 >   BOOL CharDescription:: GetItalic()
01763 
01764 
01765     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
01766     Created:    20/3/95
01767     Inputs:     -
01768     Outputs:    -
01769     Returns:    The italic state
01770     Purpose:    To extract the italic state from a CharDescription
01771     Errors:     -
01772     SeeAlso:    -
01773 
01774 ********************************************************************************************/
01775 
01776 class CharDescription:public CCObject
01777 {
01778     CC_DECLARE_DYNCREATE(CharDescription)
01779 
01780     // Needs sorting out
01781     CharDescription() {};
01782     CharDescription(CharDescription& that);
01783     CharDescription(WCHAR CharCode, WORD TypefaceHandle, BOOL Bold, BOOL Italic);
01784 
01785     WCHAR GetCharCode()       { return (WCHAR)(charHandle >> 16); }
01786     WORD GetTypefaceHandle()  { return (WORD)(charHandle & 0x00003FFF); }
01787     BOOL GetBold()            { return ((charHandle & 0x00008000) != 0); }
01788     BOOL GetItalic()          { return ((charHandle & 0x00004000) != 0); }
01789 
01790 public:
01791     UINT32 charHandle;    // The char handle used in GCache 
01792 
01793     CharDescription& operator=(CharDescription& that) { this->charHandle =that.charHandle; return *this; }
01794     BOOL operator==(CharDescription& that) const { return this->charHandle==that.charHandle; }
01795     BOOL operator!=(CharDescription& that) const { return this->charHandle!=that.charHandle; }
01796 };
01797 
01798 #endif

Generated on Sat Nov 10 03:47:16 2007 for Camelot by  doxygen 1.4.4