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

Class Index

killustrator'KIllustratorDocument (./koffice/killustrator/koffice/KIllustrator_doc.h:50)

class KIllustratorDocument : public KoDocument
{
    Q_OBJECT
public:
    KIllustratorDocument( QObject* parent = 0, const char* name = 0, bool singleViewMode = false );
    ~KIllustratorDocument ();

    // Overloaded methods from KoDocument

    virtual bool saveChildren (KoStore* _store, const char *_path);
    bool save (std::ostream& os, const char *fmt);
    bool completeSaving (KoStore* store);

    bool load (std::istream& is, KoStore* store);
    bool loadChildren (KoStore* store);
    bool hasToWriteMultipart ();

    /**
     * Overloaded @ref Part::createView
     */
    KoView* createView( QWidget* parent, const char* name );

    /**
     * Overloaded @ref Part::createShell
     */
    KoMainWindow* createShell();

    /**
     * Overloaded @ref KoDocument::initDoc.
     */
    bool initDoc ();

    /**
     * Overloaded @ref KoDocument::mimeType.
     */
    QCString mimeType() const { return "application/x-killustrator"; }

    /**
     * Overloaded @ref ContainerPart::insertChild.
     */
    void insertChild( KoDocumentChild* child );
	
    /**
     * Overloaded @ref Part::paintContent
     */
    void paintContent( QPainter& painter, const QRect& rect, bool transparent );
	
    // Killustrator stuff
    GDocument* gdoc();

    void insertPart (const QRect& rect, KoDocumentEntry& e);
    void changeChildGeometry (KIllustratorChild* child, const QRect& r);

signals:
    void partInserted (KIllustratorChild* child, GPart* part);
    void childGeometryChanged (KIllustratorChild* child);

private:
    GDocument* m_gdocument;
};

killustrator'KIllustratorDocument::KIllustratorDocument() (./koffice/killustrator/koffice/KIllustrator_doc.cc:55)

KIllustratorDocument::KIllustratorDocument( QObject* parent, const char* name, bool singleViewMode )
    : KoDocument( parent, name, singleViewMode )
{
    setInstance( KIllustratorFactory::global() );
    m_gdocument = new GDocument();
    GObject::registerPrototype ("object", new GPart ());
}


killustrator'KIllustratorDocument::~KIllustratorDocument() (./koffice/killustrator/koffice/KIllustrator_doc.cc:63)

KIllustratorDocument::~KIllustratorDocument()
{
    delete m_gdocument;
}


killustrator'KIllustratorDocument::save() (./koffice/killustrator/koffice/KIllustrator_doc.cc:68)

bool KIllustratorDocument::save (ostream& os, const char* )
{
    cout << "save KIllu to stream !!!!!!!!!!!!!!!" << endl;
    return m_gdocument->saveToXml (os);
}


killustrator'KIllustratorDocument::load() (./koffice/killustrator/koffice/KIllustrator_doc.cc:74)

bool KIllustratorDocument::load (istream& in, KoStore* )
{
  cout << "load KIllu from stream !!!!!!!!!" << endl;
  if ( m_gdocument->readFromXml (in)) {

    // now look for part objects in order to create the child list
    vector<GLayer*>& layers = (vector<GLayer*>&) m_gdocument->getLayers();
    vector<GLayer*>::iterator i = layers.begin ();
    for (; i != layers.end (); i++) {
      GLayer* layer = *i;
      list<GObject*>& contents = layer->objects ();
      for (list<GObject*>::iterator oi = contents.begin ();
	   oi != contents.end (); oi++) {
	if ((*oi)->isA ("GPart")) {
	  GPart *part = (GPart *) *oi;
	  insertChild (part->getChild ());
	}
      }
    }
    return true;
  }
  return false;
}


killustrator'KIllustratorDocument::loadChildren() (./koffice/killustrator/koffice/KIllustrator_doc.cc:98)

bool KIllustratorDocument::loadChildren (KoStore* store)
{
  QListIterator<KoDocumentChild> it ( children() );
  for (; it.current (); ++it) {
    if (! ((KoDocumentChild*)it.current())->loadDocument (store))
      return false;
  }

  return true;
}


killustrator'KIllustratorDocument::saveChildren() (./koffice/killustrator/koffice/KIllustrator_doc.cc:109)

bool KIllustratorDocument::saveChildren (KoStore* _store, const char *_path)
{
  cerr << "void KIllustratorDocument::saveChildren( KOStore::Store _store, const char *_path )" << endl;
  int i = 0;
  QListIterator<KoDocumentChild> it ( children() );
  for( ; it.current(); ++it )
  {
    QString path = QString( "%1/%2" ).arg( _path ).arg( i++ );
    if ( !((KoDocumentChild*)it.current())->document()->saveToStore( _store, "", path ) )
      return false;
  }
  return true;
}


killustrator'KIllustratorDocument::completeSaving() (./koffice/killustrator/koffice/KIllustrator_doc.cc:123)

bool KIllustratorDocument::completeSaving (KoStore* store)
{
  if (!store)
    return true;

  return true;
}


killustrator'KIllustratorDocument::hasToWriteMultipart() (./koffice/killustrator/koffice/KIllustrator_doc.cc:131)

bool KIllustratorDocument::hasToWriteMultipart ()
{
    return (children().count() > 0 );
}


killustrator'KIllustratorDocument::insertPart() (./koffice/killustrator/koffice/KIllustrator_doc.cc:136)

void KIllustratorDocument::insertPart (const QRect& rect, KoDocumentEntry& e)
{
    KoDocument* doc = e.createDoc();
    if ( !doc )
	return;

    if (! doc->initDoc() )
    {
	QMessageBox::critical ((QWidget *) 0L, i18n ("KIllustrator Error"),
			       i18n ("Could not insert document"), i18n ("OK"));
	return;
    }

    KIllustratorChild *child = new KIllustratorChild (this, doc, rect );
    insertChild (child);

    GPart* part = new GPart (child);
    m_gdocument->insertObject (part);
    emit partInserted (child, part);
}



killustrator'KIllustratorDocument::insertChild() (./koffice/killustrator/koffice/KIllustrator_doc.cc:158)

void KIllustratorDocument::insertChild( KoDocumentChild* child )
{
    KoDocument::insertChild( child );

    setModified (true);
}


killustrator'KIllustratorDocument::changeChildGeometry() (./koffice/killustrator/koffice/KIllustrator_doc.cc:165)

void KIllustratorDocument::changeChildGeometry (KIllustratorChild* child, const QRect& r)
{
  child->setGeometry (r);
  setModified (true);
  emit childGeometryChanged (child);
}


killustrator'KIllustratorDocument::initDoc() (./koffice/killustrator/koffice/KIllustrator_doc.cc:172)

bool KIllustratorDocument::initDoc()
{
  return true;
}


killustrator'KIllustratorDocument::createView() (./koffice/killustrator/koffice/KIllustrator_doc.cc:177)

KoView* KIllustratorDocument::createView( QWidget* parent, const char* name )
{
    KIllustratorView* view = new KIllustratorView( parent, name, this );
    addView( view );

    return view;
}


killustrator'KIllustratorDocument::createShell() (./koffice/killustrator/koffice/KIllustrator_doc.cc:185)

KoMainWindow* KIllustratorDocument::createShell()
{
    KoMainWindow* shell = new KIllustratorShell;
    shell->show();

    return shell;
}


killustrator'KIllustratorDocument::paintContent() (./koffice/killustrator/koffice/KIllustrator_doc.cc:193)

void KIllustratorDocument::paintContent( QPainter& painter, const QRect& rect, bool transparent )
{
    Rect r( (float)rect.x(), (float)rect.y(), (float)rect.width(), (float)rect.height() );

    if ( !transparent )
	painter.fillRect( rect, white );
    m_gdocument->drawContentsInRegion( painter, r );
}


killustrator'KIllustratorDocument::gdoc() (./koffice/killustrator/koffice/KIllustrator_doc.cc:202)

GDocument* KIllustratorDocument::gdoc()
{
    return m_gdocument;
}