Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > f37f2c0b149d5391818dc5157943cda0 > files > 86

gnome-chemistry-utils-devel-0.10.8-3mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>The Gnome Chemistry Utils: gcp::Operation Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacegcp.html">gcp</a>::<a class="el" href="classgcp_1_1Operation.html">Operation</a>
  </div>
</div>
<div class="contents">
<h1>gcp::Operation Class Reference</h1><!-- doxytag: class="gcp::Operation" -->
<p><code>#include &lt;<a class="el" href="operation_8h_source.html">gcp/operation.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for gcp::Operation:</div>
<div class="dynsection">
 <div class="center">
  <img src="classgcp_1_1Operation.gif" usemap="#gcp::Operation_map" alt=""/>
  <map id="gcp::Operation_map" name="gcp::Operation_map">
<area href="classgcp_1_1AddOperation.html" alt="gcp::AddOperation" shape="rect" coords="0,56,134,80"/>
<area href="classgcp_1_1DeleteOperation.html" alt="gcp::DeleteOperation" shape="rect" coords="144,56,278,80"/>
<area href="classgcp_1_1ModifyOperation.html" alt="gcp::ModifyOperation" shape="rect" coords="288,56,422,80"/>
</map>
 </div>
</div>

<p><a href="classgcp_1_1Operation-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#ac011147054c6ef84c9f58e5022598faf">Operation</a> (<a class="el" href="classgcp_1_1Document.html">Document</a> *pDoc, unsigned long ID)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a28f5207dfb9c9f0f586f98d687f12600">Undo</a> ()=0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a56848b25e63e60453b3273a12eed901e">Redo</a> ()=0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#ae713d95b1c4d6487a02ca6d3176b4f13">AddObject</a> (<a class="el" href="classgcu_1_1Object.html">gcu::Object</a> *pObject, unsigned type=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#ab4e256613f7cb52a85cc4fc077b7fdf9">AddNode</a> (xmlNodePtr node, unsigned type=0)</td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a0cc4ca5b232a38642980fff597611e83">Add</a> (unsigned type=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a4666a4ff04bf033791b3c7cad89eeedf">Delete</a> (unsigned type=0)</td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">xmlNodePtr *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a2e4bb51639a31e1f434566acebe12fad">m_Nodes</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Base operation class for the Undo/Redo framework. This class is virtual since some methods are pure virtual. </p>

<p>Definition at line <a class="el" href="operation_8h_source.html#l00061">61</a> of file <a class="el" href="operation_8h_source.html">operation.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac011147054c6ef84c9f58e5022598faf"></a><!-- doxytag: member="gcp::Operation::Operation" ref="ac011147054c6ef84c9f58e5022598faf" args="(Document *pDoc, unsigned long ID)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">gcp::Operation::Operation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classgcp_1_1Document.html">Document</a> *&nbsp;</td>
          <td class="paramname"> <em>pDoc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&nbsp;</td>
          <td class="paramname"> <em>ID</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pDoc</em>&nbsp;</td><td>a document. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ID</em>&nbsp;</td><td>a unique operation ID for the document and the session.</td></tr>
  </table>
  </dd>
</dl>
<p>Creates a new operation. Operations should always created by calls to <a class="el" href="classgcp_1_1Document.html#a9929825e838d4b3e16a033e9393b4fa6">Document::GetNewOperation()</a>. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0cc4ca5b232a38642980fff597611e83"></a><!-- doxytag: member="gcp::Operation::Add" ref="a0cc4ca5b232a38642980fff597611e83" args="(unsigned type=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gcp::Operation::Add </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>type</em> = <code>0</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>a number indicationg the role of the stored objects.</td></tr>
  </table>
  </dd>
</dl>
<p>The <em>type</em> argument is only significant for the <a class="el" href="classgcp_1_1ModifyOperation.html">gcp::ModifyOperation</a> class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.</p>
<p>Adds the stored objects to the document owning the operation. </p>

</div>
</div>
<a class="anchor" id="ab4e256613f7cb52a85cc4fc077b7fdf9"></a><!-- doxytag: member="gcp::Operation::AddNode" ref="ab4e256613f7cb52a85cc4fc077b7fdf9" args="(xmlNodePtr node, unsigned type=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void gcp::Operation::AddNode </td>
          <td>(</td>
          <td class="paramtype">xmlNodePtr&nbsp;</td>
          <td class="paramname"> <em>node</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>type</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>node</em>&nbsp;</td><td>an xml node related to the changes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>a number indicationg the role of the stored objects.</td></tr>
  </table>
  </dd>
</dl>
<p>The <em>type</em> argument is only significant for the <a class="el" href="classgcp_1_1ModifyOperation.html">gcp::ModifyOperation</a> class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.</p>
<p>Adds the node to the document owning the operation. This might be used when Objects are not available such as when editing text. </p>

</div>
</div>
<a class="anchor" id="ae713d95b1c4d6487a02ca6d3176b4f13"></a><!-- doxytag: member="gcp::Operation::AddObject" ref="ae713d95b1c4d6487a02ca6d3176b4f13" args="(gcu::Object *pObject, unsigned type=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void gcp::Operation::AddObject </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classgcu_1_1Object.html">gcu::Object</a> *&nbsp;</td>
          <td class="paramname"> <em>pObject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>type</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pObject</em>&nbsp;</td><td>an Object affected by the changes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>a number indicationg the role of the stored objects.</td></tr>
  </table>
  </dd>
</dl>
<p>The <em>type</em> argument is only significant for the <a class="el" href="classgcp_1_1ModifyOperation.html">gcp::ModifyOperation</a> class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.</p>
<p>Adds an object to the operation. Typically, modifying an object whould need code like: </p>
<div class="fragment"><pre class="fragment">        Object *obj;
        <span class="comment">// Initialize the object pointer so that it points to a valid object</span>
                ...
        Document *doc = obj-&gt;GetDocument ();
        <a class="code" href="classgcp_1_1Operation.html#ac011147054c6ef84c9f58e5022598faf">Operation</a> *op = doc-&gt;GetNewOperation (<a class="code" href="namespacegcp.html#aa8e6482c44ad2980e2054f056212c34faa40c4e6a93decefec7ed4bdb3f39299d">GCP_MODIFY_OPERATION</a>);
        op-&gt;AddObject (obj, 0);
        <span class="comment">// Modify the object</span>
                ...
        op-&gt;AddObject (obj, 1);
        doc-&gt;FinishOperation ();
</pre></div> 
</div>
</div>
<a class="anchor" id="a4666a4ff04bf033791b3c7cad89eeedf"></a><!-- doxytag: member="gcp::Operation::Delete" ref="a4666a4ff04bf033791b3c7cad89eeedf" args="(unsigned type=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gcp::Operation::Delete </td>
          <td>(</td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>type</em> = <code>0</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>a number indicationg the role of the stored objects.</td></tr>
  </table>
  </dd>
</dl>
<p>The <em>type</em> argument is only significant for the <a class="el" href="classgcp_1_1ModifyOperation.html">gcp::ModifyOperation</a> class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.</p>
<p>Deletes the stored objects to the document owning the operation. </p>

</div>
</div>
<a class="anchor" id="a56848b25e63e60453b3273a12eed901e"></a><!-- doxytag: member="gcp::Operation::Redo" ref="a56848b25e63e60453b3273a12eed901e" args="()=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void gcp::Operation::Redo </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Redo the changes represented by this operation. </p>

<p>Implemented in <a class="el" href="classgcp_1_1AddOperation.html#aaf12ab044554080715aecc3e5bc3082c">gcp::AddOperation</a>, <a class="el" href="classgcp_1_1DeleteOperation.html#a73f44294304cdc254798ff628ba2a8ea">gcp::DeleteOperation</a>, and <a class="el" href="classgcp_1_1ModifyOperation.html#ac59a5f760a739b5f189fb13b69e45184">gcp::ModifyOperation</a>.</p>

</div>
</div>
<a class="anchor" id="a28f5207dfb9c9f0f586f98d687f12600"></a><!-- doxytag: member="gcp::Operation::Undo" ref="a28f5207dfb9c9f0f586f98d687f12600" args="()=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void gcp::Operation::Undo </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Undo the changes represented by this operation. </p>

<p>Implemented in <a class="el" href="classgcp_1_1AddOperation.html#ad61d355fff6d754064e55c74fe907d06">gcp::AddOperation</a>, <a class="el" href="classgcp_1_1DeleteOperation.html#a50475f9addf33577065aabfe008c4abb">gcp::DeleteOperation</a>, and <a class="el" href="classgcp_1_1ModifyOperation.html#a1ea02ee5adf214f88d33c2c1ae8e2187">gcp::ModifyOperation</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a2e4bb51639a31e1f434566acebe12fad"></a><!-- doxytag: member="gcp::Operation::m_Nodes" ref="a2e4bb51639a31e1f434566acebe12fad" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">xmlNodePtr* <a class="el" href="classgcp_1_1Operation.html#a2e4bb51639a31e1f434566acebe12fad">gcp::Operation::m_Nodes</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The xml nodes storing the changes. </p>

<p>Definition at line <a class="el" href="operation_8h_source.html#l00145">145</a> of file <a class="el" href="operation_8h_source.html">operation.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="operation_8h_source.html">operation.h</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 6 18:33:54 2009 for The Gnome Chemistry Utils by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>