1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
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"
16 class nsClipboard
: public nsIClipboard
,
21 virtual ~nsClipboard();
28 // Make sure we are initialized, called from the factory
32 // Someone requested the selection
33 void SelectionGetEvent (GtkClipboard
*aGtkClipboard
,
34 GtkSelectionData
*aSelectionData
);
35 void SelectionClearEvent (GtkClipboard
*aGtkClipboard
);
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
47 nsITransferable
*GetTransferable (int32_t aWhichClipboard
);
49 // Hang on to our owners and transferables so we can transfer data
51 nsCOMPtr
<nsIClipboardOwner
> mSelectionOwner
;
52 nsCOMPtr
<nsIClipboardOwner
> mGlobalOwner
;
53 nsCOMPtr
<nsITransferable
> mSelectionTransferable
;
54 nsCOMPtr
<nsITransferable
> mGlobalTransferable
;
55 nsRefPtr
<nsClipboardPrivacyHandler
> mPrivacyHandler
;
59 #endif /* __nsClipboard_h_ */