2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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 nsDataHandler_h___
|
|
|
|
#define nsDataHandler_h___
|
|
|
|
|
|
|
|
#include "nsIProtocolHandler.h"
|
|
|
|
|
|
|
|
class nsDataHandler : public nsIProtocolHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIProtocolHandler methods:
|
|
|
|
NS_DECL_NSIPROTOCOLHANDLER
|
|
|
|
|
|
|
|
// nsDataHandler methods:
|
|
|
|
nsDataHandler();
|
|
|
|
virtual ~nsDataHandler();
|
|
|
|
|
|
|
|
// Define a Create method to be used with a factory:
|
2010-06-10 11:11:40 -07:00
|
|
|
static nsresult
|
2007-03-22 10:30:00 -07:00
|
|
|
Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
|
2007-08-21 10:28:22 -07:00
|
|
|
|
|
|
|
// Parse a data: URI and return the individual parts
|
|
|
|
// (the given spec will temporarily be modified but will be returned
|
|
|
|
// to the original before returning)
|
|
|
|
static NS_HIDDEN_(nsresult) ParseURI(nsCString& spec,
|
|
|
|
nsCString& contentType,
|
|
|
|
nsCString& contentCharset,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool& isBase64,
|
2011-05-24 08:40:10 -07:00
|
|
|
nsCString& dataBuffer,
|
|
|
|
nsCString& hashRef);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsDataHandler_h___ */
|