Support "eject" on OS X.
[maemo-rb.git] / rbutil / rbutilqt / base / systeminfo.h
blob0e603f865ecc7081d5247eda50827ed6439759c5
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2010 by Dominik Wenger
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
21 #ifndef SYSTEMINFO_H
22 #define SYSTEMINFO_H
24 #include <QtCore>
26 class SystemInfo : public QObject
28 Q_OBJECT
29 public:
30 //! Type of requested usb-id map
31 enum MapType {
32 MapDevice,
33 MapError,
34 MapIncompatible,
37 //! All system settings
38 enum SystemInfos {
39 ManualUrl,
40 BleedingUrl,
41 BootloaderUrl,
42 BootloaderInfoUrl,
43 DailyUrl,
44 DailyFontUrl,
45 DailyVoiceUrl,
46 DoomUrl,
47 ReleaseUrl,
48 ReleaseVoiceUrl,
49 ReleaseFontUrl,
50 BuildInfoUrl,
51 GenlangUrl,
52 ThemesUrl,
53 ThemesInfoUrl,
54 RbutilUrl,
55 CurPlatformName,
56 CurManual,
57 CurBootloaderMethod,
58 CurBootloaderName,
59 CurBootloaderFile,
60 CurBootloaderFilter,
61 CurEncoder,
62 CurBrand,
63 CurName,
64 CurBuildserverModel,
65 CurConfigureModel,
66 CurPlayerPicture,
69 enum PlatformType {
70 PlatformAll,
71 PlatformAllDisabled,
72 PlatformBase,
73 PlatformBaseDisabled,
74 PlatformVariant,
75 PlatformVariantDisabled
78 //! return a list of all platforms (rbutil internal names)
79 static QStringList platforms(enum PlatformType type = PlatformAll,
80 QString variant="");
81 //! returns a map of all languages
82 static QMap<QString, QStringList> languages(void);
83 //! returns a map of usb-ids and their targets
84 static QMap<int, QString> usbIdMap(enum MapType);
85 //! get a value from system settings
86 static QVariant value(enum SystemInfos info);
87 //! get a value from system settings for a named platform.
88 static QVariant platformValue(QString platform, enum SystemInfos info);
90 private:
91 //! you shouldnt call this, its a fully static calls
92 SystemInfo() {}
93 //! create the setting objects if neccessary
94 static void ensureSystemInfoExists();
95 //! pointers to our setting objects
96 static QSettings *systemInfos;
99 #endif