url_list.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 URL_LIST_HEADER
00020 #define URL_LIST_HEADER
00021 
00025 
00026 #include "whiptk/whipcore.h"
00027 #include "whiptk/attribute.h"
00028 
00030 
00031 class WHIPTK_API WT_URL_Item : public WT_Item
00032 {
00033     friend class WT_URL;
00034     friend class WT_URL_List;
00035     friend class WT_Attribute_URL;
00036 private:
00037     WT_String m_address;
00038     WT_String m_friendly_name;
00039     WT_Boolean m_emitted;
00040     WT_Integer32 m_index;
00041     void set_emitted_status(WT_Boolean status) { m_emitted = status; }
00042     void _deleteObject(void *object)
00043     {
00044         delete (WT_URL_Item*)object;
00045     }
00046 
00047 public:
00048 
00050 
00051     WT_URL_Item()
00052         : m_index(0)
00053     {};
00055     WT_URL_Item(
00056         WT_Integer32 index, 
00057         WT_Unsigned_Integer16 const * address, 
00058         WT_Unsigned_Integer16 const * friendly_name 
00059         )
00060     {
00061         set(index, address, friendly_name);
00062     }
00064     WT_URL_Item(
00065         WT_Integer32 index, 
00066         char const *address, 
00067         char const *friendly_name 
00068         )
00069     {
00070         set(index, address, friendly_name);
00071     }
00072 
00074     WT_URL_Item(
00075         WT_Integer32 index, 
00076         WT_String & address, 
00077         WT_String & friendly_name 
00078         );
00079 
00081     WT_URL_Item(
00082         WT_Unsigned_Integer16 const *address, 
00083         WT_Unsigned_Integer16 const *friendly_name 
00084         )
00085     {
00086         set(WD_URL_Optimize, address, friendly_name);
00087     }
00088 
00090     WT_URL_Item(
00091         char const *address, 
00092         char const *friendly_name 
00093         )
00094     {
00095         set(WD_URL_Optimize, address, friendly_name);
00096     }
00097 
00099     WT_URL_Item(
00100         WT_String & address, 
00101         WT_String & friendly_name 
00102         )
00103     {
00104         m_address.set(address);
00105         m_friendly_name.set(friendly_name);
00106         m_emitted = WD_False;
00107     }
00108 
00110     virtual ~WT_URL_Item() {}
00112 public:
00114     void set(
00115         WT_Integer32 index, 
00116         WT_Unsigned_Integer16 const * address, 
00117         WT_Unsigned_Integer16 const * friendly_name 
00118         );
00120     void set(
00121         WT_Integer32 index, 
00122         char const *address, 
00123         char const *friendly_name 
00124         );
00125 
00127     WT_String    &    address()        { return m_address; }
00129     WT_String    &    friendly_name()  { return m_friendly_name; }
00131     WT_Integer32 &    index()          { return m_index; }
00133     WT_Boolean get_emitted_status()    { return m_emitted; }
00134 };
00135 
00136 
00138 class WHIPTK_API WT_URL_List : public WT_Item_List, public WT_Object
00139 {
00140         friend class WT_URL;
00141         friend class WT_Attribute_URL;
00142         friend class WT_Rendition;
00143         friend class WT_W2D_Class_Factory;
00144 
00145 public:
00147     WT_URL_List()
00148     { }
00149 
00151     WT_URL_List(WT_URL_List const & list);
00152 
00154     virtual ~WT_URL_List();
00155 
00156 public:
00158     void add(WT_URL_Item &item);
00160 
00163     WT_Boolean check_whether_emitted(WT_Integer32 index) const;
00165     WT_Integer32  index_from_url_item(WT_URL_Item & item_in);
00167     WT_URL_Item * url_item_from_index(WT_Integer32 index);
00169 
00172     void set_as_being_emitted(WT_Integer32 index);
00173 
00174     // WT_Object virtual methods
00175     WT_Result    materialize(WT_Opcode const & opcode, WT_File & file);
00176     WT_ID        object_id() const;
00177     WT_Type      object_type() const;
00178     WT_Result    process(WT_File & file);
00179     virtual WT_Result    serialize (WT_File & file) const;
00180     WT_Result    skip_operand(WT_Opcode const & opcode, WT_File & file);
00181 
00183     WT_URL_List const & operator=(WT_URL_List const & url);
00185     WT_Boolean       operator== (WT_URL_List const & list) const;
00186 };
00187 
00188 #endif // URL_LIST_HEADER

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