2010-10-14 01:27:31 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2002-03-26 06:36:40 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2002-03-26 06:36:40 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2002-03-26 10:57:44 -06:00
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-03-26 10:57:44 -06:00
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2002-03-26 06:36:40 -06:00
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2002-03-26 06:36:40 -06:00
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2002-03-26 06:36:40 -06:00
|
|
|
*
|
2008-04-10 02:38:37 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2002-03-26 06:36:40 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _I18N_CALENDARIMPL_HXX_
|
|
|
|
#define _I18N_CALENDARIMPL_HXX_
|
|
|
|
|
2011-11-18 14:26:39 -06:00
|
|
|
#include <com/sun/star/i18n/XCalendar3.hpp>
|
2003-04-24 05:02:33 -05:00
|
|
|
#include <com/sun/star/i18n/CalendarDisplayCode.hpp>
|
2002-07-12 11:29:36 -05:00
|
|
|
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
|
|
|
|
#include <com/sun/star/i18n/CalendarDisplayIndex.hpp>
|
2002-03-26 06:36:40 -06:00
|
|
|
#include <cppuhelper/implbase2.hxx> // helper for implementations
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2004-01-20 06:16:02 -06:00
|
|
|
#include <vector>
|
2002-03-26 06:36:40 -06:00
|
|
|
|
|
|
|
// ----------------------------------------------------
|
|
|
|
// class CalendarImpl
|
|
|
|
// ----------------------------------------------------
|
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star { namespace i18n {
|
|
|
|
|
|
|
|
class CalendarImpl : public cppu::WeakImplHelper2
|
|
|
|
<
|
2011-11-18 14:26:39 -06:00
|
|
|
com::sun::star::i18n::XCalendar3,
|
2002-03-26 06:36:40 -06:00
|
|
|
com::sun::star::lang::XServiceInfo
|
|
|
|
>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructors
|
|
|
|
CalendarImpl() {};
|
|
|
|
CalendarImpl(const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
~CalendarImpl();
|
|
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
virtual void SAL_CALL loadDefaultCalendar(const com::sun::star::lang::Locale& rLocale) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL loadCalendar(const rtl::OUString& uniqueID, const com::sun::star::lang::Locale& rLocale) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual Calendar SAL_CALL getLoadedCalendar() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < rtl::OUString > SAL_CALL getAllCalendars(const com::sun::star::lang::Locale& rLocale) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual rtl::OUString SAL_CALL getUniqueID() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setDateTime(double nTimeInDays) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual double SAL_CALL getDateTime() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setValue( sal_Int16 nFieldIndex, sal_Int16 nValue ) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Int16 SAL_CALL getValue(sal_Int16 nFieldIndex) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL isValid() throw (com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL addValue(sal_Int16 nFieldIndex, sal_Int32 nAmount) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Int16 SAL_CALL getFirstDayOfWeek() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setFirstDayOfWeek(sal_Int16 nDay) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setMinimumNumberOfDaysForFirstWeek(sal_Int16 nDays) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Int16 SAL_CALL getMinimumNumberOfDaysForFirstWeek() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Int16 SAL_CALL getNumberOfMonthsInYear() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Int16 SAL_CALL getNumberOfDaysInWeek() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem > SAL_CALL getMonths() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem > SAL_CALL getDays() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual rtl::OUString SAL_CALL getDisplayName(sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
|
2002-07-12 11:29:36 -05:00
|
|
|
// Methods in XExtendedCalendar
|
|
|
|
virtual rtl::OUString SAL_CALL getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) throw (com::sun::star::uno::RuntimeException);
|
|
|
|
|
2011-11-18 14:26:39 -06:00
|
|
|
// XCalendar3
|
|
|
|
virtual Calendar2 SAL_CALL getLoadedCalendar2() throw(com::sun::star::uno::RuntimeException);
|
2011-11-19 08:51:41 -06:00
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem2 > SAL_CALL getDays2() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem2 > SAL_CALL getMonths2() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem2 > SAL_CALL getGenitiveMonths2() throw(com::sun::star::uno::RuntimeException);
|
2011-11-22 07:29:35 -06:00
|
|
|
virtual com::sun::star::uno::Sequence < CalendarItem2 > SAL_CALL getPartitiveMonths2() throw(com::sun::star::uno::RuntimeException);
|
2011-11-18 14:26:39 -06:00
|
|
|
|
2002-03-26 06:36:40 -06:00
|
|
|
//XServiceInfo
|
|
|
|
virtual rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw(com::sun::star::uno::RuntimeException);
|
|
|
|
virtual com::sun::star::uno::Sequence < rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct lookupTableItem {
|
2011-11-18 14:26:39 -06:00
|
|
|
lookupTableItem(const rtl::OUString& _uniqueID, com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 >& _xCalendar) :
|
2002-03-26 06:36:40 -06:00
|
|
|
uniqueID(_uniqueID), xCalendar(_xCalendar) {}
|
|
|
|
rtl::OUString uniqueID;
|
2011-11-18 14:26:39 -06:00
|
|
|
com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar;
|
2002-03-26 06:36:40 -06:00
|
|
|
};
|
2004-01-20 06:16:02 -06:00
|
|
|
std::vector<lookupTableItem*> lookupTable;
|
2002-03-26 06:36:40 -06:00
|
|
|
com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
|
2011-11-18 14:26:39 -06:00
|
|
|
com::sun::star::uno::Reference < com::sun::star::i18n::XCalendar3 > xCalendar;
|
2002-03-26 06:36:40 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} } } }
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 01:27:31 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|