#ifndef PROXIFIER_CONFIG #define PROXIFIER_CONFIG #include #include #include using namespace std; class QDomDocument; class Proxifier { public: /** * @brief class representing Proxifier's proxy setting */ class Proxy { public: string login; string password; string host; string type; short port; // proxifier-specific fields int id; short option; bool emptyAuth; Proxy(); }; /** * @brief class representing Proxifier's proxy chain */ class Chain { public: /** * @brief chain id */ int id; /** * @brief chain name */ string name; /** * @brief associative array of proxies in the chain - [id: isEnabled] */ map proxies; Chain(); }; class Rule { public: /** * @brief indicates if the rule is enabled */ bool isEnabled; /** * @brief rule name */ string name; /** * @brief list of applications the rule affects */ string apps; /** * @brief rule targets (list of hosts separeted w ';') */ string targets; /** * @brief rule ports (e.g.: 80; 8000-9000; 8080) */ string ports; /** * @brief rule action (one of: 'Direct', 'Block', 'Chain', 'Proxy') */ string action; /** * @brief action parameter (applicable only to 'Chain' and 'Proxy' actions) */ int id; Rule(); }; static Proxifier* GetInstance(); bool IsValid(); void Update(); private: static Proxifier *instance; bool valid; QDomDocument *configDom; vector proxyList; vector chainList; vector ruleList; Proxifier(); bool UpdateProxyList(QDomElement& root); bool UpdateChainList(QDomElement& root); bool UpdateRuleList(QDomElement& root); }; #endif