OpenMW
apps/openmw/mwgui/companionwindow.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_MWGUI_COMPANIONWINDOW_H
00002 #define OPENMW_MWGUI_COMPANIONWINDOW_H
00003 
00004 #include "widgets.hpp"
00005 #include "windowbase.hpp"
00006 #include "referenceinterface.hpp"
00007 
00008 namespace MWGui
00009 {
00010     class MessageBoxManager;
00011     class ItemView;
00012     class DragAndDrop;
00013     class SortFilterItemModel;
00014     class CompanionItemModel;
00015 
00016     class CompanionWindow : public WindowBase, public ReferenceInterface
00017     {
00018     public:
00019         CompanionWindow(DragAndDrop* dragAndDrop, MessageBoxManager* manager);
00020 
00021         void open(const MWWorld::Ptr& npc);
00022         void onFrame ();
00023 
00024     private:
00025         ItemView* mItemView;
00026         SortFilterItemModel* mSortModel;
00027         CompanionItemModel* mModel;
00028         size_t mSelectedItem;
00029 
00030         DragAndDrop* mDragAndDrop;
00031 
00032         MyGUI::Button* mCloseButton;
00033         MyGUI::TextBox* mProfitLabel;
00034         Widgets::MWDynamicStat* mEncumbranceBar;
00035         MessageBoxManager* mMessageBoxManager;
00036 
00037         void onItemSelected(int index);
00038         void onBackgroundSelected();
00039         void dragItem(MyGUI::Widget* sender, int count);
00040 
00041         void onMessageBoxButtonClicked(int button);
00042 
00043         void updateEncumbranceBar();
00044 
00045         void onCloseButtonClicked(MyGUI::Widget* _sender);
00046 
00047         virtual void onReferenceUnavailable();
00048     };
00049 
00050 }
00051 
00052 #endif