From koffice-devel Sat May 12 23:03:54 2007 From: Thomas Zander Date: Sat, 12 May 2007 23:03:54 +0000 To: koffice-devel Subject: ODF Loading Message-Id: <200705130103.54428.zander () kde ! org> X-MARC-Message: https://marc.info/?l=koffice-devel&m=117901108430571 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============2073602018==" --===============2073602018== Content-Type: multipart/signed; boundary="nextPart51267297.FhxJOPYLuW"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart51267297.FhxJOPYLuW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline (result of our discussion 'digitized' ;) Loading ODF data is done in KOffice1 already; what is new in KOffice2 is=20 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)=20 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= =20 e) =3D 0; class KoTool { /// enum for insertOdf enum Insert {=20 /// insert at selection position, possibly replacing a current selection InsertOverSelection,=20 /// insert at the specified position, leaving the selection untouched InsertAtPosition=20 }; /// insert the odf content into the (first) selected shape. virtual bool insertOdf((KoShapeLoadingContext *context, KoXmlElement e,=20 Insert, QPointF position =3D QPointF()) =3D 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' /=20 * 'draw:frame' / etc. */ KoShape * KoShapeRegistry::createShapeFromOdf(KoShapeLoadingContext=20 *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=20 /// started at argument element. ('draw:line' / 'draw:frame' / etc) bool KoShapeFactory::supports(KoXmlElement e) const; =2D-=20 Thomas Zander --nextPart51267297.FhxJOPYLuW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGRkfaCojCW6H2z/QRAsT4AJ9z+lulCa3JXy3ic2TMNApM20mYgQCeNpoT qQRmqeO7d0W4JbKN6G3dnS0= =4E75 -----END PGP SIGNATURE----- --nextPart51267297.FhxJOPYLuW-- --===============2073602018== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel --===============2073602018==--