📄 mghtml_settings.h
字号:
// In this file, the application gets the global parameters from this class. It will get the// parameters from the configure file. // Modify this file is not difficult.// ---------------------------------------------------------------------------------------- #ifndef __mghtml_settings_h__#define __mghtml_settings_h__#include <qstring.h>#include <qstringlist.h>#include <qmap.h>#include "mgcolor.h"class MGHTMLSettings{public: enum KJavaScriptAdvice { KJavaScriptDunno=0, KJavaScriptAccept, KJavaScriptReject, }; MGHTMLSettings(); // Called by constructor and reparseConfiguration void init(); void init(bool); //void init( KConfig * config, bool reset = true ); // Destructor. Don't delete any instance by yourself. virtual ~MGHTMLSettings() {}; // Behaviour settings bool changeCursor() { return m_bChangeCursor; } bool underlineLink() { return m_underlineLink; } // set cursor HCURSOR getLinkCursor() {return m_hLinkCursor; } void setLinkCursor(HCURSOR cursor) { m_hLinkCursor = cursor; } // Font settings QString stdFontName() const; QString fixedFontName() const; QString serifFontName() const; QString sansSerifFontName() const; QString cursiveFontName() const; QString fantasyFontName() const; // these two can be set. Mainly for historical reasons (the method in MGHTMLPart exists...) void setStdFontName(const QString &n); void setFixedFontName(const QString &n); const QValueList<int> &fontSizes() const { return m_fontSizes; } void setFontSizes(const QValueList<int> &newFontSizes ); void resetFontSizes(); int minFontSize() const { return m_minFontSize; } // the charset used to display the current document. MGFont::CharSet charset() const { return m_charset; } const QString &encoding() const { return m_encoding; } void setCharset( MGFont::CharSet c); // Color settings const MGColor& textColor() { return m_textColor; } const MGColor& linkColor() { return m_linkColor; } const MGColor& vLinkColor() { return m_vLinkColor; } // Autoload images bool autoLoadImages() { return m_bAutoLoadImages; } // Java and JavaScript bool isJavaEnabled( const QString& hostname = QString::null ); bool isJavaScriptEnabled( const QString& hostname = QString::null ); bool isCSSEnabled( const QString& hostname = QString::null ); // helpers for parsing domain-specific configuration, used in KControl module as well static KJavaScriptAdvice strToAdvice(const QString& _str); static void splitDomainAdvice(const QString& configStr, QString &domain, KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice); static const char* adviceToStr(KJavaScriptAdvice _advice); MGString settingsToCSS() const; QString availableFamilies() const { return availFamilies; }private: void setFont(const MGFont::CharSet &charset, int i, const QString &n); QString lookupFont(const MGFont::CharSet &charset, int i) const; private: bool m_bChangeCursor; // when point to a link, whether change cursor bool m_underlineLink; // whether draw a line under the link text. int m_fontSize; QValueList<int> m_fontSizes; // to build a list to store the font size int m_minFontSize; MGFont::CharSet m_charset; bool enforceCharset; // ????? QString m_encoding; // ????? MGColor m_textColor; MGColor m_linkColor; MGColor m_vLinkColor; bool m_bAutoLoadImages; bool m_bEnableJava; bool m_bEnableJavaScript; bool m_bEnableCSS; QMap<QString,KJavaScriptAdvice> javaDomainPolicy; QMap<QString,KJavaScriptAdvice> javaScriptDomainPolicy; QMap<MGFont::CharSet, QStringList> fontsForCharset; QStringList defaultFonts; QString availFamilies; HCURSOR m_hLinkCursor;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -