chxavviewbase.h

来自「symbian 下的helix player源代码」· C头文件 代码 · 共 150 行

H
150
字号
/************************************************************************
 * chxavviewbase.h
 * ---------------
 *
 * Synopsis:
 * Contains the declaration of the CHXAvViewBase class.  This class 
 * constains some common routines to all of the views.
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 ************************************************************************/

#ifndef _chxavviewbase_h_
#define _chxavviewbase_h_

// Includes...
#include <aknview.h>
#include <aknconsts.h>
#include <akntitle.h>
#include <aknnavide.h>
#include <akncontext.h>

#include "chxavrefptr.h"

// Forward declarations...
class CHXAvPlayerUI;


// CHXAvVewBase declaration...
class CHXAvViewBase : public CAknView
{
public:
    virtual ~CHXAvViewBase();

protected:

    // Keeping this a virtual class only....
    CHXAvViewBase(TInt viewIndex, CHXAvPlayerUI *playerUI);
    virtual void ConstructL();    

public:
    
    CHXAvPlayerUI *GetPlayerUI();
    TUid Id() const;
    TInt GetBackView() const;
    void SetBackView(TInt idxView);
    virtual void HandleLosePlayFocus();

    void SetDefaultAppTitleL();
    void RestoreDefaultNaviPaneL();

public:

    // CAknView methods...
    void DoActivateL(const TVwsViewId& prevViewID, TUid customMsgID, const TDesC8& customMsg);
    void DoDeactivate();
    void HandleStatusPaneSizeChange();
    void HandleForegroundEventL(TBool bEnterForeground);
    void HandleCommandL(TInt command);
    void ProcessCommandL(TInt cmd);

    // CHXAvViewBase
    virtual void UpdateViewStateL();
    virtual CCoeControl* CreateViewWindowForActivatingViewL() = 0; 
    virtual void FinishViewActivateL();
    virtual void FinishViewDeactivateL() = 0;

    CCoeControl* GetWindow();

protected:

    void ShowPopupMenuL(TInt idRes);
    void ClosePopupMenu();
    void ShowPopupMenuHelperL(TInt idRes);

protected:
	
    TInt m_backViewIndex;
    TInt m_viewIndex;

    CAknContextPane*                    m_contextPane;
    CEikStatusPane*                     m_statusPane;
    CAknNavigationControlContainer*     m_naviPane;
    CAknTitlePane*                      m_titlePane;
    CHXAvPlayerUI*                      m_playerUI;

    refptr<CEikMenuBar>                 m_pMenuPopup;

private:
    CCoeControl* m_window;
    bool m_bFirstForegroundEventPending;
};


#define HXPLAYER_DEFINE_CREATE(CLASS_NAME) \
public: \
    static CLASS_NAME* NewL(TInt idxView, CHXAvPlayerUI *pContext); \
    virtual ~CLASS_NAME(); \
private: \
    CLASS_NAME(TInt idxView, CHXAvPlayerUI *pContext); \
    virtual void ConstructL();
    
#define HXPLAYER_IMPLEMENT_STATIC_CREATE(CLASS_NAME) \
CLASS_NAME* CLASS_NAME::NewL(TInt idxView, CHXAvPlayerUI* pContext) \
{ \
    CLASS_NAME* pView = new(ELeave) CLASS_NAME(idxView, pContext); \
    AUTO_PUSH_POP(pView); \
    pView->ConstructL(); \
    return pView; \
}

inline
CCoeControl* CHXAvViewBase::GetWindow()
{
    return m_window;
}

inline
CHXAvPlayerUI *CHXAvViewBase::GetPlayerUI() 
{
    return m_playerUI;
}

inline
TInt CHXAvViewBase::GetBackView() const
{
    return m_backViewIndex;
}

inline
void CHXAvViewBase::SetBackView(TInt idxView)
{
    HX_ASSERT(idxView != m_viewIndex); // back to self
    m_backViewIndex = idxView;
}




#endif // _chxavviewbase_h_





⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?