• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

DragAndDrop

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • draganddrop
DeclarativeMimeData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 by BetterInbox <contact@betterinbox.com>
3  Original author: Gregory Schlomoff <greg@betterinbox.com>
4 
5  Permission is hereby granted, free of charge, to any person obtaining a copy
6  of this software and associated documentation files (the "Software"), to deal
7  in the Software without restriction, including without limitation the rights
8  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  copies of the Software, and to permit persons to whom the Software is
10  furnished to do so, subject to the following conditions:
11 
12  The above copyright notice and this permission notice shall be included in
13  all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21  THE SOFTWARE.
22 */
23 
24 #ifndef DECLARATIVEMIMEDATA_H
25 #define DECLARATIVEMIMEDATA_H
26 
27 #include <QMimeData>
28 #include <QColor>
29 #include <QUrl>
30 #include <QDeclarativeItem>
31 
32 class DeclarativeMimeData : public QMimeData
33 {
34  Q_OBJECT
35 
39  Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
40 
41 
44  Q_PROPERTY(QString html READ html WRITE setHtml NOTIFY htmlChanged)
45 
49  Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
50 
55  Q_PROPERTY(QVariantList urls READ urls WRITE setUrls NOTIFY urlsChanged)
56 
60  Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
61 
65  Q_PROPERTY(QDeclarativeItem* source READ source WRITE setSource NOTIFY sourceChanged)
66  //TODO: Image property
67 
68 public:
69  DeclarativeMimeData() : QMimeData() {}
70  DeclarativeMimeData(const QMimeData* copy);
71 
72  QUrl url() const;
73  void setUrl(const QUrl &url);
74 
75  QVariantList urls() const;
76  void setUrls(const QVariantList &urls);
77 
78  QColor color() const;
79  void setColor(const QColor &color);
80 
81  Q_INVOKABLE void setData(const QString &mimeType, const QVariant &data);
82 
83  QDeclarativeItem* source() const;
84  void setSource(QDeclarativeItem* source);
85 
86 
87  /*
88  QString text() const; //TODO: Reimplement this to issue the onChanged signals
89  void setText(const QString &text);
90  QString html() const;
91  void setHtml(const QString &html);
92  */
93 
94 signals:
95  void textChanged(); //FIXME not being used
96  void htmlChanged(); //FIXME not being used
97  void urlChanged();
98  void urlsChanged();
99  void colorChanged();
100  void sourceChanged();
101 
102 private:
103  QDeclarativeItem* m_source;
104 };
105 
106 #endif // DECLARATIVEMIMEDATA_H
QMimeData::data
QByteArray data(const QString &mimeType) const
DeclarativeMimeData::setUrl
void setUrl(const QUrl &url)
Definition: DeclarativeMimeData.cpp:75
DeclarativeMimeData::htmlChanged
void htmlChanged()
DeclarativeMimeData::source
QDeclarativeItem * source() const
DeclarativeMimeData::url
QUrl url() const
QMimeData
DeclarativeMimeData::urlChanged
void urlChanged()
DeclarativeMimeData::DeclarativeMimeData
DeclarativeMimeData()
Definition: DeclarativeMimeData.h:69
DeclarativeMimeData::sourceChanged
void sourceChanged()
QMimeData::text
QString text() const
DeclarativeMimeData::urls
QVariantList urls() const
QMimeData::setText
void setText(const QString &text)
DeclarativeMimeData::colorChanged
void colorChanged()
QString
QColor
DeclarativeMimeData::setColor
void setColor(const QColor &color)
Definition: DeclarativeMimeData.cpp:113
DeclarativeMimeData::setUrls
void setUrls(const QVariantList &urls)
Definition: DeclarativeMimeData.cpp:95
QUrl
DeclarativeMimeData::color
QColor color() const
DeclarativeMimeData::setSource
void setSource(QDeclarativeItem *source)
Definition: DeclarativeMimeData.cpp:143
DeclarativeMimeData
Definition: DeclarativeMimeData.h:32
DeclarativeMimeData::textChanged
void textChanged()
QDeclarativeItem
QMimeData::setHtml
void setHtml(const QString &html)
DeclarativeMimeData::setData
Q_INVOKABLE void setData(const QString &mimeType, const QVariant &data)
Definition: DeclarativeMimeData.cpp:121
QMimeData::html
QString html() const
DeclarativeMimeData::urlsChanged
void urlsChanged()
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:31 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

DragAndDrop

Skip menu "DragAndDrop"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal