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

#include "contactactionssettings.h"

#include <klocale.h>

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

class ContactActionsSettingsHelper
{
  public:
    ContactActionsSettingsHelper() : q(0) {}
    ~ContactActionsSettingsHelper() { delete q; }
    ContactActionsSettings *q;
};
K_GLOBAL_STATIC(ContactActionsSettingsHelper, s_globalContactActionsSettings)
ContactActionsSettings *ContactActionsSettings::self()
{
  if (!s_globalContactActionsSettings->q) {
    new ContactActionsSettings;
    s_globalContactActionsSettings->q->readConfig();
  }

  return s_globalContactActionsSettings->q;
}

ContactActionsSettings::ContactActionsSettings(  )
  : KConfigSkeleton( QLatin1String( "akonadi_contactrc" ) )
{
  Q_ASSERT(!s_globalContactActionsSettings->q);
  s_globalContactActionsSettings->q = this;
  setCurrentGroup( QLatin1String( "Show Address Settings" ) );

  QList<KConfigSkeleton::ItemEnum::Choice2> valuesShowAddressAction;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseBrowser");
    valuesShowAddressAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseExternalAddressApplication");
    valuesShowAddressAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseGooglemap");
    valuesShowAddressAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseMapquest");
    valuesShowAddressAction.append( choice );
  }
  mShowAddressActionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "ShowAddressAction" ), mShowAddressAction, valuesShowAddressAction, UseBrowser );
  mShowAddressActionItem->setLabel( i18n("ShowAddressAction") );
  mShowAddressActionItem->setWhatsThis( i18n("Defines which application shall be used to show the postal address of a contact on a map. If 'Web Browser' is selected, an URL can be defined with placeholders for the single address parts. If 'External Application' is selected, a command with placeholders can be defined.") );
  addItem( mShowAddressActionItem, QLatin1String( "ShowAddressAction" ) );
  mAddressUrlItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "AddressUrl" ), mAddressUrl, QLatin1String( "http://open.mapquestapi.com/nominatim/v1/search.php?q=%s,+%l,+%c" ) );
  mAddressUrlItem->setLabel( i18n("AddressUrl") );
  mAddressUrlItem->setToolTip( i18n("The following placeholders can be used in the URL:\n"
"   %s: Street\n"
"   %r: Region\n"
"   %l: Location\n"
"   %z: Zip Code\n"
"   %c: Country ISO Code") );
  mAddressUrlItem->setWhatsThis( i18n("This URL defines the website that shall be used to show a contact's postal address.") );
  addItem( mAddressUrlItem, QLatin1String( "AddressUrl" ) );
  mAddressCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "AddressCommand" ), mAddressCommand );
  mAddressCommandItem->setLabel( i18n("Address Command") );
  mAddressCommandItem->setToolTip( i18n("The following placeholders can be used in the command:\n"
"   %s: Street\n"
"   %r: Region\n"
"   %l: Location\n"
"   %z: Zip Code\n"
"   %c: Country ISO Code") );
  mAddressCommandItem->setWhatsThis( i18n("This command defines the application that shall be executed to show a contact's postal address.") );
  addItem( mAddressCommandItem, QLatin1String( "AddressCommand" ) );

  setCurrentGroup( QLatin1String( "Phone Dial Settings" ) );

  QList<KConfigSkeleton::ItemEnum::Choice2> valuesDialPhoneNumberAction;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseSkype");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseExternalPhoneApplication");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseWinCE");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseSflPhone");
    valuesDialPhoneNumberAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseEkiga");
    valuesDialPhoneNumberAction.append( choice );
  }
  mDialPhoneNumberActionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "DialPhoneNumberAction" ), mDialPhoneNumberAction, valuesDialPhoneNumberAction, UseSkype );
  mDialPhoneNumberActionItem->setLabel( i18n("DialPhoneNumberAction") );
  mDialPhoneNumberActionItem->setWhatsThis( i18n("Defines which application shall be used to dial the phone number of a contact. If 'Skype' is selected the Skype application will be started (if installed on the computer) and the number is dialed. If 'External Application' is selected, a command with placeholders can be defined.") );
  addItem( mDialPhoneNumberActionItem, QLatin1String( "DialPhoneNumberAction" ) );
  mPhoneCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "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, QLatin1String( "PhoneCommand" ) );

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

  QList<KConfigSkeleton::ItemEnum::Choice2> valuesSendSmsAction;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseSkypeSms");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseExternalSmsApplication");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseWinCESms");
    valuesSendSmsAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("UseSflPhoneSms");
    valuesSendSmsAction.append( choice );
  }
  mSendSmsActionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "SendSmsAction" ), mSendSmsAction, valuesSendSmsAction, UseSkypeSms );
  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 'Skype' is selected the Skype application will be started (if installed on the computer) and the SMS is sent via Skype. If 'External Application' is selected, a command with placeholders can be defined.") );
  addItem( mSendSmsActionItem, QLatin1String( "SendSmsAction" ) );
  mSmsCommandItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "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, QLatin1String( "SmsCommand" ) );
}

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

