mysettings.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #ifndef MYSETTINGS_H
  2. #define MYSETTINGS_H
  3. #include <QSettings>
  4. class MySettings : public QSettings
  5. {
  6. Q_OBJECT
  7. QString group_main;
  8. QString group_gui;
  9. QString group_xmpp;
  10. QString group_accounts;
  11. QString key_jid;
  12. QString key_passwd;
  13. QString key_showGroup;
  14. QString key_lastPresence;
  15. QString key_accounts;
  16. QString key_resource;
  17. QString key_status_text;
  18. QString key_status;
  19. QString key_default;
  20. QString key_host;
  21. QString key_port;
  22. QString key_useHostPort;
  23. QString key_sndIncomingMsg;
  24. QString key_sndOutcomingMsg;
  25. QString key_notifyConnection;
  26. QString key_notifyOnline;
  27. QString key_notifyOffline;
  28. QString key_notifyMessage;
  29. QString key_notifyTyping;
  30. QString key_sndBuddyLogsIn;
  31. QString key_sndBuddyLogsOut;
  32. QString key_keepAliveInterval;
  33. QString key_reconnectOnError;
  34. QString key_sndChatSome1SaysMyName;
  35. QString key_sndChatPersonEnters;
  36. QString key_sndChatPersonLeaves;
  37. QString key_sndChatITalk;
  38. QString key_sndChatOthersTalk;
  39. QString key_vibrMessageRecv;
  40. QString key_vibrMessageSent;
  41. QString key_vibrChatSaysMyName;
  42. QString key_vibrChatOthersTalk;
  43. QString key_smilesTheme;
  44. protected:
  45. void addAccount( const QString& acc );
  46. QStringList getListAccounts();
  47. void remAccount( const QString& acc );
  48. public:
  49. explicit MySettings(QObject *parent = 0);
  50. static QString appName;
  51. static QString pathMeegIMHome;
  52. static QString pathMeegIMCache;
  53. static QString fileConfig;
  54. QString getPasswd( const QString &jid );
  55. void setPasswd( const QString &jid, const QString& passwd );
  56. QString getResource( const QString &jid );
  57. void setResource( const QString &jid, const QString& resource );
  58. QString getHost( const QString &jid );
  59. void setHost( const QString &jid, const QString& host );
  60. int getPort( const QString &jid );
  61. void setPort( const QString &jid, const int port );
  62. bool isAccDefault( const QString &jid );
  63. void setAccDefault( const QString &jid, const bool& def );
  64. QString getStatus();
  65. void setStatus( const QString& status );
  66. QString getStatusText();
  67. void setStatusText( const QString& status_text );
  68. bool isHostPortManually( const QString &jid );
  69. void setHostPortManually( const QString &jid, const bool& def );
  70. /* incomming msg */
  71. QString getSndIncomingMsg();
  72. void setSndIncomingMsg( const QString &f );
  73. /* outcoming msg */
  74. QString getSndOutcomingMsg();
  75. void setSndOutcomingMsg( const QString &f );
  76. bool notifyConnection();
  77. void setNotifyConnection( const bool isSet );
  78. bool notifyOnline();
  79. void setNotifyOnline( const bool isSet );
  80. bool notifyOffline();
  81. void setNotifyOffline( const bool isSet );
  82. bool notifyMessage();
  83. void setNotifyMessage( const bool isSet );
  84. bool notifyTyping();
  85. void setNotifyTyping( const bool isSet );
  86. QString getSndBuddyLogsIn();
  87. void setSndBuddyLogsIn( const QString &f );
  88. QString getSndBuddyLogsOut();
  89. void setSndBuddyLogsOut( const QString &f );
  90. bool reconnectWhenError();
  91. void setReconnectWhenError( const bool isSet );
  92. int keepAliveInterval();
  93. void setKeepAliveInterval( const int isSet );
  94. QString getSndChatSaysMyName();
  95. void setSndChatSaysMyName( const QString &f );
  96. QString getSndChatPersonEnters();
  97. void setSndChatPersonEnters( const QString &f );
  98. QString getSndChatPersonLeaves();
  99. void setSndChatPersonLeaves( const QString &f );
  100. QString getSndChatITalk();
  101. void setSndChatITalk( const QString &f );
  102. QString getSndChatOthersTalk();
  103. void setSndChatOthersTalk( const QString &f );
  104. bool vibrationMessageRecv();
  105. void setVibrationMessageRecv( const bool isSet );
  106. bool vibrationMessageSent();
  107. void setVibrationMessageSent( const bool isSet );
  108. bool vibrationChatSaysMyName();
  109. void setVibrationChatSaysMyName( const bool isSet );
  110. bool vibrationChatOthersTalk();
  111. void setVibrationChatOthersTalk( const bool isSet );
  112. QString getSmilesTheme();
  113. void setSmilesTheme( const QString &f );
  114. signals:
  115. public slots:
  116. };
  117. #endif // MYSETTINGS_H