<html><head><title>Chapter 2. KOffice Technology</title><link rel="stylesheet" href="help:/common/tde-default.css" type="text/css"><link rel="stylesheet" href="help:/common/tde-docs.css" type="text/css"><link rel="stylesheet" href="help:/common/tde-localised.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.67.2"><meta name="keywords" content="KDE, KOffice"><link rel="start" href="index.html" title="KOffice"><link rel="up" href="index.html" title="KOffice"><link rel="prev" href="features.html" title="Overview of KOffice features"><link rel="next" href="configuration.html" title="Chapter 3. Configuring KOffice and Your System"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="GENERATOR" content="TDE XSL Stylesheet V1.13 using libxslt"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div style="background-image: url(help:/common/top-middle.png); width: 100%; height: 131px;"><div style="position: absolute;                      right: 0px;"><img src="help:/common/top-right-konqueror.png" style="margin: 0px" alt=""></div><div style="position: absolute;                         top: 25px;                          left: 140px;                          text-align: left;                          font-size: xx-large;                          font-weight: bold;                          text-shadow: #000000 1px 1px 5px;                         color: #fff"><span class="application">KOffice</span> Technology</div></div><div style="margin-top: 20px; background-color: #white;                        color: black;                       margin-left: 20px;                        margin-right: 20px;"><div style="position: absolute;                          left: 20px;"><a accesskey="p" href="features.html">Prev</a></div><div style="position: absolute;                          right: 20px;"><a accesskey="n" href="configuration.html">Next</a></div><div class="navCenter"> </div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id128"></a>Chapter 2. <span class="application">KOffice</span> Technology</h2></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tdeparts"></a>KParts - the building blocks of <span class="application">KOffice</span></h2></div></div></div><p>
Each <span class="application">KOffice</span> application is designed to fulfill very specific needs.
For example, <span class="application">KSpread</span> is a program for manipulating spreadsheets, while
<span class="application">KWord</span> is a program for word processing. By focusing on a specific
area, each program aims for perfection in exactly this area. However,
depending on what you do with <span class="application">KOffice</span>, you'll often want to take
advantage of functionality provided by different applications, but in
the <span class="emphasis"><em>same</em></span> document.
</p><p>
Suppose that you are preparing a document in <span class="application">KWord</span> and want to
illustrate some point using a table. While <span class="application">KWord</span> provides its own
functionality for the insertion of tables, this may not be enough for
your needs. For example, you may want to use certain currency data
formats or to do calculations using spreadsheet formulae. Now, some
<span class="application">KWord</span> programmer certainly <span class="emphasis"><em>could</em></span> try to implement
this functionality. However, <span class="application">KWord</span> would never be as good as <span class="application">KSpread</span>
in this field; and if it tried to implement all the functionality you
might possibly need, it would end up becoming unreasonably complex and
the source code would become impossible to maintain.
</p><p>
The alternative to this is KParts. Its philosophy is simple: let every
application do what it does best. 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="compound-docs"></a>Compound documents with KParts</h3></div></div></div><p> 
With KParts, your documents can use <span class="emphasis"><em>all</em></span>
functionality offered by <span class="emphasis"><em>all</em></span> <span class="application">KOffice</span>
applications. You can take advantage of this by inserting so-called
“<span class="quote">parts</span>” into your document. Every one of those parts is
essentially another document, that is, “<span class="quote">a document within a
document</span>”.
</p><p>
In the example mentioned above, you would simply insert a <span class="application">KSpread</span> part
into your <span class="application">KWord</span> document. Then, whenever you edit your table,
<span class="application">KSpread</span> would take control in the background. Control would return to
<span class="application">KWord</span> when you stop working on the table and start working on text
again. The only change you would notice is that the toolbars and menus,
while editing the table, reflect the functionality of <span class="application">KSpread</span> instead
of that of <span class="application">KWord</span>. This ability to include the functionality of one
application in another is called “<span class="quote">embedding</span>”.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="tdeparts-try-it"></a>Using KParts in your document</h3></div></div></div><p>
If you have never worked with compound documents, you may find them
confusing at first. The following step-by-step instructions show you
that using KParts is just as easy as working with a single application.
</p><div class="procedure"><a name="id165"></a><p class="title"><b>Procedure 2.1. Inserting a <span class="application">KSpread</span> part into a <span class="application">KWord</span> application</b></p><ol type="1"><li><p>Start <span class="application">KWord</span>. You can do that either from the panel or by typing
<strong class="userinput"><code><span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kword</strong></span></span></code></strong> at the command line.
</p></li><li><p>
Start a new, blank document. You may want to type some sample text.
</p></li><li><p>
Select <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenu">Insert</span></span>-&gt;<span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guisubmenu">Object Frame</span></span>-&gt;<span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="guiitem"><span class="guimenuitem">Spreadsheets</span></span>. You'll notice that the mouse cursor has
changed to a cross. This form of the cursor indicates that you are supposed 
to select an area.
</p></li><li><p> 
Press the <span class="mousebutton">left</span> mouse button mouse button where you want the upper left corner of
your table to be, hold it and drag it to the lower right corner. Release
the button. Now a dialog appears that gives you the possibility to 
insert an existing document or to create a new one. Create a blank worksheet.
That's it--you're done.
</p></li></ol></div><p>
Easy, isn't it? You should now see a table frame in your <span class="application">KWord</span>
document.  Now, doubleclick inside the table to see what happens. You'll
notice that:
</p><div class="itemizedlist"><ul type="disc"><li><p>
Your menubars and toolbars have changed. They now reflect those of
<span class="application">KSpread</span>.
</p></li><li><p>
Your table frame now contains the elements of a <span class="application">KSpread</span> view, with
scrollbars, a tab bar for the selection of tables, <span class="abbrev">etc.</span>
</p></li></ul></div><p>
Try editing the table. You'll see that it's not different from using
<span class="application">KSpread</span>. In fact you <span class="emphasis"><em>are</em></span> using <span class="application">KSpread</span>.
</p><p>
Now click somewhere into your <span class="application">KWord</span> document, outside of the table
area.  The menubars and toolbars should change back to those of
<span class="application">KWord</span>, the elements of the <span class="application">KSpread</span> view should disappear. Your table
stays and still reflects all of the changes you've applied to it.
</p><p>
KParts are easy to use. Try inserting other parts or even parts in
parts.
</p></div></div></div><div style="background-color: #white; color: black;                  margin-top: 20px; margin-left: 20px;                  margin-right: 20px;"><div style="position: absolute; left: 20px;"><a accesskey="p" href="features.html">Prev</a></div><div style="position: absolute; right: 20px;"><a accesskey="n" href="configuration.html">Next</a></div><div align="center"><a accesskey="h" href="index.html">Home</a></div></div><div style="background-color: #white;   color: black;         margin-left: 20px;   margin-right: 20px;"><div class="navLeft">Overview of <span class="application">KOffice</span> features </div><div class="navRight"> Configuring <span class="application">KOffice</span> and Your System</div><div class="navCenter"><a accesskey="u" href="index.html">Up</a></div></div><br><br><div class="bannerBottom" style="background-image: url(help:/common/bottom-middle.png);                                        background-repeat: x-repeat;                                         width: 100%;                                         height: 100px;                                         bottom:0px;"><div class="BannerBottomRight"><img src="help:/common/bottom-right.png" style="margin: 0px" alt=""></div><div class="bannerBottomLeft"><img src="help:/common/bottom-left.png" style="margin: 0px;" alt=""></div><div id="comments" style="position:relative; top: 5px; left: 1em; height:85px; width: 50%; color: #000000"><p>Would you like to comment or contribute an update to this page?<br>
        Send feedback to the <a href="mailto:devels@trinitydesktop.org" style="background:transparent; color:#000000; text-decoration: underline;">TDE Development Team</a></p></div></div></body></html>