kdelibs/kdeui/tests/kconfig_compiler/test_dpointer.cpp.ref
2014-11-13 01:04:59 +02:00

352 lines
9.8 KiB
Text

// This file is generated by kconfig_compiler from test_dpointer.kcfg.
// All changes you do to this file will be lost.
#include "test_dpointer.h"
#include <klocale.h>
#include <kglobal.h>
#include <QtCore/QFile>
class TestDPointerPrivate
{
public:
// General
bool autoSave;
int autoSaveInterval;
bool confirm;
QString archiveFile;
int destination;
// Views
int hourSize;
bool selectionStartsEditor;
// KOrganizer Plugins
QStringList selectedPlugins;
// Colors
QColor highlightColor;
QColor agendaBgColor;
// Fonts
QFont timeBarFont;
// items
KConfigSkeleton::ItemBool *autoSaveItem;
KConfigSkeleton::ItemInt *autoSaveIntervalItem;
KConfigSkeleton::ItemBool *confirmItem;
KConfigSkeleton::ItemString *archiveFileItem;
KConfigSkeleton::ItemEnum *destinationItem;
KConfigSkeleton::ItemInt *hourSizeItem;
KConfigSkeleton::ItemBool *selectionStartsEditorItem;
KConfigSkeleton::ItemStringList *selectedPluginsItem;
KConfigSkeleton::ItemColor *highlightColorItem;
KConfigSkeleton::ItemColor *agendaBgColorItem;
KConfigSkeleton::ItemFont *timeBarFontItem;
};
class TestDPointerHelper
{
public:
TestDPointerHelper() : q(0) {}
~TestDPointerHelper() { delete q; }
TestDPointer *q;
};
K_GLOBAL_STATIC(TestDPointerHelper, s_globalTestDPointer)
TestDPointer *TestDPointer::self()
{
if (!s_globalTestDPointer->q) {
new TestDPointer;
s_globalTestDPointer->q->readConfig();
}
return s_globalTestDPointer->q;
}
TestDPointer::TestDPointer( )
: KConfigSkeleton( QLatin1String( "korganizerrc" ) )
{
d = new TestDPointerPrivate;
Q_ASSERT(!s_globalTestDPointer->q);
s_globalTestDPointer->q = this;
setCurrentGroup( QLatin1String( "General" ) );
d->autoSaveItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Auto Save" ), d->autoSave, false );
d->autoSaveItem->setLabel( i18n("Enable automatic saving of calendar") );
d->autoSaveItem->setWhatsThis( i18n("WhatsThis text for AutoSave option") );
addItem( d->autoSaveItem, QLatin1String( "AutoSave" ) );
d->autoSaveIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Auto Save Interval" ), d->autoSaveInterval, 10 );
d->autoSaveIntervalItem->setLabel( i18n("Auto Save Interval") );
addItem( d->autoSaveIntervalItem, QLatin1String( "AutoSaveInterval" ) );
d->confirmItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Confirm Deletes" ), d->confirm, true );
d->confirmItem->setLabel( i18n("Confirm deletes") );
addItem( d->confirmItem, QLatin1String( "Confirm" ) );
d->archiveFileItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Archive File" ), d->archiveFile );
d->archiveFileItem->setLabel( i18n("Archive File") );
addItem( d->archiveFileItem, QLatin1String( "ArchiveFile" ) );
QList<KConfigSkeleton::ItemEnum::Choice2> valuesDestination;
{
KConfigSkeleton::ItemEnum::Choice2 choice;
choice.name = QLatin1String("standardDestination");
valuesDestination.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice2 choice;
choice.name = QLatin1String("askDestination");
valuesDestination.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice2 choice;
choice.name = QLatin1String("argl1");
choice.label = i18n("Argl1 Label");
valuesDestination.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice2 choice;
choice.name = QLatin1String("argl2");
choice.whatsThis = i18n("Argl2 Whatsthis");
valuesDestination.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice2 choice;
choice.name = QLatin1String("argl3");
choice.label = i18n("Argl3 Label");
choice.whatsThis = i18n("Argl3 Whatsthis");
valuesDestination.append( choice );
}
d->destinationItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "Destination" ), d->destination, valuesDestination, EnumDestination::standardDestination );
d->destinationItem->setLabel( i18n("New Events/Todos Should") );
addItem( d->destinationItem, QLatin1String( "Destination" ) );
setCurrentGroup( QLatin1String( "Views" ) );
d->hourSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Hour Size" ), d->hourSize, 10 );
d->hourSizeItem->setLabel( i18n("Hour Size") );
addItem( d->hourSizeItem, QLatin1String( "HourSize" ) );
d->selectionStartsEditorItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SelectionStartsEditor" ), d->selectionStartsEditor, false );
d->selectionStartsEditorItem->setLabel( i18n("Time range selection in agenda view starts event editor") );
addItem( d->selectionStartsEditorItem, QLatin1String( "SelectionStartsEditor" ) );
setCurrentGroup( QLatin1String( "KOrganizer Plugins" ) );
QStringList defaultSelectedPlugins;
defaultSelectedPlugins.append( QString::fromUtf8( "holidays" ) );
defaultSelectedPlugins.append( QString::fromUtf8( "webexport" ) );
d->selectedPluginsItem = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "SelectedPlugins" ), d->selectedPlugins, defaultSelectedPlugins );
d->selectedPluginsItem->setLabel( i18n("SelectedPlugins") );
addItem( d->selectedPluginsItem, QLatin1String( "SelectedPlugins" ) );
setCurrentGroup( QLatin1String( "Colors" ) );
d->highlightColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "Highlight Color" ), d->highlightColor, QColor( 100, 100, 255 ) );
d->highlightColorItem->setLabel( i18n("Highlight color") );
addItem( d->highlightColorItem, QLatin1String( "HighlightColor" ) );
d->agendaBgColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "Agenda Background Color" ), d->agendaBgColor, QColor( 255, 255, 255 ) );
d->agendaBgColorItem->setLabel( i18n("Agenda view background color") );
addItem( d->agendaBgColorItem, QLatin1String( "AgendaBgColor" ) );
setCurrentGroup( QLatin1String( "Fonts" ) );
d->timeBarFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QLatin1String( "TimeBar Font" ), d->timeBarFont );
d->timeBarFontItem->setLabel( i18n("Time bar") );
addItem( d->timeBarFontItem, QLatin1String( "TimeBarFont" ) );
}
void TestDPointer::setAutoSave( bool v )
{
if (!self()->isImmutable( QString::fromLatin1( "AutoSave" ) ))
self()->d->autoSave = v;
}
bool TestDPointer::autoSave()
{
return self()->d->autoSave;
}
KConfigSkeleton::ItemBool *TestDPointer::autoSaveItem()
{
return d->autoSaveItem;
}
void TestDPointer::setAutoSaveInterval( int v )
{
if (!self()->isImmutable( QString::fromLatin1( "AutoSaveInterval" ) ))
self()->d->autoSaveInterval = v;
}
int TestDPointer::autoSaveInterval()
{
return self()->d->autoSaveInterval;
}
KConfigSkeleton::ItemInt *TestDPointer::autoSaveIntervalItem()
{
return d->autoSaveIntervalItem;
}
void TestDPointer::setConfirm( bool v )
{
if (!self()->isImmutable( QString::fromLatin1( "Confirm" ) ))
self()->d->confirm = v;
}
bool TestDPointer::confirm()
{
return self()->d->confirm;
}
KConfigSkeleton::ItemBool *TestDPointer::confirmItem()
{
return d->confirmItem;
}
void TestDPointer::setArchiveFile( const QString & v )
{
if (!self()->isImmutable( QString::fromLatin1( "ArchiveFile" ) ))
self()->d->archiveFile = v;
}
QString TestDPointer::archiveFile()
{
return self()->d->archiveFile;
}
KConfigSkeleton::ItemString *TestDPointer::archiveFileItem()
{
return d->archiveFileItem;
}
void TestDPointer::setDestination( int v )
{
if (!self()->isImmutable( QString::fromLatin1( "Destination" ) ))
self()->d->destination = v;
}
int TestDPointer::destination()
{
return self()->d->destination;
}
KConfigSkeleton::ItemEnum *TestDPointer::destinationItem()
{
return d->destinationItem;
}
void TestDPointer::setHourSize( int v )
{
if (!self()->isImmutable( QString::fromLatin1( "HourSize" ) ))
self()->d->hourSize = v;
}
int TestDPointer::hourSize()
{
return self()->d->hourSize;
}
KConfigSkeleton::ItemInt *TestDPointer::hourSizeItem()
{
return d->hourSizeItem;
}
void TestDPointer::setSelectionStartsEditor( bool v )
{
if (!self()->isImmutable( QString::fromLatin1( "SelectionStartsEditor" ) ))
self()->d->selectionStartsEditor = v;
}
bool TestDPointer::selectionStartsEditor()
{
return self()->d->selectionStartsEditor;
}
KConfigSkeleton::ItemBool *TestDPointer::selectionStartsEditorItem()
{
return d->selectionStartsEditorItem;
}
void TestDPointer::setSelectedPlugins( const QStringList & v )
{
if (!self()->isImmutable( QString::fromLatin1( "SelectedPlugins" ) ))
self()->d->selectedPlugins = v;
}
QStringList TestDPointer::selectedPlugins()
{
return self()->d->selectedPlugins;
}
KConfigSkeleton::ItemStringList *TestDPointer::selectedPluginsItem()
{
return d->selectedPluginsItem;
}
void TestDPointer::setHighlightColor( const QColor & v )
{
if (!self()->isImmutable( QString::fromLatin1( "HighlightColor" ) ))
self()->d->highlightColor = v;
}
QColor TestDPointer::highlightColor()
{
return self()->d->highlightColor;
}
KConfigSkeleton::ItemColor *TestDPointer::highlightColorItem()
{
return d->highlightColorItem;
}
void TestDPointer::setAgendaBgColor( const QColor & v )
{
if (!self()->isImmutable( QString::fromLatin1( "AgendaBgColor" ) ))
self()->d->agendaBgColor = v;
}
QColor TestDPointer::agendaBgColor()
{
return self()->d->agendaBgColor;
}
KConfigSkeleton::ItemColor *TestDPointer::agendaBgColorItem()
{
return d->agendaBgColorItem;
}
void TestDPointer::setTimeBarFont( const QFont & v )
{
if (!self()->isImmutable( QString::fromLatin1( "TimeBarFont" ) ))
self()->d->timeBarFont = v;
}
QFont TestDPointer::timeBarFont()
{
return self()->d->timeBarFont;
}
KConfigSkeleton::ItemFont *TestDPointer::timeBarFontItem()
{
return d->timeBarFontItem;
}
TestDPointer::~TestDPointer()
{
delete d;
if (!s_globalTestDPointer.isDestroyed()) {
s_globalTestDPointer->q = 0;
}
}