Code

system clipboard support (bug #170185) from Chris Kosiński
[inkscape.git] / src / ui / clipboard.h
1 #ifndef SEEN_INKSCAPE_CLIPBOARD_H
2 #define SEEN_INKSCAPE_CLIPBOARD_H
4 /** @file
5  * @brief System-wide clipboard management - class declaration
6  */
7 /* Authors:
8  *   Krzysztof Kosiński <tweenk@o2.pl>
9  *
10  * Copyright (C) 2008 authors
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * See the file COPYING for details.
18  */
20 #include <glibmm/ustring.h>
22 // forward declarations
23 class SPDesktop;
24 namespace Inkscape {
25 class Selection;
26 namespace LivePathEffect { class PathParam; }
28 namespace UI {
30 /**
31  * @brief System-wide clipboard manager
32  *
33  * ClipboardManager takes care of manipulating the system clipboard in response
34  * to user actions. It holds a complete SPDocument as the contents. This document
35  * is exported using output extensions when other applications request data.
36  * Copying to another instance of Inkscape is special-cased, because of the extra
37  * data required (i.e. style, size, Live Path Effects parameters, etc.)
38  */
40 class ClipboardManager {
41 public:
42     virtual void copy() = 0;
43     virtual void copyPathParameter(Inkscape::LivePathEffect::PathParam *) = 0;
44     virtual bool paste(bool in_place = false) = 0;
45     virtual bool pasteStyle() = 0;
46     virtual bool pasteSize(bool separately, bool apply_x, bool apply_y) = 0;
47     virtual bool pastePathEffect() = 0;
48     virtual Glib::ustring getPathParameter() = 0;
49     
50     static ClipboardManager *get();
51 protected:
52     ClipboardManager(); // singleton
53     virtual ~ClipboardManager();
54 private:
55     ClipboardManager(const ClipboardManager &); ///< no copy
56     ClipboardManager &operator=(const ClipboardManager &); ///< no assign
57     
58     static ClipboardManager *_instance;
59 };
61 } // namespace IO
62 } // namespace Inkscape
64 #endif
65 /*
66   Local Variables:
67   mode:c++
68   c-file-style:"stroustrup"
69   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70   indent-tabs-mode:nil
71   fill-column:99
72   End:
73 */
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :