• 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 "kcalendarsystemworld.h"
30 #include "kcalendarsystemgregorian.h"
31 #include "kcalendarsystemhijri.h"
32 #include "kcalendarsystemhebrew.h"
33 #include "kcalendarsystemjalali.h"
34 
35 KCalendarSystemFactory::KCalendarSystemFactory()
36 {
37  kdDebug(5400) << "Created factory calendar" << endl;
38 }
39 
40 KCalendarSystemFactory::~KCalendarSystemFactory()
41 {
42 }
43 
44 KCalendarSystem *KCalendarSystemFactory::create( const TQString &calType,
45  const TDELocale * locale )
46 {
47  if ( calType == "world" )
48  return new KCalendarSystemWorld(locale);
49  if ( calType == "hebrew" )
50  return new KCalendarSystemHebrew(locale);
51  if ( calType == "hijri" )
52  return new KCalendarSystemHijri(locale);
53  if ( calType == "gregorian" )
54  return new KCalendarSystemGregorian(locale);
55  if ( calType == "jalali" )
56  return new KCalendarSystemJalali(locale);
57 
58  kdDebug(5400) << "Calendar " << calType << " not found, defaulting to gregorian" << endl;
59 
60  // ### HPB: Should it really be a default here?
61  return new KCalendarSystemGregorian(locale);
62 }
63 
64 TQStringList KCalendarSystemFactory::calendarSystems()
65 {
66  TQStringList lst;
67  lst.append("world");
68  lst.append("hebrew");
69  lst.append("hijri");
70  lst.append("gregorian");
71  lst.append("jalali");
72 
73  return lst;
74 }
KCalendarSystemJalali
Jalali calendar type implementation.
Definition: kcalendarsystemjalali.h:36
KCalendarSystem
CalendarSystem abstract class, default derived kde gregorian class and factory class.
Definition: kcalendarsystem.h:42
TDELocale
TDELocale provides support for country specific stuff like the national language. ...
Definition: tdelocale.h:123
KCalendarSystemWorld
World founding COLODAR type implementation.
Definition: kcalendarsystemworld.h:30
KCalendarSystemFactory::calendarSystems
static TQStringList calendarSystems()
Gets list of names of supported calendar systems.
Definition: kcalendarsystemfactory.cpp:64
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
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:44

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.