class documentation

class ClipboardManager(object): (source)

View In Hierarchy

Wrapper for Gtk.Clipboard, supporting specific data formats
Method __init__ Constructor @param name: clipboard name, can be either "CLIPBOARD" or "PRIMARY", see Gtk.Clipboard for details.
Method clear Undocumented
Method get_parsetree Get a parsetree from the clipboard.
Method get_text No summary
Method set_clipboard_data Set an item on the clipboard @param clipboard_data: a ClipboardData object
Method set_interwikilink No summary
Method set_pagelink No summary
Method set_parsetree Copy a parsetree to the clipboard. The parsetree can be pasted by the user either as formatted text within zim or as plain text outside zim. The tree can be the full tree for 'page', but also a selection.
Method set_text No summary
Method set_uri Copy an uri to the clipboard @param uri: an uri as string, or an object with an attribute uri
Instance Variable clipboard Undocumented
Instance Variable data Undocumented
Method _clear Undocumented
Method _get Undocumented
def __init__(self, name): (source)
Constructor
Parameters
nameclipboard name, can be either "CLIPBOARD" or "PRIMARY", see Gtk.Clipboard for details.
def clear(self): (source)

Undocumented

def get_parsetree(self, notebook=None, path=None, text_format='plain'): (source)

Get a parsetree from the clipboard.

Can handle various data types and convert them to ParseTree objects. So they can be pasted directly in a text buffer.

The 'notebook' and optional 'path' arguments are used to format links relative to the page which is the target for the pasting or drop operation. Otherwise absolute links will be used.

Parameters
notebooka Notebook object
patha Path object
text_formatformat to parse pasted text
Returns
a ParseTree or None
def get_text(self): (source)
Get text from the clipboard.
Returns
(unicode) text or None
Note
DO NOT USE THIS METHOD if you can use get_parsetree() instead
def set_clipboard_data(self, clipboard_data): (source)
Set an item on the clipboard
Parameters
clipboard_dataa ClipboardData object
def set_interwikilink(self, href, url): (source)
Copy an interwiki link to the clipboard
Parameters
hrefthe link as shown in zim, e.g. "wp?foobar"
urlthe expanded url for this interwiki link, e.g. "http://en.wikipedia.org/wiki/foobar"
def set_pagelink(self, notebook, path, anchor=None, text=None): (source)
Copy a page name to the clipboard. The page name can be pasted by the user either as a link within zim or as text outside zim.
Parameters
notebooka Notebook object
patha Path object
anchorUndocumented
textUndocumented
def set_parsetree(self, notebook, path, parsetree, format='plain'): (source)
Copy a parsetree to the clipboard. The parsetree can be pasted by the user either as formatted text within zim or as plain text outside zim. The tree can be the full tree for 'page', but also a selection.
Parameters
notebookthe Notebook object
paththe Path object - used to resolve links etc.
parsetreethe actual ParseTree to be set on the clipboard
formatthe format to use for pasting text, e.g. 'wiki' or 'plain'
def set_text(self, text): (source)
Set text to the clipboard
Parameters
texttext to set on the clipboard
Note
DO NOT USE THIS METHOD if you can use set_parsetree() instead
def set_uri(self, *uris): (source)
Copy an uri to the clipboard
Parameters
*urisUndocumented
urian uri as string, or an object with an attribute uri
clipboard = (source)

Undocumented

data = (source)

Undocumented

def _clear(self): (source)

Undocumented

def _get(self, clipboard, selectiondata, targetid): (source)

Undocumented