osb.h

来自「khtml在gtk上的移植版本」· C头文件 代码 · 共 565 行 · 第 1/2 页

H
565
字号
    virtual Item* forwardItem()=0;    virtual int forwardListCount()=0;    virtual int pageCacheSize()=0;    virtual void setPageCacheSize(int sz)=0;    virtual int capacity()=0;    virtual void setCapacity(int sz)=0;    virtual void setChangedNotification(ChangedFunc notifyCallback, gpointer data)=0;};class Root{    RootImpl *impl;public:    Root(const gchar* frameName=NULL, const gchar* group=NULL);        virtual ~Root();        void setPreferences(const Preferences&);    Preferences* preferences();        void setGroup(const gchar* group);    const gchar* group();    Frame* mainFrame();        BackForwardList* backForwardList();    URLCredentialStorage* credentialStorage();    void goBack();    bool canGoBack();    void goForward();    bool canGoForward();        /** set text size multiplier     *  set text multiplier.      * @param multiplier the text size multiplier 0.0 == 0%, 1.0 == 100% etc     */    void setTextSizeMultiplier(float multiplier);    /** get text size multiplier */    float textSizeMultiplier();    void setFrameLoadDelegate(FrameLoadDelegate*);    void setResourceLoadDelegate(ResourceLoadDelegate*);    void setUIDelegate(UIDelegate*);    ProtocolDelegate* protocolDelegateForURL(const gchar* url);    void registerContentRepresentation(ContentRepresentationFactory* crf, const gchar* mimeType);    bool searchFor(const gchar *string, bool forward, bool caseSensitive);};class Frame{public:    virtual ~Frame() {};        virtual void startLoad(const char* url) = 0;    virtual void stopLoad() = 0;    virtual void refresh() = 0;    virtual GtkWidget* widget() = 0;    /** */    virtual const gchar* title() = 0;    virtual const gchar* location() = 0;};/** class for HTTP/URL credentials. */class URLCredential{public:    /** Available persistence options. */    enum Persistence {        None,        ForSession,        Permanent    };public:    URLCredential();    URLCredential(const gchar* user, const gchar* pass, Persistence p);    URLCredential(const URLCredential& other);    URLCredential& operator=(const URLCredential& other);    virtual ~URLCredential();          /** Returns the user part of the credentials. */    const gchar* user() const { return m_user?m_user:""; };    /** Returns the password part of the credentials. */    const gchar* password() const { return m_pass?m_pass:""; }        URLCredential::Persistence persistence() const { return m_pers; }private:    gchar *m_user, *m_pass;    Persistence m_pers;};/** Interface for HTTP/URL protection space. */class URLProtectionSpace{public:    /** Protection space proxy type. */    enum ProxyType {        NoProxy,        HTTPProxy,        HTTPSProxy,        FTPProxy,        SOCKSProxy    };    /** Protection space authentication method. */    enum AuthenticationMethod{        /** Default method. */        Default,        /** HTTP basic authentication. */        HTTPBasic,        /** HTTP MD5 digest authentication. */        HTTPDigest,        /** HTML Forms based authentication. */        HTMLForm    } ;        URLProtectionSpace(const gchar* url,		       		       const gchar* realm,		       URLProtectionSpace::AuthenticationMethod method,		       URLProtectionSpace::ProxyType proxyType);    URLProtectionSpace(const URLProtectionSpace&);    URLProtectionSpace& operator=(const URLProtectionSpace& other);    virtual ~URLProtectionSpace();    /** Returns the authentication method of the protection space. */    AuthenticationMethod authenticationMethod() const { return m_method; }    /** Returns the host of the protection space. */    const gchar * host() const { return m_host?m_host:""; }    /** Returns the scheme://host[:port]/path representation of the protection space. */    const gchar * hostPath() const {return m_url; }        /** Returns the host port of the protection space. */    const guint port() const { return m_port;}        /** Returns whether proxy authentication is used. */    gboolean isProxy() const {return m_proxyType != URLProtectionSpace::NoProxy; }    /** Returns the protocol part of the protection domain. */    const gchar * protocol() const {return m_protocol;}    /** Returns the type of the proxy. */    ProxyType proxyType() const { return m_proxyType; }    /** Returns the authentication realm */    const gchar * realm() const {return m_realm;}    /** Returns whether authentication in given domain is secure. */    gboolean receivesCredentialSecurely() const { return m_secure; }private:    URLProtectionSpace::AuthenticationMethod m_method;    URLProtectionSpace::ProxyType m_proxyType;    gboolean m_secure;    gchar* m_url;    gchar* m_realm;    gchar* m_protocol;    gchar* m_host;    guint m_port;};/** Interface for the credential storage. */class URLCredentialStorage{public:    /** Returns dictionary of all credentials */    // virtual const NSDictionary allCredentials();    /** Get default credentials for protection space. */    virtual const URLCredential * defaultCredential(const URLProtectionSpace &) const =0;    /** Set the default credentials for protection space. */    virtual void setDefaultCredential(const URLCredential &, const URLProtectionSpace &) = 0;    /** Get all credentials for protection space in a        dictionary.  Usernames work as keys and credentials        as values. *//*     virtual const NSDictionary * *//*         credential(URLProtectionSpace *) = 0; */    /** Set the default credentials for protection space. */    virtual void setCredential(const URLCredential &, const URLProtectionSpace &) = 0;        /** Removes credential from the credential storage        for the specified protectionSpace. */    virtual void removeCredential(const URLCredential &, const URLProtectionSpace &) = 0;};class Preferences{    friend class RootImpl;    /** preferences with default settings */    Preferences();    ~Preferences();    /* copy semantics */    Preferences(const Preferences& other);      Preferences& operator=(const Preferences&);public:    void setMinimumFontSize(float a);    float minimumFontSize();        void setMinimumLogicalFontSize(float a);    float minimumLogicalFontSize();        void setDefaultFontSize(float a);    float defaultFontSize();        void setDefaultFixedFontSize(float a);    float defaultFixedFontSize();        void setJavaEnabled(bool a);    bool javaEnabled();        void setPluginsEnabled(bool a);    bool pluginsEnabled();    void setJavaScriptEnabled(bool a);    bool javaScriptEnabled();    void setJavaScriptCanOpenWindowsAutomatically(bool a) ;    bool javaScriptCanOpenWindowsAutomatically();    void setWillLoadImagesAutomatically(bool a);    bool willLoadImagesAutomatically();    void setShouldPrintBackgrounds(bool a);    bool shouldPrintBackgrounds();    void  setUserStyleSheetLocation(const gchar* location);      const gchar* userStyleSheetLocation();    void setDefaultTextEncoding(const gchar* encoding);    const gchar* defaultTextEncoding();    void setStandardFontFamily(const gchar* s);    const gchar* standardFontFamily();    void setFixedFontFamily(const gchar* s);    const gchar* fixedFontFamily();        void setSerifFontFamily(const gchar* s);    const gchar* serifFontFamily();      void setSansSerifFontFamily(const gchar* s);    const gchar* sansSerifFontFamily();    void setCursiveFontFamily(const gchar* s);    const gchar* cursiveFontFamily();        void setFantasyFontFamily(const gchar* s);    const gchar* fantasyFontFamily();private:        PreferencesImpl* d;};} // namespace OSB#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?