Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
CACanorusMLImport Class Reference

#include <canorusmlimport.h>

Inheritance diagram for CACanorusMLImport:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CACanorusMLImport (QTextStream *stream=0)
 CACanorusMLImport (const QString stream)
virtual ~CACanorusMLImport ()
void initCanorusMLImport ()
CADocumentimportDocumentImpl ()
bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attributes)
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
bool fatalError (const QXmlParseException &exception)
bool characters (const QString &ch)

Private Member Functions

void importMark (const QXmlAttributes &attributes)
void importResource (const QXmlAttributes &attributes)
CADocumentdocument ()

Private Attributes

CADocument_document
QString _version
QString _errorMsg
QStack< QString > _depth
CASheet_curSheet
CAContext_curContext
CAVoice_curVoice
CAKeySignature_curKeySig
CATimeSignature_curTimeSig
CAClef_curClef
CABarline_curBarline
CANote_curNote
CARest_curRest
CAMusElement_curMusElt
CAMark_curMark
CASlur_curTie
CASlur_curSlur
CATuplet_curTuplet
CASlur_curPhrasingSlur
CADiatonicPitch _curDiatonicPitch
CADiatonicKey _curDiatonicKey
CAPlayableLength _curPlayableLength
CAPlayableLength _curTempoPlayableLength
QHash< CALyricsContext *, int > _lcMap
QHash< CASyllable *, int > _syllableMap
QColor _color
QString _cha

Constructor & Destructor Documentation

CACanorusMLImport::CACanorusMLImport ( QTextStream *  stream = 0)

Copyright (c) 2006-2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

References initCanorusMLImport().

Here is the call graph for this function:

References initCanorusMLImport().

Here is the call graph for this function:


Member Function Documentation

bool CACanorusMLImport::characters ( const QString &  ch)
   Stores the characters between the greater-lesser signs while parsing the XML file.
   This is usually needed for getting the property values stored not as node attributes,
   but between greater-lesser signs.

   eg.
                <length>127</length>

Would set _cha value to "127".

See also:
startElement(), endElement()

References _cha.

CACanorusMLImport::document ( ) [inline, private]

Returns the newly created document when reading the XML file.

References _document.

Referenced by importDocumentImpl().

Here is the caller graph for this function:

bool CACanorusMLImport::endElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName 
)

This function is called automatically by Qt SAX parser while reading the CanorusML source. This function is called when a node has been closed (</nodeName>). Attributes for closed notes are usually not set in CanorusML format. That's why we need to store local node attributes (set when the node is opened) each time.

The function returns true, if the node was successfully recognized and parsed; otherwise false.

See also:
startElement()

References _cha, _curBarline, _curClef, _curContext, _curDiatonicKey, _curDiatonicPitch, _curKeySig, _curMark, _curMusElt, _curNote, _curPlayableLength, _curRest, _curSheet, _curTempoPlayableLength, _curTimeSig, _curTuplet, _curVoice, _depth, _document, _lcMap, _syllableMap, _version, CAVoice::append(), CATuplet::assignTimes(), CAMusElement::Barline, CAPlayable::calculateTimeLength(), CAMusElement::Clef, CAVoice::contains(), CAContext::contextType(), CAMusElement::FunctionMark, CAMusElement::KeySignature, CAKeySignature::keySignatureType(), CAVoice::lastNote(), CAKeySignature::MajorMinor, CAMark::markType(), CAMusElement::musElementType(), CAKeySignature::setDiatonicKey(), CANote::setDiatonicPitch(), CADiatonicKey::setDiatonicPitch(), CAPlayable::setPlayableLength(), CADocument::sheetAt(), CADocument::sheetCount(), CAImport::Staff, CASheet::staffAt(), CASheet::staffCount(), CAStaff::synchronizeVoices(), CAMark::Tempo, CAMusElement::TimeSignature, CAMusElement::timeStart(), CAPlayable::tuplet(), CANote::updateTies(), and CASheet::voiceList().

Here is the call graph for this function:

bool CACanorusMLImport::fatalError ( const QXmlParseException &  exception)

This method should be called when a critical error occurs while parsing the XML source.

See also:
startElement(), endElement()

References _errorMsg.

Opens a CanorusML source in and creates a document out of it. mainWin is needed for any UI settings stored in the file (the last viewports positions, current sheet etc.). CACanorusML uses SAX parser for reading.

Reimplemented from CAImport.

References document(), and CAFile::stream().

Here is the call graph for this function:

void CACanorusMLImport::importMark ( const QXmlAttributes &  attributes) [private]
void CACanorusMLImport::importResource ( const QXmlAttributes &  attributes) [private]

Imports the current resource.

References _document, CAFile::file(), CAResource::resourceTypeFromString(), and CAResource::setDescription().

Referenced by startElement().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CACanorusMLImport::startElement ( const QString &  namespaceURI,
const QString &  localName,
const QString &  qName,
const QXmlAttributes &  attributes 
)

This function is called automatically by Qt SAX parser while reading the CanorusML source. This function is called when a new node is opened. It already reads node attributes.

The function returns true, if the node was successfully recognized and parsed; otherwise false.

See also:
endElement()

References _color, _curBarline, _curClef, _curContext, _curDiatonicKey, _curDiatonicPitch, _curKeySig, _curMark, _curMusElt, _curNote, _curPhrasingSlur, _curPlayableLength, _curRest, _curSheet, _curSlur, _curTempoPlayableLength, _curTie, _curTimeSig, _curTuplet, _curVoice, _depth, _document, _errorMsg, _lcMap, _syllableMap, _version, CASheet::addContext(), CATuplet::addNote(), CADocument::addSheet(), CAStaff::addVoice(), CABarline::barlineTypeFromString(), CAClef::clefTypeFromString(), CASheet::contextCount(), CAContext::contextType(), CAFunctionMark::functionTypeFromString(), CADiatonicKey::genderFromString(), importMark(), importResource(), CAKeySignature::keySignatureTypeFromString(), CAKeySignature::MajorMinor, CAKeySignature::Modus, CAKeySignature::modusFromString(), CAPlayableLength::musicLengthFromString(), CASlur::PhrasingSlurType, CARest::restTypeFromString(), CADocument::setArranger(), CAMusElement::setColor(), CADocument::setComments(), CADocument::setComposer(), CADocument::setCopyright(), CADocument::setDateCreated(), CADocument::setDateLastModified(), CADocument::setDedication(), CAVoice::setMidiChannel(), CAVoice::setMidiProgram(), CASlur::setNoteEnd(), CANote::setPhrasingSlurEnd(), CANote::setPhrasingSlurStart(), CADocument::setPoet(), CASlur::setSlurDirection(), CANote::setSlurEnd(), CANote::setSlurStart(), CASlur::setSlurStyle(), CANote::setStemDirection(), CADocument::setSubtitle(), CADocument::setTextTranslator(), CANote::setTieStart(), CADocument::setTimeEdited(), CADocument::setTitle(), CAPlayable::setTuplet(), CADocument::sheetCount(), CASlur::slurDirectionFromString(), CASlur::SlurPreferred, CASlur::slurStyleFromString(), CASlur::SlurType, CAVoice::staff(), CAPlayable::staff(), CAImport::Staff, CASheet::staffCount(), CANote::stemDirectionFromString(), CANote::StemNeutral, CASlur::TieType, CATimeSignature::timeSignatureTypeFromString(), and CAStaff::voiceCount().


Member Data Documentation

Current characters being read using characters() method between the greater/lesser separators in XML file.

See also:
characters()

Referenced by characters(), and endElement().

QColor CACanorusMLImport::_color [private]

Referenced by startElement().

Referenced by endElement(), and startElement().

Referenced by endElement(), and startElement().

Referenced by endElement(), and startElement().

Referenced by endElement(), and startElement().

Stack which represents the current depth of the document while SAX parsing. It contains the tag names as the values.

See also:
startElement(), endElement()

Referenced by endElement(), and startElement().

Pointer to the document being read.

See also:
CADocument

Referenced by document(), endElement(), importResource(), initCanorusMLImport(), and startElement().

The error message content stored as QString, if the error happens.

See also:
fatalError()

Referenced by fatalError(), and startElement().

Referenced by endElement(), and startElement().

Referenced by endElement(), and startElement().

Document program version - which Canorus saved the file?

See also:
startElement(), endElement()

Referenced by endElement(), importMark(), and startElement().


The documentation for this class was generated from the following files: