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