00001 /* 00002 Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 00003 00004 Redistribution and use in source and binary forms, with or without 00005 modification, are permitted provided that the following conditions are met: 00006 00007 * Redistributions of source code must retain the above copyright notice, this 00008 list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright notice, 00010 this list of conditions and the following disclaimer in the documentation 00011 and/or other materials provided with the distribution. 00012 * Neither the name of Nokia Corporation nor the names of its contributors 00013 may be used to endorse or promote products derived from this software 00014 without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 00027 Description: 00028 HelloWorld 00029 The class definitions for the simple example application 00030 containing a single view with the text "Hello World !" drawn 00031 on it. 00032 The class definitions are: 00033 CExampleApplication 00034 CExampleAppUi 00035 CExampleAppView 00036 CExampleDocument 00037 */ 00038 00039 #ifndef __HELLOWORLD_H 00040 #define __HELLOWORLD_H 00041 00042 #include <coeccntx.h> 00043 00044 #include <eikenv.h> 00045 #include <eikappui.h> 00046 #include <eikapp.h> 00047 #include <eikdoc.h> 00048 #include <eikmenup.h> 00049 00050 #include <eikon.hrh> 00051 00052 #include <helloworld.rsg> 00053 #include "HelloWorld.hrh" 00054 00055 00056 00058 // 00059 // CExampleApplication 00060 // 00062 00063 class CExampleApplication : public CEikApplication 00064 { 00065 private: 00066 // Inherited from class CApaApplication 00067 CApaDocument* CreateDocumentL(); 00068 TUid AppDllUid() const; 00069 }; 00070 00072 // 00073 // CExampleAppView 00074 // 00076 class CExampleAppView : public CCoeControl 00077 { 00078 public: 00079 static CExampleAppView* NewL(const TRect& aRect); 00080 CExampleAppView(); 00081 ~CExampleAppView(); 00082 void ConstructL(const TRect& aRect); 00083 00084 private: 00085 // Inherited from CCoeControl 00086 void Draw(const TRect& /*aRect*/) const; 00087 00088 private: 00089 HBufC* iExampleText; 00090 }; 00091 00092 00094 // 00095 // CExampleAppUi 00096 // 00098 class CExampleAppUi : public CEikAppUi 00099 { 00100 public: 00101 void ConstructL(); 00102 ~CExampleAppUi(); 00103 00104 private: 00105 // Inherirted from class CEikAppUi 00106 void HandleCommandL(TInt aCommand); 00107 00108 private: 00109 CCoeControl* iAppView; 00110 }; 00111 00112 00114 // 00115 // CExampleDocument 00116 // 00118 class CExampleDocument : public CEikDocument 00119 { 00120 public: 00121 static CExampleDocument* NewL(CEikApplication& aApp); 00122 CExampleDocument(CEikApplication& aApp); 00123 void ConstructL(); 00124 private: 00125 // Inherited from CEikDocument 00126 CEikAppUi* CreateAppUiL(); 00127 }; 00128 00129 00130 #endif 00131