00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XAP_DIALOG_HTMLOPTIONS_H
00023 #define XAP_DIALOG_HTMLOPTIONS_H
00024
00025
00026
00027
00028
00029 #ifndef UT_TYPES_H
00030 #include "ut_types.h"
00031 #endif
00032
00033 #include "xap_Dialog.h"
00034
00035 class XAP_App;
00036 class UT_UTF8String;
00037
00038 struct XAP_Exp_HTMLOptions
00039 {
00040 bool bIs4;
00041 bool bIsAbiWebDoc;
00042 bool bDeclareXML;
00043 bool bAllowAWML;
00044 bool bEmbedCSS;
00045 bool bLinkCSS;
00046 bool bEmbedImages;
00047 bool bClassOnly;
00048 bool bAbsUnits;
00049 bool bScaleUnits;
00050 UT_uint32 iCompact;
00051
00052
00053 bool bMultipart;
00054 };
00055
00056 class ABI_EXPORT XAP_Dialog_HTMLOptions : public XAP_Dialog_NonPersistent
00057 {
00058 public:
00059 XAP_Dialog_HTMLOptions (XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00060
00061 virtual ~XAP_Dialog_HTMLOptions (void);
00062
00063 virtual void runModal (XAP_Frame * pFrame) = 0;
00064
00065 bool shouldSave () const { return m_bShouldSave; }
00066
00067 void setHTMLOptions (XAP_Exp_HTMLOptions * exp_opt, XAP_App * app);
00068 static void getHTMLDefaults (XAP_Exp_HTMLOptions * exp_opt, XAP_App * app);
00069
00070 protected:
00071 inline bool get_HTML4 () const { return m_exp_opt->bIs4; }
00072 inline bool get_PHTML () const { return m_exp_opt->bIsAbiWebDoc; }
00073 inline bool get_Declare_XML () const { return m_exp_opt->bDeclareXML; }
00074 inline bool get_Allow_AWML () const { return m_exp_opt->bAllowAWML; }
00075 inline bool get_Embed_CSS () const { return m_exp_opt->bEmbedCSS; }
00076 inline bool get_Link_CSS () const { return m_exp_opt->bLinkCSS; }
00077 inline bool get_Class_Only() const { return m_exp_opt->bClassOnly; }
00078 inline bool get_Embed_Images () const { return m_exp_opt->bEmbedImages; }
00079 inline bool get_Multipart () const { return m_exp_opt->bMultipart; }
00080 inline bool get_Abs_Units () const { return m_exp_opt->bAbsUnits; }
00081 inline bool get_Scale_Units () const { return m_exp_opt->bScaleUnits; }
00082 inline UT_uint32 get_Compact () const { return m_exp_opt->iCompact; }
00083
00084 UT_UTF8String & get_Link_CSS_File() const { return *m_pLinkCSS; }
00085
00086 inline bool can_set_Declare_XML () const { return m_exp_opt->bIs4 ? false : true; }
00087 inline bool can_set_Allow_AWML () const { return m_exp_opt->bIs4 ? false : true; }
00088 inline bool can_set_Embed_CSS () const { return m_exp_opt->bIsAbiWebDoc ? false : true; }
00089 inline bool can_set_Link_CSS () const { return true; }
00090 inline bool can_set_Class_Only () const { return true; }
00091 inline bool can_set_Abs_Units () const { return true; }
00092 inline bool can_set_Scale_Units () const { return true; }
00093 inline bool can_set_Embed_Images () const { return m_exp_opt->bMultipart ? false : true; }
00094
00095 void set_HTML4 (bool enable);
00096 void set_PHTML (bool enable);
00097 void set_Declare_XML (bool enable);
00098 void set_Allow_AWML (bool enable);
00099 void set_Embed_CSS (bool enable);
00100 void set_Link_CSS (bool enable);
00101 void set_Class_Only (bool enable);
00102 void set_Embed_Images (bool enable);
00103
00104 void set_Link_CSS_File (const char * file);
00105 void set_Abs_Units (bool enable);
00106 void set_Scale_Units (bool enable);
00107 void set_Compact (UT_uint32 i) {m_exp_opt->iCompact = i;}
00108
00109 void saveDefaults ();
00110 void restoreDefaults ();
00111
00112 bool m_bShouldSave;
00113
00114 private:
00115 XAP_Exp_HTMLOptions * m_exp_opt;
00116 XAP_App * m_app;
00117 UT_UTF8String * m_pLinkCSS;
00118 };
00119
00120 #endif