00001 /* AbiSource 00002 * 00003 * Copyright (C) 2011 Volodymyr Rudyj <vladimir.rudoy@gmail.com> 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301 USA. 00019 */ 00020 #ifndef AP_DIALOG_EPUBEXPORTOPTIONS_H 00021 #define AP_DIALOG_EPUBEXPORTOPTIONS_H 00022 00023 #include "xap_App.h" 00024 #include "xap_Dialog.h" 00025 #include "xap_Prefs.h" 00026 00027 #define EPUB_EXPORT_SCHEME_NAME "EpubExporterOptions" 00028 00029 extern pt2Constructor ap_Dialog_EpubExportOptions_Constructor; 00030 struct XAP_Exp_EpubExportOptions 00031 { 00032 bool bSplitDocument; 00033 bool bRenderMathMLToPNG; 00034 bool bEpub2; 00035 }; 00036 00037 class AP_Dialog_EpubExportOptions : public XAP_Dialog_NonPersistent 00038 { 00039 public: 00040 AP_Dialog_EpubExportOptions(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); 00041 00042 virtual ~AP_Dialog_EpubExportOptions(void); 00043 00044 virtual void runModal(XAP_Frame * pFrame) = 0; 00045 00046 bool shouldSave() const; 00047 00048 void setEpubExportOptions(XAP_Exp_EpubExportOptions * exp_opt, XAP_App * app); 00049 static void getEpubExportDefaults(XAP_Exp_EpubExportOptions * exp_opt, XAP_App * app); 00050 protected: 00051 bool m_bShouldSave; 00052 00053 inline bool get_Epub2 () const { return m_exp_opt->bEpub2; } 00054 inline bool get_SplitDocument () const { return m_exp_opt->bSplitDocument; } 00055 inline bool get_RenderMathMlToPng () const { return m_exp_opt->bRenderMathMLToPNG; } 00056 00057 inline bool can_set_Epub2 () const { return true; } 00058 inline bool can_set_SplitDocument() const { return true; } 00059 inline bool can_set_RenderMathMlToPng() const { return !m_exp_opt->bEpub2; } 00060 00061 00062 void set_Epub2 (bool enable); 00063 void set_SplitDocument (bool enable); 00064 void set_RenderMathMlToPng (bool enable); 00065 00066 void saveDefaults(); 00067 void restoreDefaults(); 00068 00069 private: 00070 XAP_Exp_EpubExportOptions * m_exp_opt; 00071 XAP_App * m_app; 00072 00073 }; 00074 #endif /* AP_DIALOG_EPUBEXPORTOPTIONS_H */ 00075