diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_custom_controls_8h-source.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_custom_controls_8h-source.html Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,265 @@ + + +TB10.1 Example Applications: examples/AppFramework/UIControls/CustomControls/CustomControls.h Source File + + + + +

examples/AppFramework/UIControls/CustomControls/CustomControls.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 // UI Control Framework example application
+00015 //
+00016 
+00017 #if !defined(__COSMILEY_H__)
+00018 #define __COSMILEY_H__
+00019 
+00021 //
+00022 // Include files containing:
+00023 //
+00024 // 1. Symbol definitions used by C++ code and resource scripts (the *.hrh)
+00025 // 2. Resource ids generated by resource compilation of 
+00026 //    resource scripts (the *.rsg)
+00027 // 3. Class definitions required by this app (the *.h)
+00028 //    
+00030 
+00031 // 1.
+00032 #include <eikon.hrh>
+00033 #include "CustomControls.hrh"
+00034 // 2.
+00035 #include <eikon.rsg>
+00036 #include <customcontrols.rsg>
+00037 // 3.
+00038 #include <eikenv.h>
+00039 #include <eikappui.h>
+00040 #include <eikproc.h>
+00041 #include <eikdialg.h>
+00042 #include <eikmenub.h>
+00043 #include <eikapp.h>
+00044 #include <eikdoc.h>
+00045 #include <coeutils.h>
+00046 #include <barsread.h>
+00047 #include <eikfctry.h>
+00048 
+00049   // The unique identifier for this application.
+00050   // NOTE that the number has been arbitrarily chosen for the purpose of
+00051   // of the example.
+00052 const TUid KUidExampleApp={0xE8000004};
+00053 
+00054 
+00056 //
+00057 // -----> CSmileyDialog(definition)
+00058 //
+00060 class CSmileyDialog : public CEikDialog
+00061         {
+00062 public:
+00063         // Construct and run
+00064         static TBool RunDlgLD();
+00065 private:
+00066         SEikControlInfo CreateCustomControlL(TInt aControlType);
+00067         };      
+00068 
+00070 //
+00071 // -----> CSmiley (definition)
+00072 //
+00074 class CSmiley : public CCoeControl
+00075         {
+00076 public:
+00077         CSmiley(TBool aSmiling);
+00078         ~CSmiley();
+00079 public:
+00080         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+00081         TBool IsSmiling();
+00082 private:
+00083         void Draw(const TRect& aRect) const;
+00084         void SizeChanged();
+00085 protected:
+00086         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+00087         void FocusChanged(TDrawNow aDrawNow);
+00088 private:
+00089         TBool   iSmiling;
+00090         TRect   iSmileyRect;
+00091         TInt    iSmileyWidth;
+00092         TInt    iSmileyHeight;
+00093         TRect   iSmileRect;
+00094         TRect   iFrownRect;
+00095         };
+00096 
+00098 //
+00099 // -----> CSmileyContainer(definition)
+00100 //
+00102 class CSmileyContainer : public CCoeControl, 
+00103                                                  public MCoeControlObserver
+00104         {
+00105 public:
+00106           // Construction
+00107         CSmileyContainer();
+00108         void ConstructL(const TRect& aRect);
+00109           // Destruction
+00110         ~CSmileyContainer();
+00111         void ConstructFromResourceL(TResourceReader& aReader);
+00112         void PrepareForFocusLossL();
+00113         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+00114 protected:
+00115         void FocusChanged(TDrawNow aDrawNow);
+00116 private:
+00117           // Virtual, defined by CCoeControl; replaces the default implementation
+00118           // provided by CCoeControl.
+00119         void         Draw(const TRect& aRect) const;
+00120         
+00121           // Virtual, defined by CCoeControl; replaces the default implementation
+00122           // provided by CCoeControl. 
+00123     TInt         CountComponentControls() const;
+00124 
+00125           // Virtual, defined by CCoeControl; replaces the default implementation
+00126           // provided by CCoeControl.
+00127         CCoeControl* ComponentControl(TInt aIndex) const;
+00128 
+00129           // Virtual, defined by CCoeControl; empty implementation provided by
+00130           // CCoeControl; full implementation provided by this class
+00131         void         SizeChanged();
+00132         
+00133           // Defined as pure virtual by the mixin class MCoeControlObserver 
+00134           // inherited by CCoeControl. An empty implementation provided by 
+00135           // this class (its containees do not report events).
+00136         void         HandleControlEventL(CCoeControl* aControl,
+00137                                              TCoeEvent aEventType);
+00138 private:
+00139           // Member functions defined and used by this class
+00140         void            SwapFocus(CCoeControl* aControl);
+00141 private:
+00142       // Data members defined and used by this class.
+00143         CSmiley*        iSmiley1;
+00144         CSmiley*        iSmiley2;
+00145         };
+00146 
+00147 
+00148 
+00150 //
+00151 // -----> CMainWinControl (definition)
+00152 //
+00154 class CMainWinControl : public CCoeControl
+00155 {
+00156 public:
+00157         CMainWinControl();
+00158         ~CMainWinControl();
+00159         void ConstructL(const TRect& rect);
+00160         TInt CountComponentControls() const;
+00161         CCoeControl* ComponentControl(TInt aIndex) const;
+00162         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+00163 private:
+00164         void Draw(const TRect& aRect) const;
+00165 private:
+00166         CSmileyContainer*       iContainer;
+00167 };
+00168 
+00170 //
+00171 // -----> CExampleAppUi (definition)
+00172 //
+00174 class CExampleAppUi : public CEikAppUi
+00175         {
+00176 public:
+00177           // Destruction.
+00178         ~CExampleAppUi();
+00179 
+00180 public:
+00181           // Virtual, defined by CEikAppUi; replaces the implementation 
+00182           // provided by CEikAppUi.
+00183         void ConstructL();
+00184         
+00185 private:
+00186           // Virtual, defined by CEikAppUi; empty implementation
+00187           // provided by CEikAppUi; full implementation provided
+00188           // by this class. 
+00189         void  HandleCommandL(TInt aCommand);
+00190         
+00191           // Virtual, defined by CEikAppUi; empty implementation
+00192           // provided by CEikAppUi; full implementation provided
+00193           // by this class. 
+00194         void  HandleModelChangeL();
+00195         
+00196 private:
+00197         void         OnCmdExit();
+00198 private:
+00199         // Data members defined by this class.
+00200         CMainWinControl* iMainWinControl;
+00201         };
+00202 
+00204 //
+00205 // -----> CExampleDocument (definition)
+00206 //
+00208 class CExampleDocument : public CEikDocument
+00209         {
+00210 public:
+00211           // Construction.
+00212         static CExampleDocument* NewL(CEikApplication& aApp);
+00213     CExampleDocument(CEikApplication& aApp);
+00214           // Destruction.
+00215         ~CExampleDocument();
+00216 
+00217 private:
+00218           // Defined as pure virtual by CEikDocument; full implementation
+00219           // provided by this class
+00220         CEikAppUi* CreateAppUiL();              // Construct an app.user interface
+00221 
+00222           // Defined as pure virtual by CApaDocument; empty implementation 
+00223           // provided by CEikDocument; full implementation provided
+00224           // by this class.
+00225         void       NewDocumentL();      // Build a new document
+00226 
+00227           // Defined as pure virtual by CApaDocument; empty implementation
+00228           // provided by CEikDocument; full implementation provided
+00229           // by this class.
+00230         void       StoreL(CStreamStore& aStore,
+00231                               CStreamDictionary& aStreamDic
+00232                                          ) const;
+00233         void       RestoreL(const CStreamStore& aStore,
+00234                                 const CStreamDictionary& aStreamDic
+00235                                );
+00236 
+00237 public:
+00238           // Member functions defined by this class
+00239         void       DoNewFileL(const TFileName& aFileName);
+00240         void       DoOpenFileL(const TFileName& aFileName);
+00241         void       DoSaveToNewFileL(const TFileName& aNewFileName);
+00242         TBool      FileNameExists(const TFileName& aFileName) const;
+00243 
+00244 private:
+00245           // Member functions defined by this class
+00246         void       CreateModelL();
+00247         void       ResetModelL();
+00248         };
+00249 
+00251 //
+00252 // -----> CExampleApplication (definition)
+00253 //
+00255 class CExampleApplication : public CEikApplication
+00256         {
+00257 private:                
+00258           // Defined as pure virtual by CApaApplication; implementation
+00259           // provided by this class 
+00260         TUid          AppDllUid() const; // Returns Uid associated with app
+00261 
+00262           // Defined as pure virtual by CEikApplication; implementation
+00263           // provided by this class.
+00264         CApaDocument* CreateDocumentL(); // Construct new document
+00265         };
+00266 
+00267 
+00268 
+00269 #endif
+

Generated on Thu Jan 21 10:32:55 2010 for TB10.1 Example Applications by  + +doxygen 1.5.3
+ +