|
Canorus
0.7
|
00001 00008 #ifndef IMPORT_H_ 00009 #define IMPORT_H_ 00010 00011 #include "core/file.h" 00012 00013 class CADocument; 00014 class CASheet; 00015 class CAStaff; 00016 class CAVoice; 00017 class CALyricsContext; 00018 class CAFunctionMarkContext; 00019 00020 class CAImport : public CAFile { 00021 #ifndef SWIG 00022 Q_OBJECT 00023 #endif 00024 public: 00025 CAImport( QTextStream *stream=0 ); 00026 CAImport( const QString stream ); 00027 virtual ~CAImport(); 00028 00029 virtual const QString readableStatus(); 00030 void importDocument(); 00031 void importSheet(); 00032 void importStaff(); 00033 void importVoice(); 00034 void importLyricsContext(); 00035 void importFunctionMarkContext(); 00036 00037 inline CADocument *importedDocument() { return _importedDocument; } 00038 inline CASheet *importedSheet() { return _importedSheet; } 00039 inline CAStaff *importedStaff() { return _importedStaff; } 00040 inline CAVoice *importedVoice() { return _importedVoice; } 00041 inline CALyricsContext *importedLyricsContext() { return _importedLyricsContext; } 00042 inline CAFunctionMarkContext *importedFunctionMarkContext() { return _importedFunctionMarkContext; } 00043 00044 #ifndef SWIG 00045 signals: 00046 void documentImported( CADocument* ); 00047 void sheetImported( CASheet* ); 00048 void staffImported( CAStaff* ); 00049 void voiceImported( CAVoice* ); 00050 void lyricsContextImported( CALyricsContext* ); 00051 void functionMarkContextImported( CAFunctionMarkContext* ); 00052 00053 void importDone( int status ); 00054 #endif 00055 00056 protected: 00057 virtual CADocument *importDocumentImpl() { setStatus(0); return 0; } 00058 virtual CASheet *importSheetImpl() { setStatus(0); return 0; } 00059 virtual CAStaff *importStaffImpl() { setStatus(0); return 0; } 00060 virtual CAVoice *importVoiceImpl() { setStatus(0); return 0; } 00061 virtual CALyricsContext *importLyricsContextImpl() { setStatus(0); return 0; } 00062 virtual CAFunctionMarkContext *importFunctionMarkContextImpl() { setStatus(0); return 0; } 00063 #ifndef SWIG 00064 QTextStream& in() { return *stream(); } 00065 #else 00066 QTextStream& _in() { return *stream(); } 00067 #endif 00068 00069 private: 00070 inline void setImportedDocument( CADocument *doc ) { _importedDocument = doc; } 00071 inline void setImportedSheet( CASheet *sheet ) { _importedSheet = sheet; } 00072 inline void setImportedStaff( CAStaff *staff ) { _importedStaff = staff; } 00073 inline void setImportedVoice( CAVoice *voice ) { _importedVoice = voice; } 00074 inline void setImportedLyricsContext( CALyricsContext *lc ) { _importedLyricsContext = lc; } 00075 inline void setImportedFunctionMarkContext( CAFunctionMarkContext *fmc ) { _importedFunctionMarkContext = fmc; } 00076 00077 CADocument *_importedDocument; 00078 CASheet *_importedSheet; 00079 CAStaff *_importedStaff; 00080 CAVoice *_importedVoice; 00081 CALyricsContext *_importedLyricsContext; 00082 CAFunctionMarkContext *_importedFunctionMarkContext; 00083 00084 enum CAImportPart { 00085 Undefined, 00086 Document, 00087 Sheet, 00088 Staff, 00089 Voice, 00090 LyricsContext, 00091 FunctionMarkContext 00092 }; 00093 00094 void run(); 00095 inline void setImportPart( CAImportPart part ) { _importPart = part; } 00096 inline CAImportPart importPart() { return _importPart; } 00097 00098 CAImportPart _importPart; 00099 }; 00100 00101 #endif /* IMPORT_H_ */
1.8.0