1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsAutoCopyListener_h_
7 #define nsAutoCopyListener_h_
9 #include "nsISelectionListener.h"
10 #include "nsISelectionPrivate.h"
11 #include "mozilla/Attributes.h"
13 class nsAutoCopyListener MOZ_FINAL
: public nsISelectionListener
17 NS_DECL_NSISELECTIONLISTENER
19 void Listen(nsISelectionPrivate
*aSelection
)
21 NS_ASSERTION(aSelection
, "Null selection passed to Listen()");
22 aSelection
->AddSelectionListener(this);
25 static nsAutoCopyListener
* GetInstance()
28 sInstance
= new nsAutoCopyListener();
36 static void Shutdown()
38 NS_IF_RELEASE(sInstance
);
42 ~nsAutoCopyListener() {}
44 static nsAutoCopyListener
* sInstance
;