protected override void InsertFromMimeData(Qyoto.QMimeData source) { var cursor = base.TextCursor(); if (source.HasImage()) { var image = QPixmap.FromImage((QImage)source.ImageData()); var document = base.Document(); var imageName = Guid.NewGuid().ToString(); document.AddResource((int)QTextDocument.ResourceType.ImageResource, new QUrl(imageName), image); cursor.InsertImage(imageName); } else if (source.HasUrls()) { var magic = new Magic(true); foreach (var url in source.Urls()) { if (url.Scheme() == "file") { string fileName = url.Path(); if (File.Exists(fileName)) { string mimeType = magic.Lookup(url.Path()); if (mimeType.StartsWith("image/")) { // FIXME: If image is over a certain size, send as file transfer rather // than encoded inline. cursor.InsertHtml(String.Format("<img src=\"{0}\" />", fileName)); } else { // FIXME: Generate and insert an image representing a file. Console.WriteLine("File Transfer: " + fileName); } } else { // FIXME: Support "sending" directories? cursor.InsertText(url.ToString()); } } else if (url.Scheme() == "http" || url.Scheme() == "https") { cursor.InsertHtml(String.Format("<a href=\"{0}\">{0}</a>", url.ToString())); } else { cursor.InsertText(url.ToString()); } } } else { base.InsertFromMimeData(source); } }
protected override bool CanInsertFromMimeData(Qyoto.QMimeData source) { if (source.HasImage()) { return(true); } else { return(base.CanInsertFromMimeData(source)); } }
public void SetMimeData(QMimeData data) { interceptor.Invoke("setMimeData#", "setMimeData(QMimeData*)", typeof(void), typeof(QMimeData), data); }
public void PopulateMimeData(QMimeData mimeData, Dictionary<string, string> metaData) { interceptor.Invoke("populateMimeData#?", "populateMimeData(QMimeData*, const QMap<QString,QString>&) const", typeof(void), typeof(QMimeData), mimeData, typeof(Dictionary<string, string>), metaData); }
/// <remarks> /// Extract a list of bookmarks from the contents of <code>mimeData.</code> /// Decoding will fail if <code>mimeData</code> does not contain any bookmarks. /// <param> name="mimeData" the mime data to extract from; cannot be 0 /// </param></remarks> <return> the list of bookmarks /// @note those bookmarks are valid QDomElements, but their parent QDomDocument /// is already deleted, do not use ownerDocument() /// </return> /// <short> Extract a list of bookmarks from the contents of <code>mimeData.</code></short> public static KBookmark.List FromMimeData(QMimeData mimeData) { return (KBookmark.List) staticInterceptor.Invoke("fromMimeData#", "fromMimeData(const QMimeData*)", typeof(KBookmark.List), typeof(QMimeData), mimeData); }
protected virtual void InsertFromMimeData(QMimeData source) { interceptor.Invoke("insertFromMimeData#", "insertFromMimeData(const QMimeData*)", typeof(void), typeof(QMimeData), source); }
public override bool DropMimeData(QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) { return (bool) interceptor.Invoke("dropMimeData#$$$#", "dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&)", typeof(bool), typeof(QMimeData), data, typeof(Qt.DropAction), action, typeof(int), row, typeof(int), column, typeof(QModelIndex), parent); }
public QDropEvent(QPoint pos, uint actions, QMimeData data, uint buttons, uint modifiers) : this((Type)null) { CreateProxy(); interceptor.Invoke("QDropEvent#$#$$", "QDropEvent(const QPoint&, Qt::DropActions, const QMimeData*, Qt::MouseButtons, Qt::KeyboardModifiers)", typeof(void), typeof(QPoint), pos, typeof(uint), actions, typeof(QMimeData), data, typeof(uint), buttons, typeof(uint), modifiers); }
/// <remarks> /// Sets the color and text representation fields for the specified color in the mimedata object: /// application/x-color and text/plain types are set /// </remarks> <short> Sets the color and text representation fields for the specified color in the mimedata object: application/x-color and text/plain types are set </short> public static void PopulateMimeData(QMimeData mimeData, QColor color) { staticInterceptor.Invoke("populateMimeData##", "populateMimeData(QMimeData*, const QColor&)", typeof(void), typeof(QMimeData), mimeData, typeof(QColor), color); }
/// <remarks> /// Decodes the MIME data <code>mimeData</code> and returns the resulting color. /// First tries application/x-color and if that fails, a text/plain entry, which /// represents a color in the format \#hexnumbers. If this fails too, /// an invalid QColor object is returned, use QColor.IsValid() to test it. /// </remarks> <short> Decodes the MIME data <code>mimeData</code> and returns the resulting color.</short> public static QColor FromMimeData(QMimeData mimeData) { return (QColor) staticInterceptor.Invoke("fromMimeData#", "fromMimeData(const QMimeData*)", typeof(QColor), typeof(QMimeData), mimeData); }
protected virtual bool DropMimeData(QTreeWidgetItem parent, int index, QMimeData data, Qt.DropAction action) { return (bool) interceptor.Invoke("dropMimeData#$#$", "dropMimeData(QTreeWidgetItem*, int, const QMimeData*, Qt::DropAction)", typeof(bool), typeof(QTreeWidgetItem), parent, typeof(int), index, typeof(QMimeData), data, typeof(Qt.DropAction), action); }
public static KIO.CopyJob PasteMimeSource(QMimeData data, KUrl destURL, string dialogText, QWidget widget) { return (KIO.CopyJob) staticInterceptor.Invoke("pasteMimeSource##$#", "pasteMimeSource(const QMimeData*, const KUrl&, const QString&, QWidget*)", typeof(KIO.CopyJob), typeof(QMimeData), data, typeof(KUrl), destURL, typeof(string), dialogText, typeof(QWidget), widget); }
protected virtual bool DropMimeData(int row, int column, QMimeData data, Qt.DropAction action) { return((bool)interceptor.Invoke("dropMimeData$$#$", "dropMimeData(int, int, const QMimeData*, Qt::DropAction)", typeof(bool), typeof(int), row, typeof(int), column, typeof(QMimeData), data, typeof(Qt.DropAction), action)); }
protected virtual bool DropMimeData(QTreeWidgetItem parent, int index, QMimeData data, Qt.DropAction action) { return((bool)interceptor.Invoke("dropMimeData#$#$", "dropMimeData(QTreeWidgetItem*, int, const QMimeData*, Qt::DropAction)", typeof(bool), typeof(QTreeWidgetItem), parent, typeof(int), index, typeof(QMimeData), data, typeof(Qt.DropAction), action)); }
public bool DropMimeData(Phonon.ObjectDescriptionType type, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) { return (bool) interceptor.Invoke("dropMimeData$#$$$#", "dropMimeData(Phonon::ObjectDescriptionType, const QMimeData*, Qt::DropAction, int, int, const QModelIndex&)", typeof(bool), typeof(Phonon.ObjectDescriptionType), type, typeof(QMimeData), data, typeof(Qt.DropAction), action, typeof(int), row, typeof(int), column, typeof(QModelIndex), parent); }
protected List <QTreeWidgetItem> Items(QMimeData data) { return((List <QTreeWidgetItem>)interceptor.Invoke("items#", "items(const QMimeData*) const", typeof(List <QTreeWidgetItem>), typeof(QMimeData), data)); }
public void SetMimeData(QMimeData data, QClipboard.Mode mode) { interceptor.Invoke("setMimeData#$", "setMimeData(QMimeData*, QClipboard::Mode)", typeof(void), typeof(QMimeData), data, typeof(QClipboard.Mode), mode); }
public override bool DropMimeData(QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) { return((bool)interceptor.Invoke("dropMimeData#$$$#", "dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&)", typeof(bool), typeof(QMimeData), data, typeof(Qt.DropAction), action, typeof(int), row, typeof(int), column, typeof(QModelIndex), parent)); }
protected virtual bool CanInsertFromMimeData(QMimeData source) { return (bool) interceptor.Invoke("canInsertFromMimeData#", "canInsertFromMimeData(const QMimeData*) const", typeof(bool), typeof(QMimeData), source); }
public QDropEvent(QPoint pos, uint actions, QMimeData data, uint buttons, uint modifiers) : this((Type) null) { CreateProxy(); interceptor.Invoke("QDropEvent#$#$$", "QDropEvent(const QPoint&, Qt::DropActions, const QMimeData*, Qt::MouseButtons, Qt::KeyboardModifiers)", typeof(void), typeof(QPoint), pos, typeof(uint), actions, typeof(QMimeData), data, typeof(uint), buttons, typeof(uint), modifiers); }
protected virtual bool CanInsertFromMimeData(QMimeData source) { return((bool)interceptor.Invoke("canInsertFromMimeData#", "canInsertFromMimeData(const QMimeData*) const", typeof(bool), typeof(QMimeData), source)); }
protected virtual bool DropMimeData(int row, int column, QMimeData data, Qt.DropAction action) { return (bool) interceptor.Invoke("dropMimeData$$#$", "dropMimeData(int, int, const QMimeData*, Qt::DropAction)", typeof(bool), typeof(int), row, typeof(int), column, typeof(QMimeData), data, typeof(Qt.DropAction), action); }
/// <remarks> /// Return true if <code>mimeData</code> contains bookmarks /// </remarks> <short> Return true if <code>mimeData</code> contains bookmarks </short> public static bool CanDecode(QMimeData mimeData) { return (bool) staticInterceptor.Invoke("canDecode#", "canDecode(const QMimeData*)", typeof(bool), typeof(QMimeData), mimeData); }
protected List<QTableWidgetItem> Items(QMimeData data) { return (List<QTableWidgetItem>) interceptor.Invoke("items#", "items(const QMimeData*) const", typeof(List<QTableWidgetItem>), typeof(QMimeData), data); }
/// <remarks> /// Adds this list of bookmark into the given QMimeData. /// <param> name="mimeData" the QMimeData instance used to drag or copy this bookmark /// </param></remarks> <short> Adds this list of bookmark into the given QMimeData.</short> public void PopulateMimeData(QMimeData mimeData) { interceptor.Invoke("populateMimeData#", "populateMimeData(QMimeData*) const", typeof(void), typeof(QMimeData), mimeData); }
/// <remarks> /// Adds URL data into the given QMimeData. /// By default, populateMimeData also exports the URL as plain text, for e.g. dropping /// onto a text editor. /// But in some cases this might not be wanted, e.g. if adding other mime data /// which provides better plain text data. /// WARNING: do not call this method multiple times, use KUrl.List.PopulateMimeData instead. /// <param> name="mimeData" the QMimeData instance used to drag or copy this URL /// </param><param> name="metaData" KIO metadata shipped in the mime data, which is used for instance to /// set a correct HTTP referrer (some websites require it for downloading e.g. an image) /// </param><param> name="flags" set NoTextExport to prevent setting plain/text data into <code>mimeData</code> /// In such a case, setExportAsText( false ) should be called. /// </param></remarks> <short> Adds URL data into the given QMimeData.</short> public void PopulateMimeData(QMimeData mimeData, Dictionary<string, string> metaData, KUrl.MimeDataFlags flags) { interceptor.Invoke("populateMimeData#?$", "populateMimeData(QMimeData*, const QMap<QString,QString>&, KUrl::MimeDataFlags) const", typeof(void), typeof(QMimeData), mimeData, typeof(Dictionary<string, string>), metaData, typeof(KUrl.MimeDataFlags), flags); }