gecko-dev/dom/base/nsBarProps.h

112 lines
2.9 KiB
C
Raw Normal View History

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 11:12:37 +00: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-06-09 18:59:04 +00:00
/* BarProps are the collection of little properties of DOM windows whose
only property of their own is "visible". They describe the window
chrome which can be made visible or not through JavaScript by setting
the appropriate property (window.menubar.visible)
*/
#ifndef nsBarProps_h___
#define nsBarProps_h___
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIDOMBarProp.h"
#include "nsIWeakReference.h"
1999-06-09 18:59:04 +00:00
class nsGlobalWindow;
class nsIWebBrowserChrome;
1999-06-09 18:59:04 +00:00
// Script "BarProp" object
class nsBarProp : public nsIDOMBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsBarProp(nsGlobalWindow *aWindow);
virtual ~nsBarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_ISUPPORTS
1999-06-09 18:59:04 +00:00
NS_IMETHOD GetVisibleByFlag(bool *aVisible, uint32_t aChromeFlag);
NS_IMETHOD SetVisibleByFlag(bool aVisible, uint32_t aChromeFlag);
1999-06-09 18:59:04 +00:00
protected:
already_AddRefed<nsIWebBrowserChrome> GetBrowserChrome();
nsGlobalWindow *mDOMWindow;
nsCOMPtr<nsIWeakReference> mDOMWindowWeakref;
/* Note the odd double reference to the owning global window.
Since the corresponding DOM window nominally owns this object,
but refcounted ownership of this object can be handed off to
owners unknown, we need a weak ref back to the DOM window.
However we also need access to properties of the DOM Window
that aren't available through interfaces. Then it's either
a weak ref and some skanky casting, or this funky double ref.
Funky beats skanky, so here we are. */
1999-06-09 18:59:04 +00:00
};
// Script "menubar" object
class nsMenubarProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsMenubarProp(nsGlobalWindow *aWindow);
virtual ~nsMenubarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
// Script "toolbar" object
class nsToolbarProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsToolbarProp(nsGlobalWindow *aWindow);
virtual ~nsToolbarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
// Script "locationbar" object
class nsLocationbarProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsLocationbarProp(nsGlobalWindow *aWindow);
virtual ~nsLocationbarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
// Script "personalbar" object
class nsPersonalbarProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsPersonalbarProp(nsGlobalWindow *aWindow);
virtual ~nsPersonalbarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
// Script "statusbar" object
class nsStatusbarProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsStatusbarProp(nsGlobalWindow *aWindow);
virtual ~nsStatusbarProp();
1999-06-09 18:59:04 +00:00
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
// Script "scrollbars" object
class nsScrollbarsProp : public nsBarProp
{
1999-06-09 18:59:04 +00:00
public:
explicit nsScrollbarsProp(nsGlobalWindow *aWindow);
virtual ~nsScrollbarsProp();
NS_DECL_NSIDOMBARPROP
1999-06-09 18:59:04 +00:00
};
#endif /* nsBarProps_h___ */