summaryrefslogtreecommitdiffstats
path: root/kformula/kformula_factory.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-05-23 20:48:35 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-05-29 15:16:28 +0900
commit8b78a8791bc539bcffe7159f9d9714d577cb3d7d (patch)
tree1328291f966f19a22d7b13657d3f01a588eb1083 /kformula/kformula_factory.cpp
parent95834e2bdc5e01ae1bd21ac0dfa4fa1d2417fae9 (diff)
downloadkoffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.tar.gz
koffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kformula/kformula_factory.cpp')
-rw-r--r--kformula/kformula_factory.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/kformula/kformula_factory.cpp b/kformula/kformula_factory.cpp
new file mode 100644
index 000000000..1aebcfbd7
--- /dev/null
+++ b/kformula/kformula_factory.cpp
@@ -0,0 +1,70 @@
+#include "kformula_factory.h"
+#include "kformula_doc.h"
+#include "kformula_aboutdata.h"
+
+#include <kinstance.h>
+#include <kiconloader.h>
+
+#include <tdefiledialog.h>
+#include <tdeglobal.h>
+#include <kstandarddirs.h>
+#include <tdelocale.h>
+
+#include <tqstringlist.h>
+
+K_EXPORT_COMPONENT_FACTORY( libkformulapart, KFormulaFactory )
+
+TDEInstance* KFormulaFactory::s_global = 0;
+TDEAboutData* KFormulaFactory::s_aboutData = 0;
+
+TDEAboutData* KFormulaFactory::aboutData()
+{
+ if( !s_aboutData )
+ s_aboutData=newKFormulaAboutData();
+ return s_aboutData;
+}
+
+
+KFormulaFactory::KFormulaFactory( TQObject* parent, const char* name )
+ : KoFactory( parent, name )
+{
+ // Create our instance, so that it becomes TDEGlobal::instance if the
+ // main app is KFormula.
+ (void)global();
+}
+
+KFormulaFactory::~KFormulaFactory()
+{
+ delete s_aboutData;
+ s_aboutData=0;
+ delete s_global;
+ s_global = 0L;
+}
+
+KParts::Part* KFormulaFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, TQObject* parent, const char* name, const char* classname, const TQStringList & )
+{
+ bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
+
+ KFormulaDoc *doc = new KFormulaDoc( parentWidget, widgetName, parent, name, !bWantKoDocument );
+
+ if ( !bWantKoDocument )
+ doc->setReadWrite( false );
+
+ return doc;
+}
+
+TDEInstance* KFormulaFactory::global()
+{
+ if ( !s_global )
+ {
+ s_global = new TDEInstance(aboutData());
+ s_global->dirs()->addResourceType( "toolbar",
+ TDEStandardDirs::kde_default("data") + "koffice/toolbar/");
+ // Tell the iconloader about share/apps/koffice/icons*/
+ s_global->iconLoader()->addAppDir("koffice");
+ }
+
+ return s_global;
+}
+
+#include "kformula_factory.moc"