<!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"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>The Gnome Chemistry Utils: gcp::Operation Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">The Gnome Chemistry Utils  <span id="projectnumber">0.14.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main 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> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacegcp.html">gcp</a></li><li class="navelem"><a class="el" href="classgcp_1_1Operation.html">Operation</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> | <a href="#pro-attribs">Protected Attributes</a> | <a href="classgcp_1_1Operation-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">gcp::Operation Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include <<a class="el" href="operation_8h_source.html">gcp/operation.h</a>></code></p> <div class="dynheader"> Inheritance diagram for gcp::Operation:</div> <div class="dyncontent"> <div class="center"> <img src="classgcp_1_1Operation.png" 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> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ac011147054c6ef84c9f58e5022598faf"><td class="memItemLeft" align="right" valign="top"> </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 class="memitem:a28f5207dfb9c9f0f586f98d687f12600"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a28f5207dfb9c9f0f586f98d687f12600">Undo</a> ()=0</td></tr> <tr class="memitem:a56848b25e63e60453b3273a12eed901e"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a56848b25e63e60453b3273a12eed901e">Redo</a> ()=0</td></tr> <tr class="memitem:ae713d95b1c4d6487a02ca6d3176b4f13"><td class="memItemLeft" align="right" valign="top">virtual void </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 class="memitem:ab4e256613f7cb52a85cc4fc077b7fdf9"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#ab4e256613f7cb52a85cc4fc077b7fdf9">AddNode</a> (xmlNodePtr node, unsigned type=0)</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:a0cc4ca5b232a38642980fff597611e83"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a0cc4ca5b232a38642980fff597611e83">Add</a> (unsigned type=0)</td></tr> <tr class="memitem:a4666a4ff04bf033791b3c7cad89eeedf"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a4666a4ff04bf033791b3c7cad89eeedf">Delete</a> (unsigned type=0)</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="pro-attribs"></a> Protected Attributes</h2></td></tr> <tr class="memitem:a2e4bb51639a31e1f434566acebe12fad"><td class="memItemLeft" align="right" valign="top">xmlNodePtr * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcp_1_1Operation.html#a2e4bb51639a31e1f434566acebe12fad">m_Nodes</a></td></tr> </table> <a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><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> </div><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="ac011147054c6ef84c9f58e5022598faf"></a> <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> * </td> <td class="paramname"><em>pDoc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned long </td> <td class="paramname"><em>ID</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pDoc</td><td>a document. </td></tr> <tr><td class="paramname">ID</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> <h2>Member Function Documentation</h2> <a class="anchor" id="a0cc4ca5b232a38642980fff597611e83"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void gcp::Operation::Add </td> <td>(</td> <td class="paramtype">unsigned </td> <td class="paramname"><em>type</em> = <code>0</code></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">type</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> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void gcp::Operation::AddNode </td> <td>(</td> <td class="paramtype">xmlNodePtr </td> <td class="paramname"><em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned </td> <td class="paramname"><em>type</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">node</td><td>an xml node related to the changes. </td></tr> <tr><td class="paramname">type</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> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <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> * </td> <td class="paramname"><em>pObject</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned </td> <td class="paramname"><em>type</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">pObject</td><td>an Object affected by the changes. </td></tr> <tr><td class="paramname">type</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"><div class="line">Object *obj;</div> <div class="line"><span class="comment">// Initialize the object pointer so that it points to a valid object</span></div> <div class="line"> ...</div> <div class="line">Document *doc = obj->GetDocument ();</div> <div class="line"><a class="code" href="classgcp_1_1Operation.html#ac011147054c6ef84c9f58e5022598faf">Operation</a> *op = doc->GetNewOperation (<a class="code" href="namespacegcp.html#aa8e6482c44ad2980e2054f056212c34faa40c4e6a93decefec7ed4bdb3f39299d">GCP_MODIFY_OPERATION</a>);</div> <div class="line">op->AddObject (obj, 0);</div> <div class="line"><span class="comment">// Modify the object</span></div> <div class="line"> ...</div> <div class="line">op->AddObject (obj, 1);</div> <div class="line">doc->FinishOperation ();</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="a4666a4ff04bf033791b3c7cad89eeedf"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void gcp::Operation::Delete </td> <td>(</td> <td class="paramtype">unsigned </td> <td class="paramname"><em>type</em> = <code>0</code></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">type</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> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void gcp::Operation::Redo </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </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_1ModifyOperation.html#ac59a5f760a739b5f189fb13b69e45184">gcp::ModifyOperation</a>, <a class="el" href="classgcp_1_1DeleteOperation.html#a73f44294304cdc254798ff628ba2a8ea">gcp::DeleteOperation</a>, and <a class="el" href="classgcp_1_1AddOperation.html#aaf12ab044554080715aecc3e5bc3082c">gcp::AddOperation</a>.</p> </div> </div> <a class="anchor" id="a28f5207dfb9c9f0f586f98d687f12600"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void gcp::Operation::Undo </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </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_1ModifyOperation.html#a1ea02ee5adf214f88d33c2c1ae8e2187">gcp::ModifyOperation</a>, <a class="el" href="classgcp_1_1DeleteOperation.html#a50475f9addf33577065aabfe008c4abb">gcp::DeleteOperation</a>, and <a class="el" href="classgcp_1_1AddOperation.html#ad61d355fff6d754064e55c74fe907d06">gcp::AddOperation</a>.</p> </div> </div> <h2>Member Data Documentation</h2> <a class="anchor" id="a2e4bb51639a31e1f434566acebe12fad"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">xmlNodePtr* gcp::Operation::m_Nodes</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </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><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Thu Mar 14 2013 17:34:30 for The Gnome Chemistry Utils by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>