• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • structures
  • datatypes
  • primitive
booldatainformation.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Okteta Kasten Framework, made within the KDE community.
3  *
4  * Copyright 2011 Alex Richardson <alex.richardson@gmx.de>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) version 3, or any
10  * later version accepted by the membership of KDE e.V. (or its
11  * successor approved by the membership of KDE e.V.), which shall
12  * act as a proxy defined in Section 6 of version 3 of the license.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef BOOLDATAINFORMATION_H
24 #define BOOLDATAINFORMATION_H
25 
26 #include <QScriptValue>
27 
28 #include "uintdatainformation.h"
29 
30 template<typename T>
31 class BoolDataInformationMethods
32 {
33 public:
34  static QScriptValue asScriptValue(T value, QScriptEngine* engine, ScriptHandlerInfo* handler);
35  static QString staticValueString(T val, int base = Kasten2::StructViewPreferences::unsignedDisplayBase());
36  static PrimitiveDataType staticType();
37  static T fromVariant(const QVariant& value, bool* ok);
38 
39  static QWidget* staticCreateEditWidget(QWidget* parent);
40  static QVariant staticDataFromWidget(const QWidget* w);
41  static void staticSetWidgetData(T value, QWidget* w);
42 };
43 
44 template<>
45 inline PrimitiveDataType BoolDataInformationMethods<quint8>::staticType()
46 {
47  return Type_Bool8;
48 }
49 template<>
50 inline PrimitiveDataType BoolDataInformationMethods<quint16>::staticType()
51 {
52  return Type_Bool16;
53 }
54 template<>
55 inline PrimitiveDataType BoolDataInformationMethods<quint32>::staticType()
56 {
57  return Type_Bool32;
58 }
59 template<>
60 inline PrimitiveDataType BoolDataInformationMethods<quint64>::staticType()
61 {
62  return Type_Bool64;
63 }
64 
65 template<typename T>
66 inline QScriptValue BoolDataInformationMethods<T>::asScriptValue(T value, QScriptEngine* engine,
67  ScriptHandlerInfo* handler)
68 {
69  Q_UNUSED(engine);
70  Q_UNUSED(handler);
71  return QScriptValue(value != 0);
72 }
73 
74 template<typename T>
75 inline T BoolDataInformationMethods<T>::fromVariant(const QVariant& value, bool* ok)
76 {
77  return UIntDataInformationMethods<T>::fromVariant(value, ok);
78 }
79 
80 #endif // BOOLDATAINFORMATION_H
Type_Bool32
Definition: primitivedatatype.h:40
BoolDataInformationMethods::staticCreateEditWidget
static QWidget * staticCreateEditWidget(QWidget *parent)
Definition: booldatainformation.cpp:42
Type_Bool16
Definition: primitivedatatype.h:37
QWidget
BoolDataInformationMethods::staticDataFromWidget
static QVariant staticDataFromWidget(const QWidget *w)
Definition: booldatainformation.cpp:48
BoolDataInformationMethods
Definition: booldatainformation.h:31
BoolDataInformationMethods::staticType
static PrimitiveDataType staticType()
BoolDataInformationMethods::staticValueString
static QString staticValueString(T val, int base=Kasten2::StructViewPreferences::unsignedDisplayBase())
Definition: booldatainformation.cpp:27
PrimitiveDataType
Definition: primitivedatatype.h:54
Type_Bool64
Definition: primitivedatatype.h:43
uintdatainformation.h
UIntDataInformationMethods::fromVariant
static T fromVariant(const QVariant &value, bool *ok)
Definition: uintdatainformation.h:52
ScriptHandlerInfo
Definition: scripthandlerinfo.h:39
BoolDataInformationMethods::staticSetWidgetData
static void staticSetWidgetData(T value, QWidget *w)
Definition: booldatainformation.cpp:54
BoolDataInformationMethods::asScriptValue
static QScriptValue asScriptValue(T value, QScriptEngine *engine, ScriptHandlerInfo *handler)
Definition: booldatainformation.h:66
BoolDataInformationMethods::fromVariant
static T fromVariant(const QVariant &value, bool *ok)
Definition: booldatainformation.h:75
Type_Bool8
Definition: primitivedatatype.h:33
Kasten2::StructViewPreferences::unsignedDisplayBase
static int unsignedDisplayBase()
Get UnsignedDisplayBase.
Definition: structviewpreferences.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal