sbRemoteSecurityEvent.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
27 #ifndef __SB_REMOTE_SECURITY_EVENT_H__
28 #define __SB_REMOTE_SECURITY_EVENT_H__
29 
30 #include "sbRemoteAPI.h"
31 
32 #include <sbISecurityMixin.h>
33 #include <sbISecurityAggregator.h>
34 #include <sbIRemoteSecurityEvent.h>
35 
36 #include <nsIClassInfo.h>
37 #include <nsIDOMEvent.h>
38 #include <nsIDOMEventTarget.h>
39 #include <nsIDOMNSEvent.h>
40 #include <nsIPrivateDOMEvent.h>
41 #include <nsISecurityCheckedComponent.h>
42 #include <nsStringGlue.h>
43 #include <nsCOMPtr.h>
44 
45 #define SONGBIRD_SECURITYEVENT_CONTRACTID \
46  "@songbirdnest.com/remoteapi/security-event;1"
47 #define SONGBIRD_SECURITYEVENT_CLASSNAME \
48  "Songbird Remote Security Event"
49 #define SONGBIRD_SECURITYEVENT_CID \
50 { /* 17097f88-2b36-4bbc-a74b-a3199a3e8c43 */ \
51  0x17097f88, \
52  0x2b36, \
53  0x4bbc, \
54  { 0xa7, 0x4b, 0xa3, 0x19, 0x9a, 0x3e, 0x8c, 0x43 } \
55 }
56 
58 class sbRemotePlayer;
59 
62  public sbISecurityAggregator,
65  public nsIDOMEvent,
66  public nsIPrivateDOMEvent,
67  public nsIDOMNSEvent
68 {
69 public:
71  NS_DECL_NSICLASSINFO
72  NS_DECL_SBISECURITYAGGREGATOR
73  NS_DECL_SBIREMOTESECURITYEVENT
74  NS_DECL_SBIMUTABLEREMOTESECURITYEVENT
76 
80 
82  NS_IMETHOD DuplicatePrivateData();
83  NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget);
84  NS_IMETHOD_(PRBool) IsDispatchStopped();
85  NS_IMETHOD_(nsEvent*) GetInternalNSEvent();
86  NS_IMETHOD SetTrusted(PRBool aTrusted);
87 
88 public:
91 
92  NS_IMETHOD InitEvent( nsIDOMEvent*,
93  nsIURI *,
94  const nsAString &,
95  const nsAString &,
96  PRBool );
97 
98 protected:
99  nsCOMPtr<nsISecurityCheckedComponent> mSecurityMixin;
100 
101  nsCOMPtr<nsIDOMEvent> mEvent;
102  nsCOMPtr<nsIDOMNSEvent> mNSEvent;
103 
104  // this is the actual event payload.
105  nsCOMPtr<nsIURI> mScopeURI;
106  PRBool mHasAccess;
107  nsString mCategory;
108  nsString mCategoryID;
109 };
110 
111 #endif /* __SB_REMOTE_SECURITY_EVENT_H__ */
NS_IMETHOD InitEvent(nsIDOMEvent *, nsIURI *, const nsAString &, const nsAString &, PRBool)
NS_IMETHOD DuplicatePrivateData()
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget)
nsISecurityCheckedComponent
NS_IMETHOD SetTrusted(PRBool aTrusted)
nsCOMPtr< nsISecurityCheckedComponent > mSecurityMixin
NS_FORWARD_SAFE_NSISECURITYCHECKEDCOMPONENT(mSecurityMixin)
nsCOMPtr< nsIDOMNSEvent > mNSEvent
A marker interface for objects that aggregate the security mixin.
NS_FORWARD_SAFE_NSIDOMEVENT(mEvent)
NS_FORWARD_SAFE_NSIDOMNSEVENT(mNSEvent)
#define SB_DECL_SECURITYCHECKEDCOMP_INIT
Definition: sbRemoteAPI.h:42
An interface to maintain information about the last security event that occurred. ...
nsCOMPtr< nsIDOMEvent > mEvent
NS_IMETHOD_(PRBool) IsDispatchStopped()
nsCOMPtr< nsIURI > mScopeURI