Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

url_list.h

00001 //  Copyright (c) 1996-2001 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 URL_LIST_HEADER
00019 #define URL_LIST_HEADER
00020 
00021 #include "whiptk/whipcore.h"
00022 #include "whiptk/attribute.h"
00023 
00025 
00026 class WHIPTK_API WT_URL_Item : public WT_Item
00027 {
00028     friend class WT_URL;
00029     friend class WT_URL_List;
00030 private:
00031     WT_String m_address;
00032     WT_String m_friendly_name;
00033     WT_Boolean m_emitted;
00034     WT_Integer32 m_index;
00035     void set_emitted_status(WT_Boolean status) { m_emitted = status; }
00036     void _deleteObject(void *object)
00037     {
00038         delete (WT_URL_Item*)object;
00039     }
00040 
00041 public:
00042 
00044 
00045     WT_URL_Item()
00046         : m_index(0)
00047     {};
00049     WT_URL_Item(
00050         WT_Integer32 index, 
00051         WT_Unsigned_Integer16 const * address, 
00052         WT_Unsigned_Integer16 const * friendly_name 
00053         )
00054     {
00055         set(index, address, friendly_name);
00056     }
00058     WT_URL_Item(
00059         WT_Integer32 index, 
00060         char const *address, 
00061         char const *friendly_name 
00062         )
00063     {
00064         set(index, address, friendly_name);
00065     }
00066 
00068     WT_URL_Item(
00069         WT_Integer32 index, 
00070         WT_String & address, 
00071         WT_String & friendly_name 
00072         );
00073 
00075     WT_URL_Item(
00076         WT_Unsigned_Integer16 const *address, 
00077         WT_Unsigned_Integer16 const *friendly_name 
00078         )
00079     {
00080         set(WD_URL_Optimize, address, friendly_name);
00081     }
00082 
00084     WT_URL_Item(
00085         char const *address, 
00086         char const *friendly_name 
00087         )
00088     {
00089         set(WD_URL_Optimize, address, friendly_name);
00090     }
00091 
00093     WT_URL_Item(
00094         WT_String & address, 
00095         WT_String & friendly_name 
00096         )
00097     {
00098         m_address.set(address);
00099         m_friendly_name.set(friendly_name);
00100         m_emitted = WD_False;
00101     }
00102 
00104     virtual ~WT_URL_Item() {}
00106 
00108     void set(
00109         WT_Integer32 index, 
00110         WT_Unsigned_Integer16 const * address, 
00111         WT_Unsigned_Integer16 const * friendly_name 
00112         );
00114     void set(
00115         WT_Integer32 index, 
00116         char const *address, 
00117         char const *friendly_name 
00118         );
00119 
00121     WT_String    &    address()        { return m_address; }
00123     WT_String    &    friendly_name()  { return m_friendly_name; }
00125     WT_Integer32 &    index()          { return m_index; }
00127     WT_Boolean get_emitted_status()    { return m_emitted; }
00128 };
00129 
00130 
00132 class WHIPTK_API WT_URL_List : public WT_Item_List, WT_Object
00133 {
00134 public:
00136     WT_URL_List()
00137     { }
00138 
00140     WT_URL_List(WT_URL_List const & list);
00141 
00143     ~WT_URL_List();
00144 
00146     void add(WT_URL_Item &item);
00148 
00151     WT_Boolean check_whether_emitted(WT_Integer32 index) const;
00153     WT_Integer32  index_from_url_item(WT_URL_Item & item_in);
00155     WT_URL_Item * url_item_from_index(WT_Integer32 index);
00157 
00160     void set_as_being_emitted(WT_Integer32 index);
00161 
00162     // WT_Object virtual methods
00163     WT_Result    materialize(WT_Opcode const & opcode, WT_File & file);
00164     WT_ID        object_id() const;
00165     WT_Type      object_type() const;
00166     WT_Result    process(WT_File & file);
00167     WT_Result    serialize (WT_File & file) const;
00168     WT_Result    skip_operand(WT_Opcode const & opcode, WT_File & file);
00169 
00171     WT_URL_List const & operator=(WT_URL_List const & url);
00173     WT_Boolean       operator== (WT_URL_List const & list) const;
00174 };
00175 
00176 #endif // URL_LIST_HEADER

Generated on Tue May 17 12:07:44 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1