XamlAttribute.h

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 #if !defined XAML_ATTRIBUTE
00019 #define XAML_ATTRIBUTE
00020 
00021 
00022 #include "whiptk/whip_toolkit.h"
00023 #include "whiptk/typedefs_defines.h"
00024 #include "dwfcore/DWFXMLSerializer.h"
00025 #include "dwfcore/Owner.h"
00026 
00027 class WT_XAML_File;
00028 
00029 template<class TC>
00030 class XamlAttribute
00031 {
00032 public:
00033     XamlAttribute<TC>(void)
00034     : _bAbbreviatedMode(true)
00035     {
00036     }
00037     
00038     virtual ~XamlAttribute<TC>(void) {}
00039 
00040     // copy constructor
00041         XamlAttribute<TC>( const TC& r ) {}
00042     
00043     // assignment operator
00044     virtual TC& operator=( const TC& ) = 0;
00045     
00046     // serialize as an XML attribute
00047     virtual WT_Result serializeAttribute( WT_XAML_File &, DWFCore::DWFXMLSerializer * ) const = 0;
00048 
00049     // serialize as an XML element (verbose)
00050     virtual WT_Result serializeElement( WT_XAML_File &, DWFCore::DWFXMLSerializer * ) const = 0;
00051     
00052     // returnes whether it's okay to serialize as an XML attribute ( assume it's always valid verbose )
00053     virtual bool validAsAttribute( void ) const = 0;    
00054     
00055 private:
00056     bool _bAbbreviatedMode;
00057 };
00058 
00059 #endif //XAML_ATTRIBUTE
00060 

Generated on Tue Jan 6 22:40:05 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5