WOLChatMsg.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/WWOnline/WOLChatMsg.h $
  22. *
  23. * DESCRIPTION
  24. * Chat Message representation.
  25. *
  26. * PROGRAMMER
  27. * $Author: Denzil_l $
  28. *
  29. * VERSION INFO
  30. * $Revision: 6 $
  31. * $Modtime: 10/23/01 10:19a $
  32. *
  33. ******************************************************************************/
  34. #ifndef __WOLCHATMSG_H__
  35. #define __WOLCHATMSG_H__
  36. #include <WWLib\WideString.h>
  37. #ifdef _MSC_VER
  38. #pragma warning (push,3)
  39. #endif
  40. #include <vector>
  41. #ifdef _MSC_VER
  42. #pragma warning (pop)
  43. #endif
  44. namespace WOL
  45. {
  46. struct User;
  47. }
  48. namespace WWOnline {
  49. class ChatMessage
  50. {
  51. public:
  52. ChatMessage(const WOL::User* sender, const char* message, bool isPrivate, bool isAction);
  53. ChatMessage(const WOL::User* sender, const wchar_t* message, bool isPrivate, bool isAction);
  54. ChatMessage(const wchar_t* sender, const wchar_t* message, bool isPrivate, bool isAction);
  55. ChatMessage(const ChatMessage&);
  56. virtual ~ChatMessage();
  57. const ChatMessage& operator=(const ChatMessage&);
  58. inline const WideStringClass& GetSendersName(void) const
  59. {return mSenderName;}
  60. inline const WideStringClass& GetMessage(void) const
  61. {return mMessage;}
  62. inline bool IsAction(void) const
  63. {return mIsAction;}
  64. inline bool IsPrivate(void) const
  65. {return mIsPrivate;}
  66. bool IsSenderMyself(void) const;
  67. bool IsSenderChannelOwner(void) const;
  68. bool IsSenderSquelched(void) const;
  69. bool IsSenderInClan(unsigned long clanID) const;
  70. protected:
  71. WideStringClass mSenderName;
  72. WideStringClass mMessage;
  73. bool mIsPrivate;
  74. bool mIsAction;
  75. unsigned long mSenderFlags;
  76. unsigned long mSenderClanID;
  77. };
  78. typedef std::vector<ChatMessage> ChatMessageList;
  79. bool IsAnsiText(const wchar_t* text);
  80. } // namespace WWOnline
  81. #endif // __WOLCHATMSG_H__