#ifndef _NotificationEffect_h_ #define _NotificationEffect_h_ //#include "SUIWnd.h" //#include "Util.h" /* SUINotificationWnd 연출 클래스 */ #pragma pack(push, 1) struct sNotificationControl { public: /// 컨트롤들을 애니를 시켜 준다 void animation(float t, KRect const& rect); /// 컨트롤들의 영역을 수정한다. void modifyRect(int top, int height); private: int calcHeight(float t); //_LEAK_SUN public: sNotificationControl(): m_control( NULL ) { } ~sNotificationControl() { m_control = NULL; } public: KUIControl* m_control; KPoint m_originalSize; int m_offsetTop; float m_v; /// 연출 속도 bool m_resize; /// true : resize, false : MovePos }; struct sNotificationControlList { virtual ~sNotificationControlList() { m_list.clear(); } virtual void initPos(bool /*firstOpen*/, KRect const& /*rect*/) = 0; virtual void animation(float t, bool firstOpen, KRect const& rect); void add(sNotificationControl const& node); protected: std::vector m_list; }; struct sNotificationControlTitleList : public sNotificationControlList { virtual void initPos(bool firstOpen, KRect const& rect); virtual void animation(float t, bool firstOpen, KRect const& rect); }; struct sNotificationControlBodyList : public sNotificationControlList { virtual void initPos(bool firstOpen, KRect const& rect); }; /// 새로운 알림이 도착했을 때의 효과 struct sNotificationEffect { public: sNotificationEffect(); ~sNotificationEffect(); void initialize(SUIWnd* parent); void addControl(char const* controlName, int controlType, bool resize = true); void proc(float elapsedTime); /// firstOpen가 true이면 모든 control들에 변화가 있지만, false이면 body control만 변한다. void start(bool firstOpen); bool isActive() const { return m_active; } private: void finalize(); bool isEnd(); void initControlPos(bool firstOpen); void animation(); public: /// 타이틀 부분과 바디 부분으로 나뉘는데 나뉘는 기준은 연출이 될 때 Resize와 MovePos 차이이다. /// title : MovePos, body : Resize enum { CONTROL_TYPE_TITLE, CONTROL_TYPE_BODY, CONTROL_TYPE_NUM }; private: SUIWnd* m_parent; /// SUINotificationWnd의 포인터 bool m_active; /// 알림창이 처음 열리는지 열린 상태에서 다시 알림이 설정되는지에 따라서 title과 body의 연출이 틀리다. bool m_firstOpen; float m_totalElapsedTime; sNotificationControlList* m_list[CONTROL_TYPE_NUM]; sUpdateTime m_updateTime; static float UPDATE_TIME; /// 연출이 끝나고 대기 시간을 줘서 다음 연출이 바로 시작 안되도록 해준다 static float UPDATE_WAITING_TIME; }; #pragma pack(pop) #endif