examples/AppFramework/txtshell/txtshell.h

00001 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 #ifndef __TXTSHELL_H
00017 #define __TXTSHELL_H
00018 
00019 #include <coecntrl.h>
00020 #include <coeccntx.h>
00021 
00022 #include <eikappui.h>
00023 #include <eikapp.h>
00024 #include <eikdoc.h>
00025 
00026 #include "txtexamp.h"
00027 
00028 // UID of app
00029 const TUid KUidExampleShellApp= {0xE8000003} ;
00030 
00031 //
00032 // TExampleShellModel
00033 //
00034 
00035 class TExampleShellModel
00036         // A place-holder class for the model class that would be used 
00037         // in a fully-developed application.
00038         {
00039 public:
00040         TExampleShellModel();
00041         TBool Differs(const TExampleShellModel* aCompare) const;
00042 public:
00043         TFileName iLibrary; // active control
00044         };
00045 
00046 //
00047 // class CExampleShellContainer
00048 //
00049 
00050 class CExampleShellContainer : public CCoeControl,
00051                 public MCoeControlBrushContext,
00052                 public MGraphicsExampleObserver
00053     {
00054 public:
00055     void ConstructL(const TRect& aRect, TExampleShellModel* aModel);
00056     ~CExampleShellContainer();
00057         // changing view
00058         void ResetExampleL(CGraphicExampleControl* aExample);
00059 private: // from CCoeControl
00060         void Draw(const TRect& /*aRect*/) const;
00061         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00062     TInt CountComponentControls() const;
00063     CCoeControl* ComponentControl(TInt aIndex) const;
00064 private: // from MGraphicsExampleObserver
00065         void NotifyGraphicExampleFinished();
00066 public: // also from MGraphicsExampleObserver
00067         void NotifyStatus(const TDesC& aMessage);
00068 private: // new function
00069         void CreateLabelL();
00070 private: // member data
00071         CGraphicExampleControl* iExampleControl; // example control
00072         CEikLabel* iLabel; // label for status messages
00073         // irrelevant
00074         TExampleShellModel* iModel;
00075     };
00076 
00077 //
00078 // CExampleShellDocument
00079 //
00080 
00081 class CExampleShellDocument : public CEikDocument
00082         {
00083 public:
00084         CExampleShellDocument(CEikApplication& aApp): CEikDocument(aApp) { }
00085         TExampleShellModel* Model() { return(&iModel); }
00086 private: // from CEikDocument
00087         CEikAppUi* CreateAppUiL();
00088 private:
00089         TExampleShellModel iModel;
00090         };
00091 
00092 //
00093 // CExampleShellAppUi
00094 //
00095 
00096 class CExampleShellAppUi : public CEikAppUi
00097     {
00098 public:
00099     void ConstructL();
00100         ~CExampleShellAppUi();
00101 private: // from CEikAppUi
00102         void HandleCommandL(TInt aCommand);
00103 private:
00104     CExampleShellContainer* iContainer;
00105         TExampleShellModel* iModel;
00106     };
00107 
00108 //
00109 // CExampleShellApplication
00110 //
00111 
00112 class CExampleShellApplication : public CEikApplication
00113         {
00114 private: // from CApaApplication
00115         CApaDocument* CreateDocumentL();
00116         TUid AppDllUid() const;
00117         };
00118 
00119 #endif

Generated by  doxygen 1.6.2