2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsXBLPrototypeResources_h__
|
|
|
|
#define nsXBLPrototypeResources_h__
|
|
|
|
|
2013-03-21 17:05:20 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsICSSLoaderObserver.h"
|
|
|
|
#include "nsIStyleRuleProcessor.h"
|
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsIAtom;
|
|
|
|
class nsXBLResourceLoader;
|
|
|
|
class nsXBLPrototypeBinding;
|
2010-05-11 13:41:47 -07:00
|
|
|
class nsCSSStyleSheet;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// *********************************************************************/
|
|
|
|
// The XBLPrototypeResources class
|
|
|
|
|
|
|
|
class nsXBLPrototypeResources
|
|
|
|
{
|
|
|
|
public:
|
2014-04-10 07:05:21 -07:00
|
|
|
nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding);
|
|
|
|
~nsXBLPrototypeResources();
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
void LoadResources(bool* aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
void AddResource(nsIAtom* aResourceType, const nsAString& aSrc);
|
|
|
|
void AddResourceListener(nsIContent* aElement);
|
|
|
|
nsresult FlushSkinSheets();
|
|
|
|
|
2011-11-03 13:39:08 -07:00
|
|
|
nsresult Write(nsIObjectOutputStream* aStream);
|
|
|
|
|
2014-04-10 07:05:21 -07:00
|
|
|
void Traverse(nsCycleCollectionTraversalCallback &cb) const;
|
|
|
|
|
|
|
|
void ClearLoader();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-11 13:41:47 -07:00
|
|
|
typedef nsTArray<nsRefPtr<nsCSSStyleSheet> > sheet_array_type;
|
2014-04-10 07:05:21 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
// A loader object. Exists only long enough to load resources, and then it dies.
|
2014-04-10 07:05:21 -07:00
|
|
|
nsRefPtr<nsXBLResourceLoader> mLoader;
|
2014-04-10 07:05:21 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
// A list of loaded stylesheets for this binding.
|
|
|
|
sheet_array_type mStyleSheetList;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// The list of stylesheets converted to a rule processor.
|
|
|
|
nsCOMPtr<nsIStyleRuleProcessor> mRuleProcessor;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|