meegimsettings.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #ifndef MEEGIMSETTINGS_H
  2. #define MEEGIMSETTINGS_H
  3. #include "mysettings.h"
  4. #include "accountsitemmodel.h"
  5. #include "accountslistmodel.h"
  6. #include "QXmppConfiguration.h"
  7. #include <QtDeclarative>
  8. class MeegIMSettings : public MySettings
  9. {
  10. Q_OBJECT
  11. Q_DISABLE_COPY( MeegIMSettings )
  12. Q_PROPERTY( AccountsListModel* accounts READ getAccounts NOTIFY accountsListChanged )
  13. Q_PROPERTY( QString soundIncomingMessage READ getSoundIncomingMessage WRITE setSoundIncomingMessage NOTIFY soundIncomingMessageChanged )
  14. Q_PROPERTY( QString soundOutcomingMessage READ getSoundOutcomingMessage WRITE setSoundOutcomingMessage NOTIFY soundOutcomingMessageChanged )
  15. Q_PROPERTY( bool notifyConnection READ _getNotifyConnection WRITE _setNotifyConnection NOTIFY notifyConnectionChanged )
  16. Q_PROPERTY( bool notifyOnline READ _getNotifyOnline WRITE _setNotifyOnline NOTIFY notifyOnlineChanged )
  17. Q_PROPERTY( bool notifyOffline READ _getNotifyOffline WRITE _setNotifyOffline NOTIFY notifyOfflineChanged )
  18. Q_PROPERTY( bool notifyMessage READ _getNotifyMessage WRITE _setNotifyMessage NOTIFY notifyMessageChanged )
  19. Q_PROPERTY( bool notifyTyping READ _getNotifyTyping WRITE _setNotifyTyping NOTIFY notifyTypingChanged )
  20. Q_PROPERTY( QString soundBuddyLogsIn READ getSoundBuddyLogsIn WRITE setSoundBuddyLogsIn NOTIFY soundBuddyLogsInChanged )
  21. Q_PROPERTY( QString soundBuddyLogsOut READ getSoundBuddyLogsOut WRITE setSoundBuddyLogsOut NOTIFY soundBuddyLogsOutChanged )
  22. Q_PROPERTY( bool reconnectWhenError READ _getReconnectWhenError WRITE _setReconnectWhenError NOTIFY reconnectWhenErrorChanged )
  23. Q_PROPERTY( int keepAliveInterval READ _getKeepAliveInterval WRITE _setKeepAliveInterval NOTIFY keepAliveIntervalChanged )
  24. Q_PROPERTY( QString soundChatSomeoneSaysMyName READ getChatSomeoneSaysMyName WRITE setChatSomeoneSaysMyName NOTIFY soundChatSomeoneSaysMyNameChanged )
  25. Q_PROPERTY( QString soundChatPersonEnters READ getChatPersonEnters WRITE setChatPersonEnters NOTIFY soundChatPersonEntersChanged )
  26. Q_PROPERTY( QString soundChatPersonLeaves READ getChatPersonLeaves WRITE setChatPersonLeaves NOTIFY soundChatPersonLeavesChanged )
  27. Q_PROPERTY( QString soundChatITalk READ getChatITalk WRITE setChatITalk NOTIFY soundChatITalkChanged )
  28. Q_PROPERTY( QString soundChatOthersTalk READ getChatOthersTalk WRITE setChatOthersTalk NOTIFY soundChatOthersTalkChanged )
  29. Q_PROPERTY( bool vibrationMessageReceived READ vibrationMessageRecv WRITE setVibrationMessageRecv /*NOTIFY vibrationMessageReceivedChanged*/ )
  30. Q_PROPERTY( bool vibrationMessageSent READ vibrationMessageSent WRITE setVibrationMessageSent /*NOTIFY vibrationMessageReceivedChanged*/ )
  31. Q_PROPERTY( bool vibrationChatSomeoneSaysMyName READ vibrationChatSaysMyName WRITE setVibrationChatSaysMyName /*NOTIFY vibrationMessageReceivedChanged*/ )
  32. Q_PROPERTY( bool vibrationChatOthersTalk READ vibrationChatOthersTalk WRITE setVibrationChatOthersTalk /*NOTIFY vibrationMessageReceivedChanged*/ )
  33. Q_PROPERTY( QString smilesTheme READ getSmilesTheme WRITE setSmilesTheme NOTIFY smilesThemeChanged )
  34. AccountsListModel *alm;
  35. QString jid_indx0;
  36. QString pass_indx0;
  37. bool dflt_indx0;
  38. public:
  39. explicit MeegIMSettings();
  40. QXmppConfiguration getDefaultAccount();
  41. Q_INVOKABLE void initListOfAccounts();
  42. Q_INVOKABLE void setAccount( QString _jid, QString _pass, bool isDflt, QString _resource = "", QString _host = "", QString _port = "", bool manuallyHostPort = false );
  43. Q_INVOKABLE void removeAccount( QString _jid );
  44. Q_INVOKABLE void saveStatusText( QString statusText );
  45. /* для списка аккаунтов */
  46. Q_INVOKABLE QString getJid_indx0() { return jid_indx0; }
  47. Q_INVOKABLE QString getPass_indx0() { return pass_indx0; }
  48. Q_INVOKABLE bool getDef_indx0() { return dflt_indx0; }
  49. Q_INVOKABLE bool accIsDefault( int index );
  50. Q_INVOKABLE QString accGetJid( int index );
  51. Q_INVOKABLE QString accGetPassword( int index );
  52. Q_INVOKABLE QString accGetResource( int index );
  53. Q_INVOKABLE QString accGetHost( int index );
  54. Q_INVOKABLE int accGetPort( int index );
  55. Q_INVOKABLE bool accIsManuallyHostPort( int index );
  56. AccountsListModel* getAccounts() const { return alm; }
  57. /*----------( getter/setter )----------*/
  58. /* sound of incoming msg */
  59. QString getSoundIncomingMessage() { return this->getSndIncomingMsg(); }
  60. void setSoundIncomingMessage( const QString &filePath );
  61. /* sound of incoming msg */
  62. QString getSoundOutcomingMessage() { return this->getSndOutcomingMsg(); }
  63. void setSoundOutcomingMessage( const QString &filePath );
  64. /* notify when it is doing connection */
  65. bool _getNotifyConnection() { return this->notifyConnection(); }
  66. void _setNotifyConnection( bool isSet );
  67. /* notify when it became online */
  68. bool _getNotifyOnline() { return this->notifyOnline(); }
  69. void _setNotifyOnline( bool isSet );
  70. /* notify when it became offline */
  71. bool _getNotifyOffline() { return this->notifyOffline(); }
  72. void _setNotifyOffline( bool isSet );
  73. /* notify when it received a message */
  74. bool _getNotifyMessage() { return this->notifyMessage(); }
  75. void _setNotifyMessage( bool isSet );
  76. /* */
  77. bool _getNotifyTyping() { return this->notifyTyping(); }
  78. void _setNotifyTyping( bool isSet );
  79. QString getSoundBuddyLogsIn() { return this->getSndBuddyLogsIn(); }
  80. void setSoundBuddyLogsIn( const QString &filePath );
  81. QString getSoundBuddyLogsOut() { return this->getSndBuddyLogsOut(); }
  82. void setSoundBuddyLogsOut( const QString &filePath );
  83. bool _getReconnectWhenError() { return this->reconnectWhenError(); }
  84. void _setReconnectWhenError(bool arg);
  85. int _getKeepAliveInterval() { return this->keepAliveInterval(); }
  86. void _setKeepAliveInterval(int arg);
  87. QString getChatSomeoneSaysMyName() { return this->getSndChatSaysMyName(); }
  88. void setChatSomeoneSaysMyName( const QString &file);
  89. QString getChatPersonEnters() { return this->getSndChatPersonEnters(); }
  90. void setChatPersonEnters( const QString &file );
  91. QString getChatPersonLeaves() { return this->getSndChatPersonLeaves(); }
  92. void setChatPersonLeaves( const QString &file );
  93. QString getChatITalk() { return this->getSndChatITalk(); }
  94. void setChatITalk( const QString &file );
  95. QString getChatOthersTalk() { return this->getSndChatOthersTalk(); }
  96. void setChatOthersTalk( const QString &file );
  97. signals:
  98. void accountsListChanged();
  99. void soundIncomingMessageChanged();
  100. void soundOutcomingMessageChanged();
  101. void notifyConnectionChanged();
  102. void notifyOnlineChanged();
  103. void notifyOfflineChanged();
  104. void notifyMessageChanged();
  105. void notifyTypingChanged();
  106. void soundBuddyLogsInChanged();
  107. void soundBuddyLogsOutChanged();
  108. void reconnectWhenErrorChanged();
  109. void keepAliveIntervalChanged();
  110. void soundChatSomeoneSaysMyNameChanged();
  111. void soundChatPersonEntersChanged();
  112. void soundChatPersonLeavesChanged();
  113. void soundChatITalkChanged();
  114. void soundChatOthersTalkChanged();
  115. void smilesThemeChanged();
  116. };
  117. QML_DECLARE_TYPE( MeegIMSettings )
  118. #endif // MEEGIMSETTINGS_H