Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
export.h
Go to the documentation of this file.
1 
8 #ifndef EXPORT_H_
9 #define EXPORT_H_
10 
11 #include "core/file.h"
12 #include <QString>
13 
14 class QTextStream;
15 class CADocument;
16 class CASheet;
17 class CAStaff;
18 class CAVoice;
19 class CALyricsContext;
21 
22 class CAExport : public CAFile {
23 #ifndef SWIG
24  Q_OBJECT
25 #endif
26 public:
27  CAExport( QTextStream *stream=0 );
28  virtual ~CAExport();
29 
30  virtual const QString readableStatus();
31  void exportDocument( CADocument*, bool bStartThread = true );
32  void exportSheet( CASheet* );
33  void exportStaff( CAStaff* );
34  void exportVoice( CAVoice* );
37 
39  inline CASheet *exportedSheet() { return _exportedSheet; }
40  inline CAStaff *exportedStaff() { return _exportedStaff; }
41  inline CAVoice *exportedVoice() { return _exportedVoice; }
44 
45  // Methods from CAFile to be called via abstract class CAAbsExport
46  virtual void setStreamToFile( const QString filename )
47  { CAFile::setStreamToFile( filename); }
48  bool wait ( unsigned long time = ULONG_MAX )
49  { return CAFile::wait( time ); }
50 
51 #ifndef SWIG
52 signals:
54  void sheetExported( CASheet* );
55  void staffExported( CAStaff* );
56  void voiceExported( CAVoice* );
59 
60  void exportDone( int status );
61 #endif
62 
63 protected:
64  virtual void exportDocumentImpl( CADocument* ) { setStatus(0); return; }
65  virtual void exportSheetImpl( CASheet* ) { setStatus(0); return; }
66  virtual void exportStaffImpl( CAStaff* ) { setStatus(0); return; }
67  virtual void exportVoiceImpl( CAVoice* ) { setStatus(0); return; }
68  virtual void exportLyricsContextImpl( CALyricsContext* ) { setStatus(0); return; }
70 
71  inline QTextStream& out() { return *stream(); }
72 
73  void run();
74 
75 private:
76  inline void setExportedDocument( CADocument *doc ) { _exportedDocument = doc; }
77  inline void setExportedSheet( CASheet *sheet ) { _exportedSheet = sheet; }
78  inline void setExportedStaff( CAStaff *staff ) { _exportedStaff = staff; }
79  inline void setExportedVoice( CAVoice *voice ) { _exportedVoice = voice; }
82 
89 
90 };
91 
92 #endif /* EXPORT_H_ */