mysmiles.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef MYSMILES_H
  2. #define MYSMILES_H
  3. #include <QObject>
  4. #include <QList>
  5. #include <QMap>
  6. #include "smilesitemmodel.h"
  7. #include "smileslistmodel.h"
  8. #include "smthemeitemmodel.h"
  9. #include "smthemelistmodel.h"
  10. class MySmiles : public QObject
  11. {
  12. Q_OBJECT
  13. Q_DISABLE_COPY( MySmiles )
  14. Q_PROPERTY( QString file READ getFile WRITE setFile NOTIFY fileChanged )
  15. Q_PROPERTY( SmilesListModel* smilesModel READ getSmilesModel/* WRITE setSmilesModel*/ NOTIFY smilesModelChanged )
  16. Q_PROPERTY( SmilesThemeListModel* themeSmiles READ getThemeSmiles NOTIFY themeSmilesChanged )
  17. QMap<QString, QString> bufOfSmiles;
  18. SmilesListModel* listOfSmiles;
  19. SmilesThemeListModel* m_themeSmiles;
  20. QString fileXML;
  21. QMap<QString, QString> getTheme(const QString &fileTheme) const;
  22. public:
  23. explicit MySmiles(QObject *parent = 0);
  24. void parseXMLSmiles( const QString &inFile );
  25. Q_INVOKABLE QString parseMsgString( const QString inString );
  26. Q_INVOKABLE QString htmlToPlainText( const QString inString ) const;
  27. void getBuffThemes();
  28. SmilesListModel* getSmilesModel() const { return listOfSmiles; }
  29. QString getFile() const { return fileXML; }
  30. void setFile( const QString &_fileXML );
  31. SmilesThemeListModel* getThemeSmiles() const { return m_themeSmiles; }
  32. signals:
  33. void smilesModelChanged();
  34. void fileChanged();
  35. void themeSmilesChanged();
  36. public slots:
  37. };
  38. #endif // MYSMILES_H