LCOV - code coverage report
Current view: top level - dom/base - BarProps.h (source / functions) Hit Total Coverage
Test: output.info Lines: 1 1 100.0 %
Date: 2017-07-14 16:53:18 Functions: 4 7 57.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : /* BarProps are the collection of little properties of DOM windows whose
       8             :    only property of their own is "visible".  They describe the window
       9             :    chrome which can be made visible or not through JavaScript by setting
      10             :    the appropriate property (window.menubar.visible)
      11             : */
      12             : 
      13             : #ifndef mozilla_dom_BarProps_h
      14             : #define mozilla_dom_BarProps_h
      15             : 
      16             : #include "mozilla/Attributes.h"
      17             : #include "nsCycleCollectionParticipant.h"
      18             : #include "nsWrapperCache.h"
      19             : #include "nsPIDOMWindow.h"
      20             : #include "mozilla/dom/BindingDeclarations.h"
      21             : 
      22             : class nsGlobalWindow;
      23             : class nsIWebBrowserChrome;
      24             : 
      25             : namespace mozilla {
      26             : 
      27             : class ErrorResult;
      28             : 
      29             : namespace dom {
      30             : 
      31             : // Script "BarProp" object
      32             : class BarProp : public nsISupports,
      33             :                 public nsWrapperCache
      34             : {
      35             : public:
      36             :   explicit BarProp(nsGlobalWindow *aWindow);
      37             : 
      38             :   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
      39          24 :   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BarProp)
      40             : 
      41             :   nsPIDOMWindowInner* GetParentObject() const;
      42             : 
      43             :   virtual JSObject*
      44             :   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
      45             : 
      46             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) = 0;
      47             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
      48             :                           ErrorResult& aRv) = 0;
      49             : 
      50             : protected:
      51             :   virtual ~BarProp();
      52             : 
      53             :   bool GetVisibleByFlag(uint32_t aChromeFlag, ErrorResult& aRv);
      54             :   void SetVisibleByFlag(bool aVisible, uint32_t aChromeFlag,
      55             :                         CallerType aCallerType, ErrorResult &aRv);
      56             : 
      57             :   already_AddRefed<nsIWebBrowserChrome> GetBrowserChrome();
      58             : 
      59             :   RefPtr<nsGlobalWindow> mDOMWindow;
      60             : };
      61             : 
      62             : // Script "menubar" object
      63             : class MenubarProp final : public BarProp
      64             : {
      65             : public:
      66             :   explicit MenubarProp(nsGlobalWindow *aWindow);
      67             :   virtual ~MenubarProp();
      68             : 
      69             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
      70             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
      71             :                           ErrorResult& aRv) override;
      72             : };
      73             : 
      74             : // Script "toolbar" object
      75             : class ToolbarProp final : public BarProp
      76             : {
      77             : public:
      78             :   explicit ToolbarProp(nsGlobalWindow *aWindow);
      79             :   virtual ~ToolbarProp();
      80             : 
      81             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
      82             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
      83             :                           ErrorResult& aRv) override;
      84             : };
      85             : 
      86             : // Script "locationbar" object
      87             : class LocationbarProp final : public BarProp
      88             : {
      89             : public:
      90             :   explicit LocationbarProp(nsGlobalWindow *aWindow);
      91             :   virtual ~LocationbarProp();
      92             : 
      93             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
      94             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
      95             :                           ErrorResult& aRv) override;
      96             : };
      97             : 
      98             : // Script "personalbar" object
      99             : class PersonalbarProp final : public BarProp
     100             : {
     101             : public:
     102             :   explicit PersonalbarProp(nsGlobalWindow *aWindow);
     103             :   virtual ~PersonalbarProp();
     104             : 
     105             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
     106             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
     107             :                           ErrorResult& aRv) override;
     108             : };
     109             : 
     110             : // Script "statusbar" object
     111             : class StatusbarProp final : public BarProp
     112             : {
     113             : public:
     114             :   explicit StatusbarProp(nsGlobalWindow *aWindow);
     115             :   virtual ~StatusbarProp();
     116             : 
     117             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
     118             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
     119             :                           ErrorResult& aRv) override;
     120             : };
     121             : 
     122             : // Script "scrollbars" object
     123             : class ScrollbarsProp final : public BarProp
     124             : {
     125             : public:
     126             :   explicit ScrollbarsProp(nsGlobalWindow *aWindow);
     127             :   virtual ~ScrollbarsProp();
     128             : 
     129             :   virtual bool GetVisible(CallerType aCallerType, ErrorResult& aRv) override;
     130             :   virtual void SetVisible(bool aVisible, CallerType aCallerType,
     131             :                           ErrorResult& aRv) override;
     132             : };
     133             : 
     134             : } // namespace dom
     135             : } // namespace mozilla
     136             : 
     137             : #endif /* mozilla_dom_BarProps_h */
     138             : 

Generated by: LCOV version 1.13