[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    ODF Loading
From:       Thomas Zander <zander () kde ! org>
Date:       2007-05-12 23:03:54
Message-ID: 200705130103.54428.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


(result of our discussion 'digitized' ;)

Loading ODF data is done in KOffice1 already; what is new in KOffice2 is 
that a lot of the functionality is moved to flake and its shapes.
There are some hairy usecases we discussed (I'll spare you the details) 
and we came up with the following api methods to do what we need.

/// completely replace the content of the object by the content from ODF
virtual bool KoShape::loadOdf(KoShapeLoadingContext *context, KoXmlElement 
e) = 0;

class KoTool {
  /// enum for insertOdf
  enum Insert { 
	/// insert at selection position, possibly replacing a current selection
	InsertOverSelection, 
	/// insert at the specified position, leaving the selection untouched
	InsertAtPosition 
  };
  /// insert the odf content into the (first) selected shape.
  virtual bool insertOdf((KoShapeLoadingContext *context, KoXmlElement e, 
    Insert, QPointF position = QPointF()) = 0;
}

/**
 * use the element to find out which flake plugin can load it, and returns
 * the loaded shape. The element expected is one of 'draw:line' / 
 * 'draw:frame' / etc.
 */
KoShape * KoShapeRegistry::createShapeFromOdf(KoShapeLoadingContext 
*context, KoXmlElement e) const;



/// lower prio means the shape is more generic and will be checked later
int KoShapeFactory::loadingPriority() const;

/// the name used for quick checking if this shapeFactory is able to
/// load Odf data identified by the element name.
QString KoShapeFactory::odfElementName() const;

/// returns true if this shapeFactory is able to load the ODF type 
/// started at argument element. ('draw:line' / 'draw:frame' / etc)
bool KoShapeFactory::supports(KoXmlElement e) const;

-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic