~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to kalarm/lib/kalocale.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-10-03 22:27:55 UTC
  • mfrom: (1.1.44 upstream)
  • Revision ID: james.westby@ubuntu.com-20091003222755-nm1u1hm80385m8h3
Tags: 4:4.3.2-0ubuntu1
* New upstream release
  - Bump build-deps
  - Remove kubuntu_02_dimap_folder_rename_fix.diff fixed by upstream
  - Remove ktimeticker obsolete package from kontact suggests
  - Remove several oxygen icons which also are in kde-icons-oxygen,
    add in not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
30
/** Return the first day of the week for the user's locale.
 
31
*   Reply = 1 (Mon) .. 7 (Sun).
 
32
*/
 
33
int        localeFirstDayOfWeek();
 
34
 
 
35
/** Return the week day name (Monday = 1). */
 
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