1 // DormantNodeIO.h 2 // * PURPOSE 3 // Manage the import and export of a user-instantiated 4 // media node descriptor. 5 // 6 // * HISTORY 7 // e.moon 8dec99 Begun 8 9 #ifndef __DormantNodeIO_H__ 10 #define __DormantNodeIO_H__ 11 12 #include "NodeRef.h" 13 #include "XML.h" 14 15 #include <String.h> 16 #include <Entry.h> 17 18 class dormant_node_info; 19 20 #include "cortex_defs.h" 21 __BEGIN_CORTEX_NAMESPACE 22 23 class NodeManager; 24 25 class DormantNodeIO : 26 public IPersistent { 27 28 public: // *** ctor/dtor 29 virtual ~DormantNodeIO(); 30 31 DormantNodeIO(); 32 DormantNodeIO( 33 NodeRef* ref, 34 const char* nodeKey); 35 36 bool exportValid() const { return m_exportValid; } 37 38 const char* nodeKey() const { return m_nodeKey.String(); } 39 40 public: // *** operations 41 42 // call when object imported to create the described node 43 status_t instantiate( 44 NodeManager* manager, 45 NodeRef** outRef); 46 47 public: // *** document-type setup 48 static void AddTo( 49 XML::DocumentType* docType); 50 51 public: // *** IPersistent 52 53 // EXPORT: 54 55 void xmlExportBegin( 56 ExportContext& context) const; 57 58 void xmlExportAttributes( 59 ExportContext& context) const; 60 61 void xmlExportContent( 62 ExportContext& context) const; 63 64 void xmlExportEnd( 65 ExportContext& context) const; 66 67 // IMPORT: 68 69 virtual void xmlImportBegin( 70 ImportContext& context); 71 72 virtual void xmlImportAttribute( 73 const char* key, 74 const char* value, 75 ImportContext& context); 76 77 virtual void xmlImportContent( 78 const char* data, 79 uint32 length, 80 ImportContext& context); 81 82 virtual void xmlImportChild( 83 IPersistent* child, 84 ImportContext& context); 85 86 virtual void xmlImportComplete( 87 ImportContext& context); 88 89 private: // *** implementation 90 // imported data 91 BString m_nodeKey; 92 93 BString m_dormantName; 94 int64 m_kinds; 95 int32 m_flavorID; 96 97 int32 m_flags; 98 int32 m_runMode; 99 bigtime_t m_recordingDelay; 100 bool m_cycle; 101 102 BEntry m_entry; 103 104 bool m_exportValid; 105 106 status_t _matchDormantNode( 107 dormant_node_info* outInfo); 108 }; 109 110 __END_CORTEX_NAMESPACE 111 #endif /*__DormantNodeIO_H__*/