From 5159cd2beb2e87806a5b54e9991b7895285c9d3e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:16 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tdecore/tdeconfig_compiler/tests/Makefile.am | 134 ++++++++ tdecore/tdeconfig_compiler/tests/myprefs.h | 7 + .../tests/tdeconfigcompiler_test.cpp | 96 ++++++ .../tests/tdeconfigcompiler_test.h | 35 +++ tdecore/tdeconfig_compiler/tests/test1.cpp.ref | 72 +++++ tdecore/tdeconfig_compiler/tests/test1.h.ref | 196 ++++++++++++ tdecore/tdeconfig_compiler/tests/test1.kcfg | 55 ++++ tdecore/tdeconfig_compiler/tests/test1.kcfgc | 18 ++ tdecore/tdeconfig_compiler/tests/test1main.cpp | 29 ++ tdecore/tdeconfig_compiler/tests/test2.cpp.ref | 98 ++++++ tdecore/tdeconfig_compiler/tests/test2.h.ref | 333 ++++++++++++++++++++ tdecore/tdeconfig_compiler/tests/test2.kcfg | 78 +++++ tdecore/tdeconfig_compiler/tests/test2.kcfgc | 11 + tdecore/tdeconfig_compiler/tests/test2main.cpp | 29 ++ tdecore/tdeconfig_compiler/tests/test3.cpp.ref | 29 ++ tdecore/tdeconfig_compiler/tests/test3.h.ref | 138 +++++++++ tdecore/tdeconfig_compiler/tests/test3.kcfg | 26 ++ tdecore/tdeconfig_compiler/tests/test3.kcfgc | 12 + tdecore/tdeconfig_compiler/tests/test3main.cpp | 29 ++ tdecore/tdeconfig_compiler/tests/test4.cpp.ref | 82 +++++ tdecore/tdeconfig_compiler/tests/test4.h.ref | 135 ++++++++ tdecore/tdeconfig_compiler/tests/test4.kcfg | 42 +++ tdecore/tdeconfig_compiler/tests/test4.kcfgc | 11 + tdecore/tdeconfig_compiler/tests/test4main.cpp | 30 ++ tdecore/tdeconfig_compiler/tests/test5.cpp.ref | 82 +++++ tdecore/tdeconfig_compiler/tests/test5.h.ref | 127 ++++++++ tdecore/tdeconfig_compiler/tests/test5.kcfg | 42 +++ tdecore/tdeconfig_compiler/tests/test5.kcfgc | 11 + tdecore/tdeconfig_compiler/tests/test5main.cpp | 30 ++ tdecore/tdeconfig_compiler/tests/test6.cpp.ref | 31 ++ tdecore/tdeconfig_compiler/tests/test6.h.ref | 93 ++++++ tdecore/tdeconfig_compiler/tests/test6.kcfg | 25 ++ tdecore/tdeconfig_compiler/tests/test6.kcfgc | 11 + tdecore/tdeconfig_compiler/tests/test6main.cpp | 30 ++ tdecore/tdeconfig_compiler/tests/test7.cpp.ref | 31 ++ tdecore/tdeconfig_compiler/tests/test7.h.ref | 93 ++++++ tdecore/tdeconfig_compiler/tests/test7.kcfg | 25 ++ tdecore/tdeconfig_compiler/tests/test7.kcfgc | 11 + tdecore/tdeconfig_compiler/tests/test7main.cpp | 30 ++ tdecore/tdeconfig_compiler/tests/test8a.cpp.ref | 22 ++ tdecore/tdeconfig_compiler/tests/test8a.h.ref | 61 ++++ tdecore/tdeconfig_compiler/tests/test8a.kcfg | 17 + tdecore/tdeconfig_compiler/tests/test8a.kcfgc | 3 + tdecore/tdeconfig_compiler/tests/test8b.cpp.ref | 46 +++ tdecore/tdeconfig_compiler/tests/test8b.h.ref | 96 ++++++ tdecore/tdeconfig_compiler/tests/test8b.kcfg | 21 ++ tdecore/tdeconfig_compiler/tests/test8b.kcfgc | 6 + tdecore/tdeconfig_compiler/tests/test8main.cpp | 34 ++ tdecore/tdeconfig_compiler/tests/test9.cpp.ref | 35 +++ tdecore/tdeconfig_compiler/tests/test9.h.ref | 82 +++++ tdecore/tdeconfig_compiler/tests/test9.kcfg | 24 ++ tdecore/tdeconfig_compiler/tests/test9.kcfgc | 18 ++ tdecore/tdeconfig_compiler/tests/test9main.cpp | 43 +++ .../tdeconfig_compiler/tests/test_dpointer.cpp.ref | 344 +++++++++++++++++++++ .../tdeconfig_compiler/tests/test_dpointer.h.ref | 224 ++++++++++++++ .../tdeconfig_compiler/tests/test_dpointer.kcfg | 78 +++++ .../tdeconfig_compiler/tests/test_dpointer.kcfgc | 11 + .../tests/test_dpointer_main.cpp | 30 ++ 58 files changed, 3592 insertions(+) create mode 100644 tdecore/tdeconfig_compiler/tests/Makefile.am create mode 100644 tdecore/tdeconfig_compiler/tests/myprefs.h create mode 100644 tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.h create mode 100644 tdecore/tdeconfig_compiler/tests/test1.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test1.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test1.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test1.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test1main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test2.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test2.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test2.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test2.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test2main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test3.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test3.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test3.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test3.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test3main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test4.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test4.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test4.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test4.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test4main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test5.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test5.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test5.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test5.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test5main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test6.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test6.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test6.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test6.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test6main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test7.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test7.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test7.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test7.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test7main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test8a.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test8a.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test8a.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test8a.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test8b.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test8b.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test8b.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test8b.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test8main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test9.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test9.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test9.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test9.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test9main.cpp create mode 100644 tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test_dpointer.h.ref create mode 100644 tdecore/tdeconfig_compiler/tests/test_dpointer.kcfg create mode 100644 tdecore/tdeconfig_compiler/tests/test_dpointer.kcfgc create mode 100644 tdecore/tdeconfig_compiler/tests/test_dpointer_main.cpp (limited to 'tdecore/tdeconfig_compiler/tests') diff --git a/tdecore/tdeconfig_compiler/tests/Makefile.am b/tdecore/tdeconfig_compiler/tests/Makefile.am new file mode 100644 index 000000000..fa88f0b4b --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/Makefile.am @@ -0,0 +1,134 @@ +AM_CPPFLAGS = -I$(top_srcdir)/tdecore -I$(top_srcdir)/tdeunittest $(all_includes) -DQT_NO_CAST_ASCII -DSRCDIR=\"$(srcdir)\" + +check_PROGRAMS = test1 test2 test3 test4 test5 test6 test7 test8 test9 test_dpointer + +CLEANFILES = test1.cpp test1.h \ + test2.cpp test2.h \ + test3.cpp test3.h \ + test4.cpp test4.h \ + test5.cpp test5.h \ + test6.cpp test6.h \ + test7.cpp test7.h \ + test8a.cpp test8a.h test8b.cpp test8b.h \ + test9.cpp test9.h \ + test_dpointer.cpp test_dpointer.h \ + md5sums + +test1_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test1_LDADD = $(LIB_TDECORE) +test1_SOURCES = test1main.cpp test1.cpp + +test2_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test2_LDADD = $(LIB_TDECORE) +test2_SOURCES = test2main.cpp test2.cpp + +test3_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test3_LDADD = $(LIB_TDECORE) +test3_SOURCES = test3main.cpp test3.cpp + +test4_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test4_LDADD = $(LIB_TDECORE) +test4_SOURCES = test4main.cpp test4.cpp + +test5_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test5_LDADD = $(LIB_TDECORE) +test5_SOURCES = test5main.cpp test5.cpp + +test6_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test6_LDADD = $(LIB_TDECORE) +test6_SOURCES = test6main.cpp test6.cpp + +test7_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test7_LDADD = $(LIB_TDECORE) +test7_SOURCES = test7main.cpp test7.cpp + +test8_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test8_LDADD = $(LIB_TDECORE) +test8_SOURCES = test8main.cpp test8a.cpp test8b.cpp + +test9_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test9_LDADD = $(LIB_TDECORE) +test9_SOURCES = test9main.cpp test9.cpp + +test_dpointer_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +test_dpointer_LDADD = $(LIB_TDECORE) +test_dpointer_SOURCES = test_dpointer_main.cpp test_dpointer.cpp + +check_LTLIBRARIES = tdeunittest_tdeconfigcompiler_test.la + +tdeunittest_tdeconfigcompiler_test_la_SOURCES = tdeconfigcompiler_test.cpp +tdeunittest_tdeconfigcompiler_test_la_LIBADD = \ + $(top_builddir)/tdeunittest/libtdeunittest.la +tdeunittest_tdeconfigcompiler_test_la_LDFLAGS = -module $(KDE_CHECK_PLUGIN) \ + $(all_libraries) + + +test1main.o test1.o: test1.h +# avoid running the below command in parallel +test1.cpp: test1.h +test1.cpp test1.h: $(srcdir)/test1.kcfg ../tdeconfig_compiler $(srcdir)/test1.kcfgc + ../tdeconfig_compiler $(srcdir)/test1.kcfg $(srcdir)/test1.kcfgc + +test2main.o test2.o: test2.h +# avoid running the below command in parallel +test2.cpp: test2.h +test2.cpp test2.h: $(srcdir)/test2.kcfg ../tdeconfig_compiler $(srcdir)/test2.kcfgc + ../tdeconfig_compiler $(srcdir)/test2.kcfg $(srcdir)/test2.kcfgc + +test3main.o test3.o: test3.h +# avoid running the below command in parallel +test3.cpp: test3.h +test3.cpp test3.h: $(srcdir)/test3.kcfg ../tdeconfig_compiler $(srcdir)/test3.kcfgc + ../tdeconfig_compiler $(srcdir)/test3.kcfg $(srcdir)/test3.kcfgc + +test4main.o test4.o: test4.h +# avoid running the below command in parallel +test4.cpp: test4.h +test4.cpp test4.h: $(srcdir)/test4.kcfg ../tdeconfig_compiler $(srcdir)/test4.kcfgc + ../tdeconfig_compiler $(srcdir)/test4.kcfg $(srcdir)/test4.kcfgc + +test5main.o test5.o: test5.h +# avoid running the below command in parallel +test5.cpp: test5.h +test5.cpp test5.h: $(srcdir)/test5.kcfg ../tdeconfig_compiler $(srcdir)/test5.kcfgc + ../tdeconfig_compiler $(srcdir)/test5.kcfg $(srcdir)/test5.kcfgc + +test6main.o test6.o: test6.h +# avoid running the below command in parallel +test6.cpp: test6.h +test6.cpp test6.h: $(srcdir)/test6.kcfg ../tdeconfig_compiler $(srcdir)/test6.kcfgc + ../tdeconfig_compiler $(srcdir)/test6.kcfg $(srcdir)/test6.kcfgc + +test7main.o test7.o: test7.h +# avoid running the below command in parallel +test7.cpp: test7.h +test7.cpp test7.h: $(srcdir)/test7.kcfg ../tdeconfig_compiler $(srcdir)/test7.kcfgc + ../tdeconfig_compiler $(srcdir)/test7.kcfg $(srcdir)/test7.kcfgc + +test8main.o test8a.o test8b.o: test8a.h test8b.h +# avoid running the below command in parallel +test8a.cpp: test8a.h +test8a.cpp test8a.h: $(srcdir)/test8a.kcfg ../tdeconfig_compiler $(srcdir)/test8a.kcfgc + ../tdeconfig_compiler $(srcdir)/test8a.kcfg $(srcdir)/test8a.kcfgc +test8b.cpp: test8b.h +test8b.cpp test8b.h: $(srcdir)/test8b.kcfg ../tdeconfig_compiler $(srcdir)/test8b.kcfgc + ../tdeconfig_compiler $(srcdir)/test8b.kcfg $(srcdir)/test8b.kcfgc + +test9main.o test9.o: test9.h +# avoid running the below command in parallel +test9.cpp: test9.h +test9.cpp test9.h: $(srcdir)/test9.kcfg ../tdeconfig_compiler $(srcdir)/test9.kcfgc + ../tdeconfig_compiler $(srcdir)/test9.kcfg $(srcdir)/test9.kcfgc + +test_dpointer_main.o test_dpointer.o: test_dpointer.h +# avoid running the below command in parallel +test_dpointer.cpp: test_dpointer.h +test_dpointer.cpp test_dpointer.h: $(srcdir)/test_dpointer.kcfg ../tdeconfig_compiler $(srcdir)/test_dpointer.kcfgc + ../tdeconfig_compiler $(srcdir)/test_dpointer.kcfg $(srcdir)/test_dpointer.kcfgc + +md5sums: + $(MD5SUM) $(srcdir)/test*.ref | sed -e "s,$(srcdir)/,,; s,\.ref$$,," > md5sums + +md5check: test1.cpp test2.cpp test3.cpp test4.cpp test5.cpp test6.cpp test7.cpp test8a.cpp test8b.cpp test9.cpp md5sums + $(MD5SUM) -c md5sums + diff --git a/tdecore/tdeconfig_compiler/tests/myprefs.h b/tdecore/tdeconfig_compiler/tests/myprefs.h new file mode 100644 index 000000000..99ea62ec1 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/myprefs.h @@ -0,0 +1,7 @@ +#include + +class MyPrefs : public TDEConfigSkeleton +{ + public: + MyPrefs( const TQString &a ) : TDEConfigSkeleton( a ) {} +}; diff --git a/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp new file mode 100644 index 000000000..e5bb3dcea --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.cpp @@ -0,0 +1,96 @@ +/* + Tests for TDEConfig Compiler + + Copyright (c) 2005 by Duncan Mac-Vicar + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#include +#include +#include +#include +#include "tdeconfigcompiler_test.h" + +using namespace KUnitTest; + +KUNITTEST_MODULE( tdeunittest_tdeconfigcompiler_test, "TDEConfigXT") +KUNITTEST_MODULE_REGISTER_TESTER( TDEConfigCompiler_Test ) + +typedef const char * CompilerTestSet[]; + +static CompilerTestSet testCases = +{ + "test1.cpp", "test1.h", + "test2.cpp", "test2.h", + "test3.cpp", "test3.h", + "test4.cpp", "test4.h", + "test5.cpp", "test5.h", + "test6.cpp", "test6.h", + "test7.cpp", "test7.h", + "test8a.cpp", "test8a.h", + "test8b.cpp", "test8b.h", + "test9.h", "test9.cpp", + "test_dpointer.cpp", "test_dpointer.h", + NULL +}; + +static CompilerTestSet willFailCases = +{ + // where is that TQDir comming from? + //"test9.cpp", NULL + NULL +}; + + +void TDEConfigCompiler_Test::allTests() +{ + testExpectedOutput(); +} + +void TDEConfigCompiler_Test::testExpectedOutput() +{ + uint i = 0; + // Known to pass test cases + while (testCases[ i ]) + { + performCompare(TQString::fromLatin1(testCases[ i ])); + ++i; + } + + // broken test cases + i= 0; + while (willFailCases[ i ]) + { + performCompare(TQString::fromLatin1(willFailCases[ i ]), true); + ++i; + } +} + +void TDEConfigCompiler_Test::performCompare(const TQString &fileName, bool fail) +{ + TQFile file(fileName); + TQFile fileRef(TQString::fromLatin1(SRCDIR) + TQString::fromLatin1("/") + fileName + TQString::fromLatin1(".ref")); + + if ( file.open(IO_ReadOnly) && fileRef.open(IO_ReadOnly) ) + { + TQString content = file.readAll(); + TQString contentRef = fileRef.readAll(); + + if (!fail) + CHECK( content, contentRef); + else + XFAIL( content, contentRef); + } + else + { + SKIP("Can't open file for comparision"); + } +} diff --git a/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.h b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.h new file mode 100644 index 000000000..df3f4cf37 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/tdeconfigcompiler_test.h @@ -0,0 +1,35 @@ +/* + Tests for TDEConfig Compiler + + Copyright (c) 2005 by Duncan Mac-Vicar + + ************************************************************************* + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + ************************************************************************* +*/ + +#ifndef KCONFIGCOMPILER_TEST_H +#define KCONFIGCOMPILER_TEST_H + +#include + +class TQString; + +// change to SlotTester when it works +class TDEConfigCompiler_Test : public KUnitTest::Tester +{ +public: + void allTests(); +public slots: + void testExpectedOutput(); +private: + void performCompare(const TQString &fileName, bool fail=false); +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test1.cpp.ref b/tdecore/tdeconfig_compiler/tests/test1.cpp.ref new file mode 100644 index 000000000..50f084874 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test1.cpp.ref @@ -0,0 +1,72 @@ +// This file is generated by tdeconfig_compiler from test1.kcfg. +// All changes you do to this file will be lost. + +#include "test1.h" + +Test1::Test1( const TQString & transport, const TQString & folder ) + : TDEConfigSkeleton( TQString::fromLatin1( "examplerc" ) ) + , mParamtransport(transport) + , mParamfolder(folder) +{ + setCurrentGroup( TQString::fromLatin1( "General-%1" ).arg( mParamfolder ) ); + + TDEConfigSkeleton::ItemBool *itemOneOption; + itemOneOption = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "OneOption" ), mOneOption, true ); + addItem( itemOneOption, TQString::fromLatin1( "OneOption" ) ); + TDEConfigSkeleton::ItemInt *itemAnotherOption; + itemAnotherOption = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Another Option" ), mAnotherOption, 5 ); + addItem( itemAnotherOption, TQString::fromLatin1( "AnotherOption" ) ); + TQValueList valuesListOption; + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "One" ); + valuesListOption.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Two" ); + valuesListOption.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Three" ); + valuesListOption.append( choice ); + } + TDEConfigSkeleton::ItemEnum *itemListOption; + itemListOption = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "ListOption" ), mListOption, valuesListOption, EnumListOption::One ); + addItem( itemListOption, TQString::fromLatin1( "ListOption" ) ); + + setCurrentGroup( TQString::fromLatin1( "MyOptions" ) ); + + TDEConfigSkeleton::ItemString *itemMyString; + itemMyString = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "MyString" ), mMyString, TQString::fromLatin1( "Default String" ) ); + addItem( itemMyString, TQString::fromLatin1( "MyString" ) ); + TDEConfigSkeleton::ItemPath *itemMyPath; + itemMyPath = new TDEConfigSkeleton::ItemPath( currentGroup(), TQString::fromLatin1( "MyPath" ), mMyPath, TQDir::homeDirPath()+TQString::fromLatin1(".hidden_file") ); + addItem( itemMyPath, TQString::fromLatin1( "MyPath" ) ); + TDEConfigSkeleton::ItemInt *itemAnotherOption2; + itemAnotherOption2 = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Another Option" ), mAnotherOption2, 10 ); + addItem( itemAnotherOption2, TQString::fromLatin1( "AnotherOption2" ) ); + TQStringList defaultMyStringList; + defaultMyStringList.append( TQString::fromUtf8( "up" ) ); + defaultMyStringList.append( TQString::fromUtf8( "down" ) ); + + TDEConfigSkeleton::ItemStringList *itemMyStringList; + itemMyStringList = new TDEConfigSkeleton::ItemStringList( currentGroup(), TQString::fromLatin1( "MyStringList" ), mMyStringList, defaultMyStringList ); + addItem( itemMyStringList, TQString::fromLatin1( "MyStringList" ) ); + TQStringList defaultMyStringListHidden; + defaultMyStringListHidden.append( TQString::fromUtf8( "up" ) ); + defaultMyStringListHidden.append( TQString::fromUtf8( "down" ) ); + + TDEConfigSkeleton::ItemStringList *itemMyStringListHidden; + itemMyStringListHidden = new TDEConfigSkeleton::ItemStringList( currentGroup(), TQString::fromLatin1( "MyStringListHidden" ), mMyStringListHidden, defaultMyStringListHidden ); + addItem( itemMyStringListHidden, TQString::fromLatin1( "MyStringListHidden" ) ); + TDEConfigSkeleton::ItemInt *itemMyNumber; + itemMyNumber = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "List-%1-%2" ).arg( mParamtransport ).arg( mParamfolder ), mMyNumber, 1 ); + addItem( itemMyNumber, TQString::fromLatin1( "MyNumber" ) ); +} + +Test1::~Test1() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test1.h.ref b/tdecore/tdeconfig_compiler/tests/test1.h.ref new file mode 100644 index 000000000..bb74038a5 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test1.h.ref @@ -0,0 +1,196 @@ +// This file is generated by tdeconfig_compiler from test1.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST1_H +#define TEST1_H + +#include +#include + +#include +class Test1 : public TDEConfigSkeleton +{ + public: + class EnumListOption + { + public: + enum type { One, Two, Three, COUNT }; + }; + + Test1( const TQString & transport, const TQString & folder ); + ~Test1(); + + /** + Set One option + */ + void setOneOption( bool v ) + { + if (!isImmutable( TQString::fromLatin1( "OneOption" ) )) + mOneOption = v; + } + + /** + Get One option + */ + bool oneOption() const + { + return mOneOption; + } + + /** + Set Another option + */ + void setAnotherOption( int v ) + { + if (!isImmutable( TQString::fromLatin1( "AnotherOption" ) )) + mAnotherOption = v; + } + + /** + Get Another option + */ + int anotherOption() const + { + return mAnotherOption; + } + + /** + Set This is some funky option + */ + void setListOption( int v ) + { + if (!isImmutable( TQString::fromLatin1( "ListOption" ) )) + mListOption = v; + } + + /** + Get This is some funky option + */ + int listOption() const + { + return mListOption; + } + + /** + Set This is a string + */ + void setMyString( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyString" ) )) + mMyString = v; + } + + /** + Get This is a string + */ + TQString myString() const + { + return mMyString; + } + + /** + Set This is a path + */ + void setMyPath( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyPath" ) )) + mMyPath = v; + } + + /** + Get This is a path + */ + TQString myPath() const + { + return mMyPath; + } + + /** + Set Another option + */ + void setAnotherOption2( int v ) + { + if (!isImmutable( TQString::fromLatin1( "AnotherOption2" ) )) + mAnotherOption2 = v; + } + + /** + Get Another option + */ + int anotherOption2() const + { + return mAnotherOption2; + } + + /** + Set MyStringList + */ + void setMyStringList( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyStringList" ) )) + mMyStringList = v; + } + + /** + Get MyStringList + */ + TQStringList myStringList() const + { + return mMyStringList; + } + + /** + Set MyStringListHidden + */ + void setMyStringListHidden( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyStringListHidden" ) )) + mMyStringListHidden = v; + } + + /** + Get MyStringListHidden + */ + TQStringList myStringListHidden() const + { + return mMyStringListHidden; + } + + /** + Set List Number + */ + void setMyNumber( int v ) + { + if (!isImmutable( TQString::fromLatin1( "MyNumber" ) )) + mMyNumber = v; + } + + /** + Get List Number + */ + int myNumber() const + { + return mMyNumber; + } + + protected: + TQString mParamtransport; + TQString mParamfolder; + + // General-$(folder) + bool mOneOption; + int mAnotherOption; + int mListOption; + + // MyOptions + TQString mMyString; + TQString mMyPath; + int mAnotherOption2; + TQStringList mMyStringList; + TQStringList mMyStringListHidden; + int mMyNumber; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test1.kcfg b/tdecore/tdeconfig_compiler/tests/test1.kcfg new file mode 100644 index 000000000..ce42aebfb --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test1.kcfg @@ -0,0 +1,55 @@ + + + qdir.h + + + + + + + + true + + + + 5 + + + + And this is a longer description of this option. Just wondering, how will the translations of those be handled? + + + + + + One + + + + + + Default String + + + + QDir::homeDirPath()+QString::fromLatin1(".hidden_file") + + + + 10 + + + up,down + + + + + 1 + + + diff --git a/tdecore/tdeconfig_compiler/tests/test1.kcfgc b/tdecore/tdeconfig_compiler/tests/test1.kcfgc new file mode 100644 index 000000000..dd086cdda --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test1.kcfgc @@ -0,0 +1,18 @@ +# Code generation options for tdeconfig_compiler +ClassName=Test1 +# +# Singleton=false +# +# Inherits=TDEConfigSkeleton +# +# IncludeFiles=libtdepim/kpimprefs.h +# +# MemberVariables=public +# +### The following line includes the file exampleprefs_base_addon.h +### It can be used to add extra functions and variables to the +### class. +# CustomAdditions=true +# +### Provide setFooBar(int) style functions +Mutators=true diff --git a/tdecore/tdeconfig_compiler/tests/test1main.cpp b/tdecore/tdeconfig_compiler/tests/test1main.cpp new file mode 100644 index 000000000..79546639f --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test1main.cpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2003 Cornelius Schumacher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#include "test1.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test1 *t = new Test1( TQString::null, TQString::null ); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test2.cpp.ref b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref new file mode 100644 index 000000000..cc3f67b5e --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref @@ -0,0 +1,98 @@ +// This file is generated by tdeconfig_compiler from test2.kcfg. +// All changes you do to this file will be lost. + +#include "test2.h" + +#include + +Test2::Test2( ) + : MyPrefs( TQString::fromLatin1( "korganizerrc" ) ) +{ + setCurrentGroup( TQString::fromLatin1( "General" ) ); + + mAutoSaveItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Auto Save" ), mAutoSave, false ); + mAutoSaveItem->setLabel( i18n("Enable automatic saving of calendar") ); + mAutoSaveItem->setWhatsThis( i18n("WhatsThis text for AutoSave option") ); + addItem( mAutoSaveItem, TQString::fromLatin1( "AutoSave" ) ); + mAutoSaveIntervalItem = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Auto Save Interval" ), mAutoSaveInterval, 10 ); + mAutoSaveIntervalItem->setLabel( i18n("Auto Save Interval") ); + addItem( mAutoSaveIntervalItem, TQString::fromLatin1( "AutoSaveInterval" ) ); + mConfirmItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Confirm Deletes" ), mConfirm, true ); + mConfirmItem->setLabel( i18n("Confirm deletes") ); + addItem( mConfirmItem, TQString::fromLatin1( "Confirm" ) ); + mArchiveFileItem = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Archive File" ), mArchiveFile ); + mArchiveFileItem->setLabel( i18n("Archive File") ); + addItem( mArchiveFileItem, TQString::fromLatin1( "ArchiveFile" ) ); + TQValueList valuesDestination; + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "standardDestination" ); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "askDestination" ); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl1" ); + choice.label = i18n("Argl1 Label"); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl2" ); + choice.whatsThis = i18n("Argl2 Whatsthis"); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl3" ); + choice.label = i18n("Argl3 Label"); + choice.whatsThis = i18n("Argl3 Whatsthis"); + valuesDestination.append( choice ); + } + mDestinationItem = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "Destination" ), mDestination, valuesDestination, standardDestination ); + mDestinationItem->setLabel( i18n("New Events/Todos Should") ); + addItem( mDestinationItem, TQString::fromLatin1( "Destination" ) ); + + setCurrentGroup( TQString::fromLatin1( "Views" ) ); + + mHourSizeItem = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Hour Size" ), mHourSize, 10 ); + mHourSizeItem->setLabel( i18n("Hour Size") ); + addItem( mHourSizeItem, TQString::fromLatin1( "HourSize" ) ); + mSelectionStartsEditorItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "SelectionStartsEditor" ), mSelectionStartsEditor, false ); + mSelectionStartsEditorItem->setLabel( i18n("Time range selection in agenda view starts event editor") ); + addItem( mSelectionStartsEditorItem, TQString::fromLatin1( "SelectionStartsEditor" ) ); + + setCurrentGroup( TQString::fromLatin1( "KOrganizer Plugins" ) ); + + TQStringList defaultSelectedPlugins; + defaultSelectedPlugins.append( TQString::fromUtf8( "holidays" ) ); + defaultSelectedPlugins.append( TQString::fromUtf8( "webexport" ) ); + + mSelectedPluginsItem = new TDEConfigSkeleton::ItemStringList( currentGroup(), TQString::fromLatin1( "SelectedPlugins" ), mSelectedPlugins, defaultSelectedPlugins ); + mSelectedPluginsItem->setLabel( i18n("SelectedPlugins") ); + addItem( mSelectedPluginsItem, TQString::fromLatin1( "SelectedPlugins" ) ); + + setCurrentGroup( TQString::fromLatin1( "Colors" ) ); + + mHighlightColorItem = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Highlight Color" ), mHighlightColor, TQColor( 100, 100, 255 ) ); + mHighlightColorItem->setLabel( i18n("Highlight color") ); + addItem( mHighlightColorItem, TQString::fromLatin1( "HighlightColor" ) ); + mAgendaBgColorItem = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Agenda Background Color" ), mAgendaBgColor, TQColor( 255, 255, 255 ) ); + mAgendaBgColorItem->setLabel( i18n("Agenda view background color") ); + addItem( mAgendaBgColorItem, TQString::fromLatin1( "AgendaBgColor" ) ); + + setCurrentGroup( TQString::fromLatin1( "Fonts" ) ); + + mTimeBarFontItem = new TDEConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "TimeBar Font" ), mTimeBarFont ); + mTimeBarFontItem->setLabel( i18n("Time bar") ); + addItem( mTimeBarFontItem, TQString::fromLatin1( "TimeBarFont" ) ); +} + +Test2::~Test2() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test2.h.ref b/tdecore/tdeconfig_compiler/tests/test2.h.ref new file mode 100644 index 000000000..47895ccaf --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test2.h.ref @@ -0,0 +1,333 @@ +// This file is generated by tdeconfig_compiler from test2.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST2_H +#define TEST2_H + +#include + +#include +#include + +class Test2 : public MyPrefs +{ + public: + enum { standardDestination, askDestination, argl1, argl2, argl3 }; + + Test2( ); + ~Test2(); + + /** + Set Enable automatic saving of calendar + */ + void setAutoSave( bool v ) + { + if (!isImmutable( TQString::fromLatin1( "AutoSave" ) )) + mAutoSave = v; + } + + /** + Get Enable automatic saving of calendar + */ + bool autoSave() const + { + return mAutoSave; + } + + /** + Get Item object corresponding to AutoSave() + */ + ItemBool *autoSaveItem() + { + return mAutoSaveItem; + } + + /** + Set Auto Save Interval + */ + void setAutoSaveInterval( int v ) + { + if (!isImmutable( TQString::fromLatin1( "AutoSaveInterval" ) )) + mAutoSaveInterval = v; + } + + /** + Get Auto Save Interval + */ + int autoSaveInterval() const + { + return mAutoSaveInterval; + } + + /** + Get Item object corresponding to AutoSaveInterval() + */ + ItemInt *autoSaveIntervalItem() + { + return mAutoSaveIntervalItem; + } + + /** + Set Confirm deletes + */ + void setConfirm( bool v ) + { + if (!isImmutable( TQString::fromLatin1( "Confirm" ) )) + mConfirm = v; + } + + /** + Get Confirm deletes + */ + bool confirm() const + { + return mConfirm; + } + + /** + Get Item object corresponding to Confirm() + */ + ItemBool *confirmItem() + { + return mConfirmItem; + } + + /** + Set Archive File + */ + void setArchiveFile( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "ArchiveFile" ) )) + mArchiveFile = v; + } + + /** + Get Archive File + */ + TQString archiveFile() const + { + return mArchiveFile; + } + + /** + Get Item object corresponding to ArchiveFile() + */ + ItemString *archiveFileItem() + { + return mArchiveFileItem; + } + + /** + Set New Events/Todos Should + */ + void setDestination( int v ) + { + if (!isImmutable( TQString::fromLatin1( "Destination" ) )) + mDestination = v; + } + + /** + Get New Events/Todos Should + */ + int destination() const + { + return mDestination; + } + + /** + Get Item object corresponding to Destination() + */ + ItemEnum *destinationItem() + { + return mDestinationItem; + } + + /** + Set Hour Size + */ + void setHourSize( int v ) + { + if (!isImmutable( TQString::fromLatin1( "HourSize" ) )) + mHourSize = v; + } + + /** + Get Hour Size + */ + int hourSize() const + { + return mHourSize; + } + + /** + Get Item object corresponding to HourSize() + */ + ItemInt *hourSizeItem() + { + return mHourSizeItem; + } + + /** + Set Time range selection in agenda view starts event editor + */ + void setSelectionStartsEditor( bool v ) + { + if (!isImmutable( TQString::fromLatin1( "SelectionStartsEditor" ) )) + mSelectionStartsEditor = v; + } + + /** + Get Time range selection in agenda view starts event editor + */ + bool selectionStartsEditor() const + { + return mSelectionStartsEditor; + } + + /** + Get Item object corresponding to SelectionStartsEditor() + */ + ItemBool *selectionStartsEditorItem() + { + return mSelectionStartsEditorItem; + } + + /** + Set SelectedPlugins + */ + void setSelectedPlugins( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "SelectedPlugins" ) )) + mSelectedPlugins = v; + } + + /** + Get SelectedPlugins + */ + TQStringList selectedPlugins() const + { + return mSelectedPlugins; + } + + /** + Get Item object corresponding to SelectedPlugins() + */ + ItemStringList *selectedPluginsItem() + { + return mSelectedPluginsItem; + } + + /** + Set Highlight color + */ + void setHighlightColor( const TQColor & v ) + { + if (!isImmutable( TQString::fromLatin1( "HighlightColor" ) )) + mHighlightColor = v; + } + + /** + Get Highlight color + */ + TQColor highlightColor() const + { + return mHighlightColor; + } + + /** + Get Item object corresponding to HighlightColor() + */ + ItemColor *highlightColorItem() + { + return mHighlightColorItem; + } + + /** + Set Agenda view background color + */ + void setAgendaBgColor( const TQColor & v ) + { + if (!isImmutable( TQString::fromLatin1( "AgendaBgColor" ) )) + mAgendaBgColor = v; + } + + /** + Get Agenda view background color + */ + TQColor agendaBgColor() const + { + return mAgendaBgColor; + } + + /** + Get Item object corresponding to AgendaBgColor() + */ + ItemColor *agendaBgColorItem() + { + return mAgendaBgColorItem; + } + + /** + Set Time bar + */ + void setTimeBarFont( const TQFont & v ) + { + if (!isImmutable( TQString::fromLatin1( "TimeBarFont" ) )) + mTimeBarFont = v; + } + + /** + Get Time bar + */ + TQFont timeBarFont() const + { + return mTimeBarFont; + } + + /** + Get Item object corresponding to TimeBarFont() + */ + ItemFont *timeBarFontItem() + { + return mTimeBarFontItem; + } + + protected: + public: + + // General + bool mAutoSave; + int mAutoSaveInterval; + bool mConfirm; + TQString mArchiveFile; + int mDestination; + + // Views + int mHourSize; + bool mSelectionStartsEditor; + + // KOrganizer Plugins + TQStringList mSelectedPlugins; + + // Colors + TQColor mHighlightColor; + TQColor mAgendaBgColor; + + // Fonts + TQFont mTimeBarFont; + + private: + ItemBool *mAutoSaveItem; + ItemInt *mAutoSaveIntervalItem; + ItemBool *mConfirmItem; + ItemString *mArchiveFileItem; + ItemEnum *mDestinationItem; + ItemInt *mHourSizeItem; + ItemBool *mSelectionStartsEditorItem; + ItemStringList *mSelectedPluginsItem; + ItemColor *mHighlightColorItem; + ItemColor *mAgendaBgColorItem; + ItemFont *mTimeBarFontItem; +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test2.kcfg b/tdecore/tdeconfig_compiler/tests/test2.kcfg new file mode 100644 index 000000000..3b19e270e --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test2.kcfg @@ -0,0 +1,78 @@ + + + + + + + + WhatsThis text for AutoSave option + false + + + 10 + + + + true + + + + + + + + + + + + + + + Argl2 Whatsthis + + + + Argl3 Whatsthis + + + standardDestination + + + + + + 10 + + + + false + + + + + + holidays,webexport + + + + + + + 100, 100, 255 + + + + 255, 255, 255 + + + + + + + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test2.kcfgc b/tdecore/tdeconfig_compiler/tests/test2.kcfgc new file mode 100644 index 000000000..e29040686 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test2.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test2.kcfg +ClassName=Test2 +Singleton=false +Mutators=true +Inherits=MyPrefs +IncludeFiles=myprefs.h +MemberVariables=public +GlobalEnums=true +ItemAccessors=true +SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test2main.cpp b/tdecore/tdeconfig_compiler/tests/test2main.cpp new file mode 100644 index 000000000..5970bf03d --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test2main.cpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2003 Cornelius Schumacher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#include "test2.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test2 *t = new Test2(); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test3.cpp.ref b/tdecore/tdeconfig_compiler/tests/test3.cpp.ref new file mode 100644 index 000000000..be3e5c6c1 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test3.cpp.ref @@ -0,0 +1,29 @@ +// This file is generated by tdeconfig_compiler from test3.kcfg. +// All changes you do to this file will be lost. + +#include "test3.h" + +using namespace TestNameSpace; + +Test3::Test3( ) + : TDEConfigSkeleton( TQString::fromLatin1( "test3rc" ) ) +{ + setCurrentGroup( TQString::fromLatin1( "General" ) ); + + mAutoSaveItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Auto Save" ), mAutoSave, false ); + addItem( mAutoSaveItem, TQString::fromLatin1( "AutoSave" ) ); + + setCurrentGroup( TQString::fromLatin1( "Blah" ) ); + + mBlubbItem = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Blubb" ), mBlubb, 10 ); + addItem( mBlubbItem, TQString::fromLatin1( "Blubb" ) ); + mBlahBlahItem = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "BlahBlah" ), mBlahBlah, TQString::fromLatin1( "a string" ) ); + addItem( mBlahBlahItem, TQString::fromLatin1( "BlahBlah" ) ); + mMyPasswordItem = new TDEConfigSkeleton::ItemPassword( currentGroup(), TQString::fromLatin1( "MyPassword" ), mMyPassword ); + addItem( mMyPasswordItem, TQString::fromLatin1( "MyPassword" ) ); +} + +Test3::~Test3() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test3.h.ref b/tdecore/tdeconfig_compiler/tests/test3.h.ref new file mode 100644 index 000000000..596e154e4 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test3.h.ref @@ -0,0 +1,138 @@ +// This file is generated by tdeconfig_compiler from test3.kcfg. +// All changes you do to this file will be lost. +#ifndef TESTNAMESPACE_TEST3_H +#define TESTNAMESPACE_TEST3_H + +#include +#include + +namespace TestNameSpace { + +class Test3 : public TDEConfigSkeleton +{ + public: + + Test3( ); + ~Test3(); + + /** + Set Enable automatic saving of calendar + */ + void setAutoSave( bool v ) + { + if (!isImmutable( TQString::fromLatin1( "AutoSave" ) )) + mAutoSave = v; + } + + /** + Get Enable automatic saving of calendar + */ + bool autoSave() const + { + return mAutoSave; + } + + /** + Get Item object corresponding to AutoSave() + */ + ItemBool *autoSaveItem() + { + return mAutoSaveItem; + } + + /** + Set Blubb + */ + void setBlubb( int v ) + { + if (!isImmutable( TQString::fromLatin1( "Blubb" ) )) + mBlubb = v; + } + + /** + Get Blubb + */ + int blubb() const + { + return mBlubb; + } + + /** + Get Item object corresponding to Blubb() + */ + ItemInt *blubbItem() + { + return mBlubbItem; + } + + /** + Set BlahBlah + */ + void setBlahBlah( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "BlahBlah" ) )) + mBlahBlah = v; + } + + /** + Get BlahBlah + */ + TQString blahBlah() const + { + return mBlahBlah; + } + + /** + Get Item object corresponding to BlahBlah() + */ + ItemString *blahBlahItem() + { + return mBlahBlahItem; + } + + /** + Set MyPassword + */ + void setMyPassword( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyPassword" ) )) + mMyPassword = v; + } + + /** + Get MyPassword + */ + TQString myPassword() const + { + return mMyPassword; + } + + /** + Get Item object corresponding to MyPassword() + */ + ItemPassword *myPasswordItem() + { + return mMyPasswordItem; + } + + protected: + + // General + bool mAutoSave; + + // Blah + int mBlubb; + TQString mBlahBlah; + TQString mMyPassword; + + private: + ItemBool *mAutoSaveItem; + ItemInt *mBlubbItem; + ItemString *mBlahBlahItem; + ItemPassword *mMyPasswordItem; +}; + +} + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test3.kcfg b/tdecore/tdeconfig_compiler/tests/test3.kcfg new file mode 100644 index 000000000..77916da40 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test3.kcfg @@ -0,0 +1,26 @@ + + + + + + + + WhatsThis text for AutoSave option + false + + + + + + 10 + + + a string + + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test3.kcfgc b/tdecore/tdeconfig_compiler/tests/test3.kcfgc new file mode 100644 index 000000000..d699810d0 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test3.kcfgc @@ -0,0 +1,12 @@ +# Code generation options for tdeconfig_compiler +File=test3.kcfg +NameSpace=TestNameSpace +ClassName=Test3 +#Singleton=false +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +#MemberVariables=public +GlobalEnums=true +ItemAccessors=true +#SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test3main.cpp b/tdecore/tdeconfig_compiler/tests/test3main.cpp new file mode 100644 index 000000000..f73ae38e3 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test3main.cpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2003 Cornelius Schumacher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#include "test3.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + TestNameSpace::Test3 *t = new TestNameSpace::Test3(); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test4.cpp.ref b/tdecore/tdeconfig_compiler/tests/test4.cpp.ref new file mode 100644 index 000000000..c68437969 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test4.cpp.ref @@ -0,0 +1,82 @@ +// This file is generated by tdeconfig_compiler from test4.kcfg. +// All changes you do to this file will be lost. + +#include "test4.h" + +#include + +Test4 *Test4::mSelf = 0; +static KStaticDeleter staticTest4Deleter; + +Test4 *Test4::self() +{ + if ( !mSelf ) { + staticTest4Deleter.setObject( mSelf, new Test4() ); + mSelf->readConfig(); + } + + return mSelf; +} + +const char* const Test4::EnumButton::enumToString[] = { "right", "mid", "left" }; + +Test4::Test4( ) + : TDEConfigSkeleton( TQString::fromLatin1( "test4rc" ) ) +{ + mSelf = this; + setCurrentGroup( TQString::fromLatin1( "Foo" ) ); + +TQColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; + TDEConfigSkeleton::ItemColor *itemColor[4]; + itemColor[0] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #0" ), mColor[0], defaultColor[0] ); + addItem( itemColor[0], TQString::fromLatin1( "Color0" ) ); + itemColor[1] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #1" ), mColor[1], defaultColor[1] ); + addItem( itemColor[1], TQString::fromLatin1( "Color1" ) ); + itemColor[2] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #2" ), mColor[2], defaultColor[2] ); + addItem( itemColor[2], TQString::fromLatin1( "Color2" ) ); + itemColor[3] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #3" ), mColor[3], defaultColor[3] ); + addItem( itemColor[3], TQString::fromLatin1( "Color3" ) ); + TQValueList valuesMouseAction; + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Encrypt" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Decrypt" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "CrashNBurn" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "PumpNDump" ); + valuesMouseAction.append( choice ); + } + TDEConfigSkeleton::ItemEnum *itemMouseAction[3]; + itemMouseAction[0] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, EnumMouseAction::Decrypt ); + addItem( itemMouseAction[0], TQString::fromLatin1( "MouseActionright" ) ); + itemMouseAction[1] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, EnumMouseAction::Encrypt ); + addItem( itemMouseAction[1], TQString::fromLatin1( "MouseActionmid" ) ); + itemMouseAction[2] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, EnumMouseAction::PumpNDump ); + addItem( itemMouseAction[2], TQString::fromLatin1( "MouseActionleft" ) ); + TDEConfigSkeleton::ItemString *itemFooBar; + itemFooBar = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "foo bar" ), mFooBar ); + addItem( itemFooBar, TQString::fromLatin1( "FooBar" ) ); + TDEConfigSkeleton::ItemInt *itemAge; + itemAge = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Age" ), mAge, 35 ); + itemAge->setMinValue(8); + itemAge->setMaxValue(88); + addItem( itemAge, TQString::fromLatin1( "Age" ) ); +} + +Test4::~Test4() +{ + if ( mSelf == this ) + staticTest4Deleter.setObject( mSelf, 0, false ); +} + diff --git a/tdecore/tdeconfig_compiler/tests/test4.h.ref b/tdecore/tdeconfig_compiler/tests/test4.h.ref new file mode 100644 index 000000000..9901a4208 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test4.h.ref @@ -0,0 +1,135 @@ +// This file is generated by tdeconfig_compiler from test4.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST4_H +#define TEST4_H + +#include +#include + +class Test4 : public TDEConfigSkeleton +{ + public: + class EnumMouseAction + { + public: + enum type { Encrypt, Decrypt, CrashNBurn, PumpNDump, COUNT }; + }; + class EnumButton + { + public: + enum type { right, mid, left, COUNT }; + static const char* const enumToString[]; + }; + + static Test4 *self(); + ~Test4(); + + /** + Set Block colors. + */ + static + void setColor( int i, const TQColor & v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "Color%1" ).arg( i ) )) + self()->mColor[i] = v; + } + + /** + Get Block colors. + */ + static + TQColor color( int i ) + { + return self()->mColor[i]; + } + + /** + Set Mouse actions. + */ + static + void setMouseAction( int i, int v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "MouseAction%1" ).arg( TQString::fromLatin1( EnumButton::enumToString[i] ) ) )) + self()->mMouseAction[i] = v; + } + + /** + Get Mouse actions. + */ + static + int mouseAction( int i ) + { + return self()->mMouseAction[i]; + } + + /** + Set foo bar + */ + static + void setFooBar( const TQString & v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "FooBar" ) )) + self()->mFooBar = v; + } + + /** + Get foo bar + */ + static + TQString fooBar() + { + return self()->mFooBar; + } + + /** + Set Age + */ + static + void setAge( int v ) + { + if (v < 8) + { + kdDebug() << "setAge: value " << v << " is less than the minimum value of 8" << endl; + v = 8; + } + + if (v > 88) + { + kdDebug() << "setAge: value " << v << " is greater than the maximum value of 88" << endl; + v = 88; + } + + if (!self()->isImmutable( TQString::fromLatin1( "Age" ) )) + self()->mAge = v; + } + + /** + Get Age + */ + static + int age() + { + return self()->mAge; + } + + static + void writeConfig() + { + static_cast(self())->writeConfig(); + } + protected: + Test4(); + static Test4 *mSelf; + + + // Foo + TQColor mColor[4]; + int mMouseAction[3]; + TQString mFooBar; + int mAge; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test4.kcfg b/tdecore/tdeconfig_compiler/tests/test4.kcfg new file mode 100644 index 000000000..d8ef2bfae --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test4.kcfg @@ -0,0 +1,42 @@ + + + + + + + + + QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; + defaultColor[$(Number)] + + + + + right + mid + left + + + + + + + + + + Decrypt + Encrypt + PumpNDump + + + + 35 + 8 + 88 + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test4.kcfgc b/tdecore/tdeconfig_compiler/tests/test4.kcfgc new file mode 100644 index 000000000..a81655b6c --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test4.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test4.kcfg +ClassName=Test4 +Singleton=true +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +#MemberVariables=public +GlobalEnums=false +ItemAccessors=false +#SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test4main.cpp b/tdecore/tdeconfig_compiler/tests/test4main.cpp new file mode 100644 index 000000000..5229d8a87 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test4main.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2003,2004 Waldo Bastian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test4.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test4 *t = Test4::self(); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test5.cpp.ref b/tdecore/tdeconfig_compiler/tests/test5.cpp.ref new file mode 100644 index 000000000..17965999b --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test5.cpp.ref @@ -0,0 +1,82 @@ +// This file is generated by tdeconfig_compiler from test5.kcfg. +// All changes you do to this file will be lost. + +#include "test5.h" + +#include + +Test5 *Test5::mSelf = 0; +static KStaticDeleter staticTest5Deleter; + +Test5 *Test5::self() +{ + if ( !mSelf ) { + staticTest5Deleter.setObject( mSelf, new Test5() ); + mSelf->readConfig(); + } + + return mSelf; +} + +const char* const Test5::EnumButtonToString[] = { "right", "mid", "left" }; + +Test5::Test5( ) + : TDEConfigSkeleton( TQString::fromLatin1( "test4rc" ) ) +{ + mSelf = this; + setCurrentGroup( TQString::fromLatin1( "Foo" ) ); + +TQColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; + TDEConfigSkeleton::ItemColor *itemColor[4]; + itemColor[0] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #0" ), mColor[0], defaultColor[0] ); + addItem( itemColor[0], TQString::fromLatin1( "Color0" ) ); + itemColor[1] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #1" ), mColor[1], defaultColor[1] ); + addItem( itemColor[1], TQString::fromLatin1( "Color1" ) ); + itemColor[2] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #2" ), mColor[2], defaultColor[2] ); + addItem( itemColor[2], TQString::fromLatin1( "Color2" ) ); + itemColor[3] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #3" ), mColor[3], defaultColor[3] ); + addItem( itemColor[3], TQString::fromLatin1( "Color3" ) ); + TQValueList valuesMouseAction; + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Encrypt" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "Decrypt" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "CrashNBurn" ); + valuesMouseAction.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "PumpNDump" ); + valuesMouseAction.append( choice ); + } + TDEConfigSkeleton::ItemEnum *itemMouseAction[3]; + itemMouseAction[0] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, Decrypt ); + addItem( itemMouseAction[0], TQString::fromLatin1( "MouseActionright" ) ); + itemMouseAction[1] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, Encrypt ); + addItem( itemMouseAction[1], TQString::fromLatin1( "MouseActionmid" ) ); + itemMouseAction[2] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, PumpNDump ); + addItem( itemMouseAction[2], TQString::fromLatin1( "MouseActionleft" ) ); + TDEConfigSkeleton::ItemString *itemFooBar; + itemFooBar = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "foo bar" ), mFooBar ); + addItem( itemFooBar, TQString::fromLatin1( "FooBar" ) ); + TDEConfigSkeleton::ItemInt *itemAge; + itemAge = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Age" ), mAge, 35 ); + itemAge->setMinValue(8); + itemAge->setMaxValue(88); + addItem( itemAge, TQString::fromLatin1( "Age" ) ); +} + +Test5::~Test5() +{ + if ( mSelf == this ) + staticTest5Deleter.setObject( mSelf, 0, false ); +} + diff --git a/tdecore/tdeconfig_compiler/tests/test5.h.ref b/tdecore/tdeconfig_compiler/tests/test5.h.ref new file mode 100644 index 000000000..e2f1f8118 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test5.h.ref @@ -0,0 +1,127 @@ +// This file is generated by tdeconfig_compiler from test5.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST5_H +#define TEST5_H + +#include +#include + +class Test5 : public TDEConfigSkeleton +{ + public: + enum { Encrypt, Decrypt, CrashNBurn, PumpNDump }; + enum { right, mid, left }; + static const char* const EnumButtonToString[]; + + static Test5 *self(); + ~Test5(); + + /** + Set Block colors. + */ + static + void setColor( int i, const TQColor & v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "Color%1" ).arg( i ) )) + self()->mColor[i] = v; + } + + /** + Get Block colors. + */ + static + TQColor color( int i ) + { + return self()->mColor[i]; + } + + /** + Set Mouse actions. + */ + static + void setMouseAction( int i, int v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "MouseAction%1" ).arg( TQString::fromLatin1( EnumButtonToString[i] ) ) )) + self()->mMouseAction[i] = v; + } + + /** + Get Mouse actions. + */ + static + int mouseAction( int i ) + { + return self()->mMouseAction[i]; + } + + /** + Set foo bar + */ + static + void setFooBar( const TQString & v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "FooBar" ) )) + self()->mFooBar = v; + } + + /** + Get foo bar + */ + static + TQString fooBar() + { + return self()->mFooBar; + } + + /** + Set Age + */ + static + void setAge( int v ) + { + if (v < 8) + { + kdDebug() << "setAge: value " << v << " is less than the minimum value of 8" << endl; + v = 8; + } + + if (v > 88) + { + kdDebug() << "setAge: value " << v << " is greater than the maximum value of 88" << endl; + v = 88; + } + + if (!self()->isImmutable( TQString::fromLatin1( "Age" ) )) + self()->mAge = v; + } + + /** + Get Age + */ + static + int age() + { + return self()->mAge; + } + + static + void writeConfig() + { + static_cast(self())->writeConfig(); + } + protected: + Test5(); + static Test5 *mSelf; + + + // Foo + TQColor mColor[4]; + int mMouseAction[3]; + TQString mFooBar; + int mAge; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test5.kcfg b/tdecore/tdeconfig_compiler/tests/test5.kcfg new file mode 100644 index 000000000..d8ef2bfae --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test5.kcfg @@ -0,0 +1,42 @@ + + + + + + + + + QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; + defaultColor[$(Number)] + + + + + right + mid + left + + + + + + + + + + Decrypt + Encrypt + PumpNDump + + + + 35 + 8 + 88 + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test5.kcfgc b/tdecore/tdeconfig_compiler/tests/test5.kcfgc new file mode 100644 index 000000000..dbc5603a0 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test5.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test5.kcfg +ClassName=Test5 +Singleton=true +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +#MemberVariables=public +GlobalEnums=true +ItemAccessors=false +#SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test5main.cpp b/tdecore/tdeconfig_compiler/tests/test5main.cpp new file mode 100644 index 000000000..89f28587f --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test5main.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2004 Waldo Bastian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test5.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test5 *t = Test5::self(); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test6.cpp.ref b/tdecore/tdeconfig_compiler/tests/test6.cpp.ref new file mode 100644 index 000000000..36717a7c8 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test6.cpp.ref @@ -0,0 +1,31 @@ +// This file is generated by tdeconfig_compiler from test6.kcfg. +// All changes you do to this file will be lost. + +#include "test6.h" + +Test6::Test6( const TQString & Number ) + : TDEConfigSkeleton( TQString::fromLatin1( "test4rc" ) ) + , mParamNumber(Number) +{ + setCurrentGroup( TQString::fromLatin1( "Foo" ) ); + + TDEConfigSkeleton::ItemColor *itemColor; + itemColor = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #%1" ).arg( mParamNumber ), mColor, TQColor( "red" ) ); + addItem( itemColor, TQString::fromLatin1( "Color" ) ); + + setCurrentGroup( TQString::fromLatin1( "Bar%1" ).arg( mParamNumber ) ); + + TDEConfigSkeleton::ItemString *itemFooBar; + itemFooBar = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "foo bar" ), mFooBar ); + addItem( itemFooBar, TQString::fromLatin1( "FooBar" ) ); + TDEConfigSkeleton::ItemInt *itemAge; + itemAge = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Age" ), mAge, 35 ); + itemAge->setMinValue(8); + itemAge->setMaxValue(88); + addItem( itemAge, TQString::fromLatin1( "Age" ) ); +} + +Test6::~Test6() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test6.h.ref b/tdecore/tdeconfig_compiler/tests/test6.h.ref new file mode 100644 index 000000000..da83c90c4 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test6.h.ref @@ -0,0 +1,93 @@ +// This file is generated by tdeconfig_compiler from test6.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST6_H +#define TEST6_H + +#include +#include + +class Test6 : public TDEConfigSkeleton +{ + public: + + Test6( const TQString & Number ); + ~Test6(); + + /** + Set Block colors. + */ + void setColor( const TQColor & v ) + { + if (!isImmutable( TQString::fromLatin1( "Color" ) )) + mColor = v; + } + + /** + Get Block colors. + */ + TQColor color() const + { + return mColor; + } + + /** + Set foo bar + */ + void setFooBar( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "FooBar" ) )) + mFooBar = v; + } + + /** + Get foo bar + */ + TQString fooBar() const + { + return mFooBar; + } + + /** + Set Age + */ + void setAge( int v ) + { + if (v < 8) + { + kdDebug() << "setAge: value " << v << " is less than the minimum value of 8" << endl; + v = 8; + } + + if (v > 88) + { + kdDebug() << "setAge: value " << v << " is greater than the maximum value of 88" << endl; + v = 88; + } + + if (!isImmutable( TQString::fromLatin1( "Age" ) )) + mAge = v; + } + + /** + Get Age + */ + int age() const + { + return mAge; + } + + protected: + TQString mParamNumber; + + // Foo + TQColor mColor; + + // Bar$(Number) + TQString mFooBar; + int mAge; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test6.kcfg b/tdecore/tdeconfig_compiler/tests/test6.kcfg new file mode 100644 index 000000000..e59fa88f3 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test6.kcfg @@ -0,0 +1,25 @@ + + + + + + + + + + red + + + + + + 35 + 8 + 88 + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test6.kcfgc b/tdecore/tdeconfig_compiler/tests/test6.kcfgc new file mode 100644 index 000000000..4c395ac08 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test6.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test6.kcfg +ClassName=Test6 +Singleton=false +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +#MemberVariables=public +GlobalEnums=true +ItemAccessors=false +#SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test6main.cpp b/tdecore/tdeconfig_compiler/tests/test6main.cpp new file mode 100644 index 000000000..9b1b7503e --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test6main.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2004 Waldo Bastian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test6.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test6 *t = new Test6(TQString::null); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test7.cpp.ref b/tdecore/tdeconfig_compiler/tests/test7.cpp.ref new file mode 100644 index 000000000..e4b5f08f9 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test7.cpp.ref @@ -0,0 +1,31 @@ +// This file is generated by tdeconfig_compiler from test7.kcfg. +// All changes you do to this file will be lost. + +#include "test7.h" + +Test7::Test7( int Number ) + : TDEConfigSkeleton( TQString::fromLatin1( "test7rc" ) ) + , mParamNumber(Number) +{ + setCurrentGroup( TQString::fromLatin1( "Foo" ) ); + + TDEConfigSkeleton::ItemColor *itemColor; + itemColor = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #%1" ).arg( mParamNumber ), mColor, TQColor( "red" ) ); + addItem( itemColor, TQString::fromLatin1( "Color" ) ); + + setCurrentGroup( TQString::fromLatin1( "Bar%1" ).arg( mParamNumber ) ); + + TDEConfigSkeleton::ItemString *itemFooBar; + itemFooBar = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "foo bar" ), mFooBar ); + addItem( itemFooBar, TQString::fromLatin1( "FooBar" ) ); + TDEConfigSkeleton::ItemInt *itemAge; + itemAge = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Age" ), mAge, 35 ); + itemAge->setMinValue(8); + itemAge->setMaxValue(88); + addItem( itemAge, TQString::fromLatin1( "Age" ) ); +} + +Test7::~Test7() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test7.h.ref b/tdecore/tdeconfig_compiler/tests/test7.h.ref new file mode 100644 index 000000000..8bd22ae97 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test7.h.ref @@ -0,0 +1,93 @@ +// This file is generated by tdeconfig_compiler from test7.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST7_H +#define TEST7_H + +#include +#include + +class Test7 : public TDEConfigSkeleton +{ + public: + + Test7( int Number ); + ~Test7(); + + /** + Set Block colors. + */ + void setColor( const TQColor & v ) + { + if (!isImmutable( TQString::fromLatin1( "Color" ) )) + mColor = v; + } + + /** + Get Block colors. + */ + TQColor color() const + { + return mColor; + } + + /** + Set foo bar + */ + void setFooBar( const TQString & v ) + { + if (!isImmutable( TQString::fromLatin1( "FooBar" ) )) + mFooBar = v; + } + + /** + Get foo bar + */ + TQString fooBar() const + { + return mFooBar; + } + + /** + Set Age + */ + void setAge( int v ) + { + if (v < 8) + { + kdDebug() << "setAge: value " << v << " is less than the minimum value of 8" << endl; + v = 8; + } + + if (v > 88) + { + kdDebug() << "setAge: value " << v << " is greater than the maximum value of 88" << endl; + v = 88; + } + + if (!isImmutable( TQString::fromLatin1( "Age" ) )) + mAge = v; + } + + /** + Get Age + */ + int age() const + { + return mAge; + } + + protected: + int mParamNumber; + + // Foo + TQColor mColor; + + // Bar$(Number) + TQString mFooBar; + int mAge; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test7.kcfg b/tdecore/tdeconfig_compiler/tests/test7.kcfg new file mode 100644 index 000000000..0a7fd3272 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test7.kcfg @@ -0,0 +1,25 @@ + + + + + + + + + + red + + + + + + 35 + 8 + 88 + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test7.kcfgc b/tdecore/tdeconfig_compiler/tests/test7.kcfgc new file mode 100644 index 000000000..c50aac7e3 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test7.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test7.kcfg +ClassName=Test7 +Singleton=false +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +#MemberVariables=public +GlobalEnums=true +ItemAccessors=false +#SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test7main.cpp b/tdecore/tdeconfig_compiler/tests/test7main.cpp new file mode 100644 index 000000000..81cca0184 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test7main.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2004 Waldo Bastian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test7.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test7 *t = new Test7(42); + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test8a.cpp.ref b/tdecore/tdeconfig_compiler/tests/test8a.cpp.ref new file mode 100644 index 000000000..c0a9ddda5 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8a.cpp.ref @@ -0,0 +1,22 @@ +// This file is generated by tdeconfig_compiler from test8a.kcfg. +// All changes you do to this file will be lost. + +#include "test8a.h" + +Test8a::Test8a( KSharedConfig::Ptr config ) + : TDEConfigSkeleton( config ) +{ + setCurrentGroup( TQString::fromLatin1( "Group" ) ); + + TDEConfigSkeleton::ItemFont *itemFont; + itemFont = new TDEConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "Font" ), mFont, TDEGlobalSettings::generalFont() ); + addItem( itemFont, TQString::fromLatin1( "Font" ) ); + TDEConfigSkeleton::ItemFont *itemTitleFont; + itemTitleFont = new TDEConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "TitleFont" ), mTitleFont, TDEGlobalSettings::windowTitleFont() ); + addItem( itemTitleFont, TQString::fromLatin1( "TitleFont" ) ); +} + +Test8a::~Test8a() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test8a.h.ref b/tdecore/tdeconfig_compiler/tests/test8a.h.ref new file mode 100644 index 000000000..9913cfc49 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8a.h.ref @@ -0,0 +1,61 @@ +// This file is generated by tdeconfig_compiler from test8a.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST8A_H +#define TEST8A_H + +#include +#include +#include + +class Test8a : public TDEConfigSkeleton +{ + public: + + Test8a( KSharedConfig::Ptr config = TDEGlobal::sharedConfig() ); + ~Test8a(); + + /** + Set Font + */ + void setFont( const TQFont & v ) + { + if (!isImmutable( TQString::fromLatin1( "Font" ) )) + mFont = v; + } + + /** + Get Font + */ + TQFont font() const + { + return mFont; + } + + /** + Set TitleFont + */ + void setTitleFont( const TQFont & v ) + { + if (!isImmutable( TQString::fromLatin1( "TitleFont" ) )) + mTitleFont = v; + } + + /** + Get TitleFont + */ + TQFont titleFont() const + { + return mTitleFont; + } + + protected: + + // Group + TQFont mFont; + TQFont mTitleFont; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test8a.kcfg b/tdecore/tdeconfig_compiler/tests/test8a.kcfg new file mode 100644 index 000000000..53448b624 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8a.kcfg @@ -0,0 +1,17 @@ + + + + + + + TDEGlobalSettings::generalFont() + + + + TDEGlobalSettings::windowTitleFont() + + + diff --git a/tdecore/tdeconfig_compiler/tests/test8a.kcfgc b/tdecore/tdeconfig_compiler/tests/test8a.kcfgc new file mode 100644 index 000000000..5f63c31c2 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8a.kcfgc @@ -0,0 +1,3 @@ +File=test8a.kcfg +ClassName=Test8a +Mutators=true diff --git a/tdecore/tdeconfig_compiler/tests/test8b.cpp.ref b/tdecore/tdeconfig_compiler/tests/test8b.cpp.ref new file mode 100644 index 000000000..288faeb12 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8b.cpp.ref @@ -0,0 +1,46 @@ +// This file is generated by tdeconfig_compiler from test8b.kcfg. +// All changes you do to this file will be lost. + +#include "test8b.h" + +#include + +Test8b *Test8b::mSelf = 0; +static KStaticDeleter staticTest8bDeleter; + +Test8b *Test8b::self() +{ + if ( !mSelf ) { + staticTest8bDeleter.setObject( mSelf, new Test8b() ); + mSelf->readConfig(); + } + + return mSelf; +} + +Test8b::Test8b( ) + : Test8a() +{ + mSelf = this; + setCurrentGroup( TQString::fromLatin1( "Group8b1" ) ); + + TDEConfigSkeleton::ItemUInt *itemSomething; + itemSomething = new TDEConfigSkeleton::ItemUInt( currentGroup(), TQString::fromLatin1( "Something" ), mSomething, 60 ); + addItem( itemSomething, TQString::fromLatin1( "Something" ) ); + + setCurrentGroup( TQString::fromLatin1( "Group8b2" ) ); + + TDEConfigSkeleton::ItemBool *itemFooBoo; + itemFooBoo = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "FooBoo" ), mFooBoo, false ); + addItem( itemFooBoo, TQString::fromLatin1( "FooBoo" ) ); + TDEConfigSkeleton::ItemUInt *itemPort; + itemPort = new TDEConfigSkeleton::ItemUInt( currentGroup(), TQString::fromLatin1( "Port" ), mPort, 1000 ); + addItem( itemPort, TQString::fromLatin1( "Port" ) ); +} + +Test8b::~Test8b() +{ + if ( mSelf == this ) + staticTest8bDeleter.setObject( mSelf, 0, false ); +} + diff --git a/tdecore/tdeconfig_compiler/tests/test8b.h.ref b/tdecore/tdeconfig_compiler/tests/test8b.h.ref new file mode 100644 index 000000000..82ab5d92b --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8b.h.ref @@ -0,0 +1,96 @@ +// This file is generated by tdeconfig_compiler from test8b.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST8B_H +#define TEST8B_H + +#include + +#include +#include + +class Test8b : public Test8a +{ + public: + + static Test8b *self(); + ~Test8b(); + + /** + Set Something + */ + static + void setSomething( uint v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "Something" ) )) + self()->mSomething = v; + } + + /** + Get Something + */ + static + uint something() + { + return self()->mSomething; + } + + /** + Set FooBoo + */ + static + void setFooBoo( bool v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "FooBoo" ) )) + self()->mFooBoo = v; + } + + /** + Get FooBoo + */ + static + bool fooBoo() + { + return self()->mFooBoo; + } + + /** + Set Port + */ + static + void setPort( uint v ) + { + if (!self()->isImmutable( TQString::fromLatin1( "Port" ) )) + self()->mPort = v; + } + + /** + Get Port + */ + static + uint port() + { + return self()->mPort; + } + + static + void writeConfig() + { + static_cast(self())->writeConfig(); + } + protected: + Test8b(); + static Test8b *mSelf; + + + // Group8b1 + uint mSomething; + + // Group8b2 + bool mFooBoo; + uint mPort; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test8b.kcfg b/tdecore/tdeconfig_compiler/tests/test8b.kcfg new file mode 100644 index 000000000..3e203a155 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8b.kcfg @@ -0,0 +1,21 @@ + + + + + 60 + + + + + + false + + + + 1000 + + + diff --git a/tdecore/tdeconfig_compiler/tests/test8b.kcfgc b/tdecore/tdeconfig_compiler/tests/test8b.kcfgc new file mode 100644 index 000000000..7be055203 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8b.kcfgc @@ -0,0 +1,6 @@ +File=test8b.kcfg +ClassName=Test8b +Mutators=true +Singleton=true +IncludeFiles=test8a.h +Inherits=Test8a diff --git a/tdecore/tdeconfig_compiler/tests/test8main.cpp b/tdecore/tdeconfig_compiler/tests/test8main.cpp new file mode 100644 index 000000000..04864a95c --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test8main.cpp @@ -0,0 +1,34 @@ +/* +Copyright (c) 2005 Michael Brade + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test8a.h" +#include "test8b.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test8a *config1 = new Test8a( KSharedConfig::openConfig( TQString::null ) ); + Test8a *config2 = new Test8a(); + Test8b::self(); + delete config1; + delete config2; +} diff --git a/tdecore/tdeconfig_compiler/tests/test9.cpp.ref b/tdecore/tdeconfig_compiler/tests/test9.cpp.ref new file mode 100644 index 000000000..a5ee144aa --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test9.cpp.ref @@ -0,0 +1,35 @@ +// This file is generated by tdeconfig_compiler from test9.kcfg. +// All changes you do to this file will be lost. + +#include "test9.h" + +Test9::Test9( const TQString & transport, const TQString & folder ) + : TDEConfigSkeleton( TQString::fromLatin1( "examplerc" ) ) + , mParamtransport(transport) + , mParamfolder(folder) +{ + setCurrentGroup( TQString::fromLatin1( "MyOptionsXX" ) ); + + TQStringList defaultMyStringList; + defaultMyStringList.append( TQString::fromUtf8( "up" ) ); + defaultMyStringList.append( TQString::fromUtf8( "down" ) ); + + TDEConfigSkeleton::ItemStringList *itemMyStringList; + itemMyStringList = new TDEConfigSkeleton::ItemStringList( currentGroup(), TQString::fromLatin1( "MyStringList" ), mMyStringList, defaultMyStringList ); + addItem( itemMyStringList, TQString::fromLatin1( "MyStringList" ) ); + TQStringList defaultMyPathList; + defaultMyPathList.append( TQString::fromUtf8( "/home" ) ); + defaultMyPathList.append( TQString::fromUtf8( "~" ) ); + + TDEConfigSkeleton::ItemPathList *itemMyPathList; + itemMyPathList = new TDEConfigSkeleton::ItemPathList( currentGroup(), TQString::fromLatin1( "MyPathList" ), mMyPathList, defaultMyPathList ); + addItem( itemMyPathList, TQString::fromLatin1( "MyPathList" ) ); + TDEConfigSkeleton::ItemPathList *itemMyPathsList2; + itemMyPathsList2 = new TDEConfigSkeleton::ItemPathList( currentGroup(), TQString::fromLatin1( "MyPathsList2" ), mMyPathsList2, TQStringList(TQString::fromLatin1("/usr/bin")) += TQDir::homeDirPath() ); + addItem( itemMyPathsList2, TQString::fromLatin1( "MyPathsList2" ) ); +} + +Test9::~Test9() +{ +} + diff --git a/tdecore/tdeconfig_compiler/tests/test9.h.ref b/tdecore/tdeconfig_compiler/tests/test9.h.ref new file mode 100644 index 000000000..23755f411 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test9.h.ref @@ -0,0 +1,82 @@ +// This file is generated by tdeconfig_compiler from test9.kcfg. +// All changes you do to this file will be lost. +#ifndef TEST9_H +#define TEST9_H + +#include +#include + +#include +class Test9 : public TDEConfigSkeleton +{ + public: + + Test9( const TQString & transport, const TQString & folder ); + ~Test9(); + + /** + Set MyStringList + */ + void setMyStringList( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyStringList" ) )) + mMyStringList = v; + } + + /** + Get MyStringList + */ + TQStringList myStringList() const + { + return mMyStringList; + } + + /** + Set This is a list of paths + */ + void setMyPathList( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyPathList" ) )) + mMyPathList = v; + } + + /** + Get This is a list of paths + */ + TQStringList myPathList() const + { + return mMyPathList; + } + + /** + Set This is an additional test for PathList + */ + void setMyPathsList2( const TQStringList & v ) + { + if (!isImmutable( TQString::fromLatin1( "MyPathsList2" ) )) + mMyPathsList2 = v; + } + + /** + Get This is an additional test for PathList + */ + TQStringList myPathsList2() const + { + return mMyPathsList2; + } + + protected: + public: + TQString mParamtransport; + TQString mParamfolder; + + // MyOptionsXX + TQStringList mMyStringList; + TQStringList mMyPathList; + TQStringList mMyPathsList2; + + private: +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test9.kcfg b/tdecore/tdeconfig_compiler/tests/test9.kcfg new file mode 100644 index 000000000..b7495e2b6 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test9.kcfg @@ -0,0 +1,24 @@ + + + qdir.h + + + + + + + up,down + + + + /home,~ + + + + QStringList(QString::fromLatin1("/usr/bin")) += QDir::homeDirPath() + + + diff --git a/tdecore/tdeconfig_compiler/tests/test9.kcfgc b/tdecore/tdeconfig_compiler/tests/test9.kcfgc new file mode 100644 index 000000000..47f5e5f43 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test9.kcfgc @@ -0,0 +1,18 @@ +# Code generation options for tdeconfig_compiler +ClassName=Test9 +# +# Singleton=false +# +# Inherits=TDEConfigSkeleton +# +# IncludeFiles=libtdepim/kpimprefs.h +# +MemberVariables=public +# +### The following line includes the file exampleprefs_base_addon.h +### It can be used to add extra functions and variables to the +### class. +# CustomAdditions=true +# +### Provide setFooBar(int) style functions +Mutators=true diff --git a/tdecore/tdeconfig_compiler/tests/test9main.cpp b/tdecore/tdeconfig_compiler/tests/test9main.cpp new file mode 100644 index 000000000..8668d8d8c --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test9main.cpp @@ -0,0 +1,43 @@ +/* +Copyright (c) 2005 Helge Deller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#include "test9.h" +#include "kinstance.h" +#include +#include + +int main( int, char*[] ) +{ + TDEInstance i("test"); + Test9 *t = new Test9( TQString::null, TQString::null ); + + TQStringList myPathsList2 = t->myPathsList2(); + kdWarning() << myPathsList2 << endl; + + // add another path + TQStringList newlist = TQDir::homeDirPath() + TQString::fromLatin1("/.trinity"); + myPathsList2 = myPathsList2 + newlist; + kdWarning() << myPathsList2 << endl; + + t->setMyPathsList2(myPathsList2); + kdWarning() << t->myPathsList2() << endl; + + delete t; +} diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref new file mode 100644 index 000000000..5aad12fe8 --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref @@ -0,0 +1,344 @@ +// This file is generated by tdeconfig_compiler from test_dpointer.kcfg. +// All changes you do to this file will be lost. + +#include "test_dpointer.h" + +#include + +#include + +class TestDPointerPrivate +{ + public: + + // General + bool autoSave; + int autoSaveInterval; + bool confirm; + TQString archiveFile; + int destination; + + // Views + int hourSize; + bool selectionStartsEditor; + + // KOrganizer Plugins + TQStringList selectedPlugins; + + // Colors + TQColor highlightColor; + TQColor agendaBgColor; + + // Fonts + TQFont timeBarFont; + + // items + TDEConfigSkeleton::ItemBool *autoSaveItem; + TDEConfigSkeleton::ItemInt *autoSaveIntervalItem; + TDEConfigSkeleton::ItemBool *confirmItem; + TDEConfigSkeleton::ItemString *archiveFileItem; + TDEConfigSkeleton::ItemEnum *destinationItem; + TDEConfigSkeleton::ItemInt *hourSizeItem; + TDEConfigSkeleton::ItemBool *selectionStartsEditorItem; + TDEConfigSkeleton::ItemStringList *selectedPluginsItem; + TDEConfigSkeleton::ItemColor *highlightColorItem; + TDEConfigSkeleton::ItemColor *agendaBgColorItem; + TDEConfigSkeleton::ItemFont *timeBarFontItem; +}; + +TestDPointer *TestDPointer::mSelf = 0; +static KStaticDeleter staticTestDPointerDeleter; + +TestDPointer *TestDPointer::self() +{ + if ( !mSelf ) { + staticTestDPointerDeleter.setObject( mSelf, new TestDPointer() ); + mSelf->readConfig(); + } + + return mSelf; +} + +TestDPointer::TestDPointer( ) + : TDEConfigSkeleton( TQString::fromLatin1( "korganizerrc" ) ) +{ + d = new TestDPointerPrivate; + mSelf = this; + setCurrentGroup( TQString::fromLatin1( "General" ) ); + + d->autoSaveItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "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, TQString::fromLatin1( "AutoSave" ) ); + d->autoSaveIntervalItem = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Auto Save Interval" ), d->autoSaveInterval, 10 ); + d->autoSaveIntervalItem->setLabel( i18n("Auto Save Interval") ); + addItem( d->autoSaveIntervalItem, TQString::fromLatin1( "AutoSaveInterval" ) ); + d->confirmItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Confirm Deletes" ), d->confirm, true ); + d->confirmItem->setLabel( i18n("Confirm deletes") ); + addItem( d->confirmItem, TQString::fromLatin1( "Confirm" ) ); + d->archiveFileItem = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "Archive File" ), d->archiveFile ); + d->archiveFileItem->setLabel( i18n("Archive File") ); + addItem( d->archiveFileItem, TQString::fromLatin1( "ArchiveFile" ) ); + TQValueList valuesDestination; + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "standardDestination" ); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "askDestination" ); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl1" ); + choice.label = i18n("Argl1 Label"); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl2" ); + choice.whatsThis = i18n("Argl2 Whatsthis"); + valuesDestination.append( choice ); + } + { + TDEConfigSkeleton::ItemEnum::Choice choice; + choice.name = TQString::fromLatin1( "argl3" ); + choice.label = i18n("Argl3 Label"); + choice.whatsThis = i18n("Argl3 Whatsthis"); + valuesDestination.append( choice ); + } + d->destinationItem = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "Destination" ), d->destination, valuesDestination, EnumDestination::standardDestination ); + d->destinationItem->setLabel( i18n("New Events/Todos Should") ); + addItem( d->destinationItem, TQString::fromLatin1( "Destination" ) ); + + setCurrentGroup( TQString::fromLatin1( "Views" ) ); + + d->hourSizeItem = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "Hour Size" ), d->hourSize, 10 ); + d->hourSizeItem->setLabel( i18n("Hour Size") ); + addItem( d->hourSizeItem, TQString::fromLatin1( "HourSize" ) ); + d->selectionStartsEditorItem = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "SelectionStartsEditor" ), d->selectionStartsEditor, false ); + d->selectionStartsEditorItem->setLabel( i18n("Time range selection in agenda view starts event editor") ); + addItem( d->selectionStartsEditorItem, TQString::fromLatin1( "SelectionStartsEditor" ) ); + + setCurrentGroup( TQString::fromLatin1( "KOrganizer Plugins" ) ); + + TQStringList defaultSelectedPlugins; + defaultSelectedPlugins.append( TQString::fromUtf8( "holidays" ) ); + defaultSelectedPlugins.append( TQString::fromUtf8( "webexport" ) ); + + d->selectedPluginsItem = new TDEConfigSkeleton::ItemStringList( currentGroup(), TQString::fromLatin1( "SelectedPlugins" ), d->selectedPlugins, defaultSelectedPlugins ); + d->selectedPluginsItem->setLabel( i18n("SelectedPlugins") ); + addItem( d->selectedPluginsItem, TQString::fromLatin1( "SelectedPlugins" ) ); + + setCurrentGroup( TQString::fromLatin1( "Colors" ) ); + + d->highlightColorItem = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Highlight Color" ), d->highlightColor, TQColor( 100, 100, 255 ) ); + d->highlightColorItem->setLabel( i18n("Highlight color") ); + addItem( d->highlightColorItem, TQString::fromLatin1( "HighlightColor" ) ); + d->agendaBgColorItem = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "Agenda Background Color" ), d->agendaBgColor, TQColor( 255, 255, 255 ) ); + d->agendaBgColorItem->setLabel( i18n("Agenda view background color") ); + addItem( d->agendaBgColorItem, TQString::fromLatin1( "AgendaBgColor" ) ); + + setCurrentGroup( TQString::fromLatin1( "Fonts" ) ); + + d->timeBarFontItem = new TDEConfigSkeleton::ItemFont( currentGroup(), TQString::fromLatin1( "TimeBar Font" ), d->timeBarFont ); + d->timeBarFontItem->setLabel( i18n("Time bar") ); + addItem( d->timeBarFontItem, TQString::fromLatin1( "TimeBarFont" ) ); +} + +void TestDPointer::setAutoSave( bool v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "AutoSave" ) )) + self()->d->autoSave = v; +} + +bool TestDPointer::autoSave() +{ + return self()->d->autoSave; +} + + +TDEConfigSkeleton::ItemBool *TestDPointer::autoSaveItem() +{ + return d->autoSaveItem; +} + +void TestDPointer::setAutoSaveInterval( int v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "AutoSaveInterval" ) )) + self()->d->autoSaveInterval = v; +} + +int TestDPointer::autoSaveInterval() +{ + return self()->d->autoSaveInterval; +} + + +TDEConfigSkeleton::ItemInt *TestDPointer::autoSaveIntervalItem() +{ + return d->autoSaveIntervalItem; +} + +void TestDPointer::setConfirm( bool v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "Confirm" ) )) + self()->d->confirm = v; +} + +bool TestDPointer::confirm() +{ + return self()->d->confirm; +} + + +TDEConfigSkeleton::ItemBool *TestDPointer::confirmItem() +{ + return d->confirmItem; +} + +void TestDPointer::setArchiveFile( const TQString & v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "ArchiveFile" ) )) + self()->d->archiveFile = v; +} + +TQString TestDPointer::archiveFile() +{ + return self()->d->archiveFile; +} + + +TDEConfigSkeleton::ItemString *TestDPointer::archiveFileItem() +{ + return d->archiveFileItem; +} + +void TestDPointer::setDestination( int v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "Destination" ) )) + self()->d->destination = v; +} + +int TestDPointer::destination() +{ + return self()->d->destination; +} + + +TDEConfigSkeleton::ItemEnum *TestDPointer::destinationItem() +{ + return d->destinationItem; +} + +void TestDPointer::setHourSize( int v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "HourSize" ) )) + self()->d->hourSize = v; +} + +int TestDPointer::hourSize() +{ + return self()->d->hourSize; +} + + +TDEConfigSkeleton::ItemInt *TestDPointer::hourSizeItem() +{ + return d->hourSizeItem; +} + +void TestDPointer::setSelectionStartsEditor( bool v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "SelectionStartsEditor" ) )) + self()->d->selectionStartsEditor = v; +} + +bool TestDPointer::selectionStartsEditor() +{ + return self()->d->selectionStartsEditor; +} + + +TDEConfigSkeleton::ItemBool *TestDPointer::selectionStartsEditorItem() +{ + return d->selectionStartsEditorItem; +} + +void TestDPointer::setSelectedPlugins( const TQStringList & v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "SelectedPlugins" ) )) + self()->d->selectedPlugins = v; +} + +TQStringList TestDPointer::selectedPlugins() +{ + return self()->d->selectedPlugins; +} + + +TDEConfigSkeleton::ItemStringList *TestDPointer::selectedPluginsItem() +{ + return d->selectedPluginsItem; +} + +void TestDPointer::setHighlightColor( const TQColor & v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "HighlightColor" ) )) + self()->d->highlightColor = v; +} + +TQColor TestDPointer::highlightColor() +{ + return self()->d->highlightColor; +} + + +TDEConfigSkeleton::ItemColor *TestDPointer::highlightColorItem() +{ + return d->highlightColorItem; +} + +void TestDPointer::setAgendaBgColor( const TQColor & v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "AgendaBgColor" ) )) + self()->d->agendaBgColor = v; +} + +TQColor TestDPointer::agendaBgColor() +{ + return self()->d->agendaBgColor; +} + + +TDEConfigSkeleton::ItemColor *TestDPointer::agendaBgColorItem() +{ + return d->agendaBgColorItem; +} + +void TestDPointer::setTimeBarFont( const TQFont & v ) +{ + if (!self()->isImmutable( TQString::fromLatin1( "TimeBarFont" ) )) + self()->d->timeBarFont = v; +} + +TQFont TestDPointer::timeBarFont() +{ + return self()->d->timeBarFont; +} + + +TDEConfigSkeleton::ItemFont *TestDPointer::timeBarFontItem() +{ + return d->timeBarFontItem; +} + +TestDPointer::~TestDPointer() +{ + delete d; + if ( mSelf == this ) + staticTestDPointerDeleter.setObject( mSelf, 0, false ); +} + diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.h.ref b/tdecore/tdeconfig_compiler/tests/test_dpointer.h.ref new file mode 100644 index 000000000..0bd7e771e --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.h.ref @@ -0,0 +1,224 @@ +// This file is generated by tdeconfig_compiler from test_dpointer.kcfg. +// All changes you do to this file will be lost. +#ifndef TESTDPOINTER_H +#define TESTDPOINTER_H + +#include +#include + +class TestDPointerPrivate; + +class TestDPointer : public TDEConfigSkeleton +{ + public: + class EnumDestination + { + public: + enum type { standardDestination, askDestination, argl1, argl2, argl3, COUNT }; + }; + + static TestDPointer *self(); + ~TestDPointer(); + + /** + Set Enable automatic saving of calendar + */ + static + void setAutoSave( bool v ); + + /** + Get Enable automatic saving of calendar + */ + static + bool autoSave(); + + /** + Get Item object corresponding to AutoSave() + */ + ItemBool *autoSaveItem(); + + /** + Set Auto Save Interval + */ + static + void setAutoSaveInterval( int v ); + + /** + Get Auto Save Interval + */ + static + int autoSaveInterval(); + + /** + Get Item object corresponding to AutoSaveInterval() + */ + ItemInt *autoSaveIntervalItem(); + + /** + Set Confirm deletes + */ + static + void setConfirm( bool v ); + + /** + Get Confirm deletes + */ + static + bool confirm(); + + /** + Get Item object corresponding to Confirm() + */ + ItemBool *confirmItem(); + + /** + Set Archive File + */ + static + void setArchiveFile( const TQString & v ); + + /** + Get Archive File + */ + static + TQString archiveFile(); + + /** + Get Item object corresponding to ArchiveFile() + */ + ItemString *archiveFileItem(); + + /** + Set New Events/Todos Should + */ + static + void setDestination( int v ); + + /** + Get New Events/Todos Should + */ + static + int destination(); + + /** + Get Item object corresponding to Destination() + */ + ItemEnum *destinationItem(); + + /** + Set Hour Size + */ + static + void setHourSize( int v ); + + /** + Get Hour Size + */ + static + int hourSize(); + + /** + Get Item object corresponding to HourSize() + */ + ItemInt *hourSizeItem(); + + /** + Set Time range selection in agenda view starts event editor + */ + static + void setSelectionStartsEditor( bool v ); + + /** + Get Time range selection in agenda view starts event editor + */ + static + bool selectionStartsEditor(); + + /** + Get Item object corresponding to SelectionStartsEditor() + */ + ItemBool *selectionStartsEditorItem(); + + /** + Set SelectedPlugins + */ + static + void setSelectedPlugins( const TQStringList & v ); + + /** + Get SelectedPlugins + */ + static + TQStringList selectedPlugins(); + + /** + Get Item object corresponding to SelectedPlugins() + */ + ItemStringList *selectedPluginsItem(); + + /** + Set Highlight color + */ + static + void setHighlightColor( const TQColor & v ); + + /** + Get Highlight color + */ + static + TQColor highlightColor(); + + /** + Get Item object corresponding to HighlightColor() + */ + ItemColor *highlightColorItem(); + + /** + Set Agenda view background color + */ + static + void setAgendaBgColor( const TQColor & v ); + + /** + Get Agenda view background color + */ + static + TQColor agendaBgColor(); + + /** + Get Item object corresponding to AgendaBgColor() + */ + ItemColor *agendaBgColorItem(); + + /** + Set Time bar + */ + static + void setTimeBarFont( const TQFont & v ); + + /** + Get Time bar + */ + static + TQFont timeBarFont(); + + /** + Get Item object corresponding to TimeBarFont() + */ + ItemFont *timeBarFontItem(); + + static + void writeConfig() + { + static_cast(self())->writeConfig(); + } + protected: + TestDPointer(); + static TestDPointer *mSelf; + + private: + TestDPointerPrivate *d; +}; + +#endif + diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfg b/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfg new file mode 100644 index 000000000..3b19e270e --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfg @@ -0,0 +1,78 @@ + + + + + + + + WhatsThis text for AutoSave option + false + + + 10 + + + + true + + + + + + + + + + + + + + + Argl2 Whatsthis + + + + Argl3 Whatsthis + + + standardDestination + + + + + + 10 + + + + false + + + + + + holidays,webexport + + + + + + + 100, 100, 255 + + + + 255, 255, 255 + + + + + + + + + + diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfgc b/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfgc new file mode 100644 index 000000000..83f4bce3b --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.kcfgc @@ -0,0 +1,11 @@ +# Code generation options for tdeconfig_compiler +File=test_dpointer.kcfg +ClassName=TestDPointer +Singleton=true +Mutators=true +#Inherits=MyPrefs +#IncludeFiles=myprefs.h +MemberVariables=dpointer +#GlobalEnums=true +ItemAccessors=true +SetUserTexts=true diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer_main.cpp b/tdecore/tdeconfig_compiler/tests/test_dpointer_main.cpp new file mode 100644 index 000000000..b62ee17af --- /dev/null +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer_main.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2005 Duncan Mac-Vicar P. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include "test_dpointer.h" +#include "kinstance.h" + +int main( int, char*[] ) +{ + TDEInstance i("test"); + TestDPointer *t = TestDPointer::self(); + delete t; +} -- cgit v1.2.1