LMMS
Loading...
Searching...
No Matches
Clipboard.h
Go to the documentation of this file.
1/*
2 * Clipboard.h - the clipboard for clips, notes etc.
3 *
4 * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_CLIPBOARD_H
26#define LMMS_CLIPBOARD_H
27
28#include <QDomElement>
29#include <QMap>
30
31#include "lmms_export.h"
32
33class QMimeData;
34
35namespace lmms::Clipboard
36{
37
38 enum class MimeType
39 {
42 };
43
44 // Convenience Methods
45 const QMimeData * getMimeData();
46 bool hasFormat( MimeType mT );
47
48 // Helper methods for String data
49 void LMMS_EXPORT copyString(const QString& str, MimeType mT);
50 QString getString( MimeType mT );
51
52 // Helper methods for String Pair data
53 void copyStringPair( const QString & key, const QString & value );
54 QString decodeKey( const QMimeData * mimeData );
55 QString decodeValue( const QMimeData * mimeData );
56
57 inline const char * mimeType( MimeType type )
58 {
59 switch( type )
60 {
62 return "application/x-lmms-stringpair";
63 break;
65 default:
66 return "application/x-lmms-clipboard";
67 break;
68 }
69 }
70
71} // namespace lmms::Clipboard
72
73#endif // LMMS_CLIPBOARD_H
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static PuglViewHint int value
Definition pugl.h:1708
Definition Clipboard.cpp:33
QString decodeValue(const QMimeData *mimeData)
Definition Clipboard.cpp:90
MimeType
Definition Clipboard.h:39
@ StringPair
Definition Clipboard.h:40
@ Default
Definition Clipboard.h:41
QString decodeKey(const QMimeData *mimeData)
Definition Clipboard.cpp:82
QString getString(MimeType mT)
Definition Clipboard.cpp:62
void copyStringPair(const QString &key, const QString &value)
Definition Clipboard.cpp:70
const QMimeData * getMimeData()
Definition Clipboard.cpp:35
bool hasFormat(MimeType mT)
Definition Clipboard.cpp:43
void copyString(const QString &str, MimeType mT)
Definition Clipboard.cpp:51
const char * mimeType(MimeType type)
Definition Clipboard.h:57
ZCONST char * key
Definition crypt.c:587