Source Code (Use browser search to find items of interest.)

Class Index

kformula'KFormulaShell (./koffice/kformula/notsoold/kformula_shell.h:12)

class KFormulaShell : public DefaultShell_impl
{
  Q_OBJECT
public:
  // C++
  KFormulaShell();
  ~KFormulaShell();
  
  // IDL
  void fileNew();

  // C++
  virtual void setDocument( KFormulaDocument *_doc );
  
  virtual bool openDocument( const char *_filename );
  virtual bool saveDocument( const char *_file, const char *_format );

  virtual void cleanUp();
  
protected:
  Document_ref m_rDoc;
};

kformula'KFormulaShell::KFormulaShell() (./koffice/kformula/kformula_shell.cc:25)

KFormulaShell::KFormulaShell( QWidget* parent, const char* name )
    : KoMainWindow( KFormulaFactory::global(), name )
{
}


kformula'KFormulaShell::~KFormulaShell() (./koffice/kformula/kformula_shell.cc:30)

KFormulaShell::~KFormulaShell()
{
}
/*
QString KFormulaShell::configFile() const
{
    return readConfigFile( locate( "data", "kformula/kformula_shell.rc",
				   KFormulaFactory::global() ) );

//    return readConfigFile( "kformula_shell.rc" );
}
*/

kformula'KFormulaShell::createDoc() (./koffice/kformula/kformula_shell.cc:42)

KoDocument* KFormulaShell::createDoc()
{
    return new KFormulaDoc;
}

kformula'KFormulaShell::KFormulaShell() (./koffice/kformula/notsoold/kformula_shell.cc:5)

KFormulaShell::KFormulaShell()
{
}


kformula'KFormulaShell::~KFormulaShell() (./koffice/kformula/notsoold/kformula_shell.cc:9)

KFormulaShell::~KFormulaShell()
{
    cleanUp();
}


kformula'KFormulaShell::cleanUp() (./koffice/kformula/notsoold/kformula_shell.cc:14)

void KFormulaShell::cleanUp()
{
    if ( m_bIsClean )
	return;

    DefaultShell_impl::cleanUp();

    m_rDoc = 0L;
}


kformula'KFormulaShell::setDocument() (./koffice/kformula/notsoold/kformula_shell.cc:24)

void KFormulaShell::setDocument( KFormulaDocument *_doc )
{
    m_rDoc = OPParts::Document::_duplicate( _doc );

    OPParts::View_var v = _doc->createView();  
    v->setPartShell( this );
    setRootPart( v );
}


kformula'KFormulaShell::fileNew() (./koffice/kformula/notsoold/kformula_shell.cc:33)

void KFormulaShell::fileNew()
{
    m_rDoc = 0L;
  
    m_rDoc = OPParts::Document::_duplicate( new KFormulaDocument );
    if ( !m_rDoc->init() )
	{
	    QMessageBox::critical( this, i18n("KFormula Error"), i18n("Could not init"), i18n(OK) );
	    return;
	}
  
    OPParts::View_var v = m_rDoc->createView();
    v->setPartShell( this );
    setRootPart( v );

    m_rMenuBar->setItemEnabled( m_idMenuFile_SaveAs, true );
    m_rToolBarFile->setItemEnabled( m_idButtonFile_Print, true );
}


kformula'KFormulaShell::openDocument() (./koffice/kformula/notsoold/kformula_shell.cc:52)

bool KFormulaShell::openDocument( const char *_filename )
{
    m_rDoc = 0L;
  
    m_rDoc = OPParts::Document::_duplicate( new KFormulaDocument );
    if ( !m_rDoc->open( _filename ) )
	return false;
  
    OPParts::View_var view = m_rDoc->createView();
    view->setPartShell( this );
    setRootPart( view );

    m_rMenuBar->setItemEnabled( m_idMenuFile_SaveAs, true );
    m_rToolBarFile->setItemEnabled( m_idButtonFile_Print, true );

    return true;
}


kformula'KFormulaShell::saveDocument() (./koffice/kformula/notsoold/kformula_shell.cc:70)

bool KFormulaShell::saveDocument( const char *_filename, const char *_format )
{
    assert( !CORBA::is_nil( m_rDoc ) );

    if ( _format == 0L || *_format == 0 )
	_format = "kch";
  
    return m_rDoc->saveAs( _filename, _format );
}