2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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
|
|
|
|
|
|
|
/* 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"
|
|
|
|
|
|
|
|
class nsGlobalWindow;
|
|
|
|
class nsIWebBrowserChrome;
|
|
|
|
|
|
|
|
// Script "BarProp" object
|
|
|
|
class nsBarProp : public nsIDOMBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsBarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsBarProp();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetVisibleByFlag(bool *aVisible, uint32_t aChromeFlag);
|
|
|
|
NS_IMETHOD SetVisibleByFlag(bool aVisible, uint32_t aChromeFlag);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
2011-04-27 13:54:07 -07:00
|
|
|
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. */
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
// Script "menubar" object
|
|
|
|
class nsMenubarProp : public nsBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsMenubarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsMenubarProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
// Script "toolbar" object
|
|
|
|
class nsToolbarProp : public nsBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsToolbarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsToolbarProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
// Script "locationbar" object
|
|
|
|
class nsLocationbarProp : public nsBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsLocationbarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsLocationbarProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
// Script "personalbar" object
|
|
|
|
class nsPersonalbarProp : public nsBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsPersonalbarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsPersonalbarProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
// Script "statusbar" object
|
|
|
|
class nsStatusbarProp : public nsBarProp
|
|
|
|
{
|
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsStatusbarProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsStatusbarProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
// Script "scrollbars" object
|
2011-04-27 13:54:07 -07:00
|
|
|
class nsScrollbarsProp : public nsBarProp
|
|
|
|
{
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2011-04-27 13:54:07 -07:00
|
|
|
explicit nsScrollbarsProp(nsGlobalWindow *aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual ~nsScrollbarsProp();
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMBARPROP
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsBarProps_h___ */
|
|
|
|
|