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

#include "calendarsettings.h"

#include <klocalizedstring.h>

#include <qglobal.h>
#include <QFile>

using namespace Akonadi;

namespace Akonadi {

class CalendarSettingsHelper
{
  public:
    CalendarSettingsHelper() : q(nullptr) {}
    ~CalendarSettingsHelper() { delete q; q = nullptr; }
    CalendarSettingsHelper(const CalendarSettingsHelper&) = delete;
    CalendarSettingsHelper& operator=(const CalendarSettingsHelper&) = delete;
    CalendarSettings *q;
};

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

  return s_globalCalendarSettings()->q;
}

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

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

  setCurrentGroup( QStringLiteral( "FreeBusy Retrieve" ) );

  mFreeBusyRetrieveAutoItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FreeBusyRetrieveAuto" ), mFreeBusyRetrieveAuto, false );
  mFreeBusyRetrieveAutoItem->setLabel( i18nd("libakonadi-calendar5", "Enable Automatic Free/Busy Retrieval") );
  addItem( mFreeBusyRetrieveAutoItem, QStringLiteral( "FreeBusyRetrieveAuto" ) );
  mFreeBusyFullDomainRetrievalItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FreeBusyFullDomainRetrieval" ), mFreeBusyFullDomainRetrieval, false );
  mFreeBusyFullDomainRetrievalItem->setLabel( i18nd("libakonadi-calendar5", "Use full email address for retrieval") );
  mFreeBusyFullDomainRetrievalItem->setWhatsThis( i18nd("libakonadi-calendar5", "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, QStringLiteral( "FreeBusyFullDomainRetrieval" ) );
  mFreeBusyRetrieveUrlItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "FreeBusyRetrieveUrl" ), mFreeBusyRetrieveUrl );
  mFreeBusyRetrieveUrlItem->setLabel( i18nd("libakonadi-calendar5", "Free/Busy Retrieval URL") );
  addItem( mFreeBusyRetrieveUrlItem, QStringLiteral( "FreeBusyRetrieveUrl" ) );
  mFreeBusyRetrieveUserItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "FreeBusyRetrieveUser" ), mFreeBusyRetrieveUser );
  mFreeBusyRetrieveUserItem->setLabel( i18nd("libakonadi-calendar5", "Free/Busy Retrieval Username") );
  addItem( mFreeBusyRetrieveUserItem, QStringLiteral( "FreeBusyRetrieveUser" ) );
  mFreeBusyRetrievePasswordItem = new KConfigSkeleton::ItemPassword( currentGroup(), QStringLiteral( "FreeBusyRetrievePassword" ), mFreeBusyRetrievePassword );
  mFreeBusyRetrievePasswordItem->setLabel( i18nd("libakonadi-calendar5", "Free/Busy Retrieval Password") );
  mFreeBusyRetrievePasswordItem->setWhatsThis( i18nd("libakonadi-calendar5", "Password for retrieving free/busy information") );
  addItem( mFreeBusyRetrievePasswordItem, QStringLiteral( "FreeBusyRetrievePassword" ) );
  mFreeBusyRetrieveSavePasswordItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FreeBusyRetrieveSavePassword" ), mFreeBusyRetrieveSavePassword, false );
  mFreeBusyRetrieveSavePasswordItem->setLabel( i18nd("libakonadi-calendar5", "FreeBusyRetrieveSavePassword") );
  addItem( mFreeBusyRetrieveSavePasswordItem, QStringLiteral( "FreeBusyRetrieveSavePassword" ) );

  setCurrentGroup( QStringLiteral( "Group Scheduling" ) );

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

  setCurrentGroup( QStringLiteral( "Hidden Options" ) );

  mOutlookCompatCounterProposalsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OutlookCompatCounterProposals" ), mOutlookCompatCounterProposals, false );
  mOutlookCompatCounterProposalsItem->setLabel( i18nd("libakonadi-calendar5", "Send Outlook-like pseudo counter proposals") );
  addItem( mOutlookCompatCounterProposalsItem, QStringLiteral( "OutlookCompatCounterProposals" ) );
  mFreeBusyCheckHostnameItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FreeBusyCheckHostname" ), mFreeBusyCheckHostname, false );
  mFreeBusyCheckHostnameItem->setLabel( i18nd("libakonadi-calendar5", "Check whether hostname and retrieval email address match") );
  mFreeBusyCheckHostnameItem->setWhatsThis( i18nd("libakonadi-calendar5", "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, QStringLiteral( "FreeBusyCheckHostname" ) );
}

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

