chxavmisc.h

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

H
147
字号
/*****************************************************************************
 * chxavmisc.h
 * -----------
 *
 * Synopsis:
 * Misc helpers for s60 player only
 *
 * XXXLCM clean up!
 *
 *
 *
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 *****************************************************************************/

#ifndef _chxavmisc_h_
#define _chxavmisc_h_

// Symbian includes...
#include <eikenv.h>
#include <e32def.h>
#include <aknenv.h>
#include <aknpopup.h>
#include <aknselectionlist.h>
#include <aknlists.h>
#include <aknnavide.h>
#include <aknvolumecontrol.h>
#include <aknquerydialog.h>
#include <aknconsts.h>
#include <akncontext.h>
#include <aknviewappui.h>
#include <akniconarray.h> 
#include <avkon.hrh>

#include <avkon.rsg>

// Includes from this project...
#include "chxavutil.h"
#include "chxavnamedisplaytrait.h"
#include "chxavmessagedialog.h"
#include "chxavfileutil.h"


class CHXAvPlayer;
class CHXAvInfoList;
class CHXAvURLList;
class CHXAvInfoLIst;
class CAknTabGroup;


#define ARRAY_COUNT(array) (sizeof(array) / sizeof (array[0]))

// make variable name something like "csvar1424"
#define makevar_(var, line) csvar ## line
#define makevar__(line) makevar_(var, line)

// stringify a defined constant
#define makestr_(x) #x
#define makestr(x) makestr_(x)

namespace CHXAvMisc
{   

    struct ImageInfo
    {
	TInt idxImg;
	TInt idxImgMask;
    };

    enum ListType
    { 
	Double, 
	    DoubleNoIcon, 
	    Single, 
	    SingleNoIcon 
    };


    //
    // listbox helpers
    //
    HBufC* AllocGrListItemL(ListType type, TInt idxIcon, const TDesC& mainText, const TDesC& subText = KNullDesC);
    HBufC* AllocGrListItemL(const TDesC& mainText, const TDesC& subText, TInt idxIcon = -1);
    HBufC* AllocGrListItemL(const TDesC& text, TInt idxIcon = -1);

    CDesCArrayFlat* AllocGrPopupListItemsL(CHXAvURLList *list, const CHXAvNameDisplayTrait* pDisplayTrait = 0);
    TPtrC TextChunk(const TDesC& text, TInt idxChunk, TChar chDelimit = '\t');
    void UpdateScrollBar(CEikListBox* pListBox);
    CAknIconArray* AllocIconsL(const ImageInfo vec[], TInt imageCount, const TDesC& imageFilePath = KNullDesC);
    void AddIconHelperL(const TDesC& mbmPath, CHXAvMisc::ImageInfo const info[], TInt count, CAknIconArray*& pIcons);


    void FormatTimerText(TUint ms, TDes& des);

    // apps, wgid, process, etc. helpers
    void LaunchAppL(TInt uid, const TDesC& arg);
    TInt LaunchAppL(RFs& fsSession, const TDesC& appPath, const TDesC& doc);

    //void EnsureProcessNotRunningL(const TDesC& name);
    TInt GetThisWgId();
    TUid GetAppUidFromWgId(TInt wgid);
    HBufC8* MakeHXPlayerPrivateMessageL(const TDesC8& name);
    void BroadcastWsEventL(TUint type, const HBufC8* pMsg);

    bool IsAppFileL(const TDesC& file);
    enum ForEachAppInstanceCommand
    {
        KillApp,
        EndApp
    };
    void ForEachAppInstanceL(TUid uid, ForEachAppInstanceCommand command);

    //
    // misc
    //
    HBufC* AllocFileSizeDescL(TUint cbFile);
    HBufC* AllocDisplayFriendlyStringL(const TDesC& text, const TDesC& replaceChars = KStdWhitespaceCtrlChars);
    void MakeDisplayFriendly(TDes& des, const TDesC& replaceChars = KStdWhitespaceCtrlChars);
    void ReplaceCharacters(TDes& text, const TDesC& replaceChars, TChar chWith);

    TInt RunAccessPointSettingPageL(TInt wapApId = 0);
    void AddTabL(CAknTabGroup* pGroup, const TDesC& imageFilePath, 	TInt idRes, TInt idxImage, TInt idxMask);
    //TUint GetValidRootCountL(const utVector<avMediaFolderInfoPtr>& mediaFolderInfo);
    HBufC* AllocTimerTextL(TUint ms);
    void InitDebugMenuItemsL(CEikMenuPane* pPane);
    void AddMenuItemL(CEikMenuPane* pPane, TInt idCmd, TInt resIdText);
    
    void InitHelpMenuItem(CEikMenuPane* pPane);
    HBufC* AllocTitleL(CHXAvPlayer* pPlayer);

    inline
    HBufC* AllocGrListItemL(const TDesC& text, TInt idxIcon)
    {
        return AllocGrListItemL(text, KNullDesC, idxIcon);
    }

} // ns CHXAvMisc

using namespace CHXAvMisc;

#endif // _chxavmisc_h_

⌨️ 快捷键说明

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