examples/AppFramework/txtshell/txtshell.h

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 */
00029 
00030 
00031 #ifndef __TXTSHELL_H
00032 #define __TXTSHELL_H
00033 
00034 #include <coecntrl.h>
00035 #include <coeccntx.h>
00036 
00037 #include <eikappui.h>
00038 #include <eikapp.h>
00039 #include <eikdoc.h>
00040 
00041 #include "txtexamp.h"
00042 
00043 // UID of app
00044 const TUid KUidExampleShellApp= {0xE8000003} ;
00045 
00046 //
00047 // TExampleShellModel
00048 //
00049 
00050 class TExampleShellModel
00051         // A place-holder class for the model class that would be used 
00052         // in a fully-developed application.
00053         {
00054 public:
00055         TExampleShellModel();
00056         TBool Differs(const TExampleShellModel* aCompare) const;
00057 public:
00058         TFileName iLibrary; // active control
00059         };
00060 
00061 //
00062 // class CExampleShellContainer
00063 //
00064 
00065 class CExampleShellContainer : public CCoeControl,
00066                 public MCoeControlBrushContext,
00067                 public MGraphicsExampleObserver
00068     {
00069 public:
00070     void ConstructL(const TRect& aRect, TExampleShellModel* aModel);
00071     ~CExampleShellContainer();
00072         // changing view
00073         void ResetExampleL(CGraphicExampleControl* aExample);
00074 private: // from CCoeControl
00075         void Draw(const TRect& /*aRect*/) const;
00076         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00077     TInt CountComponentControls() const;
00078     CCoeControl* ComponentControl(TInt aIndex) const;
00079 private: // from MGraphicsExampleObserver
00080         void NotifyGraphicExampleFinished();
00081 public: // also from MGraphicsExampleObserver
00082         void NotifyStatus(const TDesC& aMessage);
00083 private: // new function
00084         void CreateLabelL();
00085 private: // member data
00086         CGraphicExampleControl* iExampleControl; // example control
00087         CEikLabel* iLabel; // label for status messages
00088         // irrelevant
00089         TExampleShellModel* iModel;
00090     };
00091 
00092 //
00093 // CExampleShellDocument
00094 //
00095 
00096 class CExampleShellDocument : public CEikDocument
00097         {
00098 public:
00099         CExampleShellDocument(CEikApplication& aApp): CEikDocument(aApp) { }
00100         TExampleShellModel* Model() { return(&iModel); }
00101 private: // from CEikDocument
00102         CEikAppUi* CreateAppUiL();
00103 private:
00104         TExampleShellModel iModel;
00105         };
00106 
00107 //
00108 // CExampleShellAppUi
00109 //
00110 
00111 class CExampleShellAppUi : public CEikAppUi
00112     {
00113 public:
00114     void ConstructL();
00115         ~CExampleShellAppUi();
00116 private: // from CEikAppUi
00117         void HandleCommandL(TInt aCommand);
00118 private:
00119     CExampleShellContainer* iContainer;
00120         TExampleShellModel* iModel;
00121     };
00122 
00123 //
00124 // CExampleShellApplication
00125 //
00126 
00127 class CExampleShellApplication : public CEikApplication
00128         {
00129 private: // from CApaApplication
00130         CApaDocument* CreateDocumentL();
00131         TUid AppDllUid() const;
00132         };
00133 
00134 #endif

Generated by  doxygen 1.6.2