#pragma once // CMBEmotions command target #include using namespace std; class AFX_EXT_CLASS CMBEmotionItem : public CObject { public: CMBEmotionItem() { m_nIndex = 0; m_pBitmap = NULL; } virtual ~CMBEmotionItem() { } void operator = ( const CMBEmotionItem &Item ) { m_strFileDir = Item.m_strFileDir; m_strFixedImage = Item.m_strFixedImage; m_strFileName = Item.m_strFileName; m_strShortCut = Item.m_strShortCut; m_strTip = Item.m_strTip; m_strPinYin = Item.m_strPinYin; m_nIndex = Item.m_nIndex; m_pBitmap = Item.m_pBitmap; } public: CString m_strFileDir; CString m_strFixedImage; CString m_strFileName; CString m_strShortCut; CString m_strTip; CString m_strPinYin; int m_nIndex; IBitmap *m_pBitmap ; }; typedef CMap CMapEmotions; typedef CArray CArrayEmotionItem; class AFX_EXT_CLASS CMBEmotions : public CObject { public: CMBEmotions(); virtual ~CMBEmotions(); static CMBEmotions* Instance(); void GetEmotionsArray(CStringArray &arImages); BOOL LoadEmotions( LPCTSTR strFolder = NULL); BOOL LoadExtrenEmotions( LPCTSTR strFolder= NULL ); int GetCount(); void CleanData(); CString GetEmotionsFolder(); CMBEmotionItem* GetEmotion( int nIndex); int GetDefEndIndex(); int GetExt2EndIndex(); int GetExt3EndIndex(); void GetExtEmotionFolderName( CString &strExtrenFolder2 ,CString &strExtrenFolder3); int LookupEmotionIndex(CString strShortcut); private: CString m_strFolder; CArrayEmotionItem m_arEmotions; CString m_strExtrenFolder2; CString m_strExtrenFolder3; int m_nEmotionEndIndex; int m_nExtrenEmotionEndIndex2; int m_nExtrenEmotionEndIndex3; CMapEmotions m_mapEmotionsShortcut; };