summaryrefslogtreecommitdiffstats
path: root/kresources/featureplan
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kresources/featureplan
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/featureplan')
-rw-r--r--kresources/featureplan/Makefile.am61
-rw-r--r--kresources/featureplan/benchmarkfeaturelist.cpp98
-rw-r--r--kresources/featureplan/dumpfeaturelist.cpp102
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplan.cpp152
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplan.desktop41
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplan.h67
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplanconfig.cpp92
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplanconfig.h53
-rw-r--r--kresources/featureplan/kcal_resourcefeatureplanplugin.cpp40
-rw-r--r--kresources/featureplan/kde-features.dtd25
-rw-r--r--kresources/featureplan/kde-features.rng150
-rw-r--r--kresources/featureplan/kresources_kcal_featureplan.kcfg20
-rw-r--r--kresources/featureplan/prefs.kcfgc9
13 files changed, 910 insertions, 0 deletions
diff --git a/kresources/featureplan/Makefile.am b/kresources/featureplan/Makefile.am
new file mode 100644
index 000000000..3d36b3f9f
--- /dev/null
+++ b/kresources/featureplan/Makefile.am
@@ -0,0 +1,61 @@
+INCLUDES = -I$(top_srcdir) $(all_includes)
+
+lib_LTLIBRARIES = libkcal_resourcefeatureplan.la
+
+noinst_LTLIBRARIES = libfeatureplancommon.la
+libfeatureplancommon_la_SOURCES = kde-features.cpp kde-features_parser.cpp \
+ prefs.kcfgc
+
+libkcal_resourcefeatureplan_la_SOURCES = kcal_resourcefeatureplan.cpp \
+ kcal_resourcefeatureplanconfig.cpp
+libkcal_resourcefeatureplan_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) \
+ -version-info 1:0:0 -no-undefined
+libkcal_resourcefeatureplan_la_LIBADD = libfeatureplancommon.la \
+ $(top_builddir)/libkcal/libkcal.la \
+ $(top_builddir)/libkdepim/libkdepim.la
+libkcal_resourcefeatureplan_la_COMPILE_FIRST = kde-features.h prefs.h
+
+
+kde_module_LTLIBRARIES = kcal_resourcefeatureplan.la
+
+kcal_resourcefeatureplan_la_SOURCES = kcal_resourcefeatureplanplugin.cpp
+kcal_resourcefeatureplan_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+kcal_resourcefeatureplan_la_LIBADD = libkcal_resourcefeatureplan.la
+kcal_resourcefeatureplan_la_COMPILE_FIRST = kde-features.h prefs.h
+
+kcal_servicedir = $(kde_servicesdir)/kresources/kcal
+kcal_service_DATA = kcal_resourcefeatureplan.desktop
+
+check_PROGRAMS = dumpfeaturelist benchmarkfeaturelist
+
+dumpfeaturelist_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+dumpfeaturelist_LDADD = libfeatureplancommon.la $(LIB_KDECORE)
+dumpfeaturelist_SOURCES = dumpfeaturelist.cpp
+dumpfeaturelist_COMPILE_FIRST = kde-features.h
+
+benchmarkfeaturelist_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+benchmarkfeaturelist_LDADD = libfeatureplancommon.la $(LIB_KDECORE)
+benchmarkfeaturelist_SOURCES = benchmarkfeaturelist.cpp
+benchmarkfeaturelist_COMPILE_FIRST = kde-features.h
+
+kde-features.cpp: kde-features.h
+kde-features_parser.h kde-features_parser.cpp: kde-features.h
+
+kde-features.h kde-features.cpp kde-features_parser.h kde-features_parser.cpp: $(srcdir)/kde-features.rng \
+ $(top_builddir)/kode/kxml_compiler/kxml_compiler
+ $(top_builddir)/kode/kxml_compiler/kxml_compiler \
+ --custom-parser $(srcdir)/kde-features.rng
+
+METASOURCES = AUTO
+DISTCLEANFILES = kde-features.h kde-features.cpp \
+ kde-features_parser.h kde-features_parser.cpp \
+ kde-features.h.backup kde-features.cpp.backup \
+ kde-features_parser.h.backup kde-features_parser.cpp.backup
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kres_featureplan.pot
+
+kcal_resourcefeatureplan.lo: kde-features_parser.h
+kde-features.lo: kde-features.h
+kde-features_parser.lo: kde-features_parser.h kde-features.h
+
diff --git a/kresources/featureplan/benchmarkfeaturelist.cpp b/kresources/featureplan/benchmarkfeaturelist.cpp
new file mode 100644
index 000000000..d814a8a21
--- /dev/null
+++ b/kresources/featureplan/benchmarkfeaturelist.cpp
@@ -0,0 +1,98 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kde-features.h"
+#include "kde-features_parser.h"
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <kdebug.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include <iostream>
+
+static const KCmdLineOptions options[] =
+{
+ { "+featurelist", "Name of featurelist XML file", 0 },
+ KCmdLineLastOption
+};
+
+void displayFeature( Feature *f )
+{
+ std::cout << "FEATURE: " << f->summary().local8Bit() << std::endl;
+ Responsible::List r = f->responsibleList();
+ Responsible::List::ConstIterator it;
+ for( it = r.begin(); it != r.end(); ++it ) {
+ std::cout << " RESPONSIBLE: " << (*it)->name().local8Bit() << " ("
+ << (*it)->email().local8Bit() << ")" << std::endl;
+ }
+ std::cout << " TARGET: " << f->target().local8Bit() << std::endl;
+ std::cout << " STATUS: " << f->status().local8Bit() << std::endl;
+}
+
+void displayCategory( const QValueList<Category *> categories )
+{
+ Category::List::ConstIterator it;
+ for( it = categories.begin(); it != categories.end(); ++it ) {
+ std::cout << "CATEGORY: " << (*it)->name().local8Bit() << std::endl;
+
+ Feature::List features = (*it)->featureList();
+ Feature::List::ConstIterator it2;
+ for( it2 = features.begin(); it2 != features.end(); ++it2 ) {
+ displayFeature( *it2 );
+ }
+
+ displayCategory( (*it)->categoryList() );
+ }
+}
+
+int main( int argc, char **argv )
+{
+ KAboutData aboutData( "benchmarkfeaturelist",
+ "Benchmark for feature list XML parser",
+ "0.1" );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KApplication app( false, false );
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if ( args->count() != 1 ) {
+ args->usage( "Wrong number of arguments." );
+ }
+
+ QString filename = QFile::decodeName( args->arg( 0 ) );
+
+ for( int i = 0; i < 1; ++i ) {
+ FeaturesParser parser;
+
+ Features *features = parser.parseFile( filename );
+
+ if ( !features ) {
+ kdError() << "Parse error" << endl;
+ return 1;
+ }
+ }
+}
diff --git a/kresources/featureplan/dumpfeaturelist.cpp b/kresources/featureplan/dumpfeaturelist.cpp
new file mode 100644
index 000000000..9fbbe0084
--- /dev/null
+++ b/kresources/featureplan/dumpfeaturelist.cpp
@@ -0,0 +1,102 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kde-features.h"
+#include "kde-features_parser.h"
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <kdebug.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include <iostream>
+
+static const KCmdLineOptions options[] =
+{
+ { "+featurelist", "Name of featurelist XML file", 0 },
+ KCmdLineLastOption
+};
+
+void displayFeature( Feature *f )
+{
+ std::cout << "FEATURE: " << f->summary().local8Bit() << std::endl;
+ Responsible::List r = f->responsibleList();
+ Responsible::List::ConstIterator it;
+ for( it = r.begin(); it != r.end(); ++it ) {
+ std::cout << " RESPONSIBLE: " << (*it)->name().local8Bit() << " ("
+ << (*it)->email().local8Bit() << ")" << std::endl;
+ }
+ std::cout << " TARGET: " << f->target().local8Bit() << std::endl;
+ std::cout << " STATUS: " << f->status().local8Bit() << std::endl;
+}
+
+void displayCategory( const QValueList<Category *> categories )
+{
+ Category::List::ConstIterator it;
+ for( it = categories.begin(); it != categories.end(); ++it ) {
+ std::cout << "CATEGORY: " << (*it)->name().local8Bit() << std::endl;
+
+ Feature::List features = (*it)->featureList();
+ Feature::List::ConstIterator it2;
+ for( it2 = features.begin(); it2 != features.end(); ++it2 ) {
+ displayFeature( *it2 );
+ }
+
+ displayCategory( (*it)->categoryList() );
+ }
+}
+
+int main( int argc, char **argv )
+{
+ KAboutData aboutData( "dumpfeaturelist", "Dump XML feature list to stdout",
+ "0.1" );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KApplication app( false, false );
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if ( args->count() != 1 ) {
+ args->usage( "Wrong number of arguments." );
+ }
+
+ QString filename = QFile::decodeName( args->arg( 0 ) );
+
+ FeaturesParser parser;
+
+ Features *features = parser.parseFile( filename );
+
+ if ( !features ) {
+ kdError() << "Parse error" << endl;
+ } else {
+ QValueList<Category *> categories = features->categoryList();
+ displayCategory( categories );
+
+ QString out = filename + ".out";
+ if ( !features->writeFile( out ) ) {
+ kdError() << "Write error" << endl;
+ }
+ }
+}
diff --git a/kresources/featureplan/kcal_resourcefeatureplan.cpp b/kresources/featureplan/kcal_resourcefeatureplan.cpp
new file mode 100644
index 000000000..84c198216
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplan.cpp
@@ -0,0 +1,152 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kcal_resourcefeatureplan.h"
+
+#include "kcal_resourcefeatureplanconfig.h"
+
+#include "kde-features.h"
+#include "kde-features_parser.h"
+
+#include <qapplication.h>
+#include <qdatetime.h>
+#include <qptrlist.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+
+#include <kabc/locknull.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kresources/configwidget.h>
+#include <kstandarddirs.h>
+#include <kstringhandler.h>
+#include <kurl.h>
+#include <libkdepim/kpimprefs.h>
+
+using namespace KCal;
+
+ResourceFeaturePlan::ResourceFeaturePlan( const KConfig *config )
+ : ResourceCached( config ), mLock( true )
+{
+ mPrefs = new Prefs;
+
+ if ( config ) readConfig( config );
+}
+
+ResourceFeaturePlan::~ResourceFeaturePlan()
+{
+}
+
+Prefs *ResourceFeaturePlan::prefs()
+{
+ return mPrefs;
+}
+
+void ResourceFeaturePlan::readConfig( const KConfig * )
+{
+ mPrefs->readConfig();
+}
+
+void ResourceFeaturePlan::writeConfig( KConfig *config )
+{
+ ResourceCalendar::writeConfig( config );
+
+ mPrefs->writeConfig();
+}
+
+bool ResourceFeaturePlan::doLoad()
+{
+ kdDebug() << "ResourceFeaturePlan::load()" << endl;
+
+ mCalendar.close();
+
+ FeaturesParser parser;
+
+ Features *features = parser.parseFile( mPrefs->filename() );
+
+ if ( !features ) {
+ return false;
+ } else {
+ Category::List categories = features->categoryList();
+
+ KCal::Todo *masterTodo = new KCal::Todo;
+ masterTodo->setSummary( i18n("Feature Plan") );
+ mCalendar.addTodo( masterTodo );
+
+ insertCategories( categories, masterTodo );
+ }
+
+ emit resourceChanged( this );
+
+ return true;
+}
+
+void ResourceFeaturePlan::insertCategories( const Category::List &categories,
+ Todo *parent )
+{
+ Category::List::ConstIterator it;
+ for( it = categories.begin(); it != categories.end(); ++it ) {
+ Category *c = *it;
+
+ Todo *categoryTodo = new Todo;
+ categoryTodo->setSummary( c->name() );
+ categoryTodo->setRelatedTo( parent );
+
+ insertCategories( c->categoryList(), categoryTodo );
+
+ Feature::List features = (*it)->featureList();
+ Feature::List::ConstIterator it2;
+ for( it2 = features.begin(); it2 != features.end(); ++it2 ) {
+ Feature *f = *it2;
+ Todo *todo = new Todo;
+
+ QString summary = f->summary();
+ int pos = summary.find( '\n' );
+ if ( pos > 0 ) summary = summary.left( pos ) + "...";
+ todo->setSummary( summary );
+
+ todo->setDescription( f->summary() );
+
+ todo->setRelatedTo( categoryTodo );
+
+ int completed;
+ if ( f->status() == "done" ) completed = 100;
+ else if ( f->status() == "inprogress" ) completed = 50;
+ else completed = 0;
+ todo->setPercentComplete( completed );
+
+ mCalendar.addTodo( todo );
+ }
+ }
+}
+
+bool ResourceFeaturePlan::doSave()
+{
+ return true;
+}
+
+KABC::Lock *ResourceFeaturePlan::lock()
+{
+ return &mLock;
+}
+
+
+#include "kcal_resourcefeatureplan.moc"
diff --git a/kresources/featureplan/kcal_resourcefeatureplan.desktop b/kresources/featureplan/kcal_resourcefeatureplan.desktop
new file mode 100644
index 000000000..11b98fe26
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplan.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Name=XML Feature Plan
+Name[af]=XML eienskappe plan
+Name[ca]=Pla de característiques XML
+Name[cs]=XML plán vlastností
+Name[da]=XML Funktionsplan
+Name[el]=Σχέδιο χαρακτηριστικών XML
+Name[eo]=XML-Trajtplano
+Name[es]=Plan de características XML
+Name[et]=XML võimaluste plaan
+Name[eu]=XML eginbide plana
+Name[fa]=نقشۀ ویژگی XML
+Name[fi]=XML-ominaisuussuunnitelma
+Name[fr]=Plan de fonctionnalités XML
+Name[fy]=Funksjonaliteitsplanning yn XML
+Name[gl]=Plan de Características en XML
+Name[hu]=XML FeaturePlan
+Name[is]=XML fídusa áætlun
+Name[it]=Piano caratteristiche XML
+Name[km]=គ្រោង​លក្ខណៈ​ពិសេស XML
+Name[lt]=XML bruožų planas
+Name[ms]=Pelan Cirian XML
+Name[nds]=XML-Funkschonenplaan
+Name[ne]=एक्सएमएल विशेषता योजना
+Name[nl]=Functionaliteitsplanning in XML
+Name[pl]=Plan funkcjonalności XML
+Name[pt]=Plano de Funcionalidades em XML
+Name[pt_BR]=Plano de Funcionalidades XML
+Name[sk]=XML plán vlastností
+Name[sl]=Načrt zmožnosti v XML
+Name[sr]=XML план могућности
+Name[sr@Latn]=XML plan mogućnosti
+Name[ta]=XML பண்பு திட்டம்
+Name[tr]=XML Özellik Planı
+Name[zh_CN]=XML 特性计划
+Name[zh_TW]=XML 功能計畫
+X-KDE-Library=kcal_resourcefeatureplan
+Type=Service
+ServiceTypes=KResources/Plugin
+X-KDE-ResourceFamily=calendar
+X-KDE-ResourceType=featureplan
diff --git a/kresources/featureplan/kcal_resourcefeatureplan.h b/kresources/featureplan/kcal_resourcefeatureplan.h
new file mode 100644
index 000000000..976d82af3
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplan.h
@@ -0,0 +1,67 @@
+ /*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KCAL_RESOURCEFEATUREPLAN_H
+#define KCAL_RESOURCEFEATUREPLAN_H
+
+#include "prefs.h"
+
+#include "kde-features.h"
+
+#include <libkcal/resourcecached.h>
+
+#include <kabc/locknull.h>
+
+#include <kdepimmacros.h>
+#include <kconfig.h>
+
+namespace KCal {
+
+/**
+ This class represents a featureplan (in KDE XML format)
+*/
+class KDE_EXPORT ResourceFeaturePlan : public ResourceCached
+{
+ Q_OBJECT
+ public:
+ ResourceFeaturePlan( const KConfig * );
+ virtual ~ResourceFeaturePlan();
+
+ void readConfig( const KConfig *config );
+ void writeConfig( KConfig *config );
+
+ Prefs *prefs();
+
+ bool doLoad();
+ bool doSave();
+
+ KABC::Lock *lock();
+
+ protected:
+ void insertCategories( const Category::List &categories, Todo *parent );
+
+ private:
+ Prefs *mPrefs;
+ KABC::LockNull mLock;
+};
+
+}
+
+#endif
diff --git a/kresources/featureplan/kcal_resourcefeatureplanconfig.cpp b/kresources/featureplan/kcal_resourcefeatureplanconfig.cpp
new file mode 100644
index 000000000..c72915d0a
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplanconfig.cpp
@@ -0,0 +1,92 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+
+#include <kdebug.h>
+#include <kdialog.h>
+#include <klineedit.h>
+#include <klocale.h>
+#include <knuminput.h>
+#include <kurlrequester.h>
+
+#include "kcal_resourcefeatureplan.h"
+#include "kcal_resourcefeatureplanconfig.h"
+
+using namespace KCal;
+
+ResourceFeaturePlanConfig::ResourceFeaturePlanConfig( QWidget *parent,
+ const char *name )
+ : KRES::ConfigWidget( parent, name )
+{
+ QGridLayout *topLayout = new QGridLayout( this, 3, 2, 0,
+ KDialog::spacingHint() );
+
+ QLabel *label = new QLabel( i18n( "Filename:" ), this );
+ mFilename = new KURLRequester( this );
+
+ topLayout->addWidget( label, 0, 0 );
+ topLayout->addWidget( mFilename, 0, 1 );
+
+ label = new QLabel( i18n( "Filter email:" ), this );
+ mFilterEmail = new KLineEdit( this );
+
+ topLayout->addWidget( label, 1, 0 );
+ topLayout->addWidget( mFilterEmail, 1, 1 );
+
+ mCvsCheck = new QCheckBox( i18n("Use CVS"), this );
+
+ topLayout->addMultiCellWidget( mCvsCheck, 2, 2, 0, 1 );
+}
+
+void ResourceFeaturePlanConfig::loadSettings( KRES::Resource *res )
+{
+ ResourceFeaturePlan *resource = dynamic_cast<ResourceFeaturePlan *>( res );
+
+ if ( !resource ) {
+ kdDebug(5700) << "ResourceFeaturePlanConfig::loadSettings(): cast failed" << endl;
+ return;
+ }
+
+ Prefs *p = resource->prefs();
+ mFilename->setURL( p->filename() );
+ mFilterEmail->setText( p->filterEmail() );
+ mCvsCheck->setChecked( p->useCvs() );
+}
+
+void ResourceFeaturePlanConfig::saveSettings( KRES::Resource *res )
+{
+ ResourceFeaturePlan *resource = dynamic_cast<ResourceFeaturePlan *>( res );
+
+ if ( !resource ) {
+ kdDebug(5700) << "ResourceFeaturePlanConfig::saveSettings(): cast failed" << endl;
+ return;
+ }
+
+ Prefs *p = resource->prefs();
+ p->setFilename( mFilename->url() );
+ p->setFilterEmail( mFilterEmail->text() );
+ p->setUseCvs( mCvsCheck->isChecked() );
+}
+
+#include "kcal_resourcefeatureplanconfig.moc"
diff --git a/kresources/featureplan/kcal_resourcefeatureplanconfig.h b/kresources/featureplan/kcal_resourcefeatureplanconfig.h
new file mode 100644
index 000000000..dcba4684c
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplanconfig.h
@@ -0,0 +1,53 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RESOURCEFEATUREPLANCONFIG_H
+#define RESOURCEFEATUREPLANCONFIG_H
+
+#include <kresources/configwidget.h>
+#include <kdepimmacros.h>
+
+class KLineEdit;
+class KURLRequester;
+class QCheckBox;
+
+namespace KCal {
+
+class KDE_EXPORT ResourceFeaturePlanConfig : public KRES::ConfigWidget
+{
+ Q_OBJECT
+
+ public:
+ ResourceFeaturePlanConfig( QWidget *parent = 0, const char *name = 0 );
+
+ public slots:
+ void loadSettings( KRES::Resource * );
+ void saveSettings( KRES::Resource * );
+
+ private:
+ KURLRequester *mFilename;
+ KLineEdit *mFilterEmail;
+ QCheckBox *mCvsCheck;
+};
+
+}
+
+#endif
diff --git a/kresources/featureplan/kcal_resourcefeatureplanplugin.cpp b/kresources/featureplan/kcal_resourcefeatureplanplugin.cpp
new file mode 100644
index 000000000..cee41809f
--- /dev/null
+++ b/kresources/featureplan/kcal_resourcefeatureplanplugin.cpp
@@ -0,0 +1,40 @@
+/*
+ This file is part of kdepim.
+
+ Copyright (c) 2004 Cornelius Schumacher <[email protected]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "kcal_resourcefeatureplan.h"
+#include "kcal_resourcefeatureplanconfig.h"
+
+#include <kglobal.h>
+#include <klocale.h>
+
+using namespace KCal;
+
+typedef KRES::PluginFactory< ResourceFeaturePlan, ResourceFeaturePlanConfig > FeatureplanFactory;
+// FIXME K_EXPORT_COMPONENT_FACTORY( kcal_resourcefeatureplan, FeatureplanFactory )
+// Problem: How to insert the catalogue!
+extern "C"
+{
+ void* init_kcal_resourcefeatureplan()
+ {
+ KGlobal::locale()->insertCatalogue( "kres_featureplan" );
+ return new FeatureplanFactory;
+ }
+}
diff --git a/kresources/featureplan/kde-features.dtd b/kresources/featureplan/kde-features.dtd
new file mode 100644
index 000000000..732c447d2
--- /dev/null
+++ b/kresources/featureplan/kde-features.dtd
@@ -0,0 +1,25 @@
+
+<!ELEMENT features (category+)>
+
+<!ELEMENT category (feature|category)*>
+<!ATTLIST category name CDATA #REQUIRED >
+
+<!ELEMENT feature (summary?,responsible*)>
+<!ATTLIST feature status (inprogress|todo|done) "todo"
+ target CDATA #REQUIRED>
+
+<!ELEMENT responsible EMPTY>
+<!ATTLIST responsible name CDATA #IMPLIED
+ email CDATA #IMPLIED>
+
+<!ELEMENT summary (#PCDATA|i|a|b|em|strong|br)*>
+
+<!ELEMENT i (#PCDATA)>
+<!ELEMENT b (#PCDATA)>
+<!ELEMENT em (#PCDATA)>
+<!ELEMENT strong (#PCDATA)>
+<!ELEMENT br EMPTY>
+
+<!ELEMENT a (#PCDATA)>
+<!ATTLIST a href CDATA #IMPLIED>
+<!ATTLIST a title CDATA #IMPLIED>
diff --git a/kresources/featureplan/kde-features.rng b/kresources/featureplan/kde-features.rng
new file mode 100644
index 000000000..89a31dcb4
--- /dev/null
+++ b/kresources/featureplan/kde-features.rng
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
+ <define name="features">
+ <element name="features">
+ <ref name="attlist.features"/>
+ <oneOrMore>
+ <ref name="category"/>
+ </oneOrMore>
+ </element>
+ </define>
+ <define name="attlist.features" combine="interleave">
+ <empty/>
+ </define>
+ <define name="category">
+ <element name="category">
+ <ref name="attlist.category"/>
+ <zeroOrMore>
+ <choice>
+ <ref name="feature"/>
+ <ref name="category"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="attlist.category" combine="interleave">
+ <attribute name="name"/>
+ </define>
+ <define name="feature">
+ <element name="feature">
+ <ref name="attlist.feature"/>
+ <optional>
+ <ref name="summary"/>
+ </optional>
+ <zeroOrMore>
+ <ref name="responsible"/>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="attlist.feature" combine="interleave">
+ <optional>
+ <attribute name="status" a:defaultValue="todo">
+ <choice>
+ <value>inprogress</value>
+ <value>todo</value>
+ <value>done</value>
+ </choice>
+ </attribute>
+ </optional>
+ <attribute name="target"/>
+ </define>
+ <define name="responsible">
+ <element name="responsible">
+ <ref name="attlist.responsible"/>
+ <empty/>
+ </element>
+ </define>
+ <define name="attlist.responsible" combine="interleave">
+ <optional>
+ <attribute name="name"/>
+ </optional>
+ <optional>
+ <attribute name="email"/>
+ </optional>
+ </define>
+ <define name="summary">
+ <element name="summary">
+ <ref name="attlist.summary"/>
+ <zeroOrMore>
+ <choice>
+ <text/>
+ <ref name="i"/>
+ <ref name="a"/>
+ <ref name="b"/>
+ <ref name="em"/>
+ <ref name="strong"/>
+ <ref name="br"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="attlist.summary" combine="interleave">
+ <empty/>
+ </define>
+ <define name="i">
+ <element name="i">
+ <ref name="attlist.i"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.i" combine="interleave">
+ <empty/>
+ </define>
+ <define name="b">
+ <element name="b">
+ <ref name="attlist.b"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.b" combine="interleave">
+ <empty/>
+ </define>
+ <define name="em">
+ <element name="em">
+ <ref name="attlist.em"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.em" combine="interleave">
+ <empty/>
+ </define>
+ <define name="strong">
+ <element name="strong">
+ <ref name="attlist.strong"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.strong" combine="interleave">
+ <empty/>
+ </define>
+ <define name="br">
+ <element name="br">
+ <ref name="attlist.br"/>
+ <empty/>
+ </element>
+ </define>
+ <define name="attlist.br" combine="interleave">
+ <empty/>
+ </define>
+ <define name="a">
+ <element name="a">
+ <ref name="attlist.a"/>
+ <text/>
+ </element>
+ </define>
+ <define name="attlist.a" combine="interleave">
+ <optional>
+ <attribute name="href"/>
+ </optional>
+ </define>
+ <define name="attlist.a" combine="interleave">
+ <optional>
+ <attribute name="title"/>
+ </optional>
+ </define>
+ <start>
+ <choice>
+ <ref name="features"/>
+ </choice>
+ </start>
+</grammar>
diff --git a/kresources/featureplan/kresources_kcal_featureplan.kcfg b/kresources/featureplan/kresources_kcal_featureplan.kcfg
new file mode 100644
index 000000000..b4a5449d7
--- /dev/null
+++ b/kresources/featureplan/kresources_kcal_featureplan.kcfg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="kresources_kcal_bugzillarc"/>
+
+ <group name="General">
+ <entry type="String" name="Filename">
+ <label>Filename</label>
+ </entry>
+ <entry type="String" name="FilterEmail">
+ <label>Filter for Email</label>
+ </entry>
+ <entry type="Bool" name="UseCvs">
+ <label>Use CVS</label>
+ </entry>
+ </group>
+
+</kcfg>
diff --git a/kresources/featureplan/prefs.kcfgc b/kresources/featureplan/prefs.kcfgc
new file mode 100644
index 000000000..d0e12c2d6
--- /dev/null
+++ b/kresources/featureplan/prefs.kcfgc
@@ -0,0 +1,9 @@
+# Code generation options for kconfig_compiler
+File=kresources_kcal_featureplan.kcfg
+ClassName=Prefs
+#NameSpace=KBB
+Singleton=false
+Mutators=true
+GlobalEnums=true
+#ItemAccessors=true
+#SetUserTexts=true