00001 #ifndef CONTENTEDITOR_H 00002 #define CONTENTEDITOR_H 00003 00004 #include <QtCore/QVariant> 00005 #include <QtCore/QString> 00006 00007 #include "ACE/ui_ContentEditor_BASE.h" 00008 00009 enum ContentType { StringCT, HexCT }; 00010 00011 class ContentEditor : public QDialog, private Ui::ContentEditor_BASE 00012 { 00013 Q_OBJECT 00014 00015 public: 00016 ContentEditor( QWidget* parent = 0, bool binaryContent = false, bool readOnly = true, Qt::WindowFlags f = 0 ); 00017 ~ContentEditor(); 00018 QVariant contents() const; 00019 bool isBinary() const; 00020 bool isReadOnly() const; 00021 bool isModified() const; 00022 QTextEdit* getEditor(); 00023 void prepareEditor( bool enableBinary = false, bool enableReadOnly = true ); 00024 void setContent( QVariant content = QVariant(), ContentType cType = StringCT, bool defaultValue = false ); 00025 00026 private: 00027 void setConnections(); 00028 00029 bool contentBinary; 00030 bool contentReadOnly; 00031 ContentType defaultContentType; 00032 ContentType currentContentType; 00033 QVariant defaultContent; 00034 QVariant currentContent; 00035 bool modified; 00036 QString browsedFileName; 00037 00038 00039 public slots: 00040 void slotBrowse(); 00041 void slotExport(); 00042 void slotRevert(); 00043 void slotViewContentAs( int cType ); 00044 void slotTextChanged(); 00045 00046 }; 00047 00048 #endif