2
/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
3
It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
5
#include <%{APPNAMELC}_factory.h>
6
#include <%{APPNAMELC}_part.h>
7
#include <%{APPNAMELC}_aboutdata.h>
9
#include <kiconloader.h>
16
void* init_lib%{APPNAMELC}part()
18
KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
19
return new %{APPNAME}Factory;
23
KInstance* %{APPNAME}Factory::s_global = 0L;
24
KAboutData* %{APPNAME}Factory::s_aboutData = 0L;
26
%{APPNAME}Factory::%{APPNAME}Factory( QObject* parent, const char* name )
27
: KoFactory( parent, name )
32
%{APPNAME}Factory::~%{APPNAME}Factory()
40
KParts::Part* %{APPNAME}Factory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & )
42
// If classname is "KoDocument", our host is a koffice application
43
// otherwise, the host wants us as a simple part, so switch to readonly and single view.
44
bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
46
// parentWidget and widgetName are used by KoDocument for the "readonly+singleView" case.
47
%{APPNAME}Part *part = new %{APPNAME}Part( parentWidget, widgetName, parent, name, !bWantKoDocument );
49
if ( !bWantKoDocument )
50
part->setReadWrite( false );
55
KAboutData* %{APPNAME}Factory::aboutData()
58
// Change this, of course
59
s_aboutData = new%{APPNAME}AboutData();
63
KInstance* %{APPNAME}Factory::global()
67
s_global = new KInstance( aboutData() );
68
// Add any application-specific resource directories here
70
// Tell the iconloader about share/apps/koffice/icons
71
s_global->iconLoader()->addAppDir("koffice");
76
#include <%{APPNAMELC}_factory.moc>