PageRenderTime 37ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llnearbychatbar.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 97 lines | 49 code | 21 blank | 27 comment | 0 complexity | 172f69a14f7b81fffdf245f35e8c19aa MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llnearbychatbar.h
  3. * @brief LLNearbyChatBar class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLNEARBYCHATBAR_H
  27. #define LL_LLNEARBYCHATBAR_H
  28. #include "llfloater.h"
  29. #include "llcombobox.h"
  30. #include "llgesturemgr.h"
  31. #include "llchat.h"
  32. #include "llvoiceclient.h"
  33. #include "lloutputmonitorctrl.h"
  34. #include "llspeakers.h"
  35. class LLNearbyChatBar : public LLFloater
  36. {
  37. public:
  38. // constructor for inline chat-bars (e.g. hosted in chat history window)
  39. LLNearbyChatBar(const LLSD& key);
  40. ~LLNearbyChatBar() {}
  41. virtual BOOL postBuild();
  42. /*virtual*/ void onOpen(const LLSD& key);
  43. static LLNearbyChatBar* getInstance();
  44. LLLineEditor* getChatBox() { return mChatBox; }
  45. virtual void draw();
  46. std::string getCurrentChat();
  47. virtual BOOL handleKeyHere( KEY key, MASK mask );
  48. static void startChat(const char* line);
  49. static void stopChat();
  50. static void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
  51. static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
  52. void showHistory();
  53. void enableTranslationCheckbox(BOOL enable);
  54. /*virtual*/void setMinimized(BOOL b);
  55. protected:
  56. static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
  57. static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata);
  58. static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata);
  59. void onChatBoxFocusReceived();
  60. void sendChat( EChatType type );
  61. void onChatBoxCommit();
  62. void onChatFontChange(LLFontGL* fontp);
  63. /* virtual */ bool applyRectControl();
  64. void onToggleNearbyChatPanel();
  65. static LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
  66. EChatType processChatTypeTriggers(EChatType type, std::string &str);
  67. void displaySpeakingIndicator();
  68. // Which non-zero channel did we last chat on?
  69. static S32 sLastSpecialChatChannel;
  70. LLLineEditor* mChatBox;
  71. LLView* mNearbyChat;
  72. LLOutputMonitorCtrl* mOutputMonitor;
  73. LLLocalSpeakerMgr* mSpeakerMgr;
  74. S32 mExpandedHeight;
  75. };
  76. #endif