/*!
  @header FTImportDefaultXMLRule
  @abstract Module of FT
 
  @availability OS X, GNUstep
  @copyright 2004, 2005, 2006 Free Software Foundation, Inc.
  
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA

  <pre>
  -------------------------------------------------------------------------
  Modification history

  05.08.06 ola     initial version
  23.08.06 ola     license changed
  -------------------------------------------------------------------------
  </pre>
*/

#if !defined(__FTImportDefaultXMLRule_H)
#define __FTImportDefaultXMLRule_H

#include <Foundation/Foundation.h>
#include <Encore/Encore.h>
#include <FT/FT.h>

@class FTImport;

/*!
 * @class FTImportDefaultXMLRule
 * @abstract Methods are called during parsing process organized by 
 *   ECXMLControl. These methods add all elements specified within the
 *   export files.
 */
@interface FTImportDefaultXMLRule : FTObject {
  @private 
    FTImport *import;
    id <FTGraph> graph;
    id <FTObjectToIdMapper> graphObjectToIdMapper;

    NSString *currentNodeId;

    /**
     * Stores the last node id for which service data has been declared
     */
    NSString *currentServiceNodeId;
}

- initForImport: (FTImport *) anImport;
- (void) dealloc;

- addGraphForEvent: (ECXMLControlContext *) context;
- addNodeIdForEvent: (ECXMLControlContext *) context;

- addNodeReference: (ECXMLControlContext *) context;
- addNodeReferenceList: (ECXMLControlContext *) context;

- addServiceData: (ECXMLControlContext *) context;
- addServiceDataItem: (ECXMLControlContext *) context;

#if 0
TODO in future...
/*! 
 * @method openTransaction
 * @abstract Opens a transaction as needed
 * @discussion this way several transactions can be bundled.
 * @result self
 */
- openTransaction;
- commitTransaction;
#endif

/*!
 * @method attribute
 * @abstract fetch a specified attributed from within a given context
 * @param attributeName specified attribute
 * @param context parsing context
 * @result related attribute value or nil, if not given
 */
- (NSString *) attribute: (NSString *) attributeName
  withinContext: (ECXMLControlContext *) context;

- (void) releaseResources;
@end
#endif
