• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
tdeconfigskeleton.cpp
1/*
2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 Copyright (c) 2003 Waldo Bastian <bastian@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#include <tqcolor.h>
23#include <tqvariant.h>
24
25#include <tdeconfig.h>
26#include <tdestandarddirs.h>
27#include <tdeglobal.h>
28#include <tdeglobalsettings.h>
29#include <kdebug.h>
30
31#include "kstringhandler.h"
32
33#include "tdeconfigskeleton.h"
34
35void TDEConfigSkeletonItem::readImmutability( TDEConfig *config )
36{
37 mIsImmutable = config->entryIsImmutable( mKey );
38}
39
40
41TDEConfigSkeleton::ItemString::ItemString( const TQString &group, const TQString &key,
42 TQString &reference,
43 const TQString &defaultValue,
44 Type type )
45 : TDEConfigSkeletonGenericItem<TQString>( group, key, reference, defaultValue ),
46 mType( type )
47{
48}
49
50void TDEConfigSkeleton::ItemString::writeConfig( TDEConfig *config )
51{
52 if ( mReference != mLoadedValue ) // WABA: Is this test needed?
53 {
54 config->setGroup( mGroup );
55 if ((mDefault == mReference) && !config->hasDefault( mKey))
56 config->revertToDefault( mKey );
57 else if ( mType == Path )
58 config->writePathEntry( mKey, mReference );
59 else if ( mType == Password )
60 config->writeEntry( mKey, KStringHandler::obscure( mReference ) );
61 else
62 config->writeEntry( mKey, mReference );
63 }
64}
65
66
67void TDEConfigSkeleton::ItemString::readConfig( TDEConfig *config )
68{
69 config->setGroup( mGroup );
70
71 if ( mType == Path )
72 {
73 mReference = config->readPathEntry( mKey, mDefault );
74 }
75 else if ( mType == Password )
76 {
77 TQString value = config->readEntry( mKey,
78 KStringHandler::obscure( mDefault ) );
79 mReference = KStringHandler::obscure( value );
80 }
81 else
82 {
83 mReference = config->readEntry( mKey, mDefault );
84 }
85
86 mLoadedValue = mReference;
87
88 readImmutability( config );
89}
90
91void TDEConfigSkeleton::ItemString::setProperty(const TQVariant & p)
92{
93 mReference = p.toString();
94}
95
96TQVariant TDEConfigSkeleton::ItemString::property() const
97{
98 return TQVariant(mReference);
99}
100
101TDEConfigSkeleton::ItemPassword::ItemPassword( const TQString &group, const TQString &key,
102 TQString &reference,
103 const TQString &defaultValue)
104 : ItemString( group, key, reference, defaultValue, Password )
105{
106}
107
108TDEConfigSkeleton::ItemPath::ItemPath( const TQString &group, const TQString &key,
109 TQString &reference,
110 const TQString &defaultValue)
111 : ItemString( group, key, reference, defaultValue, Path )
112{
113}
114
115TDEConfigSkeleton::ItemProperty::ItemProperty( const TQString &group,
116 const TQString &key,
117 TQVariant &reference,
118 TQVariant defaultValue )
119 : TDEConfigSkeletonGenericItem<TQVariant>( group, key, reference, defaultValue )
120{
121}
122
123void TDEConfigSkeleton::ItemProperty::readConfig( TDEConfig *config )
124{
125 config->setGroup( mGroup );
126 mReference = config->readPropertyEntry( mKey, mDefault );
127 mLoadedValue = mReference;
128
129 readImmutability( config );
130}
131
132void TDEConfigSkeleton::ItemProperty::setProperty(const TQVariant & p)
133{
134 mReference = p;
135}
136
137TQVariant TDEConfigSkeleton::ItemProperty::property() const
138{
139 return mReference;
140}
141
142TDEConfigSkeleton::ItemBool::ItemBool( const TQString &group, const TQString &key,
143 bool &reference, bool defaultValue )
144 : TDEConfigSkeletonGenericItem<bool>( group, key, reference, defaultValue )
145{
146}
147
148void TDEConfigSkeleton::ItemBool::readConfig( TDEConfig *config )
149{
150 config->setGroup( mGroup );
151 mReference = config->readBoolEntry( mKey, mDefault );
152 mLoadedValue = mReference;
153
154 readImmutability( config );
155}
156
157void TDEConfigSkeleton::ItemBool::setProperty(const TQVariant & p)
158{
159 mReference = p.toBool();
160}
161
162TQVariant TDEConfigSkeleton::ItemBool::property() const
163{
164 return TQVariant( mReference );
165}
166
167
168TDEConfigSkeleton::ItemInt::ItemInt( const TQString &group, const TQString &key,
169 int &reference, int defaultValue )
170 : TDEConfigSkeletonGenericItem<int>( group, key, reference, defaultValue )
171 ,mHasMin(false), mHasMax(false)
172{
173}
174
175void TDEConfigSkeleton::ItemInt::readConfig( TDEConfig *config )
176{
177 config->setGroup( mGroup );
178 mReference = config->readNumEntry( mKey, mDefault );
179 if (mHasMin)
180 mReference = TQMAX(mReference, mMin);
181 if (mHasMax)
182 mReference = TQMIN(mReference, mMax);
183 mLoadedValue = mReference;
184
185 readImmutability( config );
186}
187
188void TDEConfigSkeleton::ItemInt::setProperty(const TQVariant & p)
189{
190 mReference = p.toInt();
191}
192
193TQVariant TDEConfigSkeleton::ItemInt::property() const
194{
195 return TQVariant(mReference);
196}
197
198TQVariant TDEConfigSkeleton::ItemInt::minValue() const
199{
200 if (mHasMin)
201 return TQVariant(mMin);
202 return TQVariant();
203}
204
205TQVariant TDEConfigSkeleton::ItemInt::maxValue() const
206{
207 if (mHasMax)
208 return TQVariant(mMax);
209 return TQVariant();
210}
211
212void TDEConfigSkeleton::ItemInt::setMinValue(int v)
213{
214 mHasMin = true;
215 mMin = v;
216}
217
218void TDEConfigSkeleton::ItemInt::setMaxValue(int v)
219{
220 mHasMax = true;
221 mMax = v;
222}
223
224
225TDEConfigSkeleton::ItemInt64::ItemInt64( const TQString &group, const TQString &key,
226 TQ_INT64 &reference, TQ_INT64 defaultValue )
227 : TDEConfigSkeletonGenericItem<TQ_INT64>( group, key, reference, defaultValue )
228 ,mHasMin(false), mHasMax(false)
229{
230}
231
232void TDEConfigSkeleton::ItemInt64::readConfig( TDEConfig *config )
233{
234 config->setGroup( mGroup );
235 mReference = config->readNum64Entry( mKey, mDefault );
236 if (mHasMin)
237 mReference = TQMAX(mReference, mMin);
238 if (mHasMax)
239 mReference = TQMIN(mReference, mMax);
240 mLoadedValue = mReference;
241
242 readImmutability( config );
243}
244
245void TDEConfigSkeleton::ItemInt64::setProperty(const TQVariant & p)
246{
247 mReference = p.toLongLong();
248}
249
250TQVariant TDEConfigSkeleton::ItemInt64::property() const
251{
252 return TQVariant(mReference);
253}
254
255TQVariant TDEConfigSkeleton::ItemInt64::minValue() const
256{
257 if (mHasMin)
258 return TQVariant(mMin);
259 return TQVariant();
260}
261
262TQVariant TDEConfigSkeleton::ItemInt64::maxValue() const
263{
264 if (mHasMax)
265 return TQVariant(mMax);
266 return TQVariant();
267}
268
269void TDEConfigSkeleton::ItemInt64::setMinValue(TQ_INT64 v)
270{
271 mHasMin = true;
272 mMin = v;
273}
274
275void TDEConfigSkeleton::ItemInt64::setMaxValue(TQ_INT64 v)
276{
277 mHasMax = true;
278 mMax = v;
279}
280
281TDEConfigSkeleton::ItemEnum::ItemEnum( const TQString &group, const TQString &key,
282 int &reference,
283 const TQValueList<Choice> &choices,
284 int defaultValue )
285 : ItemInt( group, key, reference, defaultValue ), mChoices( choices )
286{
287}
288
289void TDEConfigSkeleton::ItemEnum::readConfig( TDEConfig *config )
290{
291 config->setGroup( mGroup );
292 if (!config->hasKey(mKey))
293 {
294 mReference = mDefault;
295 }
296 else
297 {
298 int i = 0;
299 mReference = -1;
300 TQString tmp = config->readEntry( mKey ).lower();
301 for(TQValueList<Choice>::ConstIterator it = mChoices.begin();
302 it != mChoices.end(); ++it, ++i)
303 {
304 if ((*it).name.lower() == tmp)
305 {
306 mReference = i;
307 break;
308 }
309 }
310 if (mReference == -1)
311 mReference = config->readNumEntry( mKey, mDefault );
312 }
313 mLoadedValue = mReference;
314
315 readImmutability( config );
316}
317
318void TDEConfigSkeleton::ItemEnum::writeConfig( TDEConfig *config )
319{
320 if ( mReference != mLoadedValue ) // WABA: Is this test needed?
321 {
322 config->setGroup( mGroup );
323 if ((mDefault == mReference) && !config->hasDefault( mKey))
324 config->revertToDefault( mKey );
325 else if ((mReference >= 0) && (mReference < (int) mChoices.count()))
326 config->writeEntry( mKey, mChoices[mReference].name );
327 else
328 config->writeEntry( mKey, mReference );
329 }
330}
331
332TQValueList<TDEConfigSkeleton::ItemEnum::Choice> TDEConfigSkeleton::ItemEnum::choices() const
333{
334 return mChoices;
335}
336
337
338TDEConfigSkeleton::ItemUInt::ItemUInt( const TQString &group, const TQString &key,
339 unsigned int &reference,
340 unsigned int defaultValue )
341 : TDEConfigSkeletonGenericItem<unsigned int>( group, key, reference, defaultValue )
342 ,mHasMin(false), mHasMax(false)
343{
344}
345
346void TDEConfigSkeleton::ItemUInt::readConfig( TDEConfig *config )
347{
348 config->setGroup( mGroup );
349 mReference = config->readUnsignedNumEntry( mKey, mDefault );
350 if (mHasMin)
351 mReference = TQMAX(mReference, mMin);
352 if (mHasMax)
353 mReference = TQMIN(mReference, mMax);
354 mLoadedValue = mReference;
355
356 readImmutability( config );
357}
358
359void TDEConfigSkeleton::ItemUInt::setProperty(const TQVariant & p)
360{
361 mReference = p.toUInt();
362}
363
364TQVariant TDEConfigSkeleton::ItemUInt::property() const
365{
366 return TQVariant(mReference);
367}
368
369TQVariant TDEConfigSkeleton::ItemUInt::minValue() const
370{
371 if (mHasMin)
372 return TQVariant(mMin);
373 return TQVariant();
374}
375
376TQVariant TDEConfigSkeleton::ItemUInt::maxValue() const
377{
378 if (mHasMax)
379 return TQVariant(mMax);
380 return TQVariant();
381}
382
383void TDEConfigSkeleton::ItemUInt::setMinValue(unsigned int v)
384{
385 mHasMin = true;
386 mMin = v;
387}
388
389void TDEConfigSkeleton::ItemUInt::setMaxValue(unsigned int v)
390{
391 mHasMax = true;
392 mMax = v;
393}
394
395
396TDEConfigSkeleton::ItemUInt64::ItemUInt64( const TQString &group, const TQString &key,
397 TQ_UINT64 &reference, TQ_UINT64 defaultValue )
398 : TDEConfigSkeletonGenericItem<TQ_UINT64>( group, key, reference, defaultValue )
399 ,mHasMin(false), mHasMax(false)
400{
401}
402
403void TDEConfigSkeleton::ItemUInt64::readConfig( TDEConfig *config )
404{
405 config->setGroup( mGroup );
406 mReference = config->readUnsignedNum64Entry( mKey, mDefault );
407 if (mHasMin)
408 mReference = TQMAX(mReference, mMin);
409 if (mHasMax)
410 mReference = TQMIN(mReference, mMax);
411 mLoadedValue = mReference;
412
413 readImmutability( config );
414}
415
416void TDEConfigSkeleton::ItemUInt64::setProperty(const TQVariant & p)
417{
418 mReference = p.toULongLong();
419}
420
421TQVariant TDEConfigSkeleton::ItemUInt64::property() const
422{
423 return TQVariant(mReference);
424}
425
426TQVariant TDEConfigSkeleton::ItemUInt64::minValue() const
427{
428 if (mHasMin)
429 return TQVariant(mMin);
430 return TQVariant();
431}
432
433TQVariant TDEConfigSkeleton::ItemUInt64::maxValue() const
434{
435 if (mHasMax)
436 return TQVariant(mMax);
437 return TQVariant();
438}
439
440void TDEConfigSkeleton::ItemUInt64::setMinValue(TQ_UINT64 v)
441{
442 mHasMin = true;
443 mMin = v;
444}
445
446void TDEConfigSkeleton::ItemUInt64::setMaxValue(TQ_UINT64 v)
447{
448 mHasMax = true;
449 mMax = v;
450}
451
452TDEConfigSkeleton::ItemLong::ItemLong( const TQString &group, const TQString &key,
453 long &reference, long defaultValue )
454 : TDEConfigSkeletonGenericItem<long>( group, key, reference, defaultValue )
455 ,mHasMin(false), mHasMax(false)
456{
457}
458
459void TDEConfigSkeleton::ItemLong::readConfig( TDEConfig *config )
460{
461 config->setGroup( mGroup );
462 mReference = config->readLongNumEntry( mKey, mDefault );
463 if (mHasMin)
464 mReference = TQMAX(mReference, mMin);
465 if (mHasMax)
466 mReference = TQMIN(mReference, mMax);
467 mLoadedValue = mReference;
468
469 readImmutability( config );
470}
471
472void TDEConfigSkeleton::ItemLong::setProperty(const TQVariant & p)
473{
474 mReference = p.toLongLong();
475}
476
477TQVariant TDEConfigSkeleton::ItemLong::property() const
478{
479 return TQVariant((TQ_LLONG) mReference);
480}
481
482TQVariant TDEConfigSkeleton::ItemLong::minValue() const
483{
484 if (mHasMin)
485 return TQVariant((TQ_LLONG) mMin);
486 return TQVariant();
487}
488
489TQVariant TDEConfigSkeleton::ItemLong::maxValue() const
490{
491 if (mHasMax)
492 return TQVariant((TQ_LLONG) mMax);
493 return TQVariant();
494}
495
496void TDEConfigSkeleton::ItemLong::setMinValue(long v)
497{
498 mHasMin = true;
499 mMin = v;
500}
501
502void TDEConfigSkeleton::ItemLong::setMaxValue(long v)
503{
504 mHasMax = true;
505 mMax = v;
506}
507
508
509TDEConfigSkeleton::ItemULong::ItemULong( const TQString &group, const TQString &key,
510 unsigned long &reference,
511 unsigned long defaultValue )
512 : TDEConfigSkeletonGenericItem<unsigned long>( group, key, reference, defaultValue )
513 ,mHasMin(false), mHasMax(false)
514{
515}
516
517void TDEConfigSkeleton::ItemULong::readConfig( TDEConfig *config )
518{
519 config->setGroup( mGroup );
520 mReference = config->readUnsignedLongNumEntry( mKey, mDefault );
521 if (mHasMin)
522 mReference = TQMAX(mReference, mMin);
523 if (mHasMax)
524 mReference = TQMIN(mReference, mMax);
525 mLoadedValue = mReference;
526
527 readImmutability( config );
528}
529
530void TDEConfigSkeleton::ItemULong::setProperty(const TQVariant & p)
531{
532 mReference = p.toULongLong();
533}
534
535TQVariant TDEConfigSkeleton::ItemULong::property() const
536{
537 return TQVariant((TQ_ULLONG) mReference);
538}
539
540TQVariant TDEConfigSkeleton::ItemULong::minValue() const
541{
542 if (mHasMin)
543 return TQVariant((TQ_ULLONG) mMin);
544 return TQVariant();
545}
546
547TQVariant TDEConfigSkeleton::ItemULong::maxValue() const
548{
549 if (mHasMax)
550 return TQVariant((TQ_ULLONG) mMax);
551 return TQVariant();
552}
553
554void TDEConfigSkeleton::ItemULong::setMinValue(unsigned long v)
555{
556 mHasMin = true;
557 mMin = v;
558}
559
560void TDEConfigSkeleton::ItemULong::setMaxValue(unsigned long v)
561{
562 mHasMax = true;
563 mMax = v;
564}
565
566
567TDEConfigSkeleton::ItemDouble::ItemDouble( const TQString &group, const TQString &key,
568 double &reference, double defaultValue )
569 : TDEConfigSkeletonGenericItem<double>( group, key, reference, defaultValue )
570 ,mHasMin(false), mHasMax(false)
571{
572}
573
574void TDEConfigSkeleton::ItemDouble::readConfig( TDEConfig *config )
575{
576 config->setGroup( mGroup );
577 mReference = config->readDoubleNumEntry( mKey, mDefault );
578 if (mHasMin)
579 mReference = TQMAX(mReference, mMin);
580 if (mHasMax)
581 mReference = TQMIN(mReference, mMax);
582 mLoadedValue = mReference;
583
584 readImmutability( config );
585}
586
587void TDEConfigSkeleton::ItemDouble::setProperty(const TQVariant & p)
588{
589 mReference = p.toDouble();
590}
591
592TQVariant TDEConfigSkeleton::ItemDouble::property() const
593{
594 return TQVariant(mReference);
595}
596
597TQVariant TDEConfigSkeleton::ItemDouble::minValue() const
598{
599 if (mHasMin)
600 return TQVariant(mMin);
601 return TQVariant();
602}
603
604TQVariant TDEConfigSkeleton::ItemDouble::maxValue() const
605{
606 if (mHasMax)
607 return TQVariant(mMax);
608 return TQVariant();
609}
610
611void TDEConfigSkeleton::ItemDouble::setMinValue(double v)
612{
613 mHasMin = true;
614 mMin = v;
615}
616
617void TDEConfigSkeleton::ItemDouble::setMaxValue(double v)
618{
619 mHasMax = true;
620 mMax = v;
621}
622
623
624TDEConfigSkeleton::ItemColor::ItemColor( const TQString &group, const TQString &key,
625 TQColor &reference,
626 const TQColor &defaultValue )
627 : TDEConfigSkeletonGenericItem<TQColor>( group, key, reference, defaultValue )
628{
629}
630
631void TDEConfigSkeleton::ItemColor::readConfig( TDEConfig *config )
632{
633 config->setGroup( mGroup );
634 mReference = config->readColorEntry( mKey, &mDefault );
635 mLoadedValue = mReference;
636
637 readImmutability( config );
638}
639
640void TDEConfigSkeleton::ItemColor::setProperty(const TQVariant & p)
641{
642 mReference = p.toColor();
643}
644
645TQVariant TDEConfigSkeleton::ItemColor::property() const
646{
647 return TQVariant(mReference);
648}
649
650
651TDEConfigSkeleton::ItemFont::ItemFont( const TQString &group, const TQString &key,
652 TQFont &reference,
653 const TQFont &defaultValue )
654 : TDEConfigSkeletonGenericItem<TQFont>( group, key, reference, defaultValue )
655{
656}
657
658void TDEConfigSkeleton::ItemFont::readConfig( TDEConfig *config )
659{
660 config->setGroup( mGroup );
661 mReference = config->readFontEntry( mKey, &mDefault );
662 mLoadedValue = mReference;
663
664 readImmutability( config );
665}
666
667void TDEConfigSkeleton::ItemFont::setProperty(const TQVariant & p)
668{
669 mReference = p.toFont();
670}
671
672TQVariant TDEConfigSkeleton::ItemFont::property() const
673{
674 return TQVariant(mReference);
675}
676
677
678TDEConfigSkeleton::ItemRect::ItemRect( const TQString &group, const TQString &key,
679 TQRect &reference,
680 const TQRect &defaultValue )
681 : TDEConfigSkeletonGenericItem<TQRect>( group, key, reference, defaultValue )
682{
683}
684
685void TDEConfigSkeleton::ItemRect::readConfig( TDEConfig *config )
686{
687 config->setGroup( mGroup );
688 mReference = config->readRectEntry( mKey, &mDefault );
689 mLoadedValue = mReference;
690
691 readImmutability( config );
692}
693
694void TDEConfigSkeleton::ItemRect::setProperty(const TQVariant & p)
695{
696 mReference = p.toRect();
697}
698
699TQVariant TDEConfigSkeleton::ItemRect::property() const
700{
701 return TQVariant(mReference);
702}
703
704
705TDEConfigSkeleton::ItemPoint::ItemPoint( const TQString &group, const TQString &key,
706 TQPoint &reference,
707 const TQPoint &defaultValue )
708 : TDEConfigSkeletonGenericItem<TQPoint>( group, key, reference, defaultValue )
709{
710}
711
712void TDEConfigSkeleton::ItemPoint::readConfig( TDEConfig *config )
713{
714 config->setGroup( mGroup );
715 mReference = config->readPointEntry( mKey, &mDefault );
716 mLoadedValue = mReference;
717
718 readImmutability( config );
719}
720
721void TDEConfigSkeleton::ItemPoint::setProperty(const TQVariant & p)
722{
723 mReference = p.toPoint();
724}
725
726TQVariant TDEConfigSkeleton::ItemPoint::property() const
727{
728 return TQVariant(mReference);
729}
730
731
732TDEConfigSkeleton::ItemSize::ItemSize( const TQString &group, const TQString &key,
733 TQSize &reference,
734 const TQSize &defaultValue )
735 : TDEConfigSkeletonGenericItem<TQSize>( group, key, reference, defaultValue )
736{
737}
738
739void TDEConfigSkeleton::ItemSize::readConfig( TDEConfig *config )
740{
741 config->setGroup( mGroup );
742 mReference = config->readSizeEntry( mKey, &mDefault );
743 mLoadedValue = mReference;
744
745 readImmutability( config );
746}
747
748void TDEConfigSkeleton::ItemSize::setProperty(const TQVariant & p)
749{
750 mReference = p.toSize();
751}
752
753TQVariant TDEConfigSkeleton::ItemSize::property() const
754{
755 return TQVariant(mReference);
756}
757
758
759TDEConfigSkeleton::ItemDateTime::ItemDateTime( const TQString &group, const TQString &key,
760 TQDateTime &reference,
761 const TQDateTime &defaultValue )
762 : TDEConfigSkeletonGenericItem<TQDateTime>( group, key, reference, defaultValue )
763{
764}
765
766void TDEConfigSkeleton::ItemDateTime::readConfig( TDEConfig *config )
767{
768 config->setGroup( mGroup );
769 mReference = config->readDateTimeEntry( mKey, &mDefault );
770 mLoadedValue = mReference;
771
772 readImmutability( config );
773}
774
775void TDEConfigSkeleton::ItemDateTime::setProperty(const TQVariant & p)
776{
777 mReference = p.toDateTime();
778}
779
780TQVariant TDEConfigSkeleton::ItemDateTime::property() const
781{
782 return TQVariant(mReference);
783}
784
785
786TDEConfigSkeleton::ItemStringList::ItemStringList( const TQString &group, const TQString &key,
787 TQStringList &reference,
788 const TQStringList &defaultValue )
789 : TDEConfigSkeletonGenericItem<TQStringList>( group, key, reference, defaultValue )
790{
791}
792
793void TDEConfigSkeleton::ItemStringList::readConfig( TDEConfig *config )
794{
795 config->setGroup( mGroup );
796 if ( !config->hasKey( mKey ) )
797 mReference = mDefault;
798 else
799 mReference = config->readListEntry( mKey );
800 mLoadedValue = mReference;
801
802 readImmutability( config );
803}
804
805void TDEConfigSkeleton::ItemStringList::setProperty(const TQVariant & p)
806{
807 mReference = p.toStringList();
808}
809
810TQVariant TDEConfigSkeleton::ItemStringList::property() const
811{
812 return TQVariant(mReference);
813}
814
815
816TDEConfigSkeleton::ItemPathList::ItemPathList( const TQString &group, const TQString &key,
817 TQStringList &reference,
818 const TQStringList &defaultValue )
819 : ItemStringList( group, key, reference, defaultValue )
820{
821}
822
823void TDEConfigSkeleton::ItemPathList::readConfig( TDEConfig *config )
824{
825 config->setGroup( mGroup );
826 if ( !config->hasKey( mKey ) )
827 mReference = mDefault;
828 else
829 mReference = config->readPathListEntry( mKey );
830 mLoadedValue = mReference;
831
832 readImmutability( config );
833}
834
835void TDEConfigSkeleton::ItemPathList::writeConfig( TDEConfig *config )
836{
837 if ( mReference != mLoadedValue ) // WABA: Is this test needed?
838 {
839 config->setGroup( mGroup );
840 if ((mDefault == mReference) && !config->hasDefault( mKey))
841 config->revertToDefault( mKey );
842 else {
843 TQStringList sl = mReference;
844 config->writePathEntry( mKey, sl );
845 }
846 }
847}
848
849
850TDEConfigSkeleton::ItemIntList::ItemIntList( const TQString &group, const TQString &key,
851 TQValueList<int> &reference,
852 const TQValueList<int> &defaultValue )
853 : TDEConfigSkeletonGenericItem<TQValueList<int> >( group, key, reference, defaultValue )
854{
855}
856
857void TDEConfigSkeleton::ItemIntList::readConfig( TDEConfig *config )
858{
859 config->setGroup( mGroup );
860 if ( !config->hasKey( mKey ) )
861 mReference = mDefault;
862 else
863 mReference = config->readIntListEntry( mKey );
864 mLoadedValue = mReference;
865
866 readImmutability( config );
867}
868
869void TDEConfigSkeleton::ItemIntList::setProperty(const TQVariant &)
870{
871 // TODO: Not yet supported
872}
873
874TQVariant TDEConfigSkeleton::ItemIntList::property() const
875{
876 // TODO: Not yet supported
877 return TQVariant();
878}
879
880
881TDEConfigSkeleton::TDEConfigSkeleton( const TQString &configname )
882 : mCurrentGroup( "No Group" ), mUseDefaults(false)
883{
884 kdDebug(177) << "Creating TDEConfigSkeleton (" << (void *)this << ")" << endl;
885
886 if ( !configname.isEmpty() )
887 {
888 mConfig = TDESharedConfig::openConfig( configname );
889 }
890 else
891 {
892 mConfig = TDEGlobal::sharedConfig();
893 }
894}
895
896TDEConfigSkeleton::TDEConfigSkeleton(TDESharedConfig::Ptr config)
897 : mCurrentGroup( "No Group" ), mUseDefaults(false)
898{
899 kdDebug(177) << "Creating TDEConfigSkeleton (" << (void *)this << ")" << endl;
900 mConfig = config;
901}
902
903
904TDEConfigSkeleton::~TDEConfigSkeleton()
905{
906 TDEConfigSkeletonItem::List::ConstIterator it;
907 for( it = mItems.begin(); it != mItems.end(); ++it )
908 {
909 delete *it;
910 }
911}
912
913void TDEConfigSkeleton::setCurrentGroup( const TQString &group )
914{
915 mCurrentGroup = group;
916}
917
918TDEConfig *TDEConfigSkeleton::config() const
919{
920 return mConfig;
921}
922
923bool TDEConfigSkeleton::useDefaults(bool b)
924{
925 if (b == mUseDefaults)
926 return mUseDefaults;
927
928 mUseDefaults = b;
929 TDEConfigSkeletonItem::List::ConstIterator it;
930 for( it = mItems.begin(); it != mItems.end(); ++it )
931 {
932 (*it)->swapDefault();
933 }
934
935 usrUseDefaults(b);
936 return !mUseDefaults;
937}
938
939void TDEConfigSkeleton::setDefaults()
940{
941 TDEConfigSkeletonItem::List::ConstIterator it;
942 for( it = mItems.begin(); it != mItems.end(); ++it ) {
943 (*it)->setDefault();
944 }
945
946 usrSetDefaults();
947}
948
949void TDEConfigSkeleton::readConfig()
950{
951 kdDebug(177) << "TDEConfigSkeleton::readConfig()" << endl;
952
953 TQString origGroup = mConfig->group();
954
955 mConfig->reparseConfiguration();
956 TDEConfigSkeletonItem::List::ConstIterator it;
957 for( it = mItems.begin(); it != mItems.end(); ++it )
958 {
959 (*it)->readConfig( mConfig );
960 }
961
962 usrReadConfig();
963
964 mConfig->setGroup(origGroup);
965}
966
967void TDEConfigSkeleton::writeConfig()
968{
969 kdDebug(177) << "TDEConfigSkeleton::writeConfig()" << endl;
970
971 TQString origGroup = mConfig->group();
972
973 TDEConfigSkeletonItem::List::ConstIterator it;
974 for( it = mItems.begin(); it != mItems.end(); ++it )
975 {
976 (*it)->writeConfig( mConfig );
977 }
978
979 usrWriteConfig();
980
981 mConfig->sync();
982
983 readConfig();
984
985 mConfig->setGroup(origGroup);
986}
987
988void TDEConfigSkeleton::addItem( TDEConfigSkeletonItem *item, const TQString &name )
989{
990 item->setName( name.isEmpty() ? item->key() : name );
991 mItems.append( item );
992 mItemDict.insert( item->name(), item );
993 item->readDefault( mConfig );
994 item->readConfig( mConfig );
995}
996
997TDEConfigSkeleton::ItemString *TDEConfigSkeleton::addItemString( const TQString &name, TQString &reference,
998 const TQString &defaultValue, const TQString &key )
999{
1000 TDEConfigSkeleton::ItemString *item;
1001 item = new TDEConfigSkeleton::ItemString( mCurrentGroup, key.isEmpty() ? name : key,
1002 reference, defaultValue,
1003 TDEConfigSkeleton::ItemString::Normal );
1004 addItem( item, name );
1005 return item;
1006}
1007
1008TDEConfigSkeleton::ItemPassword *TDEConfigSkeleton::addItemPassword( const TQString &name, TQString &reference,
1009 const TQString &defaultValue, const TQString &key )
1010{
1011 TDEConfigSkeleton::ItemPassword *item;
1012 item = new TDEConfigSkeleton::ItemPassword( mCurrentGroup, key.isNull() ? name : key,
1013 reference, defaultValue );
1014 addItem( item, name );
1015 return item;
1016}
1017
1018TDEConfigSkeleton::ItemPath *TDEConfigSkeleton::addItemPath( const TQString &name, TQString &reference,
1019 const TQString &defaultValue, const TQString &key )
1020{
1021 TDEConfigSkeleton::ItemPath *item;
1022 item = new TDEConfigSkeleton::ItemPath( mCurrentGroup, key.isNull() ? name : key,
1023 reference, defaultValue );
1024 addItem( item, name );
1025 return item;
1026}
1027
1028TDEConfigSkeleton::ItemProperty *TDEConfigSkeleton::addItemProperty( const TQString &name, TQVariant &reference,
1029 const TQVariant &defaultValue, const TQString &key )
1030{
1031 TDEConfigSkeleton::ItemProperty *item;
1032 item = new TDEConfigSkeleton::ItemProperty( mCurrentGroup, key.isNull() ? name : key,
1033 reference, defaultValue );
1034 addItem( item, name );
1035 return item;
1036}
1037
1038TDEConfigSkeleton::ItemBool *TDEConfigSkeleton::addItemBool( const TQString &name, bool &reference,
1039 bool defaultValue, const TQString &key )
1040{
1041 TDEConfigSkeleton::ItemBool *item;
1042 item = new TDEConfigSkeleton::ItemBool( mCurrentGroup, key.isNull() ? name : key,
1043 reference, defaultValue );
1044 addItem( item, name );
1045 return item;
1046}
1047
1048TDEConfigSkeleton::ItemInt *TDEConfigSkeleton::addItemInt( const TQString &name, int &reference,
1049 int defaultValue, const TQString &key )
1050{
1051 TDEConfigSkeleton::ItemInt *item;
1052 item = new TDEConfigSkeleton::ItemInt( mCurrentGroup, key.isNull() ? name : key,
1053 reference, defaultValue );
1054 addItem( item, name );
1055 return item;
1056}
1057
1058TDEConfigSkeleton::ItemUInt *TDEConfigSkeleton::addItemUInt( const TQString &name, unsigned int &reference,
1059 unsigned int defaultValue, const TQString &key )
1060{
1061 TDEConfigSkeleton::ItemUInt *item;
1062 item = new TDEConfigSkeleton::ItemUInt( mCurrentGroup, key.isNull() ? name : key,
1063 reference, defaultValue );
1064 addItem( item, name );
1065 return item;
1066}
1067
1068TDEConfigSkeleton::ItemInt64 *TDEConfigSkeleton::addItemInt64( const TQString &name, TQ_INT64 &reference,
1069 TQ_INT64 defaultValue, const TQString &key )
1070{
1071 TDEConfigSkeleton::ItemInt64 *item;
1072 item = new TDEConfigSkeleton::ItemInt64( mCurrentGroup, key.isNull() ? name : key,
1073 reference, defaultValue );
1074 addItem( item, name );
1075 return item;
1076}
1077
1078TDEConfigSkeleton::ItemUInt64 *TDEConfigSkeleton::addItemUInt64( const TQString &name, TQ_UINT64 &reference,
1079 TQ_UINT64 defaultValue, const TQString &key )
1080{
1081 TDEConfigSkeleton::ItemUInt64 *item;
1082 item = new TDEConfigSkeleton::ItemUInt64( mCurrentGroup, key.isNull() ? name : key,
1083 reference, defaultValue );
1084 addItem( item, name );
1085 return item;
1086}
1087
1088TDEConfigSkeleton::ItemLong *TDEConfigSkeleton::addItemLong( const TQString &name, long &reference,
1089 long defaultValue, const TQString &key )
1090{
1091 TDEConfigSkeleton::ItemLong *item;
1092 item = new TDEConfigSkeleton::ItemLong( mCurrentGroup, key.isNull() ? name : key,
1093 reference, defaultValue );
1094 addItem( item, name );
1095 return item;
1096}
1097
1098TDEConfigSkeleton::ItemULong *TDEConfigSkeleton::addItemULong( const TQString &name, unsigned long &reference,
1099 unsigned long defaultValue, const TQString &key )
1100{
1101 TDEConfigSkeleton::ItemULong *item;
1102 item = new TDEConfigSkeleton::ItemULong( mCurrentGroup, key.isNull() ? name : key,
1103 reference, defaultValue );
1104 addItem( item, name );
1105 return item;
1106}
1107
1108TDEConfigSkeleton::ItemDouble *TDEConfigSkeleton::addItemDouble( const TQString &name, double &reference,
1109 double defaultValue, const TQString &key )
1110{
1111 TDEConfigSkeleton::ItemDouble *item;
1112 item = new TDEConfigSkeleton::ItemDouble( mCurrentGroup, key.isNull() ? name : key,
1113 reference, defaultValue );
1114 addItem( item, name );
1115 return item;
1116}
1117
1118TDEConfigSkeleton::ItemColor *TDEConfigSkeleton::addItemColor( const TQString &name, TQColor &reference,
1119 const TQColor &defaultValue, const TQString &key )
1120{
1121 TDEConfigSkeleton::ItemColor *item;
1122 item = new TDEConfigSkeleton::ItemColor( mCurrentGroup, key.isNull() ? name : key,
1123 reference, defaultValue );
1124 addItem( item, name );
1125 return item;
1126}
1127
1128TDEConfigSkeleton::ItemFont *TDEConfigSkeleton::addItemFont( const TQString &name, TQFont &reference,
1129 const TQFont &defaultValue, const TQString &key )
1130{
1131 TDEConfigSkeleton::ItemFont *item;
1132 item = new TDEConfigSkeleton::ItemFont( mCurrentGroup, key.isNull() ? name : key,
1133 reference, defaultValue );
1134 addItem( item, name );
1135 return item;
1136}
1137
1138TDEConfigSkeleton::ItemRect *TDEConfigSkeleton::addItemRect( const TQString &name, TQRect &reference,
1139 const TQRect &defaultValue, const TQString &key )
1140{
1141 TDEConfigSkeleton::ItemRect *item;
1142 item = new TDEConfigSkeleton::ItemRect( mCurrentGroup, key.isNull() ? name : key,
1143 reference, defaultValue );
1144 addItem( item, name );
1145 return item;
1146}
1147
1148TDEConfigSkeleton::ItemPoint *TDEConfigSkeleton::addItemPoint( const TQString &name, TQPoint &reference,
1149 const TQPoint &defaultValue, const TQString &key )
1150{
1151 TDEConfigSkeleton::ItemPoint *item;
1152 item = new TDEConfigSkeleton::ItemPoint( mCurrentGroup, key.isNull() ? name : key,
1153 reference, defaultValue );
1154 addItem( item, name );
1155 return item;
1156}
1157
1158TDEConfigSkeleton::ItemSize *TDEConfigSkeleton::addItemSize( const TQString &name, TQSize &reference,
1159 const TQSize &defaultValue, const TQString &key )
1160{
1161 TDEConfigSkeleton::ItemSize *item;
1162 item = new TDEConfigSkeleton::ItemSize( mCurrentGroup, key.isNull() ? name : key,
1163 reference, defaultValue );
1164 addItem( item, name );
1165 return item;
1166}
1167
1168TDEConfigSkeleton::ItemDateTime *TDEConfigSkeleton::addItemDateTime( const TQString &name, TQDateTime &reference,
1169 const TQDateTime &defaultValue, const TQString &key )
1170{
1171 TDEConfigSkeleton::ItemDateTime *item;
1172 item = new TDEConfigSkeleton::ItemDateTime( mCurrentGroup, key.isNull() ? name : key,
1173 reference, defaultValue );
1174 addItem( item, name );
1175 return item;
1176}
1177
1178TDEConfigSkeleton::ItemStringList *TDEConfigSkeleton::addItemStringList( const TQString &name, TQStringList &reference,
1179 const TQStringList &defaultValue, const TQString &key )
1180{
1181 TDEConfigSkeleton::ItemStringList *item;
1182 item = new TDEConfigSkeleton::ItemStringList( mCurrentGroup, key.isNull() ? name : key,
1183 reference, defaultValue );
1184 addItem( item, name );
1185 return item;
1186}
1187
1188TDEConfigSkeleton::ItemIntList *TDEConfigSkeleton::addItemIntList( const TQString &name, TQValueList<int> &reference,
1189 const TQValueList<int> &defaultValue, const TQString &key )
1190{
1191 TDEConfigSkeleton::ItemIntList *item;
1192 item = new TDEConfigSkeleton::ItemIntList( mCurrentGroup, key.isNull() ? name : key,
1193 reference, defaultValue );
1194 addItem( item, name );
1195 return item;
1196}
1197
1198bool TDEConfigSkeleton::isImmutable(const TQString &name)
1199{
1200 TDEConfigSkeletonItem *item = findItem(name);
1201 return !item || item->isImmutable();
1202}
1203
1204TDEConfigSkeletonItem *TDEConfigSkeleton::findItem(const TQString &name)
1205{
1206 return mItemDict.find(name);
1207}
KStringHandler::obscure
static TQString obscure(const TQString &str)
Obscure string by using a simple symmetric encryption.
Definition: kstringhandler.cpp:556
TDEConfigBase::readUnsignedLongNumEntry
unsigned long readUnsignedLongNumEntry(const TQString &pKey, unsigned long nDefault=0) const
Read an unsigned numerical value.
Definition: tdeconfigbase.cpp:672
TDEConfigBase::hasDefault
bool hasDefault(const TQString &key) const
Returns whether a default is specified for an entry in either the system wide configuration file or t...
Definition: tdeconfigbase.cpp:1804
TDEConfigBase::readEntry
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: tdeconfigbase.cpp:221
TDEConfigBase::revertToDefault
void revertToDefault(const TQString &key)
Reverts the entry with key key in the current group in the application specific config file to either...
Definition: tdeconfigbase.cpp:1777
TDEConfigBase::readColorEntry
TQColor readColorEntry(const TQString &pKey, const TQColor *pDefault=0L) const
Reads a TQColor entry.
Definition: tdeconfigbase.cpp:947
TDEConfigBase::readUnsignedNum64Entry
TQ_UINT64 readUnsignedNum64Entry(const TQString &pKey, TQ_UINT64 nDefault=0) const
Read an 64-bit unsigned numerical value.
Definition: tdeconfigbase.cpp:710
TDEConfigBase::readNum64Entry
TQ_INT64 readNum64Entry(const TQString &pKey, TQ_INT64 nDefault=0) const
Reads a 64-bit numerical value.
Definition: tdeconfigbase.cpp:690
TDEConfigBase::readNumEntry
int readNumEntry(const TQString &pKey, int nDefault=0) const
Reads a numerical value.
Definition: tdeconfigbase.cpp:613
TDEConfigBase::readBoolEntry
bool readBoolEntry(const TQString &pKey, bool bDefault=false) const
Reads a boolean entry.
Definition: tdeconfigbase.cpp:748
TDEConfigBase::readSizeEntry
TQSize readSizeEntry(const TQString &pKey, const TQSize *pDefault=0L) const
Reads a TQSize entry.
Definition: tdeconfigbase.cpp:921
TDEConfigBase::writePathEntry
void writePathEntry(const TQString &pKey, const TQString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a file path.
Definition: tdeconfigbase.cpp:1093
TDEConfigBase::entryIsImmutable
bool entryIsImmutable(const TQString &key) const
Checks whether it is possible to change the given entry.
Definition: tdeconfigbase.cpp:182
TDEConfigBase::readUnsignedNumEntry
unsigned int readUnsignedNumEntry(const TQString &pKey, unsigned int nDefault=0) const
Reads an unsigned numerical value.
Definition: tdeconfigbase.cpp:634
TDEConfigBase::readDoubleNumEntry
double readDoubleNumEntry(const TQString &pKey, double nDefault=0.0) const
Reads a floating point value.
Definition: tdeconfigbase.cpp:729
TDEConfigBase::readIntListEntry
TQValueList< int > readIntListEntry(const TQString &pKey) const
Reads a list of Integers.
Definition: tdeconfigbase.cpp:567
TDEConfigBase::readPointEntry
TQPoint readPointEntry(const TQString &pKey, const TQPoint *pDefault=0L) const
Reads a TQPoint entry.
Definition: tdeconfigbase.cpp:896
TDEConfigBase::group
TQString group() const
Returns the name of the group in which we are searching for keys and from which we are retrieving ent...
Definition: tdeconfigbase.cpp:100
TDEConfigBase::readRectEntry
TQRect readRectEntry(const TQString &pKey, const TQRect *pDefault=0L) const
Reads a TQRect entry.
Definition: tdeconfigbase.cpp:872
TDEConfigBase::readListEntry
int readListEntry(const TQString &pKey, TQStrList &list, char sep=',') const
Reads a list of strings.
Definition: tdeconfigbase.cpp:467
TDEConfigBase::sync
virtual void sync()
Flushes all changes that currently reside only in memory back to disk / permanent storage.
Definition: tdeconfigbase.cpp:1738
TDEConfigBase::readPathListEntry
TQStringList readPathListEntry(const TQString &pKey, char sep=',') const
Reads a list of string paths.
Definition: tdeconfigbase.cpp:599
TDEConfigBase::readLongNumEntry
long readLongNumEntry(const TQString &pKey, long nDefault=0) const
Reads a numerical value.
Definition: tdeconfigbase.cpp:653
TDEConfigBase::hasKey
bool hasKey(const TQString &key) const
Checks whether the key has an entry in the currently active group.
Definition: tdeconfigbase.cpp:109
TDEConfigBase::writeEntry
void writeEntry(const TQString &pKey, const TQString &pValue, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
Writes a key/value pair.
Definition: tdeconfigbase.cpp:1044
TDEConfigBase::readDateTimeEntry
TQDateTime readDateTimeEntry(const TQString &pKey, const TQDateTime *pDefault=0L) const
Reads a TQDateTime entry.
Definition: tdeconfigbase.cpp:1012
TDEConfigBase::readPathEntry
TQString readPathEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads a path.
Definition: tdeconfigbase.cpp:585
TDEConfigBase::readFontEntry
TQFont readFontEntry(const TQString &pKey, const TQFont *pDefault=0L) const
Reads a TQFont value.
Definition: tdeconfigbase.cpp:775
TDEConfigBase::setGroup
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: tdeconfigbase.cpp:79
TDEConfigBase::readPropertyEntry
TQVariant readPropertyEntry(const TQString &pKey, TQVariant::Type) const
Reads the value of an entry specified by pKey in the current group.
Definition: tdeconfigbase.cpp:365
TDEConfigSkeletonItem
Class for storing a preferences setting.
Definition: tdeconfigskeleton.h:51
TDEConfigSkeletonItem::readConfig
virtual void readConfig(TDEConfig *)=0
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
TDEConfigSkeletonItem::setName
void setName(const TQString &name)
Set internal name of entry.
Definition: tdeconfigskeleton.h:110
TDEConfigSkeletonItem::isImmutable
bool isImmutable() const
Return if the entry can be modified.
Definition: tdeconfigskeleton.h:207
TDEConfigSkeletonItem::readDefault
virtual void readDefault(TDEConfig *)=0
Read global default value.
TDEConfigSkeletonItem::name
TQString name() const
Return internal name of entry.
Definition: tdeconfigskeleton.h:118
TDEConfigSkeletonItem::key
TQString key() const
Return config file key.
Definition: tdeconfigskeleton.h:102
TDEConfigSkeletonItem::readImmutability
void readImmutability(TDEConfig *config)
sets mIsImmutable to true if mKey in config is immutable
Definition: tdeconfigskeleton.cpp:35
TDEConfigSkeleton::ItemBool
Class for handling a bool preferences item.
Definition: tdeconfigskeleton.h:433
TDEConfigSkeleton::ItemBool::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:148
TDEConfigSkeleton::ItemBool::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:162
TDEConfigSkeleton::ItemBool::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:157
TDEConfigSkeleton::ItemColor
Class for handling a color preferences item.
Definition: tdeconfigskeleton.h:654
TDEConfigSkeleton::ItemColor::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:645
TDEConfigSkeleton::ItemColor::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:640
TDEConfigSkeleton::ItemColor::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:631
TDEConfigSkeleton::ItemDateTime
Class for handling a TQDateTime preferences item.
Definition: tdeconfigskeleton.h:730
TDEConfigSkeleton::ItemDateTime::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:780
TDEConfigSkeleton::ItemDateTime::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:775
TDEConfigSkeleton::ItemDateTime::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:766
TDEConfigSkeleton::ItemDouble
Class for handling a floating point preference item.
Definition: tdeconfigskeleton.h:628
TDEConfigSkeleton::ItemDouble::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:592
TDEConfigSkeleton::ItemDouble::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:597
TDEConfigSkeleton::ItemDouble::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:604
TDEConfigSkeleton::ItemDouble::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:574
TDEConfigSkeleton::ItemDouble::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:587
TDEConfigSkeleton::ItemEnum::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:289
TDEConfigSkeleton::ItemEnum::writeConfig
void writeConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to write the value of this setting to a config file.
Definition: tdeconfigskeleton.cpp:318
TDEConfigSkeleton::ItemFont
Class for handling a font preferences item.
Definition: tdeconfigskeleton.h:670
TDEConfigSkeleton::ItemFont::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:658
TDEConfigSkeleton::ItemFont::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:672
TDEConfigSkeleton::ItemFont::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:667
TDEConfigSkeleton::ItemInt64
Class for handling an 64-bit integer preferences item.
Definition: tdeconfigskeleton.h:473
TDEConfigSkeleton::ItemInt64::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:262
TDEConfigSkeleton::ItemInt64::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:255
TDEConfigSkeleton::ItemInt64::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:232
TDEConfigSkeleton::ItemInt64::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:250
TDEConfigSkeleton::ItemInt64::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:245
TDEConfigSkeleton::ItemIntList
Class for handling an integer list preferences item.
Definition: tdeconfigskeleton.h:777
TDEConfigSkeleton::ItemIntList::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:874
TDEConfigSkeleton::ItemIntList::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:869
TDEConfigSkeleton::ItemIntList::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:857
TDEConfigSkeleton::ItemInt
Class for handling an integer preferences item.
Definition: tdeconfigskeleton.h:448
TDEConfigSkeleton::ItemInt::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:198
TDEConfigSkeleton::ItemInt::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:193
TDEConfigSkeleton::ItemInt::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:175
TDEConfigSkeleton::ItemInt::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:205
TDEConfigSkeleton::ItemInt::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:188
TDEConfigSkeleton::ItemLong
Class for hanlding a long integer preferences item.
Definition: tdeconfigskeleton.h:551
TDEConfigSkeleton::ItemLong::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:472
TDEConfigSkeleton::ItemLong::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:459
TDEConfigSkeleton::ItemLong::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:489
TDEConfigSkeleton::ItemLong::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:482
TDEConfigSkeleton::ItemLong::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:477
TDEConfigSkeleton::ItemPassword
Class for handling a password preferences item.
Definition: tdeconfigskeleton.h:395
TDEConfigSkeleton::ItemPathList::writeConfig
void writeConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to write the value of this setting to a config file.
Definition: tdeconfigskeleton.cpp:835
TDEConfigSkeleton::ItemPathList::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:823
TDEConfigSkeleton::ItemPath
Class for handling a path preferences item.
Definition: tdeconfigskeleton.h:406
TDEConfigSkeleton::ItemPoint
Class for handling a TQPoint preferences item.
Definition: tdeconfigskeleton.h:700
TDEConfigSkeleton::ItemPoint::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:721
TDEConfigSkeleton::ItemPoint::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:726
TDEConfigSkeleton::ItemPoint::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:712
TDEConfigSkeleton::ItemProperty
Class for handling a TQVariant preferences item.
Definition: tdeconfigskeleton.h:418
TDEConfigSkeleton::ItemProperty::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:137
TDEConfigSkeleton::ItemProperty::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:132
TDEConfigSkeleton::ItemProperty::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:123
TDEConfigSkeleton::ItemRect
Class for handling a TQRect preferences item.
Definition: tdeconfigskeleton.h:685
TDEConfigSkeleton::ItemRect::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:685
TDEConfigSkeleton::ItemRect::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:694
TDEConfigSkeleton::ItemRect::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:699
TDEConfigSkeleton::ItemSize
Class for handling a TQSize preferences item.
Definition: tdeconfigskeleton.h:715
TDEConfigSkeleton::ItemSize::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:739
TDEConfigSkeleton::ItemSize::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:748
TDEConfigSkeleton::ItemSize::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:753
TDEConfigSkeleton::ItemStringList
Class for handling a string list preferences item.
Definition: tdeconfigskeleton.h:746
TDEConfigSkeleton::ItemStringList::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:793
TDEConfigSkeleton::ItemStringList::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:805
TDEConfigSkeleton::ItemStringList::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:810
TDEConfigSkeleton::ItemString
Class for handling a string preferences item.
Definition: tdeconfigskeleton.h:373
TDEConfigSkeleton::ItemString::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:67
TDEConfigSkeleton::ItemString::writeConfig
void writeConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to write the value of this setting to a config file.
Definition: tdeconfigskeleton.cpp:50
TDEConfigSkeleton::ItemString::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:96
TDEConfigSkeleton::ItemString::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:91
TDEConfigSkeleton::ItemUInt64
Class for handling unsigned 64-bit integer preferences item.
Definition: tdeconfigskeleton.h:602
TDEConfigSkeleton::ItemUInt64::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:403
TDEConfigSkeleton::ItemUInt64::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:433
TDEConfigSkeleton::ItemUInt64::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:426
TDEConfigSkeleton::ItemUInt64::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:416
TDEConfigSkeleton::ItemUInt64::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:421
TDEConfigSkeleton::ItemUInt
Class for handling an unsingend integer preferences item.
Definition: tdeconfigskeleton.h:525
TDEConfigSkeleton::ItemUInt::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:359
TDEConfigSkeleton::ItemUInt::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:376
TDEConfigSkeleton::ItemUInt::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:369
TDEConfigSkeleton::ItemUInt::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:364
TDEConfigSkeleton::ItemUInt::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:346
TDEConfigSkeleton::ItemULong
Class for handling an unsigned long integer preferences item.
Definition: tdeconfigskeleton.h:577
TDEConfigSkeleton::ItemULong::maxValue
TQVariant maxValue() const
Return maximum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:547
TDEConfigSkeleton::ItemULong::setProperty
void setProperty(const TQVariant &p)
Set item to p.
Definition: tdeconfigskeleton.cpp:530
TDEConfigSkeleton::ItemULong::minValue
TQVariant minValue() const
Return minimum value of item or invalid if not specified.
Definition: tdeconfigskeleton.cpp:540
TDEConfigSkeleton::ItemULong::property
TQVariant property() const
Return item as property.
Definition: tdeconfigskeleton.cpp:535
TDEConfigSkeleton::ItemULong::readConfig
void readConfig(TDEConfig *config)
This function is called by TDEConfigSkeleton to read the value for this setting from a config file.
Definition: tdeconfigskeleton.cpp:517
TDEConfigSkeleton::findItem
TDEConfigSkeletonItem * findItem(const TQString &name)
Lookup item by name.
Definition: tdeconfigskeleton.cpp:1204
TDEConfigSkeleton::readConfig
void readConfig()
Read preferences from config file.
Definition: tdeconfigskeleton.cpp:949
TDEConfigSkeleton::usrUseDefaults
virtual void usrUseDefaults(bool)
Implemented by subclasses that use special defaults.
Definition: tdeconfigskeleton.h:1193
TDEConfigSkeleton::~TDEConfigSkeleton
virtual ~TDEConfigSkeleton()
Destructor.
Definition: tdeconfigskeleton.cpp:904
TDEConfigSkeleton::addItemLong
ItemLong * addItemLong(const TQString &name, long &reference, long defaultValue=0, const TQString &key=TQString::null)
Register an item of type long.
Definition: tdeconfigskeleton.cpp:1088
TDEConfigSkeleton::addItemPath
ItemPath * addItemPath(const TQString &name, TQString &reference, const TQString &defaultValue=TQString::fromLatin1(""), const TQString &key=TQString::null)
Register a path item of type TQString.
Definition: tdeconfigskeleton.cpp:1018
TDEConfigSkeleton::addItemStringList
ItemStringList * addItemStringList(const TQString &name, TQStringList &reference, const TQStringList &defaultValue=TQStringList(), const TQString &key=TQString::null)
Register an item of type TQStringList.
Definition: tdeconfigskeleton.cpp:1178
TDEConfigSkeleton::addItemUInt
ItemUInt * addItemUInt(const TQString &name, unsigned int &reference, unsigned int defaultValue=0, const TQString &key=TQString::null)
Register an item of type unsigned int.
Definition: tdeconfigskeleton.cpp:1058
TDEConfigSkeleton::addItemULong
ItemULong * addItemULong(const TQString &name, unsigned long &reference, unsigned long defaultValue=0, const TQString &key=TQString::null)
Register an item of type unsigned long.
Definition: tdeconfigskeleton.cpp:1098
TDEConfigSkeleton::addItemColor
ItemColor * addItemColor(const TQString &name, TQColor &reference, const TQColor &defaultValue=TQColor(128, 128, 128), const TQString &key=TQString::null)
Register an item of type TQColor.
Definition: tdeconfigskeleton.cpp:1118
TDEConfigSkeleton::addItemRect
ItemRect * addItemRect(const TQString &name, TQRect &reference, const TQRect &defaultValue=TQRect(), const TQString &key=TQString::null)
Register an item of type TQRect.
Definition: tdeconfigskeleton.cpp:1138
TDEConfigSkeleton::useDefaults
bool useDefaults(bool b)
Indicate whether this object should reflect the actual values or the default values.
Definition: tdeconfigskeleton.cpp:923
TDEConfigSkeleton::addItemSize
ItemSize * addItemSize(const TQString &name, TQSize &reference, const TQSize &defaultValue=TQSize(), const TQString &key=TQString::null)
Register an item of type TQSize.
Definition: tdeconfigskeleton.cpp:1158
TDEConfigSkeleton::addItemInt
ItemInt * addItemInt(const TQString &name, int &reference, int defaultValue=0, const TQString &key=TQString::null)
Register an item of type int.
Definition: tdeconfigskeleton.cpp:1048
TDEConfigSkeleton::setDefaults
void setDefaults()
Set all registered items to their default values.
Definition: tdeconfigskeleton.cpp:939
TDEConfigSkeleton::addItemProperty
ItemProperty * addItemProperty(const TQString &name, TQVariant &reference, const TQVariant &defaultValue=TQVariant(), const TQString &key=TQString::null)
Register a property item of type TQVariant.
Definition: tdeconfigskeleton.cpp:1028
TDEConfigSkeleton::usrWriteConfig
virtual void usrWriteConfig()
Implemented by subclasses that write special config values.
Definition: tdeconfigskeleton.h:1211
TDEConfigSkeleton::isImmutable
bool isImmutable(const TQString &name)
Return whether a certain item is immutable.
Definition: tdeconfigskeleton.cpp:1198
TDEConfigSkeleton::writeConfig
void writeConfig()
Write preferences to config file.
Definition: tdeconfigskeleton.cpp:967
TDEConfigSkeleton::addItemBool
ItemBool * addItemBool(const TQString &name, bool &reference, bool defaultValue=false, const TQString &key=TQString::null)
Register an item of type bool.
Definition: tdeconfigskeleton.cpp:1038
TDEConfigSkeleton::setCurrentGroup
void setCurrentGroup(const TQString &group)
Set the config file group for subsequent addItem() calls.
Definition: tdeconfigskeleton.cpp:913
TDEConfigSkeleton::addItem
void addItem(TDEConfigSkeletonItem *, const TQString &name=TQString::null)
Register a custom TDEConfigSkeletonItem with a given name.
Definition: tdeconfigskeleton.cpp:988
TDEConfigSkeleton::addItemPassword
ItemPassword * addItemPassword(const TQString &name, TQString &reference, const TQString &defaultValue=TQString::fromLatin1(""), const TQString &key=TQString::null)
Register a password item of type TQString.
Definition: tdeconfigskeleton.cpp:1008
TDEConfigSkeleton::config
TDEConfig * config() const
Return the TDEConfig object used for reading and writing the settings.
Definition: tdeconfigskeleton.cpp:918
TDEConfigSkeleton::addItemIntList
ItemIntList * addItemIntList(const TQString &name, TQValueList< int > &reference, const TQValueList< int > &defaultValue=TQValueList< int >(), const TQString &key=TQString::null)
Register an item of type TQValueList<int>.
Definition: tdeconfigskeleton.cpp:1188
TDEConfigSkeleton::addItemDouble
ItemDouble * addItemDouble(const TQString &name, double &reference, double defaultValue=0.0, const TQString &key=TQString::null)
Register an item of type double.
Definition: tdeconfigskeleton.cpp:1108
TDEConfigSkeleton::addItemDateTime
ItemDateTime * addItemDateTime(const TQString &name, TQDateTime &reference, const TQDateTime &defaultValue=TQDateTime(), const TQString &key=TQString::null)
Register an item of type TQDateTime.
Definition: tdeconfigskeleton.cpp:1168
TDEConfigSkeleton::addItemInt64
ItemInt64 * addItemInt64(const TQString &name, TQ_INT64 &reference, TQ_INT64 defaultValue=0, const TQString &key=TQString::null)
Register an item of type TQ_INT64.
Definition: tdeconfigskeleton.cpp:1068
TDEConfigSkeleton::addItemString
ItemString * addItemString(const TQString &name, TQString &reference, const TQString &defaultValue=TQString::fromLatin1(""), const TQString &key=TQString::null)
Register an item of type TQString.
Definition: tdeconfigskeleton.cpp:997
TDEConfigSkeleton::usrReadConfig
virtual void usrReadConfig()
Implemented by subclasses that read special config values.
Definition: tdeconfigskeleton.h:1204
TDEConfigSkeleton::addItemPoint
ItemPoint * addItemPoint(const TQString &name, TQPoint &reference, const TQPoint &defaultValue=TQPoint(), const TQString &key=TQString::null)
Register an item of type TQPoint.
Definition: tdeconfigskeleton.cpp:1148
TDEConfigSkeleton::addItemUInt64
ItemUInt64 * addItemUInt64(const TQString &name, TQ_UINT64 &reference, TQ_UINT64 defaultValue=0, const TQString &key=TQString::null)
Register an item of type TQ_UINT64.
Definition: tdeconfigskeleton.cpp:1078
TDEConfigSkeleton::addItemFont
ItemFont * addItemFont(const TQString &name, TQFont &reference, const TQFont &defaultValue=TDEGlobalSettings::generalFont(), const TQString &key=TQString::null)
Register an item of type TQFont.
Definition: tdeconfigskeleton.cpp:1128
TDEConfigSkeleton::TDEConfigSkeleton
TDEConfigSkeleton(const TQString &configname=TQString::null)
Constructor.
Definition: tdeconfigskeleton.cpp:881
TDEConfig
Access KDE Configuration entries.
Definition: tdeconfig.h:44
TDEConfig::reparseConfiguration
virtual void reparseConfiguration()
Clears all internal data structures and then reread configuration information from disk.
Definition: tdeconfig.cpp:161
TDEGlobal::sharedConfig
static TDESharedConfig * sharedConfig()
Returns the general config object.
Definition: tdeglobal.cpp:72
TDESharedConfig::openConfig
static TDESharedConfig::Ptr openConfig(const TQString &fileName, bool readOnly=false, bool bUseKDEGlobals=true)
Returns a ref-counted pointer to a shared read-write config object.
Definition: tdeconfig.cpp:334
TDESharedPtr< TDESharedConfig >
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
TDEStdAccel::key
int key(StdAccel id)
Definition: tdestdaccel.cpp:383

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.