00001 00006 /* 00007 * CC PDF Converter: Windows PDF Printer with Creative Commons license support 00008 * Excel to PDF Converter: Excel PDF printing addin, keeping hyperlinks AND Creative Commons license support 00009 * Copyright (C) 2007-2010 Guy Hachlili <[email protected]>, Cogniview LTD. 00010 * 00011 * This file is part of CC PDF Converter / Excel to PDF Converter 00012 * 00013 * CC PDF Converter and Excel to PDF Converter are free software; 00014 * you can redistribute them and/or modify them under the terms of the 00015 * GNU General Public License as published by the Free Software Foundation; 00016 * either version 2 of the License, or (at your option) any later version. 00017 * 00018 * CC PDF Converter and Excel to PDF Converter are is distributed in the hope 00019 * that they will be useful, but WITHOUT ANY WARRANTY; without even the implied 00020 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00025 */ 00026 00027 #ifndef _LICENSEINFOLOADER_H_ 00028 #define _LICENSEINFOLOADER_H_ 00029 00030 #include "LicenseInfo.h" 00031 00035 struct LicenseInfoLoader : public LicenseInfo 00036 { 00037 public: 00041 LicenseInfoLoader() : LicenseInfo() {}; 00046 LicenseInfoLoader(const LicenseInfo& info) : LicenseInfo(info) {}; 00047 00048 protected: 00049 // Static members 00051 static XDoc m_xmlData[LLDT_Count]; 00053 static bool m_bRetrievedFromWeb[LLDT_Count]; 00054 00055 public: 00056 // Methods 00058 LoadedLicenseDataType GetCCLicenseType() const; 00059 00061 std::tstring GetLicenseName() const; 00063 UINT GetLicenseImageID() const; 00064 00066 bool LoadLicenseData(HWND hParent); 00067 00068 protected: 00069 // Helpers 00071 bool RequestLicense(HWND hParent, XDoc& doc, bool& bCancel); 00072 00073 public: 00074 // Static methods 00076 static void InitLicenseRetrievedData(); 00077 00083 static const XDoc& GetLicenseXML(LoadedLicenseDataType eType) {return m_xmlData[eType];}; 00085 static bool RequestLicenseType(LoadedLicenseDataType eType, HWND hWnd, bool& bCancel); 00086 00087 protected: 00088 // Static Helpers 00090 static bool IsValidLicenseInfo(LoadedLicenseDataType eType); 00092 00097 static bool IsLicenseRetrievedData(LoadedLicenseDataType eType) {return m_bRetrievedFromWeb[eType];}; 00099 static bool LoadData(LoadedLicenseDataType eType, LPCTSTR pXML); 00100 00102 static bool LoadAndValidateData(LoadedLicenseDataType eType, XDoc& doc, LPCTSTR pXML); 00104 static bool LoadInternalLicenseInfo(LoadedLicenseDataType eType); 00106 static bool IsValidLicenseInfo(LoadedLicenseDataType eType, XDoc& doc); 00111 static void SetLicenseRetrieved(LoadedLicenseDataType eType) {m_bRetrievedFromWeb[eType] = true;}; 00112 00114 static LPCTSTR GetLicenseURL(LoadedLicenseDataType eType); 00116 static LPCTSTR GetImageURL(LoadedLicenseDataType eType); 00117 }; 00118 00119 #endif //#define _LICENSEINFOLOADER_H_