GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

clipboard.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_CLIPBOARD_HH 00025 #define GFC_GTK_CLIPBOARD_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GDK_TYPES_HH 00032 #include <gfc/gdk/types.hh> 00033 #endif 00034 00035 #ifndef __GTK_CLIPBOARD_H__ 00036 #include <gtk/gtkclipboard.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace G { 00046 class Object; 00047 } 00048 00049 namespace Gdk { 00050 class Display; 00051 } 00052 00053 namespace Gtk { 00054 00055 class SelectionData; 00056 class TargetEntry; 00057 00090 00091 class Clipboard : public G::Object 00092 { 00093 friend class G::Object; 00094 00095 Clipboard(const Clipboard&); 00096 Clipboard& operator=(const Clipboard&); 00097 00098 protected: 00101 00102 explicit Clipboard(GtkClipboard *clipboard, bool owns_reference = false); 00109 00111 00112 public: 00113 typedef sigc::slot<void, const SelectionData&> ReceivedSlot; 00122 00123 typedef sigc::slot<void, const String&> TextReceivedSlot; 00131 00132 typedef sigc::slot<void, const std::vector<Gdk::Atom>&> TargetsReceivedSlot; 00141 00142 typedef sigc::slot<void, SelectionData&, unsigned int> GetSlot; 00159 00160 typedef sigc::slot<void> ClearSlot; 00167 00170 00171 virtual ~Clipboard(); 00173 00175 00176 static Clipboard* get(Gdk::Atom selection, const Gdk::Display *display = 0); 00207 00208 static Clipboard* get_default(const Gdk::Display *display = 0); 00222 00223 static Clipboard* get_primary(const Gdk::Display *display = 0); 00237 00240 00241 GtkClipboard* gtk_clipboard() const; 00243 00244 operator GtkClipboard* () const; 00246 00247 Gdk::Display* get_display() const; 00250 00254 00255 bool set(const std::vector<TargetEntry>& targets, const GetSlot& get, const ClearSlot& clear); 00267 00268 void clear(); 00273 00274 void set_text(const String& text); 00280 00281 void request_contents(Gdk::Atom target, const ReceivedSlot& received) const; 00288 00289 void request_text(const TextReceivedSlot& received) const; 00298 00299 void request_targets(const TargetsReceivedSlot& received); 00306 00307 Pointer<SelectionData> wait_for_contents(Gdk::Atom target) const; 00314 00315 String wait_for_text() const; 00323 00324 bool wait_is_text_available() const; 00333 00334 bool wait_for_targets(std::vector<Gdk::Atom>& targets) const; 00342 00344 }; 00345 00346 } // namespace Gtk 00347 00348 } // namespace GFC 00349 00350 #include <gfc/gtk/inline/clipboard.inl> 00351 00352 #endif // GFC_GTK_CLIPBOARD_HH 00353

Generated on Tue Aug 24 00:34:30 2004 for GFC-UI by doxygen 1.3.8