/* * * Custom widget Demo * * File : DConsoleView.h * Purpose : Define the custom Console View class * Author : JLV * Creation : 10/19/04 * Last Update : 10/28/04 * * (C) hexaZen 2004 * * This file is part of a demo application for Zinzala. It can be * used, distributed and modified without limitation. * * * $Id$ */ /* * $Log$ */ #ifndef _DCONSOLEVIEW #define _DCONSOLEVIEW #include #include #include #include using namespace zSDK::Cincinella; using namespace zSDK::Farfalla; enum tConsoleState { ePlaying, eStopped, ePaused, eForward, eBackward }; class cDConsoleView : public cDrawView { public: static cDConsoleView *NewL(cDSkin &aSkin); virtual ~cDConsoleView(); void SetState(tConsoleState aState); tConsoleState GetState() const {return iState;}; protected: virtual void PlayPressed(tBool aActive) {}; virtual void PausePressed(tBool aActive) {}; virtual void StopPressed(tBool aActive) {}; virtual void FwdPressed(tBool aActive) {}; virtual void BwdPressed(tBool aActive) {}; protected: void OnScreen(); void Beat(); void MouseUp(uPoint aPoint); void MouseDown(uPoint aPoint); void OutBound(uPoint aPoint); protected: cDConsoleView(); virtual void ConstructL(cDSkin &aSkin); private: tUint8 FindButton(uPoint aPoint) const; void Render(tUint8 aButton,tBool aBackground = false); void Pressed(tUint8 aButton); void Invoked(); private: typedef struct tButton; private: tConsoleState iState; // console state cBitmap* iBackground; // background bitmap cBitmap** iBStates; // Button's states bitmaps cBitmap** iBLabelsN; // Button's labels bitmaps (non dimmed) cBitmap** iBLabelsD; // Button's labels bitmaps (dimmed) tButton* iButtons; // Button's data tUint8 iPressedButton; // ID of the button currently pressed tUint8 iActiveButton; // ID of the button currently active tUint8 iPrevState; // Previous state of the current pressed button tInt8 iActiveDir; // Direction of the Active button animation }; #endif