/*---------------------------------------------------------------------------* Project: Horizon File: GuiControlManager.h Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 46365 $ *---------------------------------------------------------------------------*/ #ifndef NN_COMMON_SCENE_GUICONTROLMANAGER_H_ #define NN_COMMON_SCENE_GUICONTROLMANAGER_H_ #include "GuiControlBase.h" #include "List.h" namespace scene { /* Please see man pages for details */ typedef void (*ControlEventCallback)(ControlEvent event, ControlBase* pControl, s16 x, s16 y, void* pParam); /* Please see man pages for details */ typedef List ControlList; /* Please see man pages for details */ class ControlManager { public: /* Please see man pages for details */ ControlManager(); /* Please see man pages for details */ virtual ~ControlManager(); /* Please see man pages for details */ void Add(ControlBase* pControl); /* Please see man pages for details */ void Clear(); /* Please see man pages for details */ ControlBase* FindBy(u32 id); /* Please see man pages for details */ List* GetList(); /* Please see man pages for details */ void RegisterControlEventCallback(ControlEventCallback pCallback, void* pParam) { m_pCallback = pCallback; m_pParam = pParam; } /* Please see man pages for details */ void Update(); /* Please see man pages for details */ void Draw(); protected: // vtable 4byte exists in this position (keep in mind when adjusting padding) // ID of active control u32 m_activeId; // Callbacks ControlEventCallback m_pCallback; // Callback parameters void* m_pParam; // Control list ControlList m_controlList; // Touch panel reader nn::hid::TouchPanelReader m_touchReader; // Touch panel input information nn::hid::TouchPanelStatus m_touchStatus; nn::hid::TouchPanelStatus m_touchStatusOld; }; } #endif // NN_COMMON_SCENE_GUICONTROLMANAGER_H_