<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trinitydesktop.org/index.php?action=history&amp;feed=atom&amp;title=KOffice_Library_Classes</id>
	<title>KOffice Library Classes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trinitydesktop.org/index.php?action=history&amp;feed=atom&amp;title=KOffice_Library_Classes"/>
	<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;action=history"/>
	<updated>2026-05-04T14:25:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=2237&amp;oldid=prev</id>
		<title>Blu256: Blu256 moved page KOffice Document and View Introduction (KDE3 Architecture) to KOffice Library Classes: Simplify</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=2237&amp;oldid=prev"/>
		<updated>2022-04-21T16:19:25Z</updated>

		<summary type="html">&lt;p&gt;Blu256 moved page &lt;a href=&quot;/KOffice_Document_and_View_Introduction_(KDE3_Architecture)&quot; class=&quot;mw-redirect&quot; title=&quot;KOffice Document and View Introduction (KDE3 Architecture)&quot;&gt;KOffice Document and View Introduction (KDE3 Architecture)&lt;/a&gt; to &lt;a href=&quot;/KOffice_Library_Classes&quot; title=&quot;KOffice Library Classes&quot;&gt;KOffice Library Classes&lt;/a&gt;: Simplify&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:19, 21 April 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=2236&amp;oldid=prev</id>
		<title>Blu256: -Applicable to TDE (redundant), categories to bottom</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=2236&amp;oldid=prev"/>
		<updated>2022-04-21T16:19:03Z</updated>

		<summary type="html">&lt;p&gt;-Applicable to TDE (redundant), categories to bottom&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:19, 21 April 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_2_6_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_0_0_rhs&quot;&gt;&lt;/a&gt;To perform all the embedding magic in KOffice, the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;KOffice Library Classes&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt; have to extend the TDEParts concept. Due to that these classes are a little bit difficult to understand if you look at them for the first time without any background information. Even TDE/TQt savvy programmers might have to look very closely to fully understand these concepts. This might be one reason that there are rather few KOffice programmers around. With this document I&#039;m trying to point out the basic concepts which are hidden deeply inside KOffice. I won&#039;t discuss the gory (implementation) details, but with that overview and some source code studies you should be able to write or improve a KOffice application. However, before starting a brand new KOffice application you should think whether it would be better to fix and improve an already existing KOffice application. At the moment many applications lack a maintainer (e.g. KFormula and KChart). I know that it&#039;s more fun to create own applications, but due to the lack of developers we need all helping hands we can get to fix the existing applications.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_4_1_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_1_0_lhs&quot;&gt;&lt;/a&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_4_2_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_2_0_lhs&quot;&gt;&lt;/a&gt;[[Category:Architecture]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_4_3_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_2_1_lhs&quot;&gt;&lt;/a&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;{{Applicable to TDE}}&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_0_0_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_2_6_lhs&quot;&gt;&lt;/a&gt;To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the TDEParts concept. Due to that these classes are a little bit difficult to understand if you look at them for the first time without any background information. Even TDE/TQt savvy programmers might have to look very closely to fully understand these concepts. This might be one reason that there are rather few KOffice programmers around. With this document I&#039;m trying to point out the basic concepts which are hidden deeply inside KOffice. I won&#039;t discuss the gory (implementation) details, but with that overview and some source code studies you should be able to write or improve a KOffice application. However, before starting a brand new KOffice application you should think whether it would be better to fix and improve an already existing KOffice application. At the moment many applications lack a maintainer (e.g. KFormula and KChart). I know that it&#039;s more fun to create own applications, but due to the lack of developers we need all helping hands we can get to fix the existing applications.&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;As a starting point for your studies you might want to use the example application in koffice/example. Note: Remove the configure.in.in file from this directory because it prevents the example from being compiled! Of course it&#039;s also funny to play with KWord and friends, but in the beginning it&#039;s easier with the example app, because it&#039;s really straightforward.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;As a starting point for your studies you might want to use the example application in koffice/example. Note: Remove the configure.in.in file from this directory because it prevents the example from being compiled! Of course it&#039;s also funny to play with KWord and friends, but in the beginning it&#039;s easier with the example app, because it&#039;s really straightforward.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;The reason for that is, that it&#039;s not feasible to have one widget for every embedded part because of performance problems (imagine a document with 100 embedded formulas).&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;The reason for that is, that it&#039;s not feasible to have one widget for every embedded part because of performance problems (imagine a document with 100 embedded formulas).&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_1_0_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_4_1_rhs&quot;&gt;&lt;/a&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_2_0_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_4_2_rhs&quot;&gt;&lt;/a&gt;[[Category:Architecture]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_2_1_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_4_3_rhs&quot;&gt;&lt;/a&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=1708&amp;oldid=prev</id>
		<title>Blu256: Updated</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=1708&amp;oldid=prev"/>
		<updated>2021-08-22T21:51:30Z</updated>

		<summary type="html">&lt;p&gt;Updated&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:51, 22 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_16_1_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_0_0_rhs&quot;&gt;&lt;/a&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_16_2_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_0_1_rhs&quot;&gt;&lt;/a&gt;[[Category:Architecture]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-right&quot; title=&quot;Paragraph was moved. Click to jump to old location.&quot; href=&quot;#movedpara_16_3_lhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_0_2_rhs&quot;&gt;&lt;/a&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;{{Applicable to TDE}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;KParts&lt;/del&gt; concept. Due to that these classes are a little bit difficult to understand if you look at them for the first time without any background information. Even &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;KDE&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Qt&lt;/del&gt; savvy programmers might have to look very closely to fully understand these concepts. This might be one reason that there are rather few KOffice programmers around. With this document I&#039;m trying to point out the basic concepts which are hidden deeply inside KOffice. I won&#039;t discuss the gory (implementation) details, but with that overview and some source code studies you should be able to write or improve a KOffice application. However, before starting a brand new KOffice application you should think whether it would be better to fix and improve an already existing KOffice application. At the moment many applications lack a maintainer (e.g. KFormula and KChart). I know that it&#039;s more fun to create own applications, but due to the lack of developers we need all helping hands we can get to fix the existing applications.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TDEParts&lt;/ins&gt; concept. Due to that these classes are a little bit difficult to understand if you look at them for the first time without any background information. Even &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TDE&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TQt&lt;/ins&gt; savvy programmers might have to look very closely to fully understand these concepts. This might be one reason that there are rather few KOffice programmers around. With this document I&#039;m trying to point out the basic concepts which are hidden deeply inside KOffice. I won&#039;t discuss the gory (implementation) details, but with that overview and some source code studies you should be able to write or improve a KOffice application. However, before starting a brand new KOffice application you should think whether it would be better to fix and improve an already existing KOffice application. At the moment many applications lack a maintainer (e.g. KFormula and KChart). I know that it&#039;s more fun to create own applications, but due to the lack of developers we need all helping hands we can get to fix the existing applications.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;As a starting point for your studies you might want to use the example application in koffice/example. Note: Remove the configure.in.in file from this directory because it prevents the example from being compiled! Of course it&#039;s also funny to play with KWord and friends, but in the beginning it&#039;s easier with the example app, because it&#039;s really straightforward.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;As a starting point for your studies you might want to use the example application in koffice/example. Note: Remove the configure.in.in file from this directory because it prevents the example from being compiled! Of course it&#039;s also funny to play with KWord and friends, but in the beginning it&#039;s easier with the example app, because it&#039;s really straightforward.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== The Shell ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== The Shell ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;The shell of a KOffice application is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;basicly&lt;/del&gt; a KTMainWindow with some extra spice. There is nothing spectacular there, and you normally only use the plain shell from the KOffice Libraries. If you really want to perform some shell tricks you&#039;ll have to derive from it, like KOffice Workspace does. It provides a basic File and a Help menu, see koffice/lib/kofficecore/koffice_shell.rc &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;The shell of a KOffice application is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;basically&lt;/ins&gt; a KTMainWindow with some extra spice. There is nothing spectacular there, and you normally only use the plain shell from the KOffice Libraries. If you really want to perform some shell tricks you&#039;ll have to derive from it, like KOffice Workspace does. It provides a basic File and a Help menu, see koffice/lib/kofficecore/koffice_shell.rc &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== The View ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== The View ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;The view class sets the XMLGUI rc-file and creates all the actions which are bound to the view (e.g. zooming,...). You may also create document specific actions there (like most of the current applications do, because some time ago you couldn&#039;t create actions in the document), but generally you should prefer to define the actions where the are used. If you aren&#039;t familiar with [https://web.archive.org/web/20110131141802/http://developer.kde.org/documentation/tutorials/xmlui/preface.html XMLGUI] and the [https://web.archive.org/web/20020613050800/http://developer.kde.org/documentation/kde2arch/actionpattern.html action] pattern, I suggest reading the documentation for this first.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;The view class sets the XMLGUI rc-file and creates all the actions which are bound to the view (e.g. zooming,...). You may also create document specific actions there (like most of the current applications do, because some time ago you couldn&#039;t create actions in the document), but generally you should prefer to define the actions where the are used. If you aren&#039;t familiar with [https://web.archive.org/web/20110131141802/http://developer.kde.org/documentation/tutorials/xmlui/preface.html XMLGUI] and the [https://web.archive.org/web/20020613050800/http://developer.kde.org/documentation/kde2arch/actionpattern.html action] pattern, I suggest reading the documentation for this first.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;There are two very important methods in this class: paintEvent() and updateReadWrite(). The paintEvent() is responsible to set up a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;QPainter&lt;/del&gt; and prepare the document to be painted. This includes setting up zooming, double buffering, transparency, and so on. I can&#039;t tell you what you&#039;ll see there, because every application does this differently. Anyway, you can leave this part as it is done in the example code for the beginning. You can also see that this method calls paintEverything() which in turn calls the same method for the document. More on that later.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;There are two very important methods in this class: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paintEvent()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;updateReadWrite()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;. The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paintEvent()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; is responsible to set up a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TQPainter&lt;/ins&gt; and prepare the document to be painted. This includes setting up zooming, double buffering, transparency, and so on. I can&#039;t tell you what you&#039;ll see there, because every application does this differently. Anyway, you can leave this part as it is done in the example code for the beginning. You can also see that this method calls &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paintEverything()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; which in turn calls the same method for the document. More on that later.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;If a plain widget is not feasible as &quot;main widget&quot;, also other widgets like &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;QScrollView&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;QTableView&lt;/del&gt;, or something else may be used, but KoView&#039;s canvas() method has to be overriden to return a pointer to this widget. There are also other useful KoView methods to provide neat features; I suggest reading the KoView header (koffice/lib/kofficecore/koView.h) for further information.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;If a plain widget is not feasible as &quot;main widget&quot;, also other widgets like &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TQScrollView&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TQTableView&lt;/ins&gt;, or something else may be used, but KoView&#039;s &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;canvas()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; method has to be overriden to return a pointer to this widget. There are also other useful KoView methods to provide neat features; I suggest reading the KoView header (koffice/lib/kofficecore/koView.h) for further information.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;The updateReadWrite() method is necessary, because KOffice can be switched to a &quot;view-only&quot; mode where the user is not able to change the document, but only view it.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;updateReadWrite()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; method is necessary, because KOffice can be switched to a &quot;view-only&quot; mode where the user is not able to change the document, but only view it.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== The Document ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== The Document ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;This is a main part of the application. The document has to be able to paint itself to a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;QPainter&lt;/del&gt; (paintEverything() and friends), and it has to store all the information of the document, of course. It&#039;s called example_part.cc, because it&#039;s a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;KPart&lt;/del&gt;, internally. Therefore &quot;document&quot; and &quot;part&quot; are often used synonymously. As you can see, there are several methods which have to be reimplemented, otherwise the application won&#039;t compile (they are pure virtual). There are also other methods (for loading, saving,...) which have to be reimplemented if loading/saving, and so on should be supported. Please have a look at koffice/lib/kofficecore/koDocument.h for further information.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;This is a main part of the application. The document has to be able to paint itself to a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TQPainter&lt;/ins&gt; (&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paintEverything()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; and friends), and it has to store all the information of the document, of course. It&#039;s called example_part.cc, because it&#039;s a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TDEPart&lt;/ins&gt;, internally. Therefore &quot;document&quot; and &quot;part&quot; are often used synonymously. As you can see, there are several methods which have to be reimplemented, otherwise the application won&#039;t compile (they are pure virtual). There are also other methods (for loading, saving,...) which have to be reimplemented if loading/saving, and so on should be supported. Please have a look at koffice/lib/kofficecore/koDocument.h for further information.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;== Framework ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;== Framework ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 48:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;Basically it works like this: &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;Basically it works like this: &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;* If the application runs standalone, the main() function creates a KoApplication. This application creates a document and a shell. The shell creates a view and in the end all this stuff is shown.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;* If the application runs standalone, the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;main()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; function creates a KoApplication. This application creates a document and a shell. The shell creates a view and in the end all this stuff is shown.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;* If the application gets embedded, the &quot;parent&quot; application creates only a document of its child. You&#039;ve heard above that a document is &quot;invisible&quot; without a view, but this is not totally true. This is the reason for the paint*() methods in KoDocument. Whenever the document is embedded it has no &quot;real&quot; view, but it paints itself on the view widget of its parent (i.e. the parent calls the paintEverything() method of the child document and passes its own painter). When the child gets activated (by a mouse click), the matching view is created and shown. Now the application is fully functional, but the shell is another one (i.e. the one from the parent application). This doesn&#039;t matter, because the shell merges the GUI of the child application (all the actions). Now only the shell&#039;s GUI (like the Help &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-&amp;gt;&lt;/del&gt; About... dialog) is provided by the shell of the parent application. Everything else in the menus and toolbars is provided by the child application.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;* If the application gets embedded, the &quot;parent&quot; application creates only a document of its child. You&#039;ve heard above that a document is &quot;invisible&quot; without a view, but this is not totally true. This is the reason for the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paint*()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; methods in KoDocument. Whenever the document is embedded it has no &quot;real&quot; view, but it paints itself on the view widget of its parent (i.e. the parent calls the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;paintEverything()&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; method of the child document and passes its own painter). When the child gets activated (by a mouse click), the matching view is created and shown. Now the application is fully functional, but the shell is another one (i.e. the one from the parent application). This doesn&#039;t matter, because the shell merges the GUI of the child application (all the actions). Now only the shell&#039;s GUI (like the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/ins&gt;Help &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;→&lt;/ins&gt; About...&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt; dialog) is provided by the shell of the parent application. Everything else in the menus and toolbars is provided by the child application.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;The reason for that is, that it&#039;s not feasible to have one widget for every embedded part because of performance problems (imagine a document with 100 embedded formulas).&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;The reason for that is, that it&#039;s not feasible to have one widget for every embedded part because of performance problems (imagine a document with 100 embedded formulas).&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_0_0_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_16_1_lhs&quot;&gt;&lt;/a&gt;[[Category:KDE3]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_0_1_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_16_2_lhs&quot;&gt;&lt;/a&gt;[[Category:Architecture]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;a class=&quot;mw-diff-movedpara-left&quot; title=&quot;Paragraph was moved. Click to jump to new location.&quot; href=&quot;#movedpara_0_2_rhs&quot;&gt;&amp;#x26AB;&lt;/a&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&lt;a name=&quot;movedpara_16_3_lhs&quot;&gt;&lt;/a&gt;[[Category:Developers]]&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=364&amp;oldid=prev</id>
		<title>imported&gt;Eliddell: Created page with &quot;== Introduction ==  To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the KParts concept. Due to that these classes are a little bit di...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.org/index.php?title=KOffice_Library_Classes&amp;diff=364&amp;oldid=prev"/>
		<updated>2014-06-09T21:25:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Introduction ==  To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the KParts concept. Due to that these classes are a little bit di...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To perform all the embedding magic in KOffice, the KOffice Library Classes have to extend the KParts concept. Due to that these classes are a little bit difficult to understand if you look at them for the first time without any background information. Even KDE/Qt savvy programmers might have to look very closely to fully understand these concepts. This might be one reason that there are rather few KOffice programmers around. With this document I&amp;#039;m trying to point out the basic concepts which are hidden deeply inside KOffice. I won&amp;#039;t discuss the gory (implementation) details, but with that overview and some source code studies you should be able to write or improve a KOffice application. However, before starting a brand new KOffice application you should think whether it would be better to fix and improve an already existing KOffice application. At the moment many applications lack a maintainer (e.g. KFormula and KChart). I know that it&amp;#039;s more fun to create own applications, but due to the lack of developers we need all helping hands we can get to fix the existing applications.&lt;br /&gt;
&lt;br /&gt;
As a starting point for your studies you might want to use the example application in koffice/example. Note: Remove the configure.in.in file from this directory because it prevents the example from being compiled! Of course it&amp;#039;s also funny to play with KWord and friends, but in the beginning it&amp;#039;s easier with the example app, because it&amp;#039;s really straightforward.&lt;br /&gt;
&lt;br /&gt;
== Structure of a KOffice Binary ==&lt;br /&gt;
&lt;br /&gt;
KOffice applications are libraries which are loaded via a small wrapper application. Normally all the application&amp;#039;s code will be compiled and linked to a library (e.g. libkword.so) and the main.cc file in the directory creates a KoApplication. The start() method of this class uses a special C &amp;quot;bootstrap&amp;quot; function (init_libkword()) to load this library (via dlopen() and friends). Then it creates a document and a shell - this &amp;quot;starts&amp;quot; a KOffice application (i.e. brings up a main window and opens an empty document or shows a template dialog). Applications have to be structured that way, otherwise they wouldn&amp;#039;t be embeddable in other KOffice documents!&lt;br /&gt;
&lt;br /&gt;
== Basic Structure of a KOffice Application ==&lt;br /&gt;
&lt;br /&gt;
KOffice applications aim to follow the &amp;#039;&amp;#039;&amp;#039;document/view model&amp;#039;&amp;#039;&amp;#039;. This means there is a &amp;#039;&amp;#039;&amp;#039;document&amp;#039;&amp;#039;&amp;#039; which holds all the necessary information, can store itself to disk, load a file from disk, and so on. To show this document, a view has to be created. As the document is highly independent from the view, it is possible to create more than one view to show it. Of course the document can be shown with different zoom factors and so on (this doesn&amp;#039;t affect the document, but only the view), but if you change the document in one view (e.g. by writing a formula in a KSpread cell) all the other views will be updated, too. This means you don&amp;#039;t have to worry about data-loss, file corruption, and so on, because you work on &amp;#039;&amp;#039;&amp;#039;multiple views for one document&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A rule of thumb (of course not totally true) is, that you can&amp;#039;t see a document, but you need at least one view to show it to the user.&lt;br /&gt;
&lt;br /&gt;
To support embedding, the view mustn&amp;#039;t be a main window with a menubar, toolbars, and so on, but an ordinary widget. This implies that there has to be something else, because if you can&amp;#039;t see documents and the view is only a widget, where do all the toolbars come from...? Indeed, KOffice uses a &amp;#039;&amp;#039;&amp;#039;shell&amp;#039;&amp;#039;&amp;#039; to show the view (as a kind of main widget).&lt;br /&gt;
&lt;br /&gt;
Now I&amp;#039;ll discuss the three main parts of a KOffice application (namely shell, view, and document) in a more detailed manner. Then I&amp;#039;ll give you some basic information on the additional stuff which is needed to make an application work (like the factory, the wrapper application, .desktop files, and so on). After that I&amp;#039;ll give you a short overview on the interaction between these components. This will help you to understand the behavior of applications, and it will hopefully make it easier to find bugs.&lt;br /&gt;
&lt;br /&gt;
Please have a look at the appropriate example files while reading the next paragraphs, because I&amp;#039;m referring to them in various sections.&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
The shell of a KOffice application is basicly a KTMainWindow with some extra spice. There is nothing spectacular there, and you normally only use the plain shell from the KOffice Libraries. If you really want to perform some shell tricks you&amp;#039;ll have to derive from it, like KOffice Workspace does. It provides a basic File and a Help menu, see koffice/lib/kofficecore/koffice_shell.rc &lt;br /&gt;
&lt;br /&gt;
== The View ==&lt;br /&gt;
&lt;br /&gt;
The view class sets the XMLGUI rc-file and creates all the actions which are bound to the view (e.g. zooming,...). You may also create document specific actions there (like most of the current applications do, because some time ago you couldn&amp;#039;t create actions in the document), but generally you should prefer to define the actions where the are used. If you aren&amp;#039;t familiar with [https://web.archive.org/web/20110131141802/http://developer.kde.org/documentation/tutorials/xmlui/preface.html XMLGUI] and the [https://web.archive.org/web/20020613050800/http://developer.kde.org/documentation/kde2arch/actionpattern.html action] pattern, I suggest reading the documentation for this first.&lt;br /&gt;
&lt;br /&gt;
There are two very important methods in this class: paintEvent() and updateReadWrite(). The paintEvent() is responsible to set up a QPainter and prepare the document to be painted. This includes setting up zooming, double buffering, transparency, and so on. I can&amp;#039;t tell you what you&amp;#039;ll see there, because every application does this differently. Anyway, you can leave this part as it is done in the example code for the beginning. You can also see that this method calls paintEverything() which in turn calls the same method for the document. More on that later.&lt;br /&gt;
&lt;br /&gt;
If a plain widget is not feasible as &amp;quot;main widget&amp;quot;, also other widgets like QScrollView, QTableView, or something else may be used, but KoView&amp;#039;s canvas() method has to be overriden to return a pointer to this widget. There are also other useful KoView methods to provide neat features; I suggest reading the KoView header (koffice/lib/kofficecore/koView.h) for further information.&lt;br /&gt;
&lt;br /&gt;
The updateReadWrite() method is necessary, because KOffice can be switched to a &amp;quot;view-only&amp;quot; mode where the user is not able to change the document, but only view it.&lt;br /&gt;
&lt;br /&gt;
== The Document ==&lt;br /&gt;
&lt;br /&gt;
This is a main part of the application. The document has to be able to paint itself to a QPainter (paintEverything() and friends), and it has to store all the information of the document, of course. It&amp;#039;s called example_part.cc, because it&amp;#039;s a KPart, internally. Therefore &amp;quot;document&amp;quot; and &amp;quot;part&amp;quot; are often used synonymously. As you can see, there are several methods which have to be reimplemented, otherwise the application won&amp;#039;t compile (they are pure virtual). There are also other methods (for loading, saving,...) which have to be reimplemented if loading/saving, and so on should be supported. Please have a look at koffice/lib/kofficecore/koDocument.h for further information.&lt;br /&gt;
&lt;br /&gt;
== Framework ==&lt;br /&gt;
There is some code needed to glue all this together and to make it run. This code is in main.cc and *_factory.*. These files are &amp;quot;templates&amp;quot; which mostly have to be copied and pasted. This is also true for the .desktop files and the rc-File.&lt;br /&gt;
&lt;br /&gt;
== Interaction between Shell, Document, and View ==&lt;br /&gt;
&lt;br /&gt;
As you can see, all applications support embedding, but how does this work? Well, there are several small hints on how it&amp;#039;s done in the example code, but if you really want to have exact information, please look into the kofficecore libraries.&lt;br /&gt;
&lt;br /&gt;
Basically it works like this: &lt;br /&gt;
&lt;br /&gt;
* If the application runs standalone, the main() function creates a KoApplication. This application creates a document and a shell. The shell creates a view and in the end all this stuff is shown.&lt;br /&gt;
* If the application gets embedded, the &amp;quot;parent&amp;quot; application creates only a document of its child. You&amp;#039;ve heard above that a document is &amp;quot;invisible&amp;quot; without a view, but this is not totally true. This is the reason for the paint*() methods in KoDocument. Whenever the document is embedded it has no &amp;quot;real&amp;quot; view, but it paints itself on the view widget of its parent (i.e. the parent calls the paintEverything() method of the child document and passes its own painter). When the child gets activated (by a mouse click), the matching view is created and shown. Now the application is fully functional, but the shell is another one (i.e. the one from the parent application). This doesn&amp;#039;t matter, because the shell merges the GUI of the child application (all the actions). Now only the shell&amp;#039;s GUI (like the Help -&amp;gt; About... dialog) is provided by the shell of the parent application. Everything else in the menus and toolbars is provided by the child application.&lt;br /&gt;
&lt;br /&gt;
The reason for that is, that it&amp;#039;s not feasible to have one widget for every embedded part because of performance problems (imagine a document with 100 embedded formulas).&lt;br /&gt;
&lt;br /&gt;
[[Category:KDE3]]&lt;br /&gt;
[[Category:Architecture]]&lt;br /&gt;
[[Category:Developers]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Eliddell</name></author>
	</entry>
</feed>