FEUISimpleHexTable.h
Go to the documentation of this file.
00001 #ifndef FEUISIMPLEHEX_H
00002 #define FEUISIMPLEHEX_H
00003 
00004 #include <QtGui>
00005 #include "../../../../fedm-classlib/src/FedmIscCore.h"
00006 
00007 class FEHexItemEditor : public QTextEdit
00008 {
00009     Q_OBJECT
00010 public:
00011         FEHexItemEditor(QWidget *parent = 0);
00012         void setAllowOnlyHexKeys(bool hexOnly);
00013 protected:
00014         virtual void keyPressEvent(QKeyEvent * event);
00015         virtual void dropEvent(QDropEvent *e);
00016         virtual void mousePressEvent(QMouseEvent *e);
00017 private:
00018         bool m_bOnlyHex;
00019         int  rowIndex;
00020         bool isHex(int cSign);
00021 };
00022 
00023 class FEUISimpleHexTableDelegate : public QItemDelegate
00024 {
00025     Q_OBJECT
00026 public:
00027         FEUISimpleHexTableDelegate(QObject *parent = 0);
00028         QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
00029                 const QModelIndex &index) const;
00030         void setEditorData(QWidget *editor, const QModelIndex &index) const;
00031         void setModelData(QWidget *editor, QAbstractItemModel *model,
00032                 const QModelIndex &index) const;
00033 
00034 private:
00035         mutable bool isResolving;
00036 };
00037 
00038 class FEUISimpleHexTableItem : public QTableWidgetItem
00039 {
00040 public:
00041         FEUISimpleHexTableItem();
00042         FEUISimpleHexTableItem(const QString &text);
00043         
00044         QTableWidgetItem *clone() const;
00045         
00046         QVariant data(int role) const;
00047         void setData(int role, const QVariant &value);
00048         void setSecurityArea(bool isSecure);
00049         QVariant display() const;
00050         inline QString hexString() const
00051                 { return QTableWidgetItem::data(Qt::DisplayRole).toString(); }
00052 
00053 private:
00054         bool m_bSecurityArea;
00055         mutable bool isResolving;
00056 };
00057 
00058 #if !defined(QT_NO_DBUS) && defined(Q_OS_UNIX)
00059 #include <QtDBus>
00060 
00061 class FEUISimpleHexTableAdaptor : public QDBusAbstractAdaptor
00062 {
00063         Q_OBJECT
00064         Q_CLASSINFO("D-Bus Interface", "com.feig.DBus.FEUISimpleHexTable")
00065 
00066 public:
00067         FEUISimpleHexTableAdaptor(QTableWidget *table) : QDBusAbstractAdaptor(table), table(table)
00068         { QDBusConnection::sessionBus().registerObject("/FEUISimpleHexTable", table); }
00069 
00070 public slots:
00071 private:
00072     QTableWidget *table;
00073 
00074 };
00075 #endif // QT_NO_DBUS
00076 
00077 class FEUISimpleHexTable : public QTableWidget
00078 {
00079     Q_OBJECT 
00080 public:
00081         FEUISimpleHexTable(QWidget *parent = 0);
00082         ~FEUISimpleHexTable();
00083         int edit(int record, unsigned char* data, bool securityArea);
00084         void initTable(int size, int blockSize);
00085         void getHexString(char* str, int row);
00086         void setSize(int size);  
00087 
00088 public slots:
00089         void clear();
00090         void updateAscii(QTableWidgetItem* item);
00091 
00092 protected:
00093         void setupContextMenu();
00094         void createActions();
00095         void resizeEvent(QResizeEvent *event);
00096         void newRow();
00097 
00098 private:
00099         QAction *clearAction;
00100         QLabel *cellLabel;
00101         QTableWidget *table;
00102         int m_iBlockSize;
00103         bool isHex(char cSign);
00104         void addSpaces(char* dest, char* src, int srcLen);
00105         void removeBlanks(char* dest, char* src, int srcLen);
00106         void convUcharToAscii(char* dest, unsigned char* src, int srcLen);
00107         char hexToChar(char *str);
00108         void charToHex(char a, char *str);
00109 };
00110 
00111 #endif


maggie_rfid_drivers
Author(s): Raul Perula-Martinez
autogenerated on Mon Sep 14 2015 03:05:30