Bug 932076 - Add check for MediaExtractor creation failure. r=doublec
[gecko.git] / widget / gtk / nsClipboard.h
blob8103fa6b592e4091be9277b85d0b72c0dd6014a5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef __nsClipboard_h_
9 #define __nsClipboard_h_
11 #include "nsIClipboard.h"
12 #include "nsClipboardPrivacyHandler.h"
13 #include "nsAutoPtr.h"
14 #include <gtk/gtk.h>
16 class nsClipboard : public nsIClipboard,
17 public nsIObserver
19 public:
20 nsClipboard();
21 virtual ~nsClipboard();
23 NS_DECL_ISUPPORTS
25 NS_DECL_NSICLIPBOARD
26 NS_DECL_NSIOBSERVER
28 // Make sure we are initialized, called from the factory
29 // constructor
30 nsresult Init (void);
32 // Someone requested the selection
33 void SelectionGetEvent (GtkClipboard *aGtkClipboard,
34 GtkSelectionData *aSelectionData);
35 void SelectionClearEvent (GtkClipboard *aGtkClipboard);
37 private:
38 // Utility methods
39 static GdkAtom GetSelectionAtom (int32_t aWhichClipboard);
40 static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard);
42 // Save global clipboard content to gtk
43 nsresult Store (void);
45 // Get our hands on the correct transferable, given a specific
46 // clipboard
47 nsITransferable *GetTransferable (int32_t aWhichClipboard);
49 // Hang on to our owners and transferables so we can transfer data
50 // when asked.
51 nsCOMPtr<nsIClipboardOwner> mSelectionOwner;
52 nsCOMPtr<nsIClipboardOwner> mGlobalOwner;
53 nsCOMPtr<nsITransferable> mSelectionTransferable;
54 nsCOMPtr<nsITransferable> mGlobalTransferable;
55 nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler;
59 #endif /* __nsClipboard_h_ */