text_background.h

Go to the documentation of this file.
00001 //  Copyright (c) 1996-2006 by Autodesk, Inc.
00002 //
00003 //  By using this code, you are agreeing to the terms and conditions of
00004 //  the License Agreement included in the documentation for this code.
00005 //
00006 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00007 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00008 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00009 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00010 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00011 //
00012 //  Use, duplication, or disclosure by the U.S. Government is subject to
00013 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00014 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00015 //  Data and Computer Software), as applicable.
00016 //
00017 
00018 #if !defined TEXT_BACKGROUND_HEADER
00019 #define TEXT_BACKGROUND_HEADER
00020 
00024 
00025 #include "whiptk/whipcore.h"
00026 #include "whiptk/attribute.h"
00027 
00028 // Attribute class for specifying text background
00029 class WHIPTK_API WT_Text_Background : public WT_Attribute
00030 {
00031         friend class WT_Rendition;
00032         friend class WT_W2D_Class_Factory;
00033         friend class WT_Opcode;
00034 
00035 public:
00036     enum eBackground
00037     {
00038         None    = 0,   // no text background
00039         Ghosted = 1,   // ghosted text background
00040         Solid   = 2    // solid text background
00041     };
00042 
00043 public:
00044     // constructs a WT_Text_Background object
00045     WT_Text_Background();
00046 
00047     // constructs a WT_Text_Background object with the given background style and color
00048     WT_Text_Background(WT_Text_Background::eBackground background, 
00049                        WT_Integer32 offset);
00050 
00051         //Copy Constructor
00052         WT_Text_Background(WT_Text_Background const& backgrnd)
00053         {
00054                 *this = backgrnd;
00055         }
00056 
00057     // destructor
00058     virtual ~WT_Text_Background();
00059 
00060 public:
00061     // returns the background style
00062     inline const eBackground& background() const { return m_eBackground; }
00063     inline eBackground&       background()       { return m_eBackground; };
00064 
00065     // returns the offset
00066     inline const WT_Integer32& offset() const { return m_offset; }
00067     inline WT_Integer32&       offset()       { return m_offset; }
00068 
00069     // WT_Attribute virtual methods
00070     WT_Boolean operator==(WT_Attribute const & attrib) const;
00071 
00072     // WT_Object virtual methods
00073     WT_Result      materialize(WT_Opcode const & opcode, WT_File & file);
00074     WT_ID          object_id() const;
00075     WT_Result      process(WT_File & file);
00076     WT_Result      serialize(WT_File & file) const;
00077     WT_Result      skip_operand(WT_Opcode const & opcode, WT_File & file);
00078     WT_Result      sync(WT_File & file) const;
00079     // provide a default action handler for this object
00080     static WT_Result default_process(
00081         WT_Text_Background & item, // The object to process.
00082         WT_File & file             // The file being read.
00083         );
00084 protected:
00085     // static methods 
00086     static const char*     enum_to_string(eBackground background);
00087     static WT_Boolean      string_to_enum(const char* pStr, eBackground& outBackground);
00088 
00089 private:
00090     // Data members 
00091     eBackground m_eBackground;
00092     WT_Integer32 m_offset;
00093 
00094 private:
00095     static const char* str_Background_None;
00096     static const char* str_Background_Ghosted;
00097     static const char* str_Background_Solid;
00098 };
00099 
00100 
00101 #endif //TEXT_BACKGROUND_HEADER
00102 //endif

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