diff options
Diffstat (limited to 'src/devices/mem24/base/mem24.h')
-rw-r--r-- | src/devices/mem24/base/mem24.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/devices/mem24/base/mem24.h b/src/devices/mem24/base/mem24.h new file mode 100644 index 0000000..d66ff47 --- /dev/null +++ b/src/devices/mem24/base/mem24.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#ifndef MEM24_H +#define MEM24_H + +#include "common/common/misc.h" +#include "devices/base/generic_device.h" + +namespace Mem24 +{ +class XmlToData; +class Group; + +//----------------------------------------------------------------------------- +class Data : public Device::Data +{ +public: + Data() : Device::Data(0) {} + virtual QString listViewGroup() const { return i18n("24 EEPROM"); } + uint nbBytes() const { return _nbBytes; } + virtual bool matchId(BitValue, Device::IdData &) const { return false; } + virtual uint nbBitsAddress() const { return nbBits(_nbBytes-1); } + virtual bool canWriteCalibration() const { return false; } + uint nbBlocks() const { return _nbBlocks; } + uint nbBytesPage() const { return _nbBytesPage; } + +private: + uint _nbBytes, _nbBlocks, _nbBytesPage; + + friend class XmlToData; + friend class Group; + friend QDataStream &operator <<(QDataStream &s, const Data &data); + friend QDataStream &operator >>(QDataStream &s, Data &data); +}; + +QDataStream &operator <<(QDataStream &s, const Data &data); +QDataStream &operator >>(QDataStream &s, Data &data); + +} // namespace + +#endif |