Warning, /frameworks/kconfig/autotests/kconfig_compiler/test_dpointer.cpp.ref is written in an unsupported language. File is not indexed.
0001 // This file is generated by kconfig_compiler_kf6 from test_dpointer.kcfg. 0002 // All changes you do to this file will be lost. 0003 0004 #include "test_dpointer.h" 0005 0006 #include <qglobal.h> 0007 #include <QFile> 0008 0009 class TestDPointerPrivate 0010 { 0011 public: 0012 0013 // General 0014 bool autoSave; 0015 int autoSaveInterval; 0016 bool confirm; 0017 QString archiveFile; 0018 int destination; 0019 0020 // Views 0021 int hourSize; 0022 bool selectionStartsEditor; 0023 0024 // KOrganizer Plugins 0025 QStringList selectedPlugins; 0026 0027 // Colors 0028 QColor highlightColor; 0029 QColor agendaBgColor; 0030 0031 // Fonts 0032 QFont timeBarFont; 0033 0034 // items 0035 KConfigSkeleton::ItemBool *autoSaveItem; 0036 KConfigSkeleton::ItemInt *autoSaveIntervalItem; 0037 KConfigSkeleton::ItemBool *confirmItem; 0038 KConfigSkeleton::ItemString *archiveFileItem; 0039 KConfigSkeleton::ItemEnum *destinationItem; 0040 KConfigSkeleton::ItemInt *hourSizeItem; 0041 KConfigSkeleton::ItemBool *selectionStartsEditorItem; 0042 KConfigSkeleton::ItemStringList *selectedPluginsItem; 0043 KConfigSkeleton::ItemColor *highlightColorItem; 0044 KConfigSkeleton::ItemColor *agendaBgColorItem; 0045 KConfigSkeleton::ItemFont *timeBarFontItem; 0046 }; 0047 0048 class TestDPointerHelper 0049 { 0050 public: 0051 TestDPointerHelper() : q(nullptr) {} 0052 ~TestDPointerHelper() { delete q; q = nullptr; } 0053 TestDPointerHelper(const TestDPointerHelper&) = delete; 0054 TestDPointerHelper& operator=(const TestDPointerHelper&) = delete; 0055 TestDPointer *q; 0056 }; 0057 Q_GLOBAL_STATIC(TestDPointerHelper, s_globalTestDPointer) 0058 TestDPointer *TestDPointer::self() 0059 { 0060 if (!s_globalTestDPointer()->q) { 0061 new TestDPointer; 0062 s_globalTestDPointer()->q->read(); 0063 } 0064 0065 return s_globalTestDPointer()->q; 0066 } 0067 0068 TestDPointer::TestDPointer( ) 0069 : KConfigSkeleton( QStringLiteral( "korganizerrc" ) ) 0070 { 0071 d = new TestDPointerPrivate; 0072 Q_ASSERT(!s_globalTestDPointer()->q); 0073 s_globalTestDPointer()->q = this; 0074 setCurrentGroup( QStringLiteral( "General" ) ); 0075 0076 d->autoSaveItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Auto Save" ), d->autoSave, false ); 0077 d->autoSaveItem->setLabel( QCoreApplication::translate("TestDPointer", "Enable automatic saving of calendar") ); 0078 d->autoSaveItem->setWhatsThis( QCoreApplication::translate("TestDPointer", "WhatsThis text for AutoSave option") ); 0079 addItem( d->autoSaveItem, QStringLiteral( "AutoSave" ) ); 0080 d->autoSaveIntervalItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Auto Save Interval" ), d->autoSaveInterval, 10 ); 0081 d->autoSaveIntervalItem->setMinValue(0); 0082 d->autoSaveIntervalItem->setMaxValue(123); 0083 d->autoSaveIntervalItem->setLabel( QCoreApplication::translate("TestDPointer", "Auto Save Interval") ); 0084 addItem( d->autoSaveIntervalItem, QStringLiteral( "AutoSaveInterval" ) ); 0085 d->confirmItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Confirm Deletes" ), d->confirm, true ); 0086 d->confirmItem->setLabel( QCoreApplication::translate("TestDPointer", "Confirm deletes") ); 0087 addItem( d->confirmItem, QStringLiteral( "Confirm" ) ); 0088 d->archiveFileItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Archive File" ), d->archiveFile ); 0089 d->archiveFileItem->setLabel( QCoreApplication::translate("TestDPointer", "Archive File") ); 0090 addItem( d->archiveFileItem, QStringLiteral( "ArchiveFile" ) ); 0091 QList<KConfigSkeleton::ItemEnum::Choice> valuesDestination; 0092 { 0093 KConfigSkeleton::ItemEnum::Choice choice; 0094 choice.name = QStringLiteral("standardDestination"); 0095 valuesDestination.append( choice ); 0096 } 0097 { 0098 KConfigSkeleton::ItemEnum::Choice choice; 0099 choice.name = QStringLiteral("askDestination"); 0100 valuesDestination.append( choice ); 0101 } 0102 { 0103 KConfigSkeleton::ItemEnum::Choice choice; 0104 choice.name = QStringLiteral("argl1"); 0105 choice.label = QCoreApplication::translate("TestDPointer", "Argl1 Label"); 0106 valuesDestination.append( choice ); 0107 } 0108 { 0109 KConfigSkeleton::ItemEnum::Choice choice; 0110 choice.name = QStringLiteral("argl2"); 0111 choice.whatsThis = QCoreApplication::translate("TestDPointer", "Argl2 Whatsthis"); 0112 valuesDestination.append( choice ); 0113 } 0114 { 0115 KConfigSkeleton::ItemEnum::Choice choice; 0116 choice.name = QStringLiteral("argl3"); 0117 choice.label = QCoreApplication::translate("TestDPointer", "Argl3 Label"); 0118 choice.whatsThis = QCoreApplication::translate("TestDPointer", "Argl3 Whatsthis"); 0119 valuesDestination.append( choice ); 0120 } 0121 d->destinationItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "Destination" ), d->destination, valuesDestination, EnumDestination::standardDestination ); 0122 d->destinationItem->setLabel( QCoreApplication::translate("TestDPointer", "New Events/Todos Should") ); 0123 addItem( d->destinationItem, QStringLiteral( "Destination" ) ); 0124 0125 setCurrentGroup( QStringLiteral( "Views" ) ); 0126 0127 d->hourSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Hour Size" ), d->hourSize, 10 ); 0128 d->hourSizeItem->setLabel( QCoreApplication::translate("TestDPointer", "Hour Size") ); 0129 addItem( d->hourSizeItem, QStringLiteral( "HourSize" ) ); 0130 d->selectionStartsEditorItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SelectionStartsEditor" ), d->selectionStartsEditor, false ); 0131 d->selectionStartsEditorItem->setLabel( QCoreApplication::translate("TestDPointer", "Time range selection in agenda view starts event editor") ); 0132 addItem( d->selectionStartsEditorItem, QStringLiteral( "SelectionStartsEditor" ) ); 0133 0134 setCurrentGroup( QStringLiteral( "KOrganizer Plugins" ) ); 0135 0136 QStringList defaultSelectedPlugins; 0137 defaultSelectedPlugins.append( QString::fromUtf8( "holidays" ) ); 0138 defaultSelectedPlugins.append( QString::fromUtf8( "webexport" ) ); 0139 0140 d->selectedPluginsItem = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "SelectedPlugins" ), d->selectedPlugins, defaultSelectedPlugins ); 0141 d->selectedPluginsItem->setLabel( QCoreApplication::translate("TestDPointer", "SelectedPlugins") ); 0142 addItem( d->selectedPluginsItem, QStringLiteral( "SelectedPlugins" ) ); 0143 0144 setCurrentGroup( QStringLiteral( "Colors" ) ); 0145 0146 d->highlightColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Highlight Color" ), d->highlightColor, QColor( 100, 100, 255 ) ); 0147 d->highlightColorItem->setLabel( QCoreApplication::translate("TestDPointer", "Highlight color") ); 0148 addItem( d->highlightColorItem, QStringLiteral( "HighlightColor" ) ); 0149 d->agendaBgColorItem = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Agenda Background Color" ), d->agendaBgColor, QColor( 255, 255, 255 ) ); 0150 d->agendaBgColorItem->setLabel( QCoreApplication::translate("TestDPointer", "Agenda view background color") ); 0151 addItem( d->agendaBgColorItem, QStringLiteral( "AgendaBgColor" ) ); 0152 0153 setCurrentGroup( QStringLiteral( "Fonts" ) ); 0154 0155 d->timeBarFontItem = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "TimeBar Font" ), d->timeBarFont ); 0156 d->timeBarFontItem->setLabel( QCoreApplication::translate("TestDPointer", "Time bar") ); 0157 addItem( d->timeBarFontItem, QStringLiteral( "TimeBarFont" ) ); 0158 } 0159 0160 void TestDPointer::setAutoSave( bool v ) 0161 { 0162 if (!self()->TestDPointer::isAutoSaveImmutable()) 0163 self()->d->autoSave = v; 0164 } 0165 0166 bool TestDPointer::autoSave() 0167 { 0168 return self()->d->autoSave; 0169 } 0170 0171 bool TestDPointer::isAutoSaveImmutable() 0172 { 0173 return self()->isImmutable( QStringLiteral( "AutoSave" ) ); 0174 } 0175 0176 0177 KConfigSkeleton::ItemBool *TestDPointer::autoSaveItem() 0178 { 0179 return d->autoSaveItem; 0180 } 0181 0182 void TestDPointer::setAutoSaveInterval( int v ) 0183 { 0184 if (v < 0) 0185 { 0186 qDebug() << "setAutoSaveInterval: value " << v << " is less than the minimum value of 0"; 0187 v = 0; 0188 } 0189 0190 if (v > 123) 0191 { 0192 qDebug() << "setAutoSaveInterval: value " << v << " is greater than the maximum value of 123"; 0193 v = 123; 0194 } 0195 0196 if (!self()->TestDPointer::isAutoSaveIntervalImmutable()) 0197 self()->d->autoSaveInterval = v; 0198 } 0199 0200 int TestDPointer::autoSaveInterval() 0201 { 0202 return self()->d->autoSaveInterval; 0203 } 0204 0205 bool TestDPointer::isAutoSaveIntervalImmutable() 0206 { 0207 return self()->isImmutable( QStringLiteral( "AutoSaveInterval" ) ); 0208 } 0209 0210 0211 KConfigSkeleton::ItemInt *TestDPointer::autoSaveIntervalItem() 0212 { 0213 return d->autoSaveIntervalItem; 0214 } 0215 0216 void TestDPointer::setConfirm( bool v ) 0217 { 0218 if (!self()->TestDPointer::isConfirmImmutable()) 0219 self()->d->confirm = v; 0220 } 0221 0222 bool TestDPointer::confirm() 0223 { 0224 return self()->d->confirm; 0225 } 0226 0227 bool TestDPointer::isConfirmImmutable() 0228 { 0229 return self()->isImmutable( QStringLiteral( "Confirm" ) ); 0230 } 0231 0232 0233 KConfigSkeleton::ItemBool *TestDPointer::confirmItem() 0234 { 0235 return d->confirmItem; 0236 } 0237 0238 void TestDPointer::setArchiveFile( const QString & v ) 0239 { 0240 if (!self()->TestDPointer::isArchiveFileImmutable()) 0241 self()->d->archiveFile = v; 0242 } 0243 0244 QString TestDPointer::archiveFile() 0245 { 0246 return self()->d->archiveFile; 0247 } 0248 0249 bool TestDPointer::isArchiveFileImmutable() 0250 { 0251 return self()->isImmutable( QStringLiteral( "ArchiveFile" ) ); 0252 } 0253 0254 0255 KConfigSkeleton::ItemString *TestDPointer::archiveFileItem() 0256 { 0257 return d->archiveFileItem; 0258 } 0259 0260 void TestDPointer::setDestination( int v ) 0261 { 0262 if (!self()->TestDPointer::isDestinationImmutable()) 0263 self()->d->destination = v; 0264 } 0265 0266 int TestDPointer::destination() 0267 { 0268 return self()->d->destination; 0269 } 0270 0271 bool TestDPointer::isDestinationImmutable() 0272 { 0273 return self()->isImmutable( QStringLiteral( "Destination" ) ); 0274 } 0275 0276 0277 KConfigSkeleton::ItemEnum *TestDPointer::destinationItem() 0278 { 0279 return d->destinationItem; 0280 } 0281 0282 void TestDPointer::setHourSize( int v ) 0283 { 0284 if (!self()->TestDPointer::isHourSizeImmutable()) 0285 self()->d->hourSize = v; 0286 } 0287 0288 int TestDPointer::hourSize() 0289 { 0290 return self()->d->hourSize; 0291 } 0292 0293 bool TestDPointer::isHourSizeImmutable() 0294 { 0295 return self()->isImmutable( QStringLiteral( "HourSize" ) ); 0296 } 0297 0298 0299 KConfigSkeleton::ItemInt *TestDPointer::hourSizeItem() 0300 { 0301 return d->hourSizeItem; 0302 } 0303 0304 void TestDPointer::setSelectionStartsEditor( bool v ) 0305 { 0306 if (!self()->TestDPointer::isSelectionStartsEditorImmutable()) 0307 self()->d->selectionStartsEditor = v; 0308 } 0309 0310 bool TestDPointer::selectionStartsEditor() 0311 { 0312 return self()->d->selectionStartsEditor; 0313 } 0314 0315 bool TestDPointer::isSelectionStartsEditorImmutable() 0316 { 0317 return self()->isImmutable( QStringLiteral( "SelectionStartsEditor" ) ); 0318 } 0319 0320 0321 KConfigSkeleton::ItemBool *TestDPointer::selectionStartsEditorItem() 0322 { 0323 return d->selectionStartsEditorItem; 0324 } 0325 0326 void TestDPointer::setSelectedPlugins( const QStringList & v ) 0327 { 0328 if (!self()->TestDPointer::isSelectedPluginsImmutable()) 0329 self()->d->selectedPlugins = v; 0330 } 0331 0332 QStringList TestDPointer::selectedPlugins() 0333 { 0334 return self()->d->selectedPlugins; 0335 } 0336 0337 bool TestDPointer::isSelectedPluginsImmutable() 0338 { 0339 return self()->isImmutable( QStringLiteral( "SelectedPlugins" ) ); 0340 } 0341 0342 0343 KConfigSkeleton::ItemStringList *TestDPointer::selectedPluginsItem() 0344 { 0345 return d->selectedPluginsItem; 0346 } 0347 0348 void TestDPointer::setHighlightColor( const QColor & v ) 0349 { 0350 if (!self()->TestDPointer::isHighlightColorImmutable()) 0351 self()->d->highlightColor = v; 0352 } 0353 0354 QColor TestDPointer::highlightColor() 0355 { 0356 return self()->d->highlightColor; 0357 } 0358 0359 bool TestDPointer::isHighlightColorImmutable() 0360 { 0361 return self()->isImmutable( QStringLiteral( "HighlightColor" ) ); 0362 } 0363 0364 0365 KConfigSkeleton::ItemColor *TestDPointer::highlightColorItem() 0366 { 0367 return d->highlightColorItem; 0368 } 0369 0370 void TestDPointer::setAgendaBgColor( const QColor & v ) 0371 { 0372 if (!self()->TestDPointer::isAgendaBgColorImmutable()) 0373 self()->d->agendaBgColor = v; 0374 } 0375 0376 QColor TestDPointer::agendaBgColor() 0377 { 0378 return self()->d->agendaBgColor; 0379 } 0380 0381 bool TestDPointer::isAgendaBgColorImmutable() 0382 { 0383 return self()->isImmutable( QStringLiteral( "AgendaBgColor" ) ); 0384 } 0385 0386 0387 KConfigSkeleton::ItemColor *TestDPointer::agendaBgColorItem() 0388 { 0389 return d->agendaBgColorItem; 0390 } 0391 0392 void TestDPointer::setTimeBarFont( const QFont & v ) 0393 { 0394 if (!self()->TestDPointer::isTimeBarFontImmutable()) 0395 self()->d->timeBarFont = v; 0396 } 0397 0398 QFont TestDPointer::timeBarFont() 0399 { 0400 return self()->d->timeBarFont; 0401 } 0402 0403 bool TestDPointer::isTimeBarFontImmutable() 0404 { 0405 return self()->isImmutable( QStringLiteral( "TimeBarFont" ) ); 0406 } 0407 0408 0409 KConfigSkeleton::ItemFont *TestDPointer::timeBarFontItem() 0410 { 0411 return d->timeBarFontItem; 0412 } 0413 0414 TestDPointer::~TestDPointer() 0415 { 0416 delete d; 0417 if (s_globalTestDPointer.exists() && !s_globalTestDPointer.isDestroyed()) { 0418 s_globalTestDPointer()->q = nullptr; 0419 } 0420 } 0421