text_options.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 #if !defined TEXT_OPTIONS_HEADER
00020 #define TEXT_OPTIONS_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/file.h"
00028 #include "whiptk/drawable.h"
00029 
00037 // ====================================================================================
00039 
00041 class WHIPTK_API WT_Text_Option_Scoring : public WT_Option
00042 {
00043 public:
00044     typedef std::vector< WT_Unsigned_Integer16 > tPositionVector;
00045 
00046 private:
00047     WT_Unsigned_Integer16     m_count;
00048     WT_Unsigned_Integer16 *   m_positions;
00049 
00050     int                       m_materialization_counter;
00051 
00052     enum
00053     {
00054         Starting = 1001,
00055         Getting_Count = 1002,
00056         Getting_Positions = 1003,
00057         Eating_Pre_Open_Paren_Whitespace = 1004,
00058         Getting_Open_Paren = 1005,
00059         Getting_Close_Parens = 1006
00060     } ;
00061 
00062 protected:
00063 
00065 
00066     WT_Text_Option_Scoring()
00067         : m_count(0)
00068         , m_positions(WD_Null)
00069     {
00070         m_stage = WT_Text_Option_Scoring::Starting;
00071     }
00073     WT_Text_Option_Scoring(WT_Text_Option_Scoring const & scoring) throw(WT_Result);
00075     virtual ~WT_Text_Option_Scoring();
00076 
00078 public:
00080 
00081     WT_Unsigned_Integer16           count() const                                 {   return m_count;     }
00083     virtual      char const *       opcode() const = 0;
00085     WT_Unsigned_Integer16 const *   positions() const                             {   return m_positions; }
00087     WT_Result  set(
00088         WT_Unsigned_Integer16 count, 
00089         WT_Unsigned_Integer16 const * pos 
00090         );
00092     WT_Result  set(
00093         const tPositionVector& rVector 
00094         );
00096     WT_Text_Option_Scoring const &  operator= (WT_Text_Option_Scoring const & scoring) throw(WT_Result);
00098 
00100     WT_Result        serialize  (WT_Object const & parent, WT_File & file) const;
00101     WT_Result        materialize(WT_Object       & parent, WT_Optioncode const & optioncode, WT_File & file);
00103 
00104 };
00105 
00106 
00107 // ====================================================================================
00109 
00111 class WHIPTK_API WT_Text_Option_Overscore : public WT_Text_Option_Scoring
00112 {
00113 public:
00115     WT_ID   object_id() const;
00117     virtual char const * opcode() const     {   return "(Overscore";    }
00118 };
00119 
00121 
00123 class WHIPTK_API WT_Text_Option_Underscore : public WT_Text_Option_Scoring
00124 {
00125 public:
00127     WT_ID   object_id() const;
00129     virtual char const * opcode() const     {   return "(Underscore";    }
00130 };
00131 
00132 
00133 // ====================================================================================
00135 
00140 class WHIPTK_API WT_Text_Option_Bounds : public WT_Option
00141 {
00142         friend class WT_W2D_Class_Factory;
00143         friend class WT_Text;
00144 private:
00145     WT_Logical_Point *       m_bounds;
00146     int                      m_materialization_counter;
00147 
00148     enum
00149     {
00150         Getting_Bounds = 1001
00151     };
00152 
00153 protected:
00154 
00156 
00157     WT_Text_Option_Bounds()
00158         : m_bounds (WD_Null)
00159     { }
00161     WT_Text_Option_Bounds(
00162         WT_Logical_Point const * pos  
00163         ) throw(WT_Result)
00164         { 
00165                 WT_Result res = set(pos);
00166                 if(res != WT_Result::Success)
00167                         throw res;
00168         }
00170     WT_Text_Option_Bounds(WT_Text_Option_Bounds const & bounds) throw(WT_Result);
00172     virtual ~WT_Text_Option_Bounds();
00173 
00175 public:
00177 
00178     WT_Logical_Point const *    bounds() const              {   return m_bounds;   }
00180     virtual void                        de_relativize(WT_File & file);
00182     virtual void                        relativize(WT_File & file);
00184     virtual void                        transform(WT_Transform const & transform);
00186     WT_Result                   set(WT_Logical_Point const * bounds);
00188     WT_Text_Option_Bounds const &   operator=(WT_Text_Option_Bounds const & bounds) throw(WT_Result);
00190 
00192     WT_ID            object_id() const;
00193     WT_Result        serialize  (WT_Object const & parent, WT_File & file) const;
00194     WT_Result        materialize(WT_Object       & parent, WT_Optioncode const & optioncode, WT_File & file);
00196 };
00197 
00198 
00199 // ====================================================================================
00200 
00202 
00204 class WHIPTK_API WT_Text_Option_Reserved : public WT_Option
00205 {
00206         friend class WT_W2D_Class_Factory;
00207         friend class WT_Text;
00208 
00209 private:
00210     WT_Unsigned_Integer16     m_count;
00211     WT_Unsigned_Integer16 *   m_values;
00212     int                       m_materialization_counter;
00213 
00214     enum
00215     {
00216         Starting = 1001,
00217         Getting_Count = 1002,
00218         Getting_Values = 1003,
00219         Eating_Pre_Open_Paren_Whitespace = 1004,
00220         Getting_Open_Paren = 1005,
00221         Getting_Close_Parens = 1006
00222     } ;
00223 
00224 protected:
00225 
00227 
00228     WT_Text_Option_Reserved()
00229         : m_count(0)
00230         , m_values(WD_Null)
00231     {
00232         m_stage = WT_Text_Option_Reserved::Starting;
00233     }
00235     WT_Text_Option_Reserved(WT_Text_Option_Reserved const & reserved) throw(WT_Result);
00237     virtual ~WT_Text_Option_Reserved();
00238 
00240 public:
00242     WT_Unsigned_Integer16           count() const                                 {   return m_count;     }
00243     WT_Unsigned_Integer16 const *   values() const                                {   return m_values; }
00244     WT_Result                       set(WT_Unsigned_Integer16 count, WT_Unsigned_Integer16 const * values);
00245     WT_Text_Option_Reserved const &  operator= (WT_Text_Option_Reserved const & reserved) throw(WT_Result);
00247 
00249     WT_ID            object_id() const;
00250     WT_Result        serialize  (WT_Object const & parent, WT_File & file) const;
00251     WT_Result        materialize(WT_Object       & parent, WT_Optioncode const & optioncode, WT_File & file);
00253 
00254 };
00255 
00256 // ====================================================================================
00257 
00259 class WHIPTK_API WT_Text_Optioncode : public WT_Optioncode
00260 {
00261 public:
00263     enum
00264     {
00265         Unknown_Option  = 0,
00266         Overscore_Option,
00267         Underscore_Option,
00268         Bounds_Option,
00269         Reserved_Option
00270     };
00271 
00273     virtual int option_id_from_optioncode();
00274 };
00275 
00276 
00278 
00279 #endif // TEXT_OPTIONS_HEADER

Generated on Tue Jan 6 22:41:13 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5