llstatusbar.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLSTATUSBAR_H
00033 #define LL_LLSTATUSBAR_H
00034 
00035 #include "llpanel.h"
00036 
00037 // "Constants" loaded from settings.xml at start time
00038 extern S32 STATUS_BAR_HEIGHT;
00039 
00040 class LLButton;
00041 class LLLineEditor;
00042 class LLMessageSystem;
00043 class LLTextBox;
00044 class LLTextEditor;
00045 class LLUICtrl;
00046 class LLUUID;
00047 class LLFrameTimer;
00048 class LLStatGraph;
00049 
00050 // used by LCD screen
00051 class LLRegionDetails
00052 {
00053 public:
00054         LLRegionDetails() :
00055                 mRegionName("Unknown"),
00056                 mParcelName("Unknown"),
00057                 mAccesString("Unknown"),
00058                 mX(0),
00059                 mY(0),
00060                 mZ(0),
00061                 mArea (0),
00062                 mForSale(FALSE),
00063                 mOwner("Unknown"),
00064                 mTraffic(0),
00065                 mBalance(0),
00066                 mPing(0)
00067         {
00068         }
00069         std::string mRegionName;
00070         std::string     mParcelName;
00071         std::string     mAccesString;
00072         S32             mX;
00073         S32             mY;
00074         S32             mZ;
00075         S32             mArea;
00076         BOOL    mForSale;
00077         std::string     mOwner;
00078         F32             mTraffic;
00079         S32             mBalance;
00080         std::string mTime;
00081         U32             mPing;
00082 };
00083 
00084 class LLStatusBar
00085 :       public LLPanel
00086 {
00087 public:
00088         LLStatusBar(const std::string& name, const LLRect& rect );
00089         /*virtual*/ ~LLStatusBar();
00090         
00091         /*virtual*/ void draw();
00092 
00093         // MANIPULATORS
00094         void            setBalance(S32 balance);
00095         void            debitBalance(S32 debit);
00096         void            creditBalance(S32 credit);
00097 
00098         void            setHealth(S32 percent);
00099 
00100         void setLandCredit(S32 credit);
00101         void setLandCommitted(S32 committed);
00102 
00103         void            refresh();
00104         void setVisibleForMouselook(bool visible);
00105                 // some elements should hide in mouselook
00106 
00107         // ACCESSORS
00108         S32                     getBalance() const;
00109         S32                     getHealth() const;
00110 
00111         BOOL isUserTiered() const;
00112         S32 getSquareMetersCredit() const;
00113         S32 getSquareMetersCommitted() const;
00114         S32 getSquareMetersLeft() const;
00115         LLRegionDetails mRegionDetails;
00116 
00117 private:
00118         // simple method to setup the part that holds the date
00119         void setupDate();
00120 
00121         static void onCommitSearch(LLUICtrl*, void* data);
00122         static void onClickSearch(void* data);
00123         static void onClickStatGraph(void* data);
00124 
00125 private:
00126         LLTextBox       *mTextBalance;
00127         LLTextBox       *mTextHealth;
00128         LLTextBox       *mTextTime;
00129 
00130         LLTextBox*      mTextParcelName;
00131 
00132         LLStatGraph *mSGBandwidth;
00133         LLStatGraph *mSGPacketLoss;
00134 
00135         LLButton        *mBtnBuyCurrency;
00136 
00137         S32                             mBalance;
00138         S32                             mHealth;
00139         S32                             mSquareMetersCredit;
00140         S32                             mSquareMetersCommitted;
00141         LLFrameTimer*   mBalanceTimer;
00142         LLFrameTimer*   mHealthTimer;
00143         
00144         static std::vector<std::string> sDays;
00145         static std::vector<std::string> sMonths;
00146         static const U32 MAX_DATE_STRING_LENGTH;
00147 };
00148 
00149 // *HACK: Status bar owns your cached money balance. JC
00150 BOOL can_afford_transaction(S32 cost);
00151 
00152 extern LLStatusBar *gStatusBar;
00153 
00154 #endif

Generated on Fri May 16 08:34:02 2008 for SecondLife by  doxygen 1.5.5