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

#include "contactactionssettings.h"

#include <klocalizedstring.h>

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

class ContactActionsSettingsHelper
{
  public:
    ContactActionsSettingsHelper() : q(nullptr) {}
    ~ContactActionsSettingsHelper() { delete q; q = nullptr; }
    ContactActionsSettingsHelper(const ContactActionsSettingsHelper&) = delete;
    ContactActionsSettingsHelper& operator=(const ContactActionsSettingsHelper&) = delete;
    ContactActionsSettings *q;
};
Q_GLOBAL_STATIC(ContactActionsSettingsHelper, s_globalContactActionsSettings)
ContactActionsSettings *ContactActionsSettings::self()
{
  if (!s_globalContactActionsSettings()->q) {
    new ContactActionsSettings;
    s_globalContactActionsSettings()->q->read();
  }

  return s_globalContactActionsSettings()->q;
}

ContactActionsSettings::ContactActionsSettings( )
  : KConfigSkeleton( QStringLiteral( "akonadi_contactrc" ) )
{
  Q_ASSERT(!s_globalContactActionsSettings()->q);
  s_globalContactActionsSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Phone Dial Settings" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesDialPhoneNumberAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSkype");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseExternalPhoneApplication");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSflPhone");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseEkiga");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSystemDefault");
    valuesDialPhoneNumberAction.append( choice );
  }
  mDialPhoneNumberActionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "DialPhoneNumberAction" ), mDialPhoneNumberAction, valuesDialPhoneNumberAction, UseSystemDefault );
  mDialPhoneNumberActionItem->setLabel( i18n("DialPhoneNumberAction") );
  mDialPhoneNumberActionItem->setWhatsThis( i18n("Define how a phone number of a contact should be dialed. 'System Default' uses the default application configured for this on your system (e.g. KDE Connect). Selecting a specific application will use that (if installed), 'External Application' allows you to specify a dial command with placeholders manually.") );
  addItem( mDialPhoneNumberActionItem, QStringLiteral( "DialPhoneNumberAction" ) );
  mPhoneCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "PhoneCommand" ), mPhoneCommand );
  mPhoneCommandItem->setLabel( i18n("Phone Command") );
  mPhoneCommandItem->setToolTip( i18n("The following placeholders can be used in the command:\n"
"   %N: The raw number as stored in the address book.\n"
"   %n: The normalized number with all non-digit characters removed.") );
  mPhoneCommandItem->setWhatsThis( i18n("This command defines the application that shall be executed to dial a contact's phone number.") );
  addItem( mPhoneCommandItem, QStringLiteral( "PhoneCommand" ) );

  setCurrentGroup( QStringLiteral( "Send SMS Settings" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesSendSmsAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSkypeSms");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseExternalSmsApplication");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSflPhoneSms");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseSystemDefaultSms");
    valuesSendSmsAction.append( choice );
  }
  mSendSmsActionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SendSmsAction" ), mSendSmsAction, valuesSendSmsAction, UseSystemDefaultSms );
  mSendSmsActionItem->setLabel( i18n("SendSmsAction") );
  mSendSmsActionItem->setWhatsThis( i18n("Defines which application shall be used to send an SMS to the phone number of a contact. If 'System Default' is selected the default handler for SMS messages on your system will be used (e.g. KDE Connect), otherwise the selected application will be used to send the SMS message (if installed on the computer). If 'External Application' is selected, a command with placeholders can be defined.") );
  addItem( mSendSmsActionItem, QStringLiteral( "SendSmsAction" ) );
  mSmsCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "SmsCommand" ), mSmsCommand );
  mSmsCommandItem->setLabel( i18n("SMS Command") );
  mSmsCommandItem->setToolTip( i18n("The following placeholders can be used in the command:\n"
"   %N: The raw number as stored in the address book.\n"
"   %n: The normalized number with all non-digit characters removed.\n"
"   %t: The text") );
  mSmsCommandItem->setWhatsThis( i18n("This command defines the application that shall be executed to send an SMS to a contact's phone number.") );
  addItem( mSmsCommandItem, QStringLiteral( "SmsCommand" ) );
}

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

