Canorus  0.0
Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CAExport Class Reference

Base class for export filters. More...

#include <export.h>

Inheritance diagram for CAExport:
Inheritance graph
[legend]

Signals

void documentExported (CADocument *)
 
void sheetExported (CASheet *)
 
void staffExported (CAStaff *)
 
void voiceExported (CAVoice *)
 
void lyricsContextExported (CALyricsContext *)
 
void functionMarkContextExported (CAFunctionMarkContext *)
 
void exportDone (int status)
 

Public Member Functions

 CAExport (QTextStream *stream=0)
 
virtual ~CAExport ()
 
virtual const QString readableStatus ()
 
void exportDocument (CADocument *, bool bStartThread=true)
 
void exportSheet (CASheet *)
 
void exportStaff (CAStaff *)
 
void exportVoice (CAVoice *)
 
void exportLyricsContext (CALyricsContext *)
 
void exportFunctionMarkContext (CAFunctionMarkContext *)
 
CADocumentexportedDocument ()
 
CASheetexportedSheet ()
 
CAStaffexportedStaff ()
 
CAVoiceexportedVoice ()
 
CALyricsContextexportedLyricsContext ()
 
CAFunctionMarkContextexportedFunctionMarkContext ()
 
virtual void setStreamToFile (const QString filename)
 
bool wait (unsigned long time=ULONG_MAX)
 
- Public Member Functions inherited from CAFile
 CAFile ()
 
virtual ~CAFile ()
 
const int status ()
 
const int progress ()
 
void setStreamFromFile (const QString filename)
 
void setStreamToFile (const QString filename)
 
void setStreamFromDevice (QIODevice *device)
 
void setStreamToDevice (QIODevice *device)
 
void setStreamToString ()
 
QString getStreamAsString ()
 

Protected Member Functions

virtual void exportDocumentImpl (CADocument *)
 
virtual void exportSheetImpl (CASheet *)
 
virtual void exportStaffImpl (CAStaff *)
 
virtual void exportVoiceImpl (CAVoice *)
 
virtual void exportLyricsContextImpl (CALyricsContext *)
 
virtual void exportFunctionMarkContextImpl (CAFunctionMarkContext *)
 
QTextStream & out ()
 
void run ()
 
- Protected Member Functions inherited from CAFile
void setStatus (const int status)
 
void setProgress (const int progress)
 
QTextStream * stream ()
 
virtual void setStream (QTextStream *stream)
 
QFile * file ()
 
void setFile (QFile *file)
 

Private Member Functions

void setExportedDocument (CADocument *doc)
 
void setExportedSheet (CASheet *sheet)
 
void setExportedStaff (CAStaff *staff)
 
void setExportedVoice (CAVoice *voice)
 
void setExportedLyricsContext (CALyricsContext *lc)
 
void setExportedFunctionMarkContext (CAFunctionMarkContext *fmc)
 

Private Attributes

CADocument_exportedDocument
 
CASheet_exportedSheet
 
CAStaff_exportedStaff
 
CAVoice_exportedVoice
 
CALyricsContext_exportedLyricsContext
 
CAFunctionMarkContext_exportedFunctionMarkContext
 

Detailed Description

Base class for export filters.

Copyright (c) 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.

This class inherits CAFile and is the base class for any specific import filter (eg. LilyPond, CanorusML, MusicXML etc.).

If a developer wants to write a new export filter, he should: 1) Create a new class with the base class CAExport 2) Implement CAExport constructors and at least exportDocumentImpl() function 3) Register the filter (put a new fileformat to CAFileFormats and add the filter to open/save dialogs in CACanorus)

Optionally: Developer should change the current status and progress while operations are in progress. He should also rewrite the readableStatus() function.

The following example illustrates the usage of export class:

CAMyExportFilter export();
export.setStreamToFile("jingle bells.xml");
export.exportDocument( curDocument );
export.wait();

Constructor & Destructor Documentation

◆ CAExport()

CAExport::CAExport ( QTextStream *  stream = 0)

◆ ~CAExport()

CAExport::~CAExport ( )
virtual

Member Function Documentation

◆ documentExported

void CAExport::documentExported ( CADocument )
signal

Referenced by exportDocument(), and run().

Here is the caller graph for this function:

◆ exportDocument()

void CAExport::exportDocument ( CADocument doc,
bool  bStartThread = true 
)

◆ exportDocumentImpl()

virtual void CAExport::exportDocumentImpl ( CADocument )
inlineprotectedvirtual

Reimplemented in CASVGExport, CAPDFExport, CAMidiExport, CACanorusMLExport, and CACanExport.

References CAFile::setStatus().

Referenced by exportDocument(), and run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportDone

void CAExport::exportDone ( int  status)
signal

Referenced by exportDocument(), and run().

Here is the caller graph for this function:

◆ exportedDocument()

CADocument* CAExport::exportedDocument ( )
inline

References _exportedDocument.

Referenced by exportDocument(), and run().

Here is the caller graph for this function:

◆ exportedFunctionMarkContext()

CAFunctionMarkContext* CAExport::exportedFunctionMarkContext ( )
inline

References _exportedFunctionMarkContext.

Referenced by run().

Here is the caller graph for this function:

◆ exportedLyricsContext()

CALyricsContext* CAExport::exportedLyricsContext ( )
inline

References _exportedLyricsContext.

Referenced by run().

Here is the caller graph for this function:

◆ exportedSheet()

CASheet* CAExport::exportedSheet ( )
inline

References _exportedSheet.

Referenced by run().

Here is the caller graph for this function:

◆ exportedStaff()

CAStaff* CAExport::exportedStaff ( )
inline

References _exportedStaff.

Referenced by run().

Here is the caller graph for this function:

◆ exportedVoice()

CAVoice* CAExport::exportedVoice ( )
inline

References _exportedVoice.

Referenced by run().

Here is the caller graph for this function:

◆ exportFunctionMarkContext()

void CAExport::exportFunctionMarkContext ( CAFunctionMarkContext fmc)

References setExportedFunctionMarkContext(), and CAFile::setStatus().

Here is the call graph for this function:

◆ exportFunctionMarkContextImpl()

virtual void CAExport::exportFunctionMarkContextImpl ( CAFunctionMarkContext )
inlineprotectedvirtual

References CAFile::setStatus().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportLyricsContext()

void CAExport::exportLyricsContext ( CALyricsContext lc)

References setExportedLyricsContext(), and CAFile::setStatus().

Referenced by CASourceView::rebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportLyricsContextImpl()

virtual void CAExport::exportLyricsContextImpl ( CALyricsContext )
inlineprotectedvirtual

Reimplemented in CALilyPondExport.

References CAFile::setStatus().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportSheet()

void CAExport::exportSheet ( CASheet sheet)

References setExportedSheet(), and CAFile::setStatus().

Referenced by CATypesetCtl::exportSheet(), CAMainWin::on_uiExportDocument_triggered(), CAPreviewCtl::on_uiPrintPreview_triggered(), and CAPrintCtl::printDocument().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportSheetImpl()

virtual void CAExport::exportSheetImpl ( CASheet )
inlineprotectedvirtual

Reimplemented in CAMidiExport, CALilyPondExport, CAMusicXmlExport, CASVGExport, and CAPDFExport.

References CAFile::setStatus().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportStaff()

void CAExport::exportStaff ( CAStaff staff)

References setExportedStaff(), and CAFile::setStatus().

Here is the call graph for this function:

◆ exportStaffImpl()

virtual void CAExport::exportStaffImpl ( CAStaff )
inlineprotectedvirtual

References CAFile::setStatus().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportVoice()

void CAExport::exportVoice ( CAVoice voice)

References setExportedVoice(), and CAFile::setStatus().

Referenced by CASourceView::rebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportVoiceImpl()

virtual void CAExport::exportVoiceImpl ( CAVoice )
inlineprotectedvirtual

Reimplemented in CALilyPondExport.

References CAFile::setStatus().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ functionMarkContextExported

void CAExport::functionMarkContextExported ( CAFunctionMarkContext )
signal

Referenced by run().

Here is the caller graph for this function:

◆ lyricsContextExported

void CAExport::lyricsContextExported ( CALyricsContext )
signal

Referenced by run().

Here is the caller graph for this function:

◆ out()

QTextStream& CAExport::out ( )
inlineprotected

◆ readableStatus()

const QString CAExport::readableStatus ( )
virtual

Implements CAFile.

References CAFile::status().

Referenced by CAMainWin::saveDocument().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void CAExport::run ( )
protected

Executed when a new thread is dispatched. It looks which part of the document should be exported and starts the procedure. It emits the appropriate signal when the procedure is finished.

References documentExported(), exportDocumentImpl(), exportDone(), exportedDocument(), exportedFunctionMarkContext(), exportedLyricsContext(), exportedSheet(), exportedStaff(), exportedVoice(), exportFunctionMarkContextImpl(), exportLyricsContextImpl(), exportSheetImpl(), exportStaffImpl(), exportVoiceImpl(), functionMarkContextExported(), lyricsContextExported(), CAFile::setStatus(), sheetExported(), staffExported(), CAFile::status(), CAFile::stream(), and voiceExported().

Here is the call graph for this function:

◆ setExportedDocument()

void CAExport::setExportedDocument ( CADocument doc)
inlineprivate

References _exportedDocument.

Referenced by CAExport(), and exportDocument().

Here is the caller graph for this function:

◆ setExportedFunctionMarkContext()

void CAExport::setExportedFunctionMarkContext ( CAFunctionMarkContext fmc)
inlineprivate

References _exportedFunctionMarkContext.

Referenced by CAExport(), and exportFunctionMarkContext().

Here is the caller graph for this function:

◆ setExportedLyricsContext()

void CAExport::setExportedLyricsContext ( CALyricsContext lc)
inlineprivate

References _exportedLyricsContext.

Referenced by CAExport(), and exportLyricsContext().

Here is the caller graph for this function:

◆ setExportedSheet()

void CAExport::setExportedSheet ( CASheet sheet)
inlineprivate

References _exportedSheet.

Referenced by CAExport(), and exportSheet().

Here is the caller graph for this function:

◆ setExportedStaff()

void CAExport::setExportedStaff ( CAStaff staff)
inlineprivate

References _exportedStaff.

Referenced by CAExport(), and exportStaff().

Here is the caller graph for this function:

◆ setExportedVoice()

void CAExport::setExportedVoice ( CAVoice voice)
inlineprivate

References _exportedVoice.

Referenced by CAExport(), and exportVoice().

Here is the caller graph for this function:

◆ setStreamToFile()

virtual void CAExport::setStreamToFile ( const QString  filename)
inlinevirtual

◆ sheetExported

void CAExport::sheetExported ( CASheet )
signal

Referenced by run().

Here is the caller graph for this function:

◆ staffExported

void CAExport::staffExported ( CAStaff )
signal

Referenced by run().

Here is the caller graph for this function:

◆ voiceExported

void CAExport::voiceExported ( CAVoice )
signal

Referenced by run().

Here is the caller graph for this function:

◆ wait()

bool CAExport::wait ( unsigned long  time = ULONG_MAX)
inline

Member Data Documentation

◆ _exportedDocument

CADocument* CAExport::_exportedDocument
private

◆ _exportedFunctionMarkContext

CAFunctionMarkContext* CAExport::_exportedFunctionMarkContext
private

◆ _exportedLyricsContext

CALyricsContext* CAExport::_exportedLyricsContext
private

◆ _exportedSheet

CASheet* CAExport::_exportedSheet
private

Referenced by exportedSheet(), and setExportedSheet().

◆ _exportedStaff

CAStaff* CAExport::_exportedStaff
private

Referenced by exportedStaff(), and setExportedStaff().

◆ _exportedVoice

CAVoice* CAExport::_exportedVoice
private

Referenced by exportedVoice(), and setExportedVoice().


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