widget/gtk/nsClipboard.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
    18 {
    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;
    57 };
    59 #endif /* __nsClipboard_h_ */

mercurial