home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / INTERNET / WWW / LYNX / SOURCE / SRC0_8A.ZIP / DOSLYNX / INC / TEXTATTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-17  |  2.3 KB  |  83 lines

  1. #ifndef __TEXTATTRIBUTE_H
  2. //    Avoid include redundancy
  3. #define __TEXTATTRIBUTE_H
  4.  
  5. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  6. //
  7. //    Include File:    textattr.h
  8. //    Purpose:    Class implementation of a WWW style of attributes
  9. //            possible on a stream of data.
  10. //    Remarks/Portability/Dependencies/Restrictions:
  11. //        Revised the paragraph to hold an index variable if included
  12. //        in a list to help with a problem when used in a TNSCollection.
  13. //        For some reason, it is a fatal error in doslynx.
  14. //    Revision History:
  15. //        02-01-94    created
  16.  
  17. //    Constant defines
  18.  
  19. //    Required includes
  20. extern "C"    {
  21. #include"htanchor.h"
  22. };
  23. #include "tform.h"
  24.  
  25. //    Class declarations
  26. class TextAttribute    {
  27. public:
  28.     //    The different type of attributes possible.
  29.     enum AttributeType    {
  30.         anchor        =    0x1,
  31.         form        =    0x2
  32.     };
  33.  
  34.     //    A pointer to the attribute structure or other useful
  35.     //    information for a text attribute.
  36.     union    {
  37.         const HTChildAnchor *HTCAp_anchor;
  38.         const TForm *TFp_form;
  39.     };
  40.  
  41.     //    Constructors.
  42.     //    for child anchor.
  43.     TextAttribute(const HTChildAnchor *HTCAp, const signed long int
  44.         sli_Offset = 0L, const signed long int sli_OffsetPlusExtent
  45.         = 0L);
  46.     //    for forms.
  47.     TextAttribute(const TForm *TFp, const signed long int sli_Offset = 0L,
  48.         const signed long int sli_OffsetPlusExent = 0L);
  49.  
  50.     //    Destructor.
  51.     ~TextAttribute();
  52.  
  53.     //    Set the offset.
  54.     void Begin(const signed long int sli_Offset);
  55.     //    End the offset.
  56.     void End(const signed long int sli_OffsetPlusExtent);
  57.     //    Return the beginning offset.
  58.     signed long int getBegin() const;
  59.     //    Return the ending offset.
  60.     signed long int getEnd() const;
  61.     //    Return the type of attribute
  62.     AttributeType getType() const;
  63.     //    Return the extent of an attribute
  64.     signed long int getExtent() const;
  65.     //    Return whether or not a stream offset is in the range of
  66.     //    an attribute.
  67.     unsigned char inRange(const signed long int sli_Offset)
  68.         const;
  69. private:
  70.     //    The specific type of attribute that this is.
  71.     AttributeType AT_StreamType;
  72.     //    The offset of where the attribute begins in a stream.
  73.     signed long int sli_StreamOffset;
  74.     //    The offset of where the attribute once ends.
  75.     signed long int sli_StreamExtent;
  76. };
  77.  
  78. //    Global variable declarations
  79.  
  80. //    Macros
  81.  
  82. #endif // __TEXTATTRIBUTE_H
  83.