Changeset 59 in projects for punch-card-project/trunk/punch-card-editor/src/qpunchcard/deck.h
- Timestamp:
- Jan 22, 2010, 7:44:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
punch-card-project/trunk/punch-card-editor/src/qpunchcard/deck.h
r53 r59 29 29 Q_OBJECT 30 30 31 QSharedPointer<const FileFormat>format;31 FileFormat format; 32 32 QList< Card > cards; 33 QSharedPointer< QFile > file; 34 //QPointer<QUndoStack> undo_stack; 33 QString filename; 35 34 QUndoStack undo_stack; 36 35 friend class FileFormat; … … 48 47 Deck(QObject* parent = 0); 49 48 ~Deck() {}; 50 /// Create from file /stream/etc., that is, calls format->read()51 Deck( const FileFormat* format, QObject* parent = 0);49 /// Create from file with format 50 Deck(FileFormat format, const QString& filename, QObject* parent = 0); 52 51 53 52 // =========== Loading and Saving, File Format Handling ================== 54 53 // (All Functions are just Shorthands for other direct public method calls) 55 54 bool save(); 56 bool save(QFile& file); 57 bool save(const FileFormat* format, QFile& file); 55 bool save(const QString& filename); 56 bool save(FileFormat format, const QString& filename); 57 bool save(FileFormat format, QFile& file); 58 58 bool read(); 59 bool read(QFile& file); 60 bool read(const FileFormat* format, QFile& file); 59 bool read(const QString& filename); 60 bool read(FileFormat format, const QString& filename); 61 bool read(FileFormat format, QFile& file); 62 61 63 62 64 bool canRead() const { return hasFile() && hasFormat(); } 63 65 bool canSave() const { return canRead(); } 64 bool hasFormat() const { return format; } 65 void setFormat(const FileFormat* format); 66 bool hasFile() const { return file; } 67 void setFile(QFile* file); 66 bool hasFormat() const { return !format.isNull(); } 67 FileFormat getFormat() const { return format; } 68 void setFormat(FileFormat format) { this->format = format; } 69 bool hasFile() const { return filename.isEmpty(); } 70 void setFileName(const QString& filename) { this->filename = filename; } 71 const QString& getFileName() const { return filename; } 68 72 69 73 // =========== Undo Framework ==================
Note: See TracChangeset
for help on using the changeset viewer.