michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=2 et tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __nsPIDOMStorage_h_ michael@0: #define __nsPIDOMStorage_h_ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsString.h" michael@0: #include "nsTArray.h" michael@0: michael@0: class nsIPrincipal; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class DOMStorageCache; michael@0: class DOMStorageManager; michael@0: michael@0: } // ::dom michael@0: } // ::mozilla michael@0: michael@0: // {09198A51-5D27-4992-97E4-38A9CEA2A65D} michael@0: #define NS_PIDOMSTORAGE_IID \ michael@0: { 0x9198a51, 0x5d27, 0x4992, \ michael@0: { 0x97, 0xe4, 0x38, 0xa9, 0xce, 0xa2, 0xa6, 0x5d } } michael@0: michael@0: class nsPIDOMStorage : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMSTORAGE_IID) michael@0: michael@0: enum StorageType { michael@0: LocalStorage = 1, michael@0: SessionStorage = 2 michael@0: }; michael@0: michael@0: virtual StorageType GetType() const = 0; michael@0: virtual mozilla::dom::DOMStorageManager* GetManager() const = 0; michael@0: virtual const mozilla::dom::DOMStorageCache* GetCache() const = 0; michael@0: michael@0: virtual nsTArray* GetKeys() = 0; michael@0: michael@0: virtual nsIPrincipal* GetPrincipal() = 0; michael@0: virtual bool PrincipalEquals(nsIPrincipal* principal) = 0; michael@0: virtual bool CanAccess(nsIPrincipal *aPrincipal) = 0; michael@0: virtual bool IsPrivate() = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMStorage, NS_PIDOMSTORAGE_IID) michael@0: michael@0: #endif // __nsPIDOMStorage_h_