diff --git a/libs/taxidermy/WidgetBuilderCreator.inl b/libs/taxidermy/WidgetBuilderCreator.inl new file mode 100644 index 0000000000000000000000000000000000000000..a78c1cabb9d9f04d0aed4aef3a198b78ef1d311f --- /dev/null +++ b/libs/taxidermy/WidgetBuilderCreator.inl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Jean-Philippe Barrette-LaPierre + * (jean-philippe.barrette-lapierre@savoirfairelinux.com) + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with dpkg; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +template< typename T > +taxidermy::WidgetBuilder * +taxidermy::WidgetBuilderCreator< T >::create() +{ + return new T(); +} + diff --git a/libs/taxidermy/WidgetBuilderFactoryImpl.inl b/libs/taxidermy/WidgetBuilderFactoryImpl.inl new file mode 100644 index 0000000000000000000000000000000000000000..9b15b9876c5bea4326a9fa14d474cb408f975b59 --- /dev/null +++ b/libs/taxidermy/WidgetBuilderFactoryImpl.inl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Jean-Philippe Barrette-LaPierre + * (jean-philippe.barrette-lapierre@savoirfairelinux.com) + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with dpkg; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +template< typename T > +void +taxidermy::WidgetBuilderFactoryImpl::add(const QString &objectType) +{ + mBuilders.insert(objectType, new WidgetBuilderCreator<T>()); +} + +