Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# clipboard.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti 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
    00021
    00022 #ifndef INTI_GTK_CLIPBOARD_H
    00023 #define INTI_GTK_CLIPBOARD_H
    00024
    00025 #ifndef INTI_G_OBJECT_H
    00026 #include <inti/glib/object.h>
    00027 #endif
    00028
    00029 #ifndef INTI_GDK_TYPES_H
    00030 #include <inti/gdk/types.h>
    00031 #endif
    00032
    00033 #ifndef __GTK_CLIPBOARD_H__
    00034 #include <gtk/gtkclipboard.h>
    00035 #endif
    00036
    00037 #ifndef _CPP_VECTOR
    00038 #include <vector>
    00039 #endif
    00040
    00041 namespace Inti {
    00042
    00043 namespace G {
    00044 class Object;
    00045 }
    00046
    00047 namespace Gdk {
    00048 class Display;
    00049 }
    00050
    00051 namespace Gtk {
    00052
    00053 class SelectionData;
    00054 class TargetEntry;
    00055
    00088
    00089 class Clipboard : public G::Object
    00090 {
    00091         friend class G::Object;
    00092
    00093         Clipboard(const Clipboard&);
    00094         Clipboard& operator=(const Clipboard&);
    00095
    00096 protected:
    00099
    00100         explicit Clipboard(GtkClipboard *clipboard, bool reference = false);
    00107
    00109
    00110 public:
    00111         typedef Slot1<void, const SelectionData&> ReceivedSlot;
    00121
    00122         typedef Slot1<void, const String&> TextReceivedSlot;
    00131
    00132         typedef Slot2<void, SelectionData&, unsigned int> GetSlot;
    00150
    00151         typedef Slot0<void> ClearSlot;
    00158
    00161
    00162         virtual ~Clipboard();
    00164
    00166
    00167         static Clipboard* get(Gdk::Atom selection, const Gdk::Display *display = 0);
    00198
    00199         static Clipboard* get_default(const Gdk::Display *display = 0);
    00213
    00214         static Clipboard* get_primary(const Gdk::Display *display = 0);
    00228
    00231
    00232         GtkClipboard* gtk_clipboard() const { return (GtkClipboard*)instance; }
    00234
    00235         operator GtkClipboard* () const;
    00237
    00238         Gdk::Display* get_display() const;
    00241
    00245
    00246         bool set(const std::vector<TargetEntry>& targets, const GetSlot *get, const ClearSlot *clear);
    00258
    00259         void clear();
    00264
    00265         void set_text(const String& text);
    00271
    00272         void request_contents(Gdk::Atom target, const ReceivedSlot *received) const;
    00280
    00281         void request_text(const TextReceivedSlot *received) const;
    00288
    00289         Pointer<SelectionData> wait_for_contents(Gdk::Atom target) const;
    00296
    00297         String wait_for_text() const;
    00305
    00306         bool wait_is_text_available() const;
    00315
    00317 };
    00318
    00319 } // namespace Gtk
    00320
    00321 } // namespace Inti
    00322
    00323 #endif // INTI_GTK_CLIPBOARD_H
    00324

Main Page - Footer