VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h@ 43138

Last change on this file since 43138 was 42526, checked in by vboxsync, 12 years ago

FE/Qt: 6234: Support for VM groups: Initial commit. GUI-3 branch reintegrated to trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h74233
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h79224,​79228,​79233,​79235,​79258,​79262-79263,​79273,​79341,​79345,​79354,​79357,​79387-79388,​79559-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h79645-79692
File size: 6.0 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * UIConverterBackend declaration
5 */
6
7/*
8 * Copyright (C) 2012 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __UIConverterBackend_h__
20#define __UIConverterBackend_h__
21
22/* Qt includes: */
23#include <QString>
24#include <QColor>
25#include <QPixmap>
26
27/* GUI includes: */
28#include "UIDefs.h"
29
30/* Determines if 'Object of type X' can be converted to object of other type.
31 * This function always returns 'false' until re-determined for specific object type. */
32template<class X> bool canConvert() { return false; }
33
34/* Converts passed 'Object X' to QColor.
35 * This function returns null QColor for any object type until re-determined for specific one. */
36template<class X> QColor toColor(const X & /* xobject */) { Assert(0); return QColor(); }
37
38/* Converts passed 'Object X' to QPixmap.
39 * This function returns null QPixmap for any object type until re-determined for specific one. */
40template<class X> QPixmap toPixmap(const X & /* xobject */) { Assert(0); return QPixmap(); }
41
42/* Converts passed 'Object of type X' to QString.
43 * This function returns null QString for any object type until re-determined for specific one. */
44template<class X> QString toString(const X & /* xobject */) { Assert(0); return QString(); }
45/* Converts passed QString to 'Object of type X'.
46 * This function returns default constructed object for any object type until re-determined for specific one. */
47template<class X> X fromString(const QString & /* strData */) { Assert(0); return X(); }
48
49/* Converts passed 'Object of type X' to non-translated QString.
50 * This function returns null QString for any object type until re-determined for specific one. */
51template<class X> QString toInternalString(const X & /* xobject */) { Assert(0); return QString(); }
52/* Converts passed non-translated QString to 'Object of type X'.
53 * This function returns default constructed object for any object type until re-determined for specific one. */
54template<class X> X fromInternalString(const QString & /* strData */) { Assert(0); return X(); }
55
56/* Declare global canConvert specializations: */
57template<> bool canConvert<StorageSlot>();
58template<> bool canConvert<DetailsElementType>();
59
60/* Declare COM canConvert specializations: */
61template<> bool canConvert<KMachineState>();
62template<> bool canConvert<KSessionState>();
63template<> bool canConvert<KDeviceType>();
64template<> bool canConvert<KClipboardMode>();
65template<> bool canConvert<KDragAndDropMode>();
66template<> bool canConvert<KMediumType>();
67template<> bool canConvert<KMediumVariant>();
68template<> bool canConvert<KNetworkAttachmentType>();
69template<> bool canConvert<KNetworkAdapterType>();
70template<> bool canConvert<KNetworkAdapterPromiscModePolicy>();
71template<> bool canConvert<KPortMode>();
72template<> bool canConvert<KUSBDeviceState>();
73template<> bool canConvert<KUSBDeviceFilterAction>();
74template<> bool canConvert<KAudioDriverType>();
75template<> bool canConvert<KAudioControllerType>();
76template<> bool canConvert<KAuthType>();
77template<> bool canConvert<KStorageBus>();
78template<> bool canConvert<KStorageControllerType>();
79template<> bool canConvert<KChipsetType>();
80template<> bool canConvert<KNATProtocol>();
81
82/* Declare global conversion specializations: */
83template<> QString toString(const StorageSlot &storageSlot);
84template<> StorageSlot fromString<StorageSlot>(const QString &strStorageSlot);
85template<> QString toString(const DetailsElementType &detailsElementType);
86template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType);
87template<> QString toInternalString(const DetailsElementType &detailsElementType);
88template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType);
89
90/* Declare COM conversion specializations: */
91template<> QColor toColor(const KMachineState &state);
92template<> QPixmap toPixmap(const KMachineState &state);
93template<> QString toString(const KMachineState &state);
94template<> QString toString(const KSessionState &state);
95template<> QString toString(const KDeviceType &type);
96template<> QString toString(const KClipboardMode &mode);
97template<> QString toString(const KDragAndDropMode &mode);
98template<> QString toString(const KMediumType &type);
99template<> QString toString(const KMediumVariant &variant);
100template<> QString toString(const KNetworkAttachmentType &type);
101template<> QString toString(const KNetworkAdapterType &type);
102template<> QString toString(const KNetworkAdapterPromiscModePolicy &policy);
103template<> QString toString(const KPortMode &mode);
104template<> QString toString(const KUSBDeviceState &state);
105template<> QString toString(const KUSBDeviceFilterAction &action);
106template<> QString toString(const KAudioDriverType &type);
107template<> QString toString(const KAudioControllerType &type);
108template<> QString toString(const KAuthType &type);
109template<> QString toString(const KStorageBus &bus);
110template<> QString toString(const KStorageControllerType &type);
111template<> QString toString(const KChipsetType &type);
112template<> QString toString(const KNATProtocol &protocol);
113template<> KPortMode fromString<KPortMode>(const QString &strMode);
114template<> KUSBDeviceFilterAction fromString<KUSBDeviceFilterAction>(const QString &strAction);
115template<> KAudioDriverType fromString<KAudioDriverType>(const QString &strType);
116template<> KAudioControllerType fromString<KAudioControllerType>(const QString &strType);
117template<> KAuthType fromString<KAuthType>(const QString &strType);
118template<> KStorageControllerType fromString<KStorageControllerType>(const QString &strType);
119
120#endif /* __UIConverterBackend_h__ */
121
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use