btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / cortex / RouteApp / ConnectionIO.h
blob3c2e1e9a87dbf397e2778fe7ef37fd05be28f3ac
1 /*
2 * Copyright (c) 1999-2000, Eric Moon.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 // ConnectionIO.h
33 // * PURPOSE
34 // Manage the import and export of a user-instantiated
35 // media node description.
37 // * HISTORY
38 // e.moon 8dec99 Begun
40 #ifndef __ConnectionIO_H__
41 #define __ConnectionIO_H__
43 #include "NodeRef.h"
44 #include "Connection.h"
45 #include "XML.h"
47 #include <String.h>
48 #include <Entry.h>
50 #include <MediaDefs.h>
52 class dormant_node_info;
54 #include "cortex_defs.h"
55 __BEGIN_CORTEX_NAMESPACE
57 class NodeManager;
58 class NodeSetIOContext;
59 class LiveNodeIO;
61 class ConnectionIO :
62 public IPersistent {
64 public: // *** ctor/dtor
65 virtual ~ConnectionIO();
67 ConnectionIO();
69 ConnectionIO(
70 const Connection* con,
71 const NodeManager* manager,
72 const NodeSetIOContext* context);
74 bool exportValid() const { return m_exportValid; }
76 public: // *** operations
78 // call when object imported to create the described
79 // connection
80 status_t instantiate(
81 NodeManager* manager,
82 const NodeSetIOContext* context,
83 Connection* outCon);
85 public: // *** document-type setup
86 static void AddTo(
87 XML::DocumentType* docType);
89 public: // *** IPersistent
91 // EXPORT:
93 void xmlExportBegin(
94 ExportContext& context) const;
96 void xmlExportAttributes(
97 ExportContext& context) const;
99 void xmlExportContent(
100 ExportContext& context) const;
102 void xmlExportEnd(
103 ExportContext& context) const;
105 // IMPORT:
107 virtual void xmlImportBegin(
108 ImportContext& context);
110 virtual void xmlImportAttribute(
111 const char* key,
112 const char* value,
113 ImportContext& context);
115 virtual void xmlImportContent(
116 const char* data,
117 uint32 length,
118 ImportContext& context);
120 virtual void xmlImportChild(
121 IPersistent* child,
122 ImportContext& context);
124 virtual void xmlImportComplete(
125 ImportContext& context);
128 virtual void xmlImportChildBegin(
129 const char* name,
130 ImportContext& context);
132 virtual void xmlImportChildComplete(
133 const char* name,
134 ImportContext& context);
136 private: // *** implementation
138 LiveNodeIO* m_inputNodeIO;
140 BString m_outputName; // original name if available
141 media_format m_outputFormat;
143 LiveNodeIO* m_outputNodeIO;
145 BString m_inputName; // original name if available
146 media_format m_inputFormat;
148 media_format m_requestedFormat;
150 uint32 m_flags;
152 bool m_exportValid;
154 // import state
155 enum import_state_t {
156 IMPORT_NONE,
157 IMPORT_OUTPUT,
158 IMPORT_INPUT
160 import_state_t m_importState;
163 __END_CORTEX_NAMESPACE
164 #endif /*__ConnectionIO_H__*/