[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
klfsysinfo.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klfsysinfo.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2012 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id$ */
23 
24 #ifndef KLFSYSINFO_H
25 #define KLFSYSINFO_H
26 
27 #include <klfdefs.h>
28 
29 
30 namespace KLFSysInfo
31 {
32  enum Os { Linux, Win32, MacOsX, OtherOs };
33 
34  inline int sizeofVoidStar() { return sizeof(void*); }
35 
37 
39  KLF_EXPORT bool isCompatibleSysArch(const QString& sysarch);
40 
42 
44 
45  struct BatteryInfo {
46  BatteryInfo() : islaptop(false), onbatterypower(false) { }
47 
48  bool islaptop;
50  };
52 
53  KLF_EXPORT bool isLaptop();
55 
56 };
57 
58 
59 
60 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
61 # define KLF_PATH_SEP ';'
62 # define KLF_DIR_SEP '\\'
63 #else
64 # define KLF_PATH_SEP ':'
65 # define KLF_DIR_SEP '/'
66 #endif
67 
68 
69 
70 #endif // KLFSYSINFO_H
KLFSysInfo::isCompatibleSysArch
KLF_EXPORT bool isCompatibleSysArch(const QString &sysarch)
Definition: klfsysinfo.cpp:46
KLFSysInfo::os
KLF_EXPORT KLFSysInfo::Os os()
Which operating system this system is running.
Definition: klfsysinfo.cpp:69
KLFSysInfo::OtherOs
@ OtherOs
systems on which neither Q_OS_{LINUX|WIN32|DARWIN} is defined
Definition: klfsysinfo.h:32
KLFSysInfo::BatteryInfo
Definition: klfsysinfo.h:45
KLFSysInfo::BatteryInfo::islaptop
bool islaptop
Definition: klfsysinfo.h:48
KLFSysInfo::sizeofVoidStar
int sizeofVoidStar()
the processor register size.
Definition: klfsysinfo.h:34
KLFSysInfo::makeSysArch
KLF_EXPORT QString makeSysArch(const QString &os, const QString &arch)
Definition: klfsysinfo.cpp:42
KLFSysInfo::batteryInfo
KLF_EXPORT BatteryInfo batteryInfo()
Definition: klfsysinfo.cpp:114
QString
KLFSysInfo::MacOsX
@ MacOsX
systems on which Q_OS_DARWIN is defined
Definition: klfsysinfo.h:32
KLF_EXPORT
#define KLF_EXPORT
Definition: klfdefs.h:41
KLFSysInfo::arch
KLF_EXPORT QString arch()
The architecture of this sytem.
Definition: klfsysinfo.cpp:37
KLFSysInfo::BatteryInfo::BatteryInfo
BatteryInfo()
Definition: klfsysinfo.h:46
KLFSysInfo
Utilities to get system information.
KLFSysInfo::Os
Os
List of known operating systems.
Definition: klfsysinfo.h:32
KLFSysInfo::BatteryInfo::onbatterypower
bool onbatterypower
Definition: klfsysinfo.h:49
KLFSysInfo::Win32
@ Win32
systems on which Q_OS_WIN32 is defined
Definition: klfsysinfo.h:32
KLFSysInfo::isLaptop
KLF_EXPORT bool isLaptop()
Definition: klfsysinfo.cpp:130
KLFSysInfo::isOnBatteryPower
KLF_EXPORT bool isOnBatteryPower()
Definition: klfsysinfo.cpp:148
KLFSysInfo::osString
KLF_EXPORT QString osString(KLFSysInfo::Os sysos=os())
The operating system we are running, returned as a string.
Definition: klfsysinfo.cpp:82
klfdefs.h
Base declarations for klatexformula and some utilities.
KLFSysInfo::Linux
@ Linux
systems on which Q_OS_LINUX is defined
Definition: klfsysinfo.h:32

Generated by doxygen 1.8.20