You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.7 KiB
71 lines
1.7 KiB
15 years ago
|
#include "kformula_factory.h"
|
||
|
#include "kformula_doc.h"
|
||
|
#include "kformula_aboutdata.h"
|
||
|
|
||
|
#include <kinstance.h>
|
||
|
#include <kiconloader.h>
|
||
|
|
||
12 years ago
|
#include <tdefiledialog.h>
|
||
12 years ago
|
#include <tdeglobal.h>
|
||
15 years ago
|
#include <kstandarddirs.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
|
||
14 years ago
|
#include <tqstringlist.h>
|
||
15 years ago
|
|
||
|
K_EXPORT_COMPONENT_FACTORY( libkformulapart, KFormulaFactory )
|
||
|
|
||
12 years ago
|
TDEInstance* KFormulaFactory::s_global = 0;
|
||
|
TDEAboutData* KFormulaFactory::s_aboutData = 0;
|
||
15 years ago
|
|
||
12 years ago
|
TDEAboutData* KFormulaFactory::aboutData()
|
||
15 years ago
|
{
|
||
|
if( !s_aboutData )
|
||
|
s_aboutData=newKFormulaAboutData();
|
||
|
return s_aboutData;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
KFormulaFactory::KFormulaFactory( TQObject* parent, const char* name )
|
||
|
: KoFactory( parent, name )
|
||
15 years ago
|
{
|
||
12 years ago
|
// Create our instance, so that it becomes TDEGlobal::instance if the
|
||
15 years ago
|
// main app is KFormula.
|
||
|
(void)global();
|
||
|
}
|
||
|
|
||
|
KFormulaFactory::~KFormulaFactory()
|
||
|
{
|
||
|
delete s_aboutData;
|
||
|
s_aboutData=0;
|
||
|
delete s_global;
|
||
|
s_global = 0L;
|
||
|
}
|
||
|
|
||
14 years ago
|
KParts::Part* KFormulaFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, TQObject* parent, const char* name, const char* classname, const TQStringList & )
|
||
15 years ago
|
{
|
||
|
bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
|
||
|
|
||
14 years ago
|
KFormulaDoc *doc = new KFormulaDoc( parentWidget, widgetName, parent, name, !bWantKoDocument );
|
||
15 years ago
|
|
||
|
if ( !bWantKoDocument )
|
||
|
doc->setReadWrite( false );
|
||
|
|
||
|
return doc;
|
||
|
}
|
||
|
|
||
12 years ago
|
TDEInstance* KFormulaFactory::global()
|
||
15 years ago
|
{
|
||
|
if ( !s_global )
|
||
|
{
|
||
12 years ago
|
s_global = new TDEInstance(aboutData());
|
||
15 years ago
|
s_global->dirs()->addResourceType( "toolbar",
|
||
12 years ago
|
TDEStandardDirs::kde_default("data") + "koffice/toolbar/");
|
||
15 years ago
|
// Tell the iconloader about share/apps/koffice/icons*/
|
||
|
s_global->iconLoader()->addAppDir("koffice");
|
||
|
}
|
||
|
|
||
|
return s_global;
|
||
|
}
|
||
|
|
||
|
#include "kformula_factory.moc"
|