kdecore Library: kcalendarsystemfactory.cpp Source File (kdecore Library)

| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kcalendarsystemfactory.cpp

    00001 /*
    00002    Copyright (c) 2002 Carlos Moro <cfmoro@correo.uniovi.es>
    00003    Copyright (c) 2002-2003 Hans Petter Bieker <bieker@kde.org>
    00004
    00005    This library is free software; you can redistribute it and/or
    00006    modify it under the terms of the GNU Library General Public
    00007    License as published by the Free Software Foundation; either
    00008    version 2 of the License, or (at your option) any later version.
    00009
    00010    This library is distributed in the hope that it will be useful,
    00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013    Library General Public License for more details.
    00014
    00015    You should have received a copy of the GNU Library General Public License
    00016    along with this library; see the file COPYING.LIB.  If not, write to
    00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018    Boston, MA 02111-1307, USA.
    00019 */
    00020
    00021 // Gregorian calendar system implementation factory for creation of kde
    00022 // calendar systems.
    00023 // Also default gregorian and factory classes
    00024
    00025 #include <kdebug.h>
    00026
    00027 #include "kcalendarsystemfactory.h"
    00028
    00029 #include "kcalendarsystemgregorian.h"
    00030 #include "kcalendarsystemhijri.h"
    00031 #include "kcalendarsystemhebrew.h"
    00032 #include "kcalendarsystemjalali.h"
    00033
    00034 KCalendarSystemFactory::KCalendarSystemFactory()
    00035 {
    00036   kdDebug(5400) << "Created factory calendar" << endl;
    00037 }
    00038
    00039 KCalendarSystemFactory::~KCalendarSystemFactory()
    00040 {
    00041 }
    00042
    00043 KCalendarSystem *KCalendarSystemFactory::create( const QString &calType,
    00044                                                  const KLocale * locale )
    00045 {
    00046   if ( calType == "hebrew" )
    00047     return new KCalendarSystemHebrew(locale);
    00048   if ( calType == "hijri" )
    00049     return new KCalendarSystemHijri(locale);
    00050   if ( calType == "gregorian" )
    00051     return new KCalendarSystemGregorian(locale);
    00052   if ( calType == "jalali" )
    00053     return new KCalendarSystemJalali(locale);
    00054
    00055   kdDebug(5400) << "Calendar " << calType << " not found, defaulting to gregorian" << endl;
    00056
    00057   // ### HPB: Should it really be a default here?
    00058   return new KCalendarSystemGregorian(locale);
    00059 }
    00060
    00061 QStringList KCalendarSystemFactory::calendarSystems()
    00062 {
    00063    QStringList lst;
    00064    lst.append("hebrew");
    00065    lst.append("hijri");
    00066    lst.append("gregorian");
    00067    lst.append("jalali");
    00068
    00069    return lst;
    00070 }

This file is part of the documentation for kdecore Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:18:01 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003