/indra/newview/llstatusbar.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 127 lines · 70 code · 26 blank · 31 comment · 0 complexity · 8a644010da042dc5cb3e0ea977bd04b6 MD5 · raw file

  1. /**
  2. * @file llstatusbar.h
  3. * @brief LLStatusBar 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_LLSTATUSBAR_H
  27. #define LL_LLSTATUSBAR_H
  28. #include "llpanel.h"
  29. // "Constants" loaded from settings.xml at start time
  30. extern S32 STATUS_BAR_HEIGHT;
  31. class LLButton;
  32. class LLLineEditor;
  33. class LLMessageSystem;
  34. class LLTextBox;
  35. class LLTextEditor;
  36. class LLUICtrl;
  37. class LLUUID;
  38. class LLFrameTimer;
  39. class LLStatGraph;
  40. class LLPanelVolumePulldown;
  41. class LLPanelNearByMedia;
  42. class LLStatusBar
  43. : public LLPanel
  44. {
  45. public:
  46. LLStatusBar(const LLRect& rect );
  47. /*virtual*/ ~LLStatusBar();
  48. /*virtual*/ void draw();
  49. /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
  50. /*virtual*/ BOOL postBuild();
  51. // MANIPULATORS
  52. void setBalance(S32 balance);
  53. void debitBalance(S32 debit);
  54. void creditBalance(S32 credit);
  55. // Request the latest currency balance from the server
  56. static void sendMoneyBalanceRequest();
  57. void setHealth(S32 percent);
  58. void setLandCredit(S32 credit);
  59. void setLandCommitted(S32 committed);
  60. void refresh();
  61. void setVisibleForMouselook(bool visible);
  62. // some elements should hide in mouselook
  63. // ACCESSORS
  64. S32 getBalance() const;
  65. S32 getHealth() const;
  66. BOOL isUserTiered() const;
  67. S32 getSquareMetersCredit() const;
  68. S32 getSquareMetersCommitted() const;
  69. S32 getSquareMetersLeft() const;
  70. LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; }
  71. private:
  72. void onClickBuyCurrency();
  73. void onVolumeChanged(const LLSD& newvalue);
  74. void onMouseEnterVolume();
  75. void onMouseEnterNearbyMedia();
  76. void onClickScreen(S32 x, S32 y);
  77. static void onClickMediaToggle(void* data);
  78. static void onClickBalance(void* data);
  79. private:
  80. LLTextBox *mTextTime;
  81. LLStatGraph *mSGBandwidth;
  82. LLStatGraph *mSGPacketLoss;
  83. LLView *mBtnStats;
  84. LLButton *mBtnVolume;
  85. LLTextBox *mBoxBalance;
  86. LLButton *mMediaToggle;
  87. LLView *mScriptOut;
  88. LLFrameTimer mClockUpdateTimer;
  89. S32 mBalance;
  90. S32 mHealth;
  91. S32 mSquareMetersCredit;
  92. S32 mSquareMetersCommitted;
  93. LLFrameTimer* mBalanceTimer;
  94. LLFrameTimer* mHealthTimer;
  95. LLPanelVolumePulldown* mPanelVolumePulldown;
  96. LLPanelNearByMedia* mPanelNearByMedia;
  97. };
  98. // *HACK: Status bar owns your cached money balance. JC
  99. BOOL can_afford_transaction(S32 cost);
  100. extern LLStatusBar *gStatusBar;
  101. #endif