22 #include <QStringList>
39 ERROR_FILE_CANNOT_OPEN,
40 ERROR_INVALID_XML_FILE,
41 ERROR_INVALID_PENCIL_FILE,
44 ERROR_INVALID_LAYER_TYPE,
45 ERROR_INVALID_FRAME_NUMBER,
46 ERROR_LOAD_IMAGE_FAIL,
49 ERROR_LOAD_SOUND_FILE,
52 ERROR_FFMPEG_NOT_FOUND,
57 Status( ErrorCode eCode, QStringList detailsList = QStringList(), QString title = QString(), QString description = QString() );
59 ErrorCode code() {
return mCode; }
60 bool ok()
const {
return ( mCode == OK ) || ( mCode == SAFE ); }
62 QString title() {
return !mTitle.isEmpty() ? mTitle : msg(); }
63 QString description() {
return mDescription; }
65 QStringList detailsList() {
return mDetails; }
67 void setTitle( QString title ) { mTitle = title; }
68 void setDescription( QString description ) { mDescription = description; }
69 void setDetailsList( QStringList detailsList ) { mDetails = detailsList; }
71 bool operator==( ErrorCode code );
75 QString mTitle, mDescription;
80 #define STATUS_CHECK( x )\
81 { Status st = (x); if ( !st.ok() ) { return st; } }
83 #endif // PENCILERROR_H