michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 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 mozilla_dom_TabContext_h michael@0: #define mozilla_dom_TabContext_h michael@0: michael@0: #include "mozilla/layout/RenderFrameUtils.h" michael@0: #include "mozIApplication.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: struct IPCTabContext; michael@0: michael@0: /** michael@0: * TabContext encapsulates information about an iframe that may be a mozbrowser michael@0: * or mozapp. You can ask whether a TabContext corresponds to a mozbrowser or michael@0: * mozapp, get the app that contains the browser, and so on. michael@0: * michael@0: * TabParent and TabChild both inherit from TabContext, and you can also have michael@0: * standalone TabContext objects. michael@0: * michael@0: * This class is immutable except by calling one of the protected michael@0: * SetTabContext*() methods (and those methods can only be called once). See michael@0: * also MutableTabContext. michael@0: */ michael@0: class TabContext michael@0: { michael@0: protected: michael@0: typedef mozilla::layout::ScrollingBehavior ScrollingBehavior; michael@0: michael@0: public: michael@0: TabContext(); michael@0: michael@0: /* (The implicit copy-constructor and operator= are fine.) */ michael@0: michael@0: /** michael@0: * Generates IPCTabContext of type BrowserFrameIPCTabContext or michael@0: * AppFrameIPCTabContext from this TabContext's information. michael@0: */ michael@0: IPCTabContext AsIPCTabContext() const; michael@0: michael@0: /** michael@0: * Does this TabContext correspond to a mozbrowser? (