2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
36 // Application class for route/1.
39 // 14may99 e.moon Created from 'routeApp.cpp'
41 #ifndef __ROUTEAPP_H__
42 #define __ROUTEAPP_H__
44 #include <Application.h>
45 #include <FilePanel.h>
50 #include "IStateArchivable.h"
52 #include "cortex_defs.h"
53 __BEGIN_CORTEX_NAMESPACE
56 class RouteAppNodeManager
;
61 public IStateArchivable
{
63 typedef BApplication _inherited
;
66 RouteAppNodeManager
* const manager
;
67 RouteWindow
* const routeWindow
;
69 static BMimeType s_nodeSetType
;
74 M_SHOW_OPEN_PANEL
=RouteApp_message_base
,
84 public: // *** BHandler
85 virtual void MessageReceived(
88 public: // *** BApplication
89 virtual void RefsReceived(
92 public: // *** IPersistent
97 ExportContext
& context
) const;
99 void xmlExportAttributes(
100 ExportContext
& context
) const;
102 void xmlExportContent(
103 ExportContext
& context
) const;
106 ExportContext
& context
) const;
111 ImportContext
& context
);
113 void xmlImportAttribute(
116 ImportContext
& context
);
118 void xmlImportContent(
121 ImportContext
& context
);
125 ImportContext
& context
);
127 void xmlImportComplete(
128 ImportContext
& context
);
130 void xmlImportChildBegin(
132 ImportContext
& context
);
134 void xmlImportChildComplete(
136 ImportContext
& context
);
138 public: // *** IStateArchivable
140 status_t
importState(
141 const BMessage
* archive
);
143 status_t
exportState(
144 BMessage
* archive
) const;
147 static const char* const s_appSignature
;
149 XML::DocumentType
* m_settingsDocType
;
150 XML::DocumentType
* m_nodeSetDocType
;
155 _READ_MEDIA_ROUTING_VIEW
159 BFilePanel m_openPanel
;
160 BFilePanel m_savePanel
;
163 XML::DocumentType
* _createSettingsDocType();
164 XML::DocumentType
* _createNodeSetDocType();
165 status_t
_readSettings();
166 status_t
_writeSettings();
168 status_t
_readNodeSet(
170 status_t
_writeSelectedNodeSet(
172 const char* filename
);
174 static status_t
_InitMimeTypes();
176 static const char* const s_settingsDirectory
;
177 static const char* const s_settingsFile
;
179 static const char* const s_rootElement
;
180 static const char* const s_mediaRoutingViewElement
;
181 static const char* const s_routeWindowElement
;
184 __END_CORTEX_NAMESPACE
185 #endif /* __ROUTEAPP_H__ */