chxavplayerui.h

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

H
229
字号
/************************************************************************
 * chxavplayerui.h
 * ----------------
 *
 * Synopsis:
 * Contains the declaration of the CHXAvPlayerUI class.  This is the main
 * UI manager class.  It manages the views and communicates back any
 * user input to the media object, implemented by CHXAvPlayerMediaEngine.
 *
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 ************************************************************************/

#ifndef _chxavplayerui_h_
#define _chxavplayerui_h_

#include <coeccntx.h>
#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikdoc.h>
#include <eikmenup.h>
#include <eikon.hrh>
#include <aknviewappui.h>
#include <apchangeobserver.h>

#include "hxwintyp.h"
#include "hxcom.h"
#include "hxcomm.h"
#include "hxmon.h"
#include "hxtypes.h"
#include "hxassert.h"
#include "unkimp.h"
#include "ihxpckts.h"
#include "chxavwaitnote.h"
#include "chxclientenginemanager.h"
#include "hxstring.h"
#include "hxurl.h"


#include "chxresourcetoken.h"
#include "chxavwaitnote.h"
#include "chxavurllist.h"
#include "comptr.h"
#include "ihxsymplayerstateobserver.h"
#include "chxavmediafolderinfo.h"

class CEnvironmentChangeNotifier;
class CHXAvPresentationWindow;
class CHXAvPlayView;
class CHXAvPlayer;
class CHXAvURLList;

//class PrefChangeObserver
class PrefChangeObserver
{
public:
    virtual void OnPrefsChanged() = 0;
};

// class CHXAvPlayerUI
class CHXAvPlayerUI 
: public CAknViewAppUi
{

public:
// enums
    enum ViewIndex
    {
	VID_FileView = 0,
	VID_PlayerView,
	VID_SelectSettingsView,
	VID_SettingsView
    };

    enum AlertType
    {
        AlertError = 0,
        AlertInfo,
        AlertConfirm,
        AlertWarn
    };

public: 
// ctor and dtor
    CHXAvPlayerUI();
    virtual ~CHXAvPlayerUI();
    void ConstructL(); 
  
public:

// CAknViewAppUi
    void HandleCommandL(TInt aCommand);
    void OpenFileL(const TDesC& fileArg);

// CHXAvPlayerUI
    CHXClientEngineManagerPtr GetClientEngineManager();
    const TDesC& CHXAvPlayerUI::GetAppImageFilePath() const;
    void ActivatePlayViewL(const TDesC& url);
    void OnViewForegroundActivateL(TInt idxView);
    bool IsRunningEmbedded() const;
    void SetPrefChangeObserver(PrefChangeObserver* pObserver);
    CHXAvURLListPtr GetRecentClipsList();
    TPtrC GetGuideUrlL(bool bForceUpdate);
    TInt GetRecentClipCount() const;
    comptr<CHXAvPlayer> GetPlayer();
    void HandleEnvChange();
    const CHXAvVector<CHXAvMediaFolderInfoPtr>& GetMediaStoreInfoL(bool bForceUpdate = false);
    //CPinbModel&  PinbModel();
public:
// ui implementation for user commands
    void DoEditPlaylistL(const TDesC& playListPath);
    void DoAboutL();
    void DoOpenRecentL();
    void DoOpenURLL();		
    void DoOpenGuideL();
    void DoSelectSettingsL();
    void DoRestoreDefaultSettingsL();
private:
// implementation helpers
    void DoBackFromCurrentViewL();
    void AppendMediaStoreInfoL(const CHXString& strRootPath, CHXAvMediaFolderInfo::PathCreateType pathType);
    
    CHXAvPlayView* GetPlayView();
    void UpdateMediaStoreInfoL();
    void ClearMediaFolderListL();
    void CloseApp();
    bool EnsureUniqueInstanceHelperL();
    void EnsureUniqueInstanceL();
    
// CAknViewAppUi
    //void HandleForegroundEventL(TBool bEnterForeground);
    //TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
    
    void HandleViewDeactivation(const TVwsViewId& idOldView, const TVwsViewId& idNewView);
    void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent);
    void HandleWsEventL(const TWsEvent& event ,CCoeControl* pDest);
    TBool ProcessCommandParametersL(TApaCommand aCommand,TFileName& aDocumentName,const TDesC8& aTail);

//MSharedDataNotifyHandler
    //void HandleNotifyL(const TUid uid, const TDesC& key, const TDesC& val);

private:

    CHXClientEngineManagerPtr   m_spEngineMgr;
    CHXAvURLListPtr m_recentClips;

    TInt m_idxDefaultView;
    TInt m_lastErrorResId;
    CHXString m_lastClipEntered;
    
    CHXAvVector<CHXAvMediaFolderInfoPtr> m_mediaStoreInfo;

    refptr<HBufC>       m_spPendingOpenFile;
    refptr<HBufC>       m_spGuideUrl;
    refptr<HBufC>       m_spLocalMediaFolder;
    refptr<HBufC>       m_spMmcMediaFolder;
    refptr<HBufC>       m_spMemoryReserve;
    refptr<TFileName>   m_spImageFilePath;

    PrefChangeObserver* m_pPrefChangeObserver;
    
    bool m_bIsRunningEmbedded;
    bool m_bLaunchAppWithClipPending;
    //bool m_bDidScreenSaverSignal;
    //bool m_bDidScreenSaverSignal;
    //bool m_bIsActivePlaybackState;

    //RSharedDataClient m_sysSdClient;
    //RSharedDataClient m_sysApSdClient;
    //refptr<CPinbModel> m_pPinbModel;

    CEnvironmentChangeNotifier* m_pEnvChange;
    bool m_bIgnoreFirstEnvChange;

    CHXResourceToken   m_instanceToken;
    CHXAvWaitNotePtr   m_spCloseAppWaitNote;

};

inline
CHXClientEngineManagerPtr CHXAvPlayerUI::GetClientEngineManager()
{
    return m_spEngineMgr;
}

inline
void CHXAvPlayerUI::SetPrefChangeObserver(PrefChangeObserver* pObserver)
{
    m_pPrefChangeObserver = pObserver;
}

/*
inline
CPinbModel& CHXAvPlayerUI::PinbModel()
{
    return *m_pPinbModel;
}
*/

inline
bool CHXAvPlayerUI::IsRunningEmbedded() const
{
    return m_bIsRunningEmbedded;
}

// return path to main app image file
inline
const TDesC& CHXAvPlayerUI::GetAppImageFilePath() const
{
    HX_ASSERT(m_spImageFilePath);
    return *m_spImageFilePath;
}

inline
CHXAvURLListPtr CHXAvPlayerUI::GetRecentClipsList()
{
    return m_recentClips;
}

#endif //_chxavplayerui_h_


⌨️ 快捷键说明

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