1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: /home/koen/project/wt/public-git/wt/examples/wt-homepage/Home.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main 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>
<h1>/home/koen/project/wt/public-git/wt/examples/wt-homepage/Home.h</h1><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'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 <Wt/WApplication></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <Wt/WContainerWidget></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#1ffce423958422c15d3815f2fb860888">00024</a> <a class="code" href="structLang.html#1ffce423958422c15d3815f2fb860888">Lang</a>(<span class="keyword">const</span> std::string& code, <span class="keyword">const</span> std::string& path,
<a name="l00025"></a>00025 <span class="keyword">const</span> std::string& shortDescription,
<a name="l00026"></a>00026 <span class="keyword">const</span> std::string& longDescription) :
<a name="l00027"></a>00027 <a class="code" href="structLang.html#d46e6f93e1002656aca93a4e9b1d0ebc">code_</a>(code),
<a name="l00028"></a>00028 <a class="code" href="structLang.html#e4b25b734896099b9551d16ee49873aa">path_</a>(path),
<a name="l00029"></a>00029 <a class="code" href="structLang.html#54adb85bff423da7c2bcb760ea938b57">shortDescription_</a>(shortDescription),
<a name="l00030"></a>00030 <a class="code" href="structLang.html#199e1b44f54b75ae92224900409771ff">longDescription_</a>(longDescription) {
<a name="l00031"></a>00031 }
<a name="l00032"></a>00032
<a name="l00033"></a><a class="code" href="structLang.html#54adb85bff423da7c2bcb760ea938b57">00033</a> std::string <a class="code" href="structLang.html#d46e6f93e1002656aca93a4e9b1d0ebc">code_</a>, <a class="code" href="structLang.html#e4b25b734896099b9551d16ee49873aa">path_</a>, <a class="code" href="structLang.html#54adb85bff423da7c2bcb760ea938b57">shortDescription_</a>, <a class="code" href="structLang.html#199e1b44f54b75ae92224900409771ff">longDescription_</a>;
<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> <<span class="keyword">typename</span> Function>
<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#8e90b8d5cc839155128b0b0e80a98f46">00048</a> <a class="code" href="classDeferredWidget.html#8e90b8d5cc839155128b0b0e80a98f46">DeferredWidget</a>(Function f)
<a name="l00049"></a>00049 : <a class="code" href="classDeferredWidget.html#d3b3a7c5891a2d033abef04e43099a36">f_</a>(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#26cbcbe066441fb23643709738c844ca">00052</a> <span class="keywordtype">void</span> <a class="code" href="classDeferredWidget.html#26cbcbe066441fb23643709738c844ca">load</a>() {
<a name="l00053"></a>00053 WContainerWidget::load();
<a name="l00054"></a>00054 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html#2cfe66d9b62940f889e99538a9f478d2">addWidget</a>(<a class="code" href="classDeferredWidget.html#d3b3a7c5891a2d033abef04e43099a36">f_</a>());
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056
<a name="l00057"></a><a class="code" href="classDeferredWidget.html#d3b3a7c5891a2d033abef04e43099a36">00057</a> Function <a class="code" href="classDeferredWidget.html#d3b3a7c5891a2d033abef04e43099a36">f_</a>;
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="keyword">template</span> <<span class="keyword">typename</span> Function>
<a name="l00061"></a><a class="code" href="Home_8h.html#7338fd9d846b012122165f3eb6ceb04a">00061</a> <a class="code" href="classDeferredWidget.html">DeferredWidget<Function></a> *<a class="code" href="Home_8h.html#7338fd9d846b012122165f3eb6ceb04a">deferCreate</a>(Function f)
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classDeferredWidget.html">DeferredWidget<Function></a>(f);
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065
<a name="l00066"></a><a class="code" href="classHome.html">00066</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="l00067"></a>00067 {
<a name="l00068"></a>00068 <span class="keyword">public</span>:
<a name="l00069"></a>00069 <a class="code" href="classHome.html#e5021fb481a207618c292c81cfbe7457">Home</a>(<span class="keyword">const</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WEnvironment.html">WEnvironment</a>& env,
<a name="l00070"></a>00070 <span class="keyword">const</span> std::string& <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#86aefff2a3438fecdfde3e0e7dd6e5da">title</a>,
<a name="l00071"></a>00071 <span class="keyword">const</span> std::string& resourceBundle, <span class="keyword">const</span> std::string& cssPath);
<a name="l00072"></a>00072
<a name="l00073"></a>00073 <span class="keyword">virtual</span> <a class="code" href="classHome.html#7b27d4931b4b445d279202a098a0e8fd">~Home</a>();
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="keywordtype">void</span> <a class="code" href="classHome.html#3c26dd54dbc1a2020776f2d6cb2aa6bf">googleAnalyticsLogger</a>();
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">protected</span>:
<a name="l00078"></a>00078 <span class="keyword">virtual</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#359a8de9caa986c141dcce1b3968b0a3">examples</a>() = 0;
<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> *<a class="code" href="classHome.html#e84380a9384ee089e7395a3a1ae49455">download</a>() = 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> *<a class="code" href="classHome.html#bd90cc8e49527b1c18e01f92663e4862">sourceViewer</a>(<span class="keyword">const</span> std::string &deployPath) = 0;
<a name="l00081"></a>00081 <span class="keyword">virtual</span> std::string <a class="code" href="classHome.html#7e96a995cdb7d825dad505eaf976022c">filePrefix</a>() <span class="keyword">const</span> = 0;
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="keywordtype">void</span> <a class="code" href="classHome.html#63520babce460a8f3e1c8d02eb9bc137">init</a>();
<a name="l00084"></a>00084
<a name="l00085"></a><a class="code" href="classHome.html#36ac9d0c0798abaa419790c4888686b0">00085</a> <span class="keywordtype">void</span> <a class="code" href="classHome.html#36ac9d0c0798abaa419790c4888686b0">addLanguage</a>(<span class="keyword">const</span> <a class="code" href="structLang.html">Lang</a>& l) { <a class="code" href="classHome.html#c50d32f527dcd701f238b4db2e0bafa0">languages</a>.push_back(l); }
<a name="l00086"></a>00086 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#6360a674c4d5dcc614411c283af8035b">linkSourceBrowser</a>(<span class="keyword">const</span> std::string& examplePath);
<a name="l00087"></a>00087
<a name="l00088"></a><a class="code" href="classHome.html#3abd28c83870cb52131d423ec9e73b6b">00088</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTabWidget.html">WTabWidget</a> *<a class="code" href="classHome.html#3abd28c83870cb52131d423ec9e73b6b">examplesMenu_</a>;
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html">WString</a> <a class="code" href="classHome.html#7c8a4abe8f7ade4407333aaaee98c57e">tr</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *key);
<a name="l00091"></a>00091 std::string <a class="code" href="classHome.html#4c6b5887e984c16b88385e83805c28a2">href</a>(<span class="keyword">const</span> std::string& <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WApplication.html#455fe732c1dd087ed507bc5975420828">url</a>, <span class="keyword">const</span> std::string& description);
<a name="l00092"></a>00092
<a name="l00093"></a><a class="code" href="classHome.html#31eeca8eae96be5b0b1d53ef96a3b4b7">00093</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTable.html">WTable</a> *<a class="code" href="classHome.html#31eeca8eae96be5b0b1d53ef96a3b4b7">releases_</a>;
<a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="classHome.html#afa9b1d1821f2501c80eb6666b54e90e">readReleases</a>(<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WTable.html">WTable</a> *releaseTable);
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="keyword">private</span>:
<a name="l00097"></a><a class="code" href="classHome.html#5a9ef14d23cc67713ebf5a34633623ed">00097</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#5a9ef14d23cc67713ebf5a34633623ed">homePage_</a>;
<a name="l00098"></a><a class="code" href="classHome.html#81dbbcea6732bbcf70b267fc2a2083ff">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#81dbbcea6732bbcf70b267fc2a2083ff">sourceViewer_</a>;
<a name="l00099"></a>00099
<a name="l00100"></a><a class="code" href="classHome.html#2aea43a56a1f6a8b40307d9e7c1d68b5">00100</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WStackedWidget.html">WStackedWidget</a> *<a class="code" href="classHome.html#2aea43a56a1f6a8b40307d9e7c1d68b5">contents_</a>;
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#7588f1119522016d3f455d3fc3ba05ee">initHome</a>();
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#471befeff5c65714689e8ade7efdcb38">introduction</a>();
<a name="l00105"></a>00105 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#40445c00ba2b7a08b018291cf666f17d">blog</a>();
<a name="l00106"></a>00106 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#0cc1b83013ca364378ebf7e548f6e34a">status</a>();
<a name="l00107"></a>00107 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#11f3739ebaf43eb01698aaef2b136a19">features</a>();
<a name="l00108"></a>00108 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#4f384190a3cbf49f1fecdf3f0f33c234">documentation</a>();
<a name="l00109"></a>00109 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#4be006ace81f78b276571bcc4d7cfb46">community</a>();
<a name="l00110"></a>00110 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#07340aa45ed31efb3b2d6b98f2e495ba">otherLanguage</a>();
<a name="l00111"></a>00111
<a name="l00112"></a><a class="code" href="classHome.html#af48ed4f0046a83106757460964042be">00112</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WMenu.html">WMenu</a> *<a class="code" href="classHome.html#af48ed4f0046a83106757460964042be">mainMenu_</a>;
<a name="l00113"></a>00113
<a name="l00114"></a><a class="code" href="classHome.html#526a7423463c4662ad824b5580d7ed3e">00114</a> <span class="keywordtype">int</span> <a class="code" href="classHome.html#526a7423463c4662ad824b5580d7ed3e">language_</a>;
<a name="l00115"></a>00115
<a name="l00116"></a>00116 <span class="keywordtype">void</span> <a class="code" href="classHome.html#15952af63255f1be2c6cb756d51c77b2">readNews</a>(<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& newsfile);
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WWidget.html">WWidget</a> *<a class="code" href="classHome.html#5bd2b198e4e02d1f05dc85f3a13adca0">wrapView</a>(<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="l00119"></a>00119
<a name="l00120"></a>00120 <span class="keywordtype">void</span> <a class="code" href="classHome.html#6762815f91ed1f02ab35c34284a95ca9">updateTitle</a>();
<a name="l00121"></a>00121 <span class="keywordtype">void</span> <a class="code" href="classHome.html#582d22dab888b8edf9ec9988c5e36b05">setLanguage</a>(<span class="keywordtype">int</span> language);
<a name="l00122"></a>00122 <span class="keywordtype">void</span> <a class="code" href="classHome.html#d381554da62b59ddbb9ae85b7c5ef93a">setLanguageFromPath</a>();
<a name="l00123"></a>00123 <span class="keywordtype">void</span> <a class="code" href="classHome.html#070118440bcd93bf8e511847c61cf97e">setup</a>();
<a name="l00124"></a>00124 <span class="keywordtype">void</span> <a class="code" href="classHome.html#bf2e03a8963dbd0c84ad14c5f8d9244e">logInternalPath</a>(<span class="keyword">const</span> std::string& path);
<a name="l00125"></a>00125
<a name="l00126"></a><a class="code" href="classHome.html#b5152bb8733fe428f5d6d80d17dc42a2">00126</a> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *<a class="code" href="classHome.html#b5152bb8733fe428f5d6d80d17dc42a2">sideBarContent_</a>;
<a name="l00127"></a>00127
<a name="l00128"></a><a class="code" href="classHome.html#c50d32f527dcd701f238b4db2e0bafa0">00128</a> std::vector<Lang> <a class="code" href="classHome.html#c50d32f527dcd701f238b4db2e0bafa0">languages</a>;
<a name="l00129"></a>00129 };
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="preprocessor">#endif // HOME_H_</span>
</pre></div></div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>
|