00001 00032 #ifndef LL_LLTOOLVIEW_H 00033 #define LL_LLTOOLVIEW_H 00034 00035 // requires stdtypes.h 00036 #include "llpanel.h" 00037 00038 // forward declares 00039 class LLTool; 00040 class LLButton; 00041 00042 class LLToolView; 00043 00044 00045 // Utility class, container for the package of information we need about 00046 // each tool. The package can either point directly to a tool, or indirectly 00047 // to another view of tools. 00048 class LLToolContainer 00049 { 00050 public: 00051 LLToolContainer(LLToolView* parent); 00052 ~LLToolContainer(); 00053 00054 public: 00055 LLToolView* mParent; // toolview that owns this container 00056 LLButton* mButton; 00057 LLPanel* mPanel; 00058 LLTool* mTool; // if not NULL, this is a tool ref 00059 }; 00060 00061 00062 // A view containing automatically arranged button icons representing 00063 // tools. The icons sit on top of panels containing options for each 00064 // tool. 00065 class LLToolView 00066 : public LLView 00067 { 00068 public: 00069 LLToolView(const std::string& name, const LLRect& rect); 00070 ~LLToolView(); 00071 00072 virtual void draw(); // handle juggling tool button highlights, panel visibility 00073 00074 static void onClickToolButton(void* container); 00075 00076 void addTool(const LLString& icon_off, const LLString& icon_on, LLPanel* panel, LLTool* tool, LLView* hoverView, const char* label); 00077 00078 LLView* getCurrentHoverView(); 00079 00080 private: 00081 LLRect getButtonRect(S32 button_index); // return rect for button to add, zero-based index 00082 LLToolContainer *findToolContainer(LLTool *tool); 00083 00084 00085 private: 00086 typedef std::vector<LLToolContainer*> contain_list_t; 00087 contain_list_t mContainList; 00088 S32 mButtonCount; // used to compute rectangles 00089 }; 00090 00091 #endif