// This file is generated by kconfig_compiler from calendarsettings.kcfg.
// All changes you do to this file will be lost.

#include "calendarsettings.h"

#include <klocale.h>

#include <kglobal.h>
#include <QtCore/QFile>

using namespace Akonadi;

namespace Akonadi {

class CalendarSettingsHelper
{
  public:
    CalendarSettingsHelper() : q(0) {}
    ~CalendarSettingsHelper() { delete q; }
    CalendarSettings *q;
};
}

K_GLOBAL_STATIC(CalendarSettingsHelper, s_globalCalendarSettings)
CalendarSettings *CalendarSettings::self()
{
  if (!s_globalCalendarSettings->q) {
    new CalendarSettings;
    s_globalCalendarSettings->q->readConfig();
  }

  return s_globalCalendarSettings->q;
}

CalendarSettings::CalendarSettings(  )
  : KConfigSkeleton( QLatin1String( "akonadi-calendarrc" ) )
{
  Q_ASSERT(!s_globalCalendarSettings->q);
  s_globalCalendarSettings->q = this;
  setCurrentGroup( QLatin1String( "FreeBusy Publish" ) );

  mFreeBusyPublishAutoItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyPublishAuto" ), mFreeBusyPublishAuto, false );
  mFreeBusyPublishAutoItem->setLabel( i18n("FreeBusyPublishAuto") );
  addItem( mFreeBusyPublishAutoItem, QLatin1String( "FreeBusyPublishAuto" ) );
  mFreeBusyPublishDelayItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "FreeBusyPublishDelay" ), mFreeBusyPublishDelay, 5 );
  mFreeBusyPublishDelayItem->setLabel( i18n("FreeBusyPublishDelay") );
  addItem( mFreeBusyPublishDelayItem, QLatin1String( "FreeBusyPublishDelay" ) );
  mFreeBusyPublishDaysItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "FreeBusyPublishDays" ), mFreeBusyPublishDays, 60 );
  mFreeBusyPublishDaysItem->setLabel( i18n("FreeBusyPublishDays") );
  addItem( mFreeBusyPublishDaysItem, QLatin1String( "FreeBusyPublishDays" ) );
  mFreeBusyPublishUrlItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "FreeBusyPublishUrl" ), mFreeBusyPublishUrl );
  mFreeBusyPublishUrlItem->setLabel( i18n("Free/Busy Publish URL") );
  mFreeBusyPublishUrlItem->setWhatsThis( i18n("URL for publishing free/busy information") );
  addItem( mFreeBusyPublishUrlItem, QLatin1String( "FreeBusyPublishUrl" ) );
  mFreeBusyPublishUserItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "FreeBusyPublishUser" ), mFreeBusyPublishUser );
  mFreeBusyPublishUserItem->setLabel( i18n("Free/Busy Publish Username") );
  mFreeBusyPublishUserItem->setWhatsThis( i18n("Username for publishing free/busy information") );
  addItem( mFreeBusyPublishUserItem, QLatin1String( "FreeBusyPublishUser" ) );
  mFreeBusyPublishPasswordItem = new KConfigSkeleton::ItemPassword( currentGroup(), QLatin1String( "FreeBusyPublishPassword" ), mFreeBusyPublishPassword );
  mFreeBusyPublishPasswordItem->setLabel( i18n("Free/Busy Publish Password") );
  mFreeBusyPublishPasswordItem->setWhatsThis( i18n("Password for publishing free/busy information") );
  addItem( mFreeBusyPublishPasswordItem, QLatin1String( "FreeBusyPublishPassword" ) );
  mFreeBusyPublishSavePasswordItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyPublishSavePassword" ), mFreeBusyPublishSavePassword, false );
  mFreeBusyPublishSavePasswordItem->setLabel( i18n("FreeBusyPublishSavePassword") );
  addItem( mFreeBusyPublishSavePasswordItem, QLatin1String( "FreeBusyPublishSavePassword" ) );

  setCurrentGroup( QLatin1String( "FreeBusy Retrieve" ) );

  mFreeBusyRetrieveAutoItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyRetrieveAuto" ), mFreeBusyRetrieveAuto, false );
  mFreeBusyRetrieveAutoItem->setLabel( i18n("Enable Automatic Free/Busy Retrieval") );
  addItem( mFreeBusyRetrieveAutoItem, QLatin1String( "FreeBusyRetrieveAuto" ) );
  mFreeBusyFullDomainRetrievalItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyFullDomainRetrieval" ), mFreeBusyFullDomainRetrieval, false );
  mFreeBusyFullDomainRetrievalItem->setLabel( i18n("Use full email address for retrieval") );
  mFreeBusyFullDomainRetrievalItem->setWhatsThis( i18n("With this setting, you can change the filename that will be fetched from the server. With this checked, it will download a free/busy file called user@domain.ifb, for example nn@kde.org.ifb. Without this set, it will download user.ifb, for example nn.ifb.") );
  addItem( mFreeBusyFullDomainRetrievalItem, QLatin1String( "FreeBusyFullDomainRetrieval" ) );
  mFreeBusyRetrieveUrlItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "FreeBusyRetrieveUrl" ), mFreeBusyRetrieveUrl );
  mFreeBusyRetrieveUrlItem->setLabel( i18n("Free/Busy Retrieval URL") );
  addItem( mFreeBusyRetrieveUrlItem, QLatin1String( "FreeBusyRetrieveUrl" ) );
  mFreeBusyRetrieveUserItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "FreeBusyRetrieveUser" ), mFreeBusyRetrieveUser );
  mFreeBusyRetrieveUserItem->setLabel( i18n("Free/Busy Retrieval Username") );
  addItem( mFreeBusyRetrieveUserItem, QLatin1String( "FreeBusyRetrieveUser" ) );
  mFreeBusyRetrievePasswordItem = new KConfigSkeleton::ItemPassword( currentGroup(), QLatin1String( "FreeBusyRetrievePassword" ), mFreeBusyRetrievePassword );
  mFreeBusyRetrievePasswordItem->setLabel( i18n("Free/Busy Retrieval Password") );
  mFreeBusyRetrievePasswordItem->setWhatsThis( i18n("Password for retrieving free/busy information") );
  addItem( mFreeBusyRetrievePasswordItem, QLatin1String( "FreeBusyRetrievePassword" ) );
  mFreeBusyRetrieveSavePasswordItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyRetrieveSavePassword" ), mFreeBusyRetrieveSavePassword, false );
  mFreeBusyRetrieveSavePasswordItem->setLabel( i18n("FreeBusyRetrieveSavePassword") );
  addItem( mFreeBusyRetrieveSavePasswordItem, QLatin1String( "FreeBusyRetrieveSavePassword" ) );

  setCurrentGroup( QLatin1String( "Group Scheduling" ) );

  mBccItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Bcc" ), mBcc, false );
  mBccItem->setLabel( i18n("Send copy to owner when mailing events") );
  mBccItem->setWhatsThis( i18n("Check this box to get a copy of all e-mail messages that KOrganizer sends at your request to event attendees.") );
  addItem( mBccItem, QLatin1String( "Bcc" ) );
  mMailTransportItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "MailTransport" ), mMailTransport, QLatin1String( "false" ) );
  mMailTransportItem->setLabel( i18n("Mail transport to use for sending e-mail messages") );
  mMailTransportItem->setWhatsThis( i18n("If specified all, groupware e-mails will use this transport. Otherwise, the default one will be used.") );
  addItem( mMailTransportItem, QLatin1String( "MailTransport" ) );

  setCurrentGroup( QLatin1String( "Hidden Options" ) );

  mOutlookCompatCounterProposalsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "OutlookCompatCounterProposals" ), mOutlookCompatCounterProposals, false );
  mOutlookCompatCounterProposalsItem->setLabel( i18n("Send Outlook-like pseudo counter proposals") );
  addItem( mOutlookCompatCounterProposalsItem, QLatin1String( "OutlookCompatCounterProposals" ) );
  mFreeBusyCheckHostnameItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "FreeBusyCheckHostname" ), mFreeBusyCheckHostname, false );
  mFreeBusyCheckHostnameItem->setLabel( i18n("Check whether hostname and retrieval email address match") );
  mFreeBusyCheckHostnameItem->setWhatsThis( i18n("With this setting you can configure whether the domain part of the free/busy URL has to match the domain part of the user ID you are looking for. For example, if this option is set, then looking for the free/busy data of joe@mydomain.com on the server www.yourdomain.com will fail.") );
  addItem( mFreeBusyCheckHostnameItem, QLatin1String( "FreeBusyCheckHostname" ) );
}

CalendarSettings::~CalendarSettings()
{
  if (!s_globalCalendarSettings.isDestroyed()) {
    s_globalCalendarSettings->q = 0;
  }
}

