• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
kcalendarsystemfactory.cpp
1 /*
2  Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
3  Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 // Gregorian calendar system implementation factory for creation of kde
22 // calendar systems.
23 // Also default gregorian and factory classes
24 
25 #include <kdebug.h>
26 
27 #include "kcalendarsystemfactory.h"
28 
29 #include "kcalendarsystemgregorian.h"
30 #include "kcalendarsystemhijri.h"
31 #include "kcalendarsystemhebrew.h"
32 #include "kcalendarsystemjalali.h"
33 
34 KCalendarSystemFactory::KCalendarSystemFactory()
35 {
36  kdDebug(5400) << "Created factory calendar" << endl;
37 }
38 
39 KCalendarSystemFactory::~KCalendarSystemFactory()
40 {
41 }
42 
43 KCalendarSystem *KCalendarSystemFactory::create( const TQString &calType,
44  const TDELocale * locale )
45 {
46  if ( calType == "hebrew" )
47  return new KCalendarSystemHebrew(locale);
48  if ( calType == "hijri" )
49  return new KCalendarSystemHijri(locale);
50  if ( calType == "gregorian" )
51  return new KCalendarSystemGregorian(locale);
52  if ( calType == "jalali" )
53  return new KCalendarSystemJalali(locale);
54 
55  kdDebug(5400) << "Calendar " << calType << " not found, defaulting to gregorian" << endl;
56 
57  // ### HPB: Should it really be a default here?
58  return new KCalendarSystemGregorian(locale);
59 }
60 
61 TQStringList KCalendarSystemFactory::calendarSystems()
62 {
63  TQStringList lst;
64  lst.append("hebrew");
65  lst.append("hijri");
66  lst.append("gregorian");
67  lst.append("jalali");
68 
69  return lst;
70 }
KCalendarSystemFactory::create
static KCalendarSystem * create(const TQString &calType=TQString::fromLatin1("gregorian"), const TDELocale *locale=0)
Gets specific calendar type number of days in previous month for a given date.
Definition: kcalendarsystemfactory.cpp:43
KCalendarSystemFactory::calendarSystems
static TQStringList calendarSystems()
Gets list of names of supported calendar systems.
Definition: kcalendarsystemfactory.cpp:61
KCalendarSystemJalali
Jalali calendar type implementation.
Definition: kcalendarsystemjalali.h:37
KCalendarSystem
CalendarSystem abstract class, default derived kde gregorian class and factory class.
Definition: kcalendarsystem.h:43
TDELocale
TDELocale provides support for country specific stuff like the national language.
Definition: tdelocale.h:124
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.1
This website is maintained by Timothy Pearson.