44 #ifndef QT_NO_CLIPBOARD 54 #include <private/qwidget_p.h> 55 #include <private/qsystemlibrary_p.h> 59 #if defined(Q_OS_WINCE) 68 #define OleGetClipboard QtCeGetClipboard 69 #define OleSetClipboard QtCeSetClipboard 70 #define OleFlushClipboard QtCeFlushClipboard 93 IDataObject * pDataObj = 0;
108 IDataObject * pDataObj = 0;
123 IDataObject * pDataObj = 0;
143 , nextClipboardViewer(0)
145 clipBoardViewer =
new QWidget();
146 clipBoardViewer->createWinId();
147 clipBoardViewer->setObjectName(
QLatin1String(
"internal clipboard owner"));
157 delete clipBoardViewer;
164 delete iData->mimeData();
181 if (ptrClipboardData == 0) {
193 ptrClipboardData = 0;
196 #if defined(Q_OS_WINCE) 200 if (!OpenClipboard(owner))
203 if (!IsClipboardFormatAvailable(CF_TEXT) && !IsClipboardFormatAvailable(CF_UNICODETEXT))
206 HANDLE clipData = GetClipboardData(CF_TEXT);
209 clipData = GetClipboardData(CF_UNICODETEXT);
227 if (!OpenClipboard(owner))
241 result = SetClipboardData(CF_UNICODETEXT, wcsdup(reinterpret_cast<const wchar_t *> (data->
text().
utf16()))) != NULL;
246 return result ? S_OK : !S_OK;
261 if (mode != Clipboard)
272 qErrnoWarning(
"QClipboard::setMimeData: Failed to set data on clipboard");
275 #if defined(Q_OS_WINCE) 279 emit changed(Clipboard);
285 if (mode != Clipboard)
return;
292 qErrnoWarning(
"QClipboard::clear: Failed to clear data on clipboard");
295 #if defined(Q_OS_WINCE) 299 emit changed(Clipboard);
303 #if !defined(Q_OS_WINCE) && defined(Q_CC_MSVC) 307 if (!GetWindowThreadProcessId(hwnd, &pid) || !pid)
309 const HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION,
FALSE, pid);
312 BOOL debugged =
FALSE;
313 CheckRemoteDebuggerPresent(processHandle, &debugged);
314 CloseHandle(processHandle);
315 return debugged !=
FALSE;
317 #else // !defined(Q_OS_WINCE) && defined(Q_CC_MSVC) 319 #endif // defined(Q_OS_WINCE) || !defined(Q_CC_MSVC) 331 if (ownsClipboard()) {
338 bool propagate =
false;
347 if (!ownsClipboard() && d->
iData)
358 qWarning(
"%s: Cowardly refusing to send clipboard message to hung application...",
Q_FUNC_INFO);
362 qWarning(
"%s: Cowardly refusing to send clipboard message to application under debugger...",
Q_FUNC_INFO);
385 if (mode != Clipboard)
397 return (mode == Clipboard);
402 if (mode == Clipboard) {
404 #if !defined(Q_OS_WINCE) 405 return d->
iData && OleIsCurrentClipboard(d->
iData) == S_OK;
420 #endif // QT_NO_CLIPBOARD The QVariant class acts like a union for the most common Qt data types.
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
The QWindowsMime class maps open-standard MIME to Window Clipboard formats.
Mode
This enum type is used to control which part of the system clipboard is used by QClipboard::mimeData(...
void clear(Mode mode=Clipboard)
Clear the clipboard contents.
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
QStringList formats_sys() const
#define QT_END_NAMESPACE
This macro expands to.
static QClipboardData * clipboardData()
bool event(QEvent *)
Reimplemented Function
void ownerDestroyed()
Internal cleanup for Windows.
static QStringList allMimesForFormats(IDataObject *pDataObj)
bool remove(const T &value)
#define ChangeClipboardChain(a, b)
BOOL(WINAPI * PtrIsHungAppWindow)(HWND)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool supportsMode(Mode mode) const
Returns true if the clipboard supports the clipboard mode speacified by mode; otherwise returns false...
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
void setMimeData(QMimeData *data, Mode mode=Clipboard)
Sets the clipboard data to src.
The QString class provides a Unicode character string.
HRESULT QtCeSetClipboard(IDataObject *obj)
bool ownsMode(Mode mode) const
Returns true if the clipboard supports the clipboard data speacified by mode; otherwise returns false...
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
static void cleanupClipboardData()
static bool isProcessBeingDebugged(HWND)
QMimeData()
Constructs a new MIME data object with no data in it.
QWidget * clipBoardViewer
const QMimeData * mimeData(Mode mode=Clipboard) const
Returns a reference to a QMimeData representation of the current clipboard data.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString text() const
Returns a plain text (MIME type text/plain) representation of the data.
bool hasFormat_sys(const QString &mimetype) const
The QStringList class provides a list of strings.
HRESULT QtCeGetClipboard(IDataObject **obj)
Q_CORE_EXPORT void qWarning(const char *,...)
Type
This enum type defines the types of variable that a QVariant can contain.
#define FALSE
Synonym for false.
static PtrIsHungAppWindow ptrIsHungAppWindow
The QMimeData class provides a container for data that records information about its MIME type...
QVariant retrieveData_sys(const QString &mimetype, QVariant::Type preferredType) const
#define SetClipboardViewer(a)
const QMimeData * mimeData() const
void * resolve(const char *symbol)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
bool hasText() const
Returns true if the object can return plain text (MIME type text/plain); otherwise returns false...
static QWindowsMime * converterToMime(const QString &mimeType, IDataObject *pDataObj)
void QtCeFlushClipboard()
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
virtual QVariant convertToMime(const QString &mimeType, IDataObject *pDataObj, QVariant::Type preferredType) const =0
Returns a QVariant containing the converted data for mimeType from pDataObj.
static QClipboardData * ptrClipboardData
The QClipboardEvent class provides the parameters used in a clipboard event.
int qstrcmp(const QByteArray &str1, const char *str2)
QClipboardWatcher watcher
#define OleFlushClipboard
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void connectNotify(const char *)
Internal optimization for Windows.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
void qErrnoWarning(const char *msg,...)