Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 119

wt-doc-3.2.3-1.fc18.noarch.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>Wt examples: /home/koen/project/wt/public-git/wt/examples/wt-homepage/Home.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt examples
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/koen/project/wt/public-git/wt/examples/wt-homepage/Home.h</div>  </div>
</div>
<div class="contents">
<a href="Home_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This may look like C code, but it&#39;s really -*- C++ -*-</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * See the LICENSE file for terms of use.</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef HOME_H_</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define HOME_H_</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;Wt/WApplication&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;Wt/WContainerWidget&gt;</span>
<a name="l00012"></a>00012 
<a name="l00013"></a>00013 <span class="keyword">namespace </span>Wt {
<a name="l00014"></a>00014   <span class="keyword">class </span><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WMenu.html">WMenu</a>;
<a name="l00015"></a>00015   <span class="keyword">class </span><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WStackedWidget.html">WStackedWidget</a>;
<a name="l00016"></a>00016   <span class="keyword">class </span><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTabWidget.html">WTabWidget</a>;
<a name="l00017"></a>00017   <span class="keyword">class </span><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTreeNode.html">WTreeNode</a>;
<a name="l00018"></a>00018   <span class="keyword">class </span><a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTable.html">WTable</a>;
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="keyword">using namespace </span>Wt;
<a name="l00022"></a>00022 
<a name="l00023"></a><a class="code" href="structLang.html">00023</a> <span class="keyword">struct </span><a class="code" href="structLang.html">Lang</a> {
<a name="l00024"></a><a class="code" href="structLang.html#a1ffce423958422c15d3815f2fb860888">00024</a>   <a class="code" href="structLang.html">Lang</a>(<span class="keyword">const</span> std::string&amp; code, <span class="keyword">const</span> std::string&amp; path,
<a name="l00025"></a>00025        <span class="keyword">const</span> std::string&amp; shortDescription,
<a name="l00026"></a>00026        <span class="keyword">const</span> std::string&amp; longDescription) :
<a name="l00027"></a>00027     code_(code),
<a name="l00028"></a>00028     path_(path),
<a name="l00029"></a>00029     shortDescription_(shortDescription),
<a name="l00030"></a>00030     longDescription_(longDescription) {
<a name="l00031"></a>00031   }
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="structLang.html#a54adb85bff423da7c2bcb760ea938b57">00033</a>   std::string code_, path_, <a class="code" href="structLang.html#a54adb85bff423da7c2bcb760ea938b57">shortDescription_</a>, longDescription_;
<a name="l00034"></a>00034 };
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">/*</span>
<a name="l00037"></a>00037 <span class="comment"> * A utility container widget which defers creation of its single</span>
<a name="l00038"></a>00038 <span class="comment"> * child widget until the container is loaded (which is done on-demand</span>
<a name="l00039"></a>00039 <span class="comment"> * by a WMenu). The constructor takes the create function for the</span>
<a name="l00040"></a>00040 <span class="comment"> * widget as a parameter.</span>
<a name="l00041"></a>00041 <span class="comment"> *</span>
<a name="l00042"></a>00042 <span class="comment"> * We use this to defer widget creation until needed.</span>
<a name="l00043"></a>00043 <span class="comment"> */</span>
<a name="l00044"></a>00044 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Function&gt;
<a name="l00045"></a><a class="code" href="classDeferredWidget.html">00045</a> <span class="keyword">class </span><a class="code" href="classDeferredWidget.html">DeferredWidget</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">public</span>:
<a name="l00048"></a><a class="code" href="classDeferredWidget.html#a8e90b8d5cc839155128b0b0e80a98f46">00048</a>   <a class="code" href="classDeferredWidget.html">DeferredWidget</a>(Function f)
<a name="l00049"></a>00049     : f_(f) { }
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="keyword">private</span>:
<a name="l00052"></a><a class="code" href="classDeferredWidget.html#a26cbcbe066441fb23643709738c844ca">00052</a>   <span class="keywordtype">void</span> <a class="code" href="classDeferredWidget.html#a26cbcbe066441fb23643709738c844ca">load</a>() {
<a name="l00053"></a>00053     <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#ae7ded9ad52a90fce9d54e8d1c299fd72">WContainerWidget::load</a>();
<a name="l00054"></a>00054     <span class="keywordflow">if</span> (count() == 0)
<a name="l00055"></a>00055       addWidget(f_());
<a name="l00056"></a>00056   }
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="classDeferredWidget.html#ad3b3a7c5891a2d033abef04e43099a36">00058</a>   Function <a class="code" href="classDeferredWidget.html#ad3b3a7c5891a2d033abef04e43099a36">f_</a>;
<a name="l00059"></a>00059 };
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Function&gt;
<a name="l00062"></a><a class="code" href="Home_8h.html#a163cca4b185f096f1744d57f32d7a0d6">00062</a> <a class="code" href="classDeferredWidget.html">DeferredWidget&lt;Function&gt;</a> *<a class="code" href="Home_8h.html#a163cca4b185f096f1744d57f32d7a0d6">deferCreate</a>(Function f)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classDeferredWidget.html">DeferredWidget&lt;Function&gt;</a>(f);
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066 
<a name="l00067"></a><a class="code" href="classHome.html">00067</a> <span class="keyword">class </span><a class="code" href="classHome.html">Home</a> : <span class="keyword">public</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WApplication.html">WApplication</a>
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069 <span class="keyword">public</span>:
<a name="l00070"></a>00070   <a class="code" href="classHome.html">Home</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a>&amp; env,
<a name="l00071"></a>00071        <span class="keyword">const</span> std::string&amp; title,
<a name="l00072"></a>00072        <span class="keyword">const</span> std::string&amp; resourceBundle, <span class="keyword">const</span> std::string&amp; cssPath);
<a name="l00073"></a>00073   
<a name="l00074"></a>00074   <span class="keyword">virtual</span> ~<a class="code" href="classHome.html">Home</a>();
<a name="l00075"></a>00075 
<a name="l00076"></a>00076   <span class="keywordtype">void</span> googleAnalyticsLogger();
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keyword">protected</span>:
<a name="l00079"></a>00079   <span class="keyword">virtual</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *examples() = 0;
<a name="l00080"></a>00080   <span class="keyword">virtual</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *createQuoteForm() = 0;
<a name="l00081"></a>00081   <span class="keyword">virtual</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *sourceViewer(<span class="keyword">const</span> std::string &amp;deployPath) = 0;
<a name="l00082"></a>00082   <span class="keyword">virtual</span> std::string filePrefix() <span class="keyword">const</span> = 0;
<a name="l00083"></a>00083 
<a name="l00084"></a>00084   <span class="keywordtype">void</span> init();
<a name="l00085"></a>00085   
<a name="l00086"></a><a class="code" href="classHome.html#a36ac9d0c0798abaa419790c4888686b0">00086</a>   <span class="keywordtype">void</span> <a class="code" href="classHome.html#a36ac9d0c0798abaa419790c4888686b0">addLanguage</a>(<span class="keyword">const</span> <a class="code" href="structLang.html">Lang</a>&amp; l) { languages.push_back(l); }
<a name="l00087"></a>00087   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *linkSourceBrowser(<span class="keyword">const</span> std::string&amp; examplePath);
<a name="l00088"></a>00088 
<a name="l00089"></a><a class="code" href="classHome.html#a3abd28c83870cb52131d423ec9e73b6b">00089</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTabWidget.html">WTabWidget</a> *<a class="code" href="classHome.html#a3abd28c83870cb52131d423ec9e73b6b">examplesMenu_</a>;
<a name="l00090"></a>00090   
<a name="l00091"></a>00091   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> tr(<span class="keyword">const</span> <span class="keywordtype">char</span> *key);
<a name="l00092"></a>00092   std::string href(<span class="keyword">const</span> std::string&amp; url, <span class="keyword">const</span> std::string&amp; description);
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="classHome.html#a31eeca8eae96be5b0b1d53ef96a3b4b7">00094</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTable.html">WTable</a> *<a class="code" href="classHome.html#a31eeca8eae96be5b0b1d53ef96a3b4b7">releases_</a>;
<a name="l00095"></a>00095   <span class="keywordtype">void</span> readReleases(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTable.html">WTable</a> *releaseTable);
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="keyword">private</span>:
<a name="l00098"></a><a class="code" href="classHome.html#a5a9ef14d23cc67713ebf5a34633623ed">00098</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#a5a9ef14d23cc67713ebf5a34633623ed">homePage_</a>;
<a name="l00099"></a><a class="code" href="classHome.html#a81dbbcea6732bbcf70b267fc2a2083ff">00099</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#a81dbbcea6732bbcf70b267fc2a2083ff">sourceViewer_</a>;
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="classHome.html#a2aea43a56a1f6a8b40307d9e7c1d68b5">00101</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WStackedWidget.html">WStackedWidget</a> *<a class="code" href="classHome.html#a2aea43a56a1f6a8b40307d9e7c1d68b5">contents_</a>;
<a name="l00102"></a>00102 
<a name="l00103"></a>00103   <span class="keywordtype">void</span> createHome();
<a name="l00104"></a>00104 
<a name="l00105"></a>00105   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *introduction();
<a name="l00106"></a>00106   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *blog();
<a name="l00107"></a>00107   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *status();
<a name="l00108"></a>00108   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *features();
<a name="l00109"></a>00109   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *documentation();
<a name="l00110"></a>00110   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *community();
<a name="l00111"></a>00111   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *otherLanguage();
<a name="l00112"></a>00112   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *download();
<a name="l00113"></a>00113   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *quoteForm();
<a name="l00114"></a>00114 
<a name="l00115"></a><a class="code" href="classHome.html#aaf48ed4f0046a83106757460964042be">00115</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WMenu.html">WMenu</a> *<a class="code" href="classHome.html#aaf48ed4f0046a83106757460964042be">mainMenu_</a>;
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="classHome.html#a526a7423463c4662ad824b5580d7ed3e">00117</a>   <span class="keywordtype">int</span> <a class="code" href="classHome.html#a526a7423463c4662ad824b5580d7ed3e">language_</a>;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119   <span class="keywordtype">void</span> readNews(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WTable.html">WTable</a> *newsTable, <span class="keyword">const</span> std::string&amp; newsfile);
<a name="l00120"></a>00120   
<a name="l00121"></a>00121   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *wrapView(<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *(<a class="code" href="classHome.html">Home</a>::*createFunction)());
<a name="l00122"></a>00122 
<a name="l00123"></a>00123   <span class="keywordtype">void</span> updateTitle();
<a name="l00124"></a>00124   <span class="keywordtype">void</span> setLanguage(<span class="keywordtype">int</span> language);
<a name="l00125"></a>00125   <span class="keywordtype">void</span> setLanguageFromPath();
<a name="l00126"></a>00126   <span class="keywordtype">void</span> setup();
<a name="l00127"></a>00127   <span class="keywordtype">void</span> logInternalPath(<span class="keyword">const</span> std::string&amp; path);
<a name="l00128"></a>00128   <span class="keywordtype">void</span> chatSetUser(<span class="keyword">const</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a>&amp; name);
<a name="l00129"></a>00129 
<a name="l00130"></a><a class="code" href="classHome.html#ab5152bb8733fe428f5d6d80d17dc42a2">00130</a>   <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *<a class="code" href="classHome.html#ab5152bb8733fe428f5d6d80d17dc42a2">sideBarContent_</a>;
<a name="l00131"></a>00131   
<a name="l00132"></a><a class="code" href="classHome.html#ac50d32f527dcd701f238b4db2e0bafa0">00132</a>   std::vector&lt;Lang&gt; <a class="code" href="classHome.html#ac50d32f527dcd701f238b4db2e0bafa0">languages</a>;
<a name="l00133"></a>00133 };
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="preprocessor">#endif // HOME_H_</span>
</pre></div></div>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>