examples/S60CppExamples/ClientServerAsync/doc/csasyncappui_8cpp-source.html

00001 "-//W3C//DTD HTML 4.0 Transitional//EN">
00002 
00003 
00004 
00005 "Content-Type" content="text/html;charset=iso-8859-1">
00006 csasyncappui.cpp Source File
00007 "style.css" rel="stylesheet" type="text/css">
00008 
00009 
00010 "0" width="100%" height="8" bgcolor="#eeeeee">
00011 
"100%" height="1">"2" color="#000000" face="Arial, Helvetica, sans-serif"> 00012 S60 5th Edition SDK
Example Applications Guide
00013 00014
class="tabs"> 00015
00020

csasyncappui.cpp

class="fragment">
class="fragment">"l00001">00001 class="comment">/*
00021 00002 * ==============================================================================
00022 00003 *  Name        : csasyncappui.cpp
00023 00004 *  Part of     : CSAsync
00024 00005 *  Interface   :
00025 00006 *  Description :
00026 00007 *  Version     :
00027 00008 *
00028 00009 *  Copyright (c) 2004-2006 Nokia Corporation.
00029 00010 *  This material, including documentation and any related
00030 00011 *  computer programs, is protected by copyright controlled by
00031 00012 *  Nokia Corporation.
00032 00013 * ==============================================================================
00033 00014 */
00034 "l00015">00015 
00035 "l00016">00016 
00036 "l00017">00017 class="comment">// INCLUDE FILES
00037 "l00018">00018 class="preprocessor">#include <eikmenup.h>
00038 "l00019">00019 class="preprocessor">#include <avkon.hrh>
00039 "l00020">00020 class="preprocessor">#include <CSAsync.rsg>
00040 "l00021">00021 
00041 "l00022">00022 class="preprocessor">#include "CSAsync.pan"
00042 "l00023">00023 class="preprocessor">#include "CSAsyncAppUi.h"
00043 "l00024">00024 class="preprocessor">#include "CSAsyncAppView.h"
00044 "l00025">00025 class="preprocessor">#include "CSAsyncDocument.h"
00045 "l00026">00026 class="preprocessor">#include "CSAsync.hrh"
00046 "l00027">00027 
00047 "l00028">00028 class="comment">// ========================= MEMBER FUNCTIONS ==================================
00048 "l00029">00029 
00049 "l00030">00030 class="comment">// -----------------------------------------------------------------------------
00050 "l00031">00031 class="comment">// CCSAsyncAppUi::CCSAsyncAppUi()
00051 "l00032">00032 class="comment">// C++ default constructor can NOT contain any code, that might leave.
00052 "l00033">00033 class="comment">// -----------------------------------------------------------------------------
00053 "l00034">00034 class="comment">//
00054 "l00035">class="code" href="class_c_c_s_async_app_ui.html#1145745dbcfc53f07104bf3b2041317c">00035 class="code" href="class_c_c_s_async_app_ui.html#1145745dbcfc53f07104bf3b2041317c">CCSAsyncAppUi::CCSAsyncAppUi()
00055 "l00036">00036     {
00056 "l00037">00037     class="comment">// No implementation required
00057 "l00038">00038     }
00058 "l00039">00039 
00059 "l00040">00040 class="comment">// -----------------------------------------------------------------------------
00060 "l00041">00041 class="comment">// CCSAsyncAppUi::ConstructL()
00061 "l00042">00042 class="comment">// Symbian 2nd phase constructor can leave.
00062 "l00043">00043 class="comment">// -----------------------------------------------------------------------------
00063 "l00044">00044 class="comment">//
00064 "l00045">class="code" href="class_c_c_s_async_app_ui.html#9ce34ba0b947863222da3c63d0481044">00045 class="keywordtype">void class="code" href="class_c_c_s_async_app_ui.html#9ce34ba0b947863222da3c63d0481044">CCSAsyncAppUi::ConstructL()
00065 "l00046">00046     {
00066 "l00047">00047     BaseConstructL();
00067 "l00048">00048 
00068 "l00049">00049     class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView = class="code" href="class_c_c_s_async_app_view.html#113d3c41dfbbbaf3bd2d6d1213cc9f32">CCSAsyncAppView::NewL( ClientRect(), *class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">AsyncDocument() );
00069 "l00050">00050 
00070 "l00051">00051     AddToStackL( class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView );
00071 "l00052">00052     }
00072 "l00053">00053 
00073 "l00054">00054 class="comment">// -----------------------------------------------------------------------------
00074 "l00055">00055 class="comment">// CCSAsyncAppUi::~CCSAsyncAppUi()
00075 "l00056">00056 class="comment">// Destructor.
00076 "l00057">00057 class="comment">// -----------------------------------------------------------------------------
00077 "l00058">00058 class="comment">//
00078 "l00059">class="code" href="class_c_c_s_async_app_ui.html#06a6b26206d4efb097029fdd4f06b116">00059 class="code" href="class_c_c_s_async_app_ui.html#06a6b26206d4efb097029fdd4f06b116">CCSAsyncAppUi::~CCSAsyncAppUi()
00079 "l00060">00060     {
00080 "l00061">00061     class="keywordflow">if ( class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView )
00081 "l00062">00062         {
00082 "l00063">00063         iEikonEnv->RemoveFromStack( class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView );
00083 "l00064">00064         class="keyword">delete iAppView;
00084 "l00065">00065         iAppView = NULL;
00085 "l00066">00066         }
00086 "l00067">00067     }
00087 "l00068">00068 
00088 "l00069">00069 class="comment">// -----------------------------------------------------------------------------
00089 "l00070">00070 class="comment">// CCSAsyncAppUi::AsyncDocument() const
00090 "l00071">00071 class="comment">// Casts iDocument member from CAknAppUi to CCSAsyncDocument.
00091 "l00072">00072 class="comment">// -----------------------------------------------------------------------------
00092 "l00073">00073 class="comment">//
00093 "l00074">class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">00074 class="code" href="class_c_c_s_async_document.html">CCSAsyncDocument* class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">CCSAsyncAppUi::AsyncDocument()class="keyword"> const
00094 "l00075">00075 class="keyword">    {
00095 "l00076">00076     class="keywordflow">return ( static_cast<CCSAsyncDocument*>( iDocument ) );
00096 "l00077">00077     }
00097 "l00078">00078 
00098 "l00079">00079 class="comment">// -----------------------------------------------------------------------------
00099 "l00080">00080 class="comment">// CCSAsyncAppUi::HandleCommandL( TInt aCommand )
00100 "l00081">00081 class="comment">// Handles user menu selections.
00101 "l00082">00082 class="comment">// -----------------------------------------------------------------------------
00102 "l00083">00083 class="comment">//
00103 "l00084">class="code" href="class_c_c_s_async_app_ui.html#a682d228622cea7790645ce10f591242">00084 class="keywordtype">void class="code" href="class_c_c_s_async_app_ui.html#a682d228622cea7790645ce10f591242">CCSAsyncAppUi::HandleCommandL( TInt aCommand )
00104 "l00085">00085     {
00105 "l00086">00086     class="keywordflow">switch( aCommand )
00106 "l00087">00087         {
00107 "l00088">00088         class="keywordflow">case EEikCmdExit:
00108 "l00089">00089         class="keywordflow">case EAknSoftkeyExit:
00109 "l00090">00090             Exit();
00110 "l00091">00091             class="keywordflow">break;
00111 "l00092">00092 
00112 "l00093">00093         class="keywordflow">case EStartClock:
00113 "l00094">00094             class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">AsyncDocument()->class="code" href="class_c_c_s_async_document.html#49951129866458617c40b0dc2b4f393f">UpdateTime();
00114 "l00095">00095             class="keywordflow">break;
00115 "l00096">00096 
00116 "l00097">00097         class="keywordflow">case EStopClock:
00117 "l00098">00098             class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">AsyncDocument()->class="code" href="class_c_c_s_async_document.html#0dcbea3e9ce301f1d5ac23a7679b8ee0">StopClock();
00118 "l00099">00099             class="keywordflow">break;
00119 "l00100">00100 
00120 "l00101">00101         class="keywordflow">default:
00121 "l00102">00102             class="keywordflow">break;
00122 "l00103">00103         }
00123 "l00104">00104     }
00124 "l00105">00105 
00125 "l00106">00106 class="comment">// -----------------------------------------------------------------------------
00126 "l00107">00107 class="comment">// CCSAsyncAppUi::HandleTimeUpdate()
00127 "l00108">00108 class="comment">// Updates view
00128 "l00109">00109 class="comment">// -----------------------------------------------------------------------------
00129 "l00110">00110 class="comment">//
00130 "l00111">class="code" href="class_c_c_s_async_app_ui.html#081e2db0d35721e6ad6d5d1d99fbbd83">00111 class="keywordtype">void class="code" href="class_c_c_s_async_app_ui.html#081e2db0d35721e6ad6d5d1d99fbbd83">CCSAsyncAppUi::HandleTimeUpdate()
00131 "l00112">00112     {
00132 "l00113">00113     __ASSERT_ALWAYS( class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView, User::Panic ( KCSAsyncClient, 
00133 "l00114">00114                                              ECSAsyncProgram ) );
00134 "l00115">00115     class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView->DrawNow();
00135 "l00116">00116     }
00136 "l00117">00117 
00137 "l00118">00118 class="comment">// -----------------------------------------------------------------------------
00138 "l00119">00119 class="comment">// CCSAsyncAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
00139 "l00120">00120 class="comment">// Prepares the menu prior to display.
00140 "l00121">00121 class="comment">// -----------------------------------------------------------------------------
00141 "l00122">00122 class="comment">//
00142 "l00123">class="code" href="class_c_c_s_async_app_ui.html#3ae77c2aed5e1270a13c14bd5aa415fe">00123 class="keywordtype">void class="code" href="class_c_c_s_async_app_ui.html#3ae77c2aed5e1270a13c14bd5aa415fe">CCSAsyncAppUi::DynInitMenuPaneL( TInt aResourceId, 
00143 "l00124">00124                                       CEikMenuPane* aMenuPane )
00144 "l00125">00125     {
00145 "l00126">00126     class="keywordflow">if ( aResourceId == R_CSASYNC_MENU )
00146 "l00127">00127         {
00147 "l00128">00128         class="keywordflow">if ( class="code" href="class_c_c_s_async_app_ui.html#1e0f1d7283b2cd8210c9d7ab96e93267">AsyncDocument()->ClockActive() )
00148 "l00129">00129             {
00149 "l00130">00130             aMenuPane->SetItemDimmed( EStartClock, ETrue );
00150 "l00131">00131             aMenuPane->SetItemDimmed( EStopClock, EFalse );
00151 "l00132">00132             }
00152 "l00133">00133         class="keywordflow">else
00153 "l00134">00134             {
00154 "l00135">00135             aMenuPane->SetItemDimmed( EStartClock, EFalse );
00155 "l00136">00136             aMenuPane->SetItemDimmed( EStopClock, ETrue );
00156 "l00137">00137             }
00157 "l00138">00138         }
00158 "l00139">00139     }
00159 "l00140">00140 
00160 "l00141">00141 class="comment">// -----------------------------------------------------------------------------
00161 "l00142">00142 class="comment">// CCSAsyncAppUi::HandleResourceChangeL( TInt aType )
00162 "l00143">00143 class="comment">// Called by framework when layout is changed.
00163 "l00144">00144 class="comment">// -----------------------------------------------------------------------------
00164 "l00145">00145 class="comment">//
00165 "l00146">class="code" href="class_c_c_s_async_app_ui.html#6acdbe8a9b57446075bf46d035e751eb">00146 class="keywordtype">void class="code" href="class_c_c_s_async_app_ui.html#6acdbe8a9b57446075bf46d035e751eb">CCSAsyncAppUi::HandleResourceChangeL( TInt aType )
00166 "l00147">00147     {
00167 "l00148">00148     CAknAppUi::HandleResourceChangeL( aType );
00168 "l00149">00149 
00169 "l00150">00150     class="keywordflow">if ( aType==KEikDynamicLayoutVariantSwitch )
00170 "l00151">00151         {
00171 "l00152">00152         class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView->SetRect( ClientRect() );
00172 "l00153">00153         }
00173 "l00154">00154     class="comment">//Controls derived from CCoeControl, handled in container class
00174 "l00155">00155     class="code" href="class_c_c_s_async_app_ui.html#45dd0a3e0e75e56b4727a01a8ef2c6b1">iAppView->HandleResourceChange( aType );
00175 "l00156">00156     }
00176 "l00157">00157 
00177 "l00158">00158 class="comment">// End of File
00178 

00179 00180 00181 style="x-cell-content-align: top;00182 width: 100%;00183 border-spacing: 0px;00184 border-spacing: 0px;"00185 cellspacing=0 00186 width=100%> 00187 "width: 50%;"> 00188 "width: 50%;"> 00189 00190 "x-cell-content-align: top;"00191 valign=top> 00192 00201 00223
"width: 50%; 00193 padding-right: 10px; 00194 padding-left: 10px; 00195 border-right-style: None; 00196 border-left-style: None; 00197 border-top-style: None; 00198 border-bottom-style: None;" 00199 width=50%> 00200

"font-family: Arial;">"font-size: smaller;"> Nokia 2009

"width: 50%; 00202 padding-right: 10px; 00203 padding-left: 10px; 00204 border-top-style: None; 00205 border-bottom-style: None; 00206 border-right-style: None;" 00207 width=50%> 00208

"text-align: right; margin-right: -4px;" 00209 align=right>"font-weight: bold;">"#Top" 00210 title="Back to top">00211 src="top.gif" 00212 x-maintain-ratio=TRUE 00213 alt="Back to top" 00214 style="border: none; 00215 width: 18px; 00216 height: 15px; 00217 float: none; 00218 border-style: none; 00219 border-style: none;" 00220 width=18 00221 height=15 00222 border=0>

00224 00225 00226

Generated by  doxygen 1.6.2