• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KUnitConversion

  • kunitconversion
acceleration.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 Petri Damstén <damu@iki.fi>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#include "acceleration.h"
21#include "converter.h"
22#include <klocale.h>
23
24using namespace KUnitConversion;
25
26Acceleration::Acceleration() : UnitCategory(AccelerationCategory)
27{
28 setName(i18n("Acceleration"));
29 setSymbolStringFormat(ki18nc("%1 value, %2 unit symbol (acceleration)", "%1 %2"));
30
31 setDefaultUnit(UP(MetresPerSecondSquared, 1,
32 i18nc("acceleration unit symbol", "m/s²"),
33 i18nc("unit description in lists", "meters per second squared"),
34 i18nc("unit synonyms for matching user input",
35 "meter per second squared;meters per second squared;m/s²;m/s2;m/s^2"),
36 ki18nc("amount in units (real)", "%1 meters per second squared"),
37 ki18ncp("amount in units (integer)", "%1 meter per second squared",
38 "%1 meters per second squared")
39 ));
40 U(FeetPerSecondSquared, 0.3048,
41 i18nc("acceleration unit symbol", "ft/s²"),
42 i18nc("unit description in lists", "feet per second squared"),
43 i18nc("unit synonyms for matching user input",
44 "foot per second squared;feet per second squared;ft/s²;ft/s2;ft/s^2"),
45 ki18nc("amount in units (real)", "%1 feet per second squared"),
46 ki18ncp("amount in units (integer)", "%1 foot per second squared",
47 "%1 feet per second squared")
48 );
49 U(StandardGravity, 9.80665,
50 i18nc("acceleration unit symbol", "g"),
51 i18nc("unit description in lists", "standard gravity"),
52 i18nc("unit synonyms for matching user input", "standard gravity;g"),
53 ki18nc("amount in units (real)", "%1 times standard gravity"),
54 ki18ncp("amount in units (integer)", "%1 standard gravity",
55 "%1 times standard gravity")
56 );
57
58 setMostCommonUnits(QList<int>() <<
59 MetresPerSecondSquared << FeetPerSecondSquared);
60}
61
acceleration.h
Acceleration::Acceleration
Acceleration()
Definition: acceleration.cpp:26
KUnitConversion::UnitCategory
Definition: unitcategory.h:34
KUnitConversion::UnitCategory::setSymbolStringFormat
void setSymbolStringFormat(const KLocalizedString &symbolStringFormat)
Definition: unitcategory.cpp:60
KUnitConversion::UnitCategory::setMostCommonUnits
void setMostCommonUnits(const QList< int > &units)
Definition: unitcategory.cpp:80
KUnitConversion::UnitCategory::setName
void setName(const QString &name)
Definition: unitcategory.cpp:156
KUnitConversion::UnitCategory::setDefaultUnit
void setDefaultUnit(UnitPtr defaultUnit)
Definition: unitcategory.cpp:161
converter.h
KUnitConversion
Definition: converter.cpp:46
KUnitConversion::AccelerationCategory
@ AccelerationCategory
Definition: converter.h:32
KUnitConversion::StandardGravity
@ StandardGravity
Definition: converter.h:118
KUnitConversion::FeetPerSecondSquared
@ FeetPerSecondSquared
Definition: converter.h:118
KUnitConversion::MetresPerSecondSquared
@ MetresPerSecondSquared
Definition: converter.h:118
U
#define U(id, m, s, d, sy, r, i)
Definition: unit.h:129
UP
#define UP(id, m, s, d, sy, r, i)
Definition: unit.h:127
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUnitConversion

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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