Follow-on fix for bug 457825. Use sheet principal for agent and user sheets. r=dbaron...
[wine-gecko.git] / intl / chardet / src / nsDocumentCharsetInfo.cpp
blob36024744a6712406cd19ca05e4bf7a18231ee729
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsCharDetDll.h"
39 #include "nsIServiceManager.h"
40 #include "nsICharsetConverterManager.h"
41 #include "nsDocumentCharsetInfo.h"
42 #include "nsCOMPtr.h"
44 // XXX doc me
46 NS_IMPL_THREADSAFE_ISUPPORTS1(nsDocumentCharsetInfo, nsIDocumentCharsetInfo)
48 nsDocumentCharsetInfo::nsDocumentCharsetInfo()
50 mParentCharsetSource = 0;
53 nsDocumentCharsetInfo::~nsDocumentCharsetInfo()
57 NS_IMETHODIMP nsDocumentCharsetInfo::SetForcedCharset(nsIAtom * aCharset)
59 mForcedCharset = aCharset;
60 return NS_OK;
63 NS_IMETHODIMP nsDocumentCharsetInfo::GetForcedCharset(nsIAtom ** aResult)
65 *aResult = mForcedCharset;
66 if (mForcedCharset) NS_ADDREF(*aResult);
67 return NS_OK;
70 NS_IMETHODIMP nsDocumentCharsetInfo::SetForcedDetector(PRBool aForced)
72 // XXX write me
73 return NS_OK;
76 NS_IMETHODIMP nsDocumentCharsetInfo::GetForcedDetector(PRBool * aResult)
78 // XXX write me
79 return NS_OK;
82 NS_IMETHODIMP nsDocumentCharsetInfo::SetParentCharset(nsIAtom * aCharset)
84 mParentCharset = aCharset;
85 return NS_OK;
88 NS_IMETHODIMP nsDocumentCharsetInfo::GetParentCharset(nsIAtom ** aResult)
90 *aResult = mParentCharset;
91 if (mParentCharset) NS_ADDREF(*aResult);
92 return NS_OK;
95 NS_IMETHODIMP nsDocumentCharsetInfo::SetParentCharsetSource(PRInt32 aCharsetSource)
97 mParentCharsetSource = aCharsetSource;
98 return NS_OK;
101 NS_IMETHODIMP nsDocumentCharsetInfo::GetParentCharsetSource(PRInt32 * aParentCharsetSource)
103 *aParentCharsetSource = mParentCharsetSource;
104 return NS_OK;