source: projects/punch-card/punch-card-editor/src/qpunchcard/format.h @ 44

Last change on this file since 44 was 44, checked in by sven, 10 years ago

Import of the Punch Card Editor Project.
This is a C++/Qt project (using qmake) that I've started this weekend.
Of course it's supposed to be released as open source.

I've tried to start with a clean (but now still empty, of course)
directory structure. There will come the sourcecode for a complete
AVR ATmega microcontroller punch card device controller, soon.
I'm planing to finish this editing program and to implement the
communication protocol (over TTY, using some platform indepentent library).
Unfortunately that will take some time (and I don't have much time
any more...)

-- Sven @ workstation

File size: 1.1 KB
Line 
1#ifndef FORMAT_H
2#define FORMAT_H
3
4namespace QPunchCard {
5class FileFormat; };
6
7#include "card.h"
8#include <QPointer>
9#include <QFile>
10
11namespace QPunchCard {
12
13class FileFormat : public QObject {
14        Q_OBJECT
15
16protected:
17//      QPointer<QFile> file;
18        QPointer<Deck> deck;
19        friend class Deck;
20
21public:
22        FileFormat(QObject* parent = 0): QObject(parent) {}
23
24public slots:
25        virtual bool write(QFile&) { return false; }
26        virtual bool read(QFile&) { return false; }
27        virtual bool saveDialog() { return false; }
28        virtual bool readDialog() { return false; }
29
30signals:
31        // for save/read progress bars in toolbar
32        void progress(int);
33};
34
35FileFormat* autoDetectFileFormat(const QFile &file);
36
37/****************************************************************************
38  FileFormat (I/O) implementations
39 ***************************************************************************/
40
41class JonesFileFormat : public FileFormat {
42        Q_OBJECT
43
44public:
45        JonesFileFormat() {}
46
47        int jones_column_to_integer(const Column& col);
48        Column jones_integer_to_column(int integer);
49
50public slots:
51        bool write(QFile& file);
52        bool read(QFile& file);
53};
54
55
56}; // namespace
57
58
59#endif // FORMAT_H
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License