2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
1999-09-17 20:12:41 +04:00
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
#ifndef nsJARProtocolHandler_h__
|
|
|
|
#define nsJARProtocolHandler_h__
|
1999-09-17 20:12:41 +04:00
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
#include "nsIJARProtocolHandler.h"
|
1999-09-17 20:12:41 +04:00
|
|
|
#include "nsIProtocolHandler.h"
|
1999-11-08 00:55:12 +03:00
|
|
|
#include "nsIJARURI.h"
|
2000-05-25 12:32:09 +04:00
|
|
|
#include "nsIZipReader.h"
|
2001-11-30 01:29:00 +03:00
|
|
|
#include "nsIMIMEService.h"
|
2001-12-20 06:46:21 +03:00
|
|
|
#include "nsWeakReference.h"
|
2000-05-25 12:32:09 +04:00
|
|
|
#include "nsCOMPtr.h"
|
1999-09-17 20:12:41 +04:00
|
|
|
|
1999-11-08 00:55:12 +03:00
|
|
|
class nsJARProtocolHandler : public nsIJARProtocolHandler
|
2001-12-20 06:46:21 +03:00
|
|
|
, public nsSupportsWeakReference
|
1999-09-17 20:12:41 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
2005-09-16 11:09:35 +04:00
|
|
|
NS_DECL_NSIPROTOCOLHANDLER
|
|
|
|
NS_DECL_NSIJARPROTOCOLHANDLER
|
1999-09-17 20:12:41 +04:00
|
|
|
|
|
|
|
// nsJARProtocolHandler methods:
|
|
|
|
nsJARProtocolHandler();
|
|
|
|
virtual ~nsJARProtocolHandler();
|
|
|
|
|
2005-09-16 11:09:35 +04:00
|
|
|
static nsJARProtocolHandler *GetSingleton();
|
1999-09-17 20:12:41 +04:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
2001-11-30 01:29:00 +03:00
|
|
|
// returns non addref'ed pointer.
|
2003-01-18 05:15:14 +03:00
|
|
|
nsIMIMEService *MimeService();
|
|
|
|
nsIZipReaderCache *JarCache() { return mJARCache; }
|
2001-11-30 01:29:00 +03:00
|
|
|
|
1999-09-17 20:12:41 +04:00
|
|
|
protected:
|
2000-05-25 12:32:09 +04:00
|
|
|
nsCOMPtr<nsIZipReaderCache> mJARCache;
|
2001-11-30 01:29:00 +03:00
|
|
|
nsCOMPtr<nsIMIMEService> mMimeService;
|
1999-09-17 20:12:41 +04:00
|
|
|
};
|
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
extern nsJARProtocolHandler *gJarHandler;
|
|
|
|
|
2004-09-14 22:32:13 +04:00
|
|
|
#define NS_JARPROTOCOLHANDLER_CLASSNAME \
|
|
|
|
"nsJarProtocolHandler"
|
|
|
|
#define NS_JARPROTOCOLHANDLER_CID \
|
|
|
|
{ /* 0xc7e410d4-0x85f2-11d3-9f63-006008a6efe9 */ \
|
|
|
|
0xc7e410d4, \
|
|
|
|
0x85f2, \
|
|
|
|
0x11d3, \
|
|
|
|
{0x9f, 0x63, 0x00, 0x60, 0x08, 0xa6, 0xef, 0xe9} \
|
|
|
|
}
|
|
|
|
|
2003-01-18 05:15:14 +03:00
|
|
|
#endif // !nsJARProtocolHandler_h__
|