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

kalarm/lib

  • sources
  • kde-4.14
  • kdepim
  • kalarm
  • lib
kalocale.h
Go to the documentation of this file.
1 /*
2  * kalocale.h - miscellaneous locale functions
3  * Program: kalarm
4  * Copyright © 2004-2009 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef LOCALE_H
22 #define LOCALE_H
23 
24 #include <QString>
25 class KLocale;
26 
27 namespace KAlarm
28 {
29 
33 int localeFirstDayOfWeek();
34 
36 QString weekDayName(int day, const KLocale*);
37 
38 /* Given a standard KDE day number, return the day number in the week for the user's locale.
39  * Standard day number = 1 (Mon) .. 7 (Sun)
40  * Locale day number in week = 0 .. 6
41  */
42 inline int weekDay_to_localeDayInWeek(int weekDay) { return (weekDay + 7 - localeFirstDayOfWeek()) % 7; }
43 
44 /* Given a day number in the week for the user's locale, return the standard KDE day number.
45  * 'index' = 0 .. 6
46  * Standard day number = 1 (Mon) .. 7 (Sun)
47  */
48 inline int localeDayInWeek_to_weekDay(int index) { return (index + localeFirstDayOfWeek() - 1) % 7 + 1; }
49 
50 uint defaultWorkDays();
51 
52 } // namespace KAlarm
53 
54 #endif // LOCALE_H
55 
56 // vim: et sw=4:
KAlarm::weekDayName
QString weekDayName(int day, const KLocale *locale)
Return the week day name (Monday = 1).
Definition: kalocale.cpp:47
KAlarm::localeDayInWeek_to_weekDay
int localeDayInWeek_to_weekDay(int index)
Definition: kalocale.h:48
KAlarm::defaultWorkDays
uint defaultWorkDays()
Definition: kalocale.cpp:66
QString
KAlarm::weekDay_to_localeDayInWeek
int weekDay_to_localeDayInWeek(int weekDay)
Definition: kalocale.h:42
KAlarm::localeFirstDayOfWeek
int localeFirstDayOfWeek()
Return the first day of the week for the user's locale.
Definition: kalocale.cpp:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:35:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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