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

Generated by  doxygen 1.6.2