Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Functions
docim.cpp File Reference
#include "docim.h"
#include "docim.moc"
#include "gtwriter.h"
#include "scpaths.h"
#include "scribusstructs.h"
#include <qobject.h>
#include <qcstring.h>
#include <qmessagebox.h>
#include <qprocess.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qtextcodec.h>

Go to the source code of this file.

Functions

bool hasAntiword ()
QString FileFormatName ()
 Returns the string with importer description.
QStringList FileExtensions ()
void GetText (QString filename, QString encoding, bool textOnly, gtWriter *writer)

Function Documentation

QStringList FileExtensions ( )

Definition at line 61 of file docim.cpp.

{
       if (hasAntiword())
       return QStringList("doc");
       else
              return QStringList();
}

Here is the call graph for this function:

QString FileFormatName ( )

Returns the string with importer description.

Return values:
QStringa string or QString::null when the plugin should not be loaded.

Definition at line 53 of file docim.cpp.

{
       if (hasAntiword())
       return QObject::tr("Word Documents");
       else
              return QString::null;
}

Here is the call graph for this function:

void GetText ( QString  filename,
QString  encoding,
bool  textOnly,
gtWriter *  writer 
)

Definition at line 69 of file docim.cpp.

{
       if (!hasAntiword())
              return;

       DocIm *dim = new DocIm(filename, encoding, textOnly, writer);
       while (dim->isRunning())
       {
#ifndef _WIN32
              usleep(5000);
#else
              Sleep(5);
#endif
       }
       delete dim;
}

Here is the call graph for this function:

Definition at line 25 of file docim.cpp.

{
       static bool searched = false, found = false;
       if (searched) // searched already in this run
              return found;

       QProcess *test = new QProcess();
#if defined(_WIN32)
       test->addArgument( ScPaths::instance().libDir() + "tools/antiword/antiword.exe" );
#else
       test->addArgument("antiword");
#endif
       if (test->start())
       {
              found = true;
              test->tryTerminate();
#ifndef _WIN32
              usleep(5000);
#else
              Sleep(5);
#endif
              test->kill(); 
       }
       delete test;
       searched = true;
       return found;
}

Here is the caller graph for this function: