Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
/home/iurt/rpm/BUILD/canorus-0.7.R1002/src/export/export.h
Go to the documentation of this file.
00001 
00008 #ifndef EXPORT_H_
00009 #define EXPORT_H_
00010 
00011 #include "core/file.h"
00012 #include <QString>
00013 
00014 class QTextStream;
00015 class CADocument;
00016 class CASheet;
00017 class CAStaff;
00018 class CAVoice;
00019 class CALyricsContext;
00020 class CAFunctionMarkContext;
00021 
00022 class CAExport : public CAFile {
00023 #ifndef SWIG
00024         Q_OBJECT
00025 #endif
00026 public:
00027         CAExport( QTextStream *stream=0 );
00028         virtual ~CAExport();
00029 
00030         virtual const QString readableStatus();
00031         void exportDocument( CADocument*, bool bStartThread = true );
00032         void exportSheet( CASheet* );
00033         void exportStaff( CAStaff* );
00034         void exportVoice( CAVoice* );
00035         void exportLyricsContext( CALyricsContext* );
00036         void exportFunctionMarkContext( CAFunctionMarkContext* );
00037 
00038         inline CADocument      *exportedDocument() { return _exportedDocument; }
00039         inline CASheet         *exportedSheet() { return _exportedSheet; }
00040         inline CAStaff         *exportedStaff() { return _exportedStaff; }
00041         inline CAVoice         *exportedVoice() { return _exportedVoice; }
00042         inline CALyricsContext *exportedLyricsContext() { return _exportedLyricsContext; }
00043         inline CAFunctionMarkContext *exportedFunctionMarkContext() { return _exportedFunctionMarkContext; }
00044 
00045         // Methods from CAFile to be called via abstract class CAAbsExport
00046         virtual void setStreamToFile( const QString filename )
00047         { CAFile::setStreamToFile( filename); }
00048         bool wait ( unsigned long time = ULONG_MAX )
00049         { return CAFile::wait( time ); }
00050 
00051 #ifndef SWIG
00052 signals:
00053         void documentExported( CADocument* );
00054         void sheetExported( CASheet* );
00055         void staffExported( CAStaff* );
00056         void voiceExported( CAVoice* );
00057         void lyricsContextExported( CALyricsContext* );
00058         void functionMarkContextExported( CAFunctionMarkContext* );
00059 
00060         void exportDone( int status );
00061 #endif
00062 
00063 protected:
00064         virtual void exportDocumentImpl( CADocument* ) { setStatus(0); return; }
00065         virtual void exportSheetImpl( CASheet* )       { setStatus(0); return; }
00066         virtual void exportStaffImpl( CAStaff* )       { setStatus(0); return; }
00067         virtual void exportVoiceImpl( CAVoice* )       { setStatus(0); return; }
00068         virtual void exportLyricsContextImpl( CALyricsContext* ) { setStatus(0); return; }
00069         virtual void exportFunctionMarkContextImpl( CAFunctionMarkContext* ) { setStatus(0); return; }
00070 
00071         inline QTextStream& out() { return *stream(); }
00072 
00073         void run();
00074 
00075 private:
00076         inline void setExportedDocument( CADocument *doc ) { _exportedDocument = doc; }
00077         inline void setExportedSheet( CASheet *sheet ) { _exportedSheet = sheet; }
00078         inline void setExportedStaff( CAStaff *staff ) { _exportedStaff = staff; }
00079         inline void setExportedVoice( CAVoice *voice ) { _exportedVoice = voice; }
00080         inline void setExportedLyricsContext( CALyricsContext *lc ) { _exportedLyricsContext = lc; }
00081         inline void setExportedFunctionMarkContext( CAFunctionMarkContext *fmc ) { _exportedFunctionMarkContext = fmc; }
00082 
00083         CADocument      *_exportedDocument;
00084         CASheet         *_exportedSheet;
00085         CAStaff         *_exportedStaff;
00086         CAVoice         *_exportedVoice;
00087         CALyricsContext *_exportedLyricsContext;
00088         CAFunctionMarkContext *_exportedFunctionMarkContext;
00089 
00090 };
00091 
00092 #endif /* EXPORT_H_ */