Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=4:tabstop=4: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef __nsClipboard_h_ |
michael@0 | 9 | #define __nsClipboard_h_ |
michael@0 | 10 | |
michael@0 | 11 | #include "nsIClipboard.h" |
michael@0 | 12 | #include "nsClipboardPrivacyHandler.h" |
michael@0 | 13 | #include "nsAutoPtr.h" |
michael@0 | 14 | #include <gtk/gtk.h> |
michael@0 | 15 | |
michael@0 | 16 | class nsClipboard : public nsIClipboard, |
michael@0 | 17 | public nsIObserver |
michael@0 | 18 | { |
michael@0 | 19 | public: |
michael@0 | 20 | nsClipboard(); |
michael@0 | 21 | virtual ~nsClipboard(); |
michael@0 | 22 | |
michael@0 | 23 | NS_DECL_ISUPPORTS |
michael@0 | 24 | |
michael@0 | 25 | NS_DECL_NSICLIPBOARD |
michael@0 | 26 | NS_DECL_NSIOBSERVER |
michael@0 | 27 | |
michael@0 | 28 | // Make sure we are initialized, called from the factory |
michael@0 | 29 | // constructor |
michael@0 | 30 | nsresult Init (void); |
michael@0 | 31 | |
michael@0 | 32 | // Someone requested the selection |
michael@0 | 33 | void SelectionGetEvent (GtkClipboard *aGtkClipboard, |
michael@0 | 34 | GtkSelectionData *aSelectionData); |
michael@0 | 35 | void SelectionClearEvent (GtkClipboard *aGtkClipboard); |
michael@0 | 36 | |
michael@0 | 37 | private: |
michael@0 | 38 | // Utility methods |
michael@0 | 39 | static GdkAtom GetSelectionAtom (int32_t aWhichClipboard); |
michael@0 | 40 | static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard); |
michael@0 | 41 | |
michael@0 | 42 | // Save global clipboard content to gtk |
michael@0 | 43 | nsresult Store (void); |
michael@0 | 44 | |
michael@0 | 45 | // Get our hands on the correct transferable, given a specific |
michael@0 | 46 | // clipboard |
michael@0 | 47 | nsITransferable *GetTransferable (int32_t aWhichClipboard); |
michael@0 | 48 | |
michael@0 | 49 | // Hang on to our owners and transferables so we can transfer data |
michael@0 | 50 | // when asked. |
michael@0 | 51 | nsCOMPtr<nsIClipboardOwner> mSelectionOwner; |
michael@0 | 52 | nsCOMPtr<nsIClipboardOwner> mGlobalOwner; |
michael@0 | 53 | nsCOMPtr<nsITransferable> mSelectionTransferable; |
michael@0 | 54 | nsCOMPtr<nsITransferable> mGlobalTransferable; |
michael@0 | 55 | nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler; |
michael@0 | 56 | |
michael@0 | 57 | }; |
michael@0 | 58 | |
michael@0 | 59 | #endif /* __nsClipboard_h_ */ |