Brian Stell wrote:

> Here is a rough draft:
> 
> Existing APIs:
> 
> 1) set default charset
> 
>     SetDefaultCharacterSet(const PRUnichar* aForceCharacterSet)
> 
> 2) force charset override
> 
>     SetForceCharacterSet(const PRUnichar* aForceCharacterSet)
>   or
>     SetForcedCharacterSet(const PRUnichar* aForceCharacterSet)
> 
>     Note: this needs to be followed by a reload
> 
> 3) find out what charset was used and how selected
> 
>     GetDocumentCharacterSet(nsAWritableString& oCharSetID)
> 
> 
>http://lxr.mozilla.org/seamonkey/source/intl/chardet/public/nsIDocumentCharsetInfo.idl
> 
> 
>http://unstable.elemental.com/mozilla/build/latest/mozilla/intl/dox/class_nsIDocumentCharsetInfo.html
> 
> 
> 
> Proposed API:
> 
> interface nsIDocumentCharacterSetEncoding : nsISupports
>  {
> 
>    /*
>     * Set fallback encoding
>     */
>    void SetDefaultCharacterSetEncoding(in nsIAtom fallbackCharacterSetEncoding);
> 
>    /*
>     * Force an override encoding
>     * (requires a reload to update display)
>     */
>    void SetOverrideCharacterSetEncoding(in nsIAtom overrideCharacterSetEncoding);
> 
>    /*
>     * Get encoding used for this page and from where
>     * (where: http header / meta tag / auto detect / fallback)
>     */
>    nsIAtom GetCharacterSetEncoding(out nsIAtom characterSetEncodingFrom);
> 
>  };

Shouldn't these be attributes (i.e., don't you want to support getting 
the default and override c.s.e. values)?

How about doc comments for doxygen and future javadoc-style comment 
extraction goodness.

Are atoms the right type for the c.s.e. names?  Would scripts want to 
call this interface?  Color me curious, not anti-atom.

/be

> 
> 
> 
> 
> 
> 
> 
> 
> 



Reply via email to