// -*- c++ -*-

/*
 * Jakelib2 - General purpose C++ library
 * Copyright (C) 2001 Florian Wolff  (florian@donuz.de)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: DateFormatSymbols.h,v 1.4 2003/09/20 12:38:02 florian Exp $
 */

#ifndef INCLUDE_JAKELIB2_TEXT_DATEFORMATSYMBOLS_H
# define INCLUDE_JAKELIB2_TEXT_DATEFORMATSYMBOLS_H

#include "../lang/Object.h"
#include "../util/Locale.h"

namespace jakelib {
  namespace util {
    class Locale;
    class ResourceBundle;
  }

  namespace text  {
    /**
     * \c DateFormatSymbols encapsulates locale-specific date-formatting
     * data like month names and week day names.
     *
     * @class DateFormatSymbols
     * @version $Id: DateFormatSymbols.h,v 1.4 2003/09/20 12:38:02 florian Exp $
     * @author Florian 'Overflo' Wolff (florian@donuz.de)
     */
    class DateFormatSymbols: public jakelib::lang::Object
    {
    public:

      /**
       * This method initializes a new instance of
       * DateFormatSymbols for the default locale.
       */
      DateFormatSymbols();

      /**
       * This method initializes a new instance of
       * DateFormatSymbols for the specified locale.
       *
       * @param loc The local to load symbols for.
       */
      DateFormatSymbols(jakelib::util::Locale* loc);

      /**
       * This method checks this object for equality against the specified object.
       * This will be \c true if and only if the following criteria are met with
       * regard to the specified object:
       *
       * \li It is not \c null.
       * \li It is an instance of DateFormatSymbols
       * \li All of its symbols are identical to the symbols in this object.
       *
       * @return \c true if the specified object is equal to this
       *         object, \c false otherwise.
       */
      jboolean equals(jakelib::lang::Object* obj);

      /**
       * Returns an array of all 12 month names, indexed from
       * jakelib::util::Calendar::JANUARY through jakelib::util::Calendar::DECEMBER.
       */
      jakelib::lang::Strings* getMonths();

      /**
       * Returns an array of all 7 week day names, indexed from
       * jakelib::util::Calendar::SUNDAY through jakelib::util::Calendar::MONDAY.
       */
      jakelib::lang::Strings* getWeekdays();

      /**
       * Returns an array of all 12 short month names, indexed from
       * jakelib::util::Calendar::JANUARY through jakelib::util::Calendar::DECEMBER.
       */
      jakelib::lang::Strings* getShortMonths();

      /**
       * Returns an array of all 7 short week day names, indexed from
       * jakelib::util::Calendar::SUNDAY through jakelib::util::Calendar::MONDAY.
       */
      jakelib::lang::Strings* getShortWeekdays();

      /**
       * Returns an array of all 4 date format patterns indexed from
       * DateFormat::FULL through DateFormat::SHORT.
       */
      jakelib::lang::Strings* getDateTimeFormats();

      /**
       * Returns an array of all 2 AM/PM strings indexed from
       * jakelib::util::Calendar::AM through jakelib::util::Calendar::PM.
       */
      jakelib::lang::Strings* getAmPmStrings();

      /**
       * Sets the 12 month names from jakelib::util::Calendar::JANUARY
       * through jakelib::util::Calendar::DECEMBER.
       */
      void setMonths(jakelib::lang::String* m0, jakelib::lang::String* m1, jakelib::lang::String* m2,
                     jakelib::lang::String* m3, jakelib::lang::String* m4, jakelib::lang::String* m5,
                     jakelib::lang::String* m6, jakelib::lang::String* m7, jakelib::lang::String* m8,
                     jakelib::lang::String* m9, jakelib::lang::String* m10, jakelib::lang::String* m11);

      /**
       * Sets the 7 weekday names from jakelib::util::Calendar::SUNDAY
       * through jakelib::util::Calendar::SATURDAY.
       */
      void setWeekdays(jakelib::lang::String* d1, jakelib::lang::String* d2,
                       jakelib::lang::String* d3, jakelib::lang::String* d4, jakelib::lang::String* d5,
                       jakelib::lang::String* d6, jakelib::lang::String* d7);

      /**
       * Sets the 12 short month names from jakelib::util::Calendar::JANUARY
       * through jakelib::util::Calendar::DECEMBER.
       */
      void setShortMonths(jakelib::lang::String* m0, jakelib::lang::String* m1, jakelib::lang::String* m2,
                          jakelib::lang::String* m3, jakelib::lang::String* m4, jakelib::lang::String* m5,
                          jakelib::lang::String* m6, jakelib::lang::String* m7, jakelib::lang::String* m8,
                          jakelib::lang::String* m9, jakelib::lang::String* m10, jakelib::lang::String* m11);

      /**
       * Sets the 7 short weekday names from jakelib::util::Calendar::SUNDAY
       * through jakelib::util::Calendar::SATURDAY.
       */
      void setShortWeekdays(jakelib::lang::String* d1, jakelib::lang::String* d2,
                            jakelib::lang::String* d3, jakelib::lang::String* d4, jakelib::lang::String* d5,
                            jakelib::lang::String* d6, jakelib::lang::String* d7);

      /**
       * Sets the 4 date format patterns DateFormat::FULL .. DateFormat::SHORT.
       */
      void setDateTimeFormats(jakelib::lang::String *full, jakelib::lang::String *l,
                              jakelib::lang::String *m, jakelib::lang::String *s);

      /**
       * Sets the 2 AM/PM strings jakelib::util::Calendar::AM
       * and jakelib::util::Calendar::PM.
       */
      void setAmPmStrings(jakelib::lang::String *am, jakelib::lang::String *pm);

    private:

      void init(jakelib::util::Locale* loc);

      /** Holds the month names. */
      jakelib::lang::Strings* monthNames;

      /** Holds the week day names. */
      jakelib::lang::Strings* weekdays;

      /** Holds the short month names. */
      jakelib::lang::Strings* shortMonthNames;

      /** Holds the short week day names. */
      jakelib::lang::Strings* shortWeekdays;

      /** Holds the 4 date format patterns. */
      jakelib::lang::Strings* dateTimeFormats;

      /** Holds the 2 AM/PM strings. */
      jakelib::lang::Strings* amPmStrings;

      JAKELIB_DECLARE_CLASS(DateFormatSymbols);
    };
  }
}

#endif
