text_valign.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_VALIGN_HEADER
00020 #define TEXT_VALIGN_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00029 // Attribute class for specifying text vertical alignment
00030 class WHIPTK_API WT_Text_VAlign : public WT_Attribute
00031 {
00032         friend class WT_Rendition;
00033         friend class WT_W2D_Class_Factory;
00034         friend class WT_Opcode;
00035 
00036 public:
00037     enum WT_VAlign
00038     {
00039         Descentline = 0,   // descentline aligned with insertion point
00040         Baseline    = 1,   // baseline aligned with insertion point
00041         Halfline    = 2,   // halfline aligned with insertion point
00042         Capline     = 3,   // capline aligned with insertion point
00043         Ascentline  = 4    // ascentline aligned with insertion point
00044     };
00045 
00046 public:
00047     // constructs a WT_Text_VAlign object
00048     WT_Text_VAlign();
00049 
00050     // constructs a WT_Text_VAlign object with the given alignment
00051     WT_Text_VAlign(WT_VAlign vAlign);
00052 
00054         WT_Text_VAlign(WT_Text_VAlign const& vAlign)
00055         {
00056                 *this = vAlign;
00057         }
00058 
00059     // destructor
00060     virtual ~WT_Text_VAlign();
00061 
00062 public:
00063     // returns the vertical alignment
00064     inline const WT_VAlign& vAlign() const { return m_eAlignment; }
00065     inline WT_VAlign&       vAlign() { return m_eAlignment; }
00066     inline WT_Text_VAlign const& operator=( WT_VAlign& eAlign ) { m_eAlignment = eAlign; return *this; }
00067 
00068     // WT_Attribute virtual methods
00069     WT_Boolean operator==(WT_Attribute const & attrib) const;
00070 
00071     // WT_Object virtual methods
00072     WT_Result      materialize(WT_Opcode const & opcode, WT_File & file);
00073     WT_ID          object_id() const;
00074     WT_Result      process(WT_File & file);
00075     WT_Result      serialize(WT_File & file) const;
00076     WT_Result      skip_operand(WT_Opcode const & opcode, WT_File & file);
00077     WT_Result      sync(WT_File &) const;
00078     // provide a default action handler for this object
00079     static WT_Result default_process(
00080         WT_Text_VAlign & item, // The object to process.
00081         WT_File & file         // The file being read.
00082         );
00083 
00084 protected:
00085     // static methods
00086     static const char*     enum_to_string(WT_VAlign eVAlign);
00087     static WT_Boolean      string_to_enum(const char* pStr, WT_VAlign& outEnum);
00088 
00089 private:
00090     // data members
00091     WT_VAlign m_eAlignment;
00092 
00093 private:
00094     // const char strings
00095     static const char* str_VAlign_Descentline;
00096     static const char* str_VAlign_Baseline;
00097     static const char* str_VAlign_Halfline;
00098     static const char* str_VAlign_Capline;
00099     static const char* str_VAlign_Ascentline;
00100 };
00101 
00102 
00103 #endif //TEXT_VALIGN_HEADER
00104 // endif

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