1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gtk/nsClipboard.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* vim:expandtab:shiftwidth=4:tabstop=4: 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#ifndef __nsClipboard_h_ 1.12 +#define __nsClipboard_h_ 1.13 + 1.14 +#include "nsIClipboard.h" 1.15 +#include "nsClipboardPrivacyHandler.h" 1.16 +#include "nsAutoPtr.h" 1.17 +#include <gtk/gtk.h> 1.18 + 1.19 +class nsClipboard : public nsIClipboard, 1.20 + public nsIObserver 1.21 +{ 1.22 +public: 1.23 + nsClipboard(); 1.24 + virtual ~nsClipboard(); 1.25 + 1.26 + NS_DECL_ISUPPORTS 1.27 + 1.28 + NS_DECL_NSICLIPBOARD 1.29 + NS_DECL_NSIOBSERVER 1.30 + 1.31 + // Make sure we are initialized, called from the factory 1.32 + // constructor 1.33 + nsresult Init (void); 1.34 + 1.35 + // Someone requested the selection 1.36 + void SelectionGetEvent (GtkClipboard *aGtkClipboard, 1.37 + GtkSelectionData *aSelectionData); 1.38 + void SelectionClearEvent (GtkClipboard *aGtkClipboard); 1.39 + 1.40 +private: 1.41 + // Utility methods 1.42 + static GdkAtom GetSelectionAtom (int32_t aWhichClipboard); 1.43 + static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard); 1.44 + 1.45 + // Save global clipboard content to gtk 1.46 + nsresult Store (void); 1.47 + 1.48 + // Get our hands on the correct transferable, given a specific 1.49 + // clipboard 1.50 + nsITransferable *GetTransferable (int32_t aWhichClipboard); 1.51 + 1.52 + // Hang on to our owners and transferables so we can transfer data 1.53 + // when asked. 1.54 + nsCOMPtr<nsIClipboardOwner> mSelectionOwner; 1.55 + nsCOMPtr<nsIClipboardOwner> mGlobalOwner; 1.56 + nsCOMPtr<nsITransferable> mSelectionTransferable; 1.57 + nsCOMPtr<nsITransferable> mGlobalTransferable; 1.58 + nsRefPtr<nsClipboardPrivacyHandler> mPrivacyHandler; 1.59 + 1.60 +}; 1.61 + 1.62 +#endif /* __nsClipboard_h_ */