platform/shared/common/AppMenu.h in rhodes-3.5.1.12 vs platform/shared/common/AppMenu.h in rhodes-5.5.0

- old
+ new

@@ -36,33 +36,54 @@ namespace rho { namespace common { struct CAppMenuItem { - enum EnumMenuType { emtNone = 0, emtSeparator, emtUrl, emtRefresh, emtHome, emtBack, emtSync, emtOptions, emtLog, emtExit, - emtClose, emtFullscreen }; + enum EnumMenuType { emtNone = 0, emtSeparator, emtExit, emtClose };//, emtUrl, emtRefresh, emtHome, emtBack, emtSync, emtOptions, emtLog, emtExit, emtClose, emtFullscreen }; String m_strLabel; String m_strLink; + bool m_isEnable; EnumMenuType m_eType; CAppMenuItem (const String &label, const String &link); - boolean processCommand(); + CAppMenuItem () : m_isEnable(true), m_eType(emtNone) {} + void processCommand(); }; class CAppMenu { DEFINE_LOGCLASS; common::CMutex m_mxAppMenu; - Vector<CAppMenuItem> m_arAppMenuItems; + Vector<CAppMenuItem> m_arAppMenuItems, m_arAppLeftMenuItems; + CAppMenuItem m_oLeftItem, m_oRightItem; + static const String g_actionTag; + static const String g_labelTag; + static const String g_disableTag; + public: - void setAppMenu(unsigned long valMenu); - void copyMenuItems(Vector<CAppMenuItem>& arAppMenuItems); + //void getMenuItems(rho::Vector< Hashtable<String, String> >& arRes); + void getMenuItemsEx(rho::Vector< Hashtable<String, String> >& arRes, bool bLeftMenu = false); + void getMenuButtonEx(Hashtable<String, String>& hashRes, bool bLeftItem = false); + //void setAppMenuJSONItems( const rho::Vector<rho::String>& arMenu, bool bLeftMenu = false ); + void setAppMenuJSONItemsEx( const rho::Vector<rho::String>& arMenu, bool bLeftMenu = false); + void setAppBackUrlWithJSONItems( const rho::Vector<rho::String>& arMenu ); -//private: - void addAppMenuItem( const String& strLabel, const String& strLink ); + void copyMenuItems(Vector<CAppMenuItem>& arAppMenuItems, bool bLeftMenu = false); + void setLeftButton( const rho::Hashtable<rho::String, rho::String>& hashButton ); + void setRightButton( const rho::Hashtable<rho::String, rho::String>& hashButton ); + + CAppMenuItem getLeftButton(); + CAppMenuItem getRightButton(); + + void setEnableMenuItem( const String& strLabel, bool enableItem, bool bLeftMenu = false ); + +private: + void addAppMenuItem( const String& strLabel, const String& strLink, bool bLeftMenu ); + + void changeButtonInfo(CAppMenuItem& button, const rho::Hashtable<rho::String, rho::String>& hashButton); }; } //namespace common } //namespace rho