#pragma once #include #include #include #include struct MyPoint { long x; long y; }; // ͼÏñʶ±ð²ÎÊý struct OCRWindowParams { int top; // Éϱ߾à int width; // ¿í¶È int height; // ¸ß¶È float scale; // Ëõ·Å±¶Êý }; using namespace std; class ConfigUtil { private: static string getConfigPath(); static void readConfig(libconfig::Config& config); static void writeConfig(libconfig::Config& config); public: static int readIntConfig(const char* key); static string readStringConfig(const char* key); static void setIntConfig(const char* key, int val); static void setStringConfig(const char* key, string val); static list getKeys(); static void delKey(string key); static bool isTradeRefresh(); static bool isGroupRefresh(); static bool isAutoFocus(); static bool isTradeQuickKey(); // »ñÈ¡Âô³ö¹æÔòµ¯¿òÏÔʾµÄλÖà static int* getSellRuleDialogShowPos(); static void setTradeRefresh(bool enable); static void setGroupRefresh(bool enable); static void setAutoFocus(bool enable); static void setTradeQuickKey(bool enable); static void setSellRuleDialogShowPos(int x, int y); static void setWindowPos(int x,int y); //½»Ò×Ë¢ÐÂÆµÂÊ static int getThsAutoRefreshTimeSpace(); static void setThsAutoRefreshTimeSpace(int ms); // Á¿ÉèÖà static list getVolumesSetting(); static void setVolumesSetting(list volumes); // ´°¿ÚλÖà static MyPoint getWindowPos(); // ±£´æ´úÂëÃû×ÖÓ³Éä static void setCodeNames(std::map codeNameMap); // »ñÈ¡´úÂëÃû×ÖÓ³Éä static map getCodeNames(); // ÂòÈë½ð¶îÉèÖà static void setBuyMoney(int money); // ÂòÈë½ð¶î»ñÈ¡ static int getBuyMoney(); // Âô³ö½ð¶îÉèÖà static void setSellMoney(int money); // Âô³ö½ð¶î»ñÈ¡ static int getSellMoney(); static void setOCRWindowParams(OCRWindowParams params); static OCRWindowParams getOCRWindowParams(); // ÉèÖÃÊÇ·ñ¿ÉÒÔʶ±ðͬ»¨Ë³´úÂë static void setEnableOCRCode(bool enable); static bool getEnableOCRCode(); };