idlehomescreen/examples/mcsexample/inc/MCSExampleAppView.h
author jake
Mon, 02 Aug 2010 12:02:47 +0300
branchRCL_3
changeset 29 d12a7ea0f775
permissions -rw-r--r--
Example applications for various Homescreen APIs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     1
/*
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     3
* All rights reserved.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     8
*
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
     9
* Initial Contributors:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    11
*
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    12
* Contributors:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    13
*
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    14
* Description:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    15
*
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    16
*/
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    17
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    18
#ifndef __MCSEXAMPLEAPPVIEW_h__
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    19
#define __MCSEXAMPLEAPPVIEW_h__
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    20
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    21
// INCLUDES
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    22
#include <coecntrl.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    23
#include <aknform.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    24
#include <gulicon.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    25
#include <aknlists.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    26
#include <eiklbo.h> // MEikListBoxObserver
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    27
#include <mcsmenu.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    28
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    29
class CMCSExampleWatcher;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    30
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    31
struct TMyData
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    32
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    33
public:     // data
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    34
    TBuf<256> majorID;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    35
    TBuf<256> minorID;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    36
    TBuf<256> iconFile;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    37
    TBuf<256> iconID;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    38
    TBuf<256> maskID;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    39
    TBuf<256> statusIcon;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    40
    TBool updated;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    41
    };
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    42
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    43
class CMyForm : public CAknForm
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    44
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    45
public:     // construction
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    46
    CMyForm( TMyData& aData );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    47
    virtual ~CMyForm();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    48
public:     // from CAknForm
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    49
    //void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    50
    //void ProcessCommandL( TInt aCommandId );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    51
    TBool SaveFormDataL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    52
    void DoNotSaveFormDataL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    53
    //void AddItemL() ;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    54
    void PreLayoutDynInitL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    55
    //MEikDialogPageObserver::TFormControlTypes
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    56
    //    ConvertCustomControlTypeToBaseControlType( TInt aControlType ) const;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    57
protected:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    58
    TBool OkToExitL( TInt aButtonId );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    59
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    60
private:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    61
    void LoadFormDataL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    62
private:    // data
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    63
    TMyData& iData;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    64
    };
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    65
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    66
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    67
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    68
// CLASS DECLARATION
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    69
class CMCSExampleAppView : public CCoeControl, public MEikListBoxObserver
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    70
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    71
public:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    72
    // New methods
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    73
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    74
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    75
     * NewL.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    76
     * Two-phased constructor.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    77
     * Create a CMCSExampleAppView object, which will draw itself to aRect.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    78
     * @param aRect The rectangle this view will be drawn to.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    79
     * @return a pointer to the created instance of CMCSExampleAppView.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    80
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    81
    static CMCSExampleAppView* NewL(const TRect& aRect);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    82
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    83
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    84
     * NewLC.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    85
     * Two-phased constructor.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    86
     * Create a CMCSExampleAppView object, which will draw itself
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    87
     * to aRect.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    88
     * @param aRect Rectangle this view will be drawn to.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    89
     * @return A pointer to the created instance of CMCSExampleAppView.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    90
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    91
    static CMCSExampleAppView* NewLC(const TRect& aRect);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    92
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    93
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    94
     * ~CMCSExampleAppView
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    95
     * Virtual Destructor.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    96
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    97
    virtual ~CMCSExampleAppView();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    98
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    99
    void ListAllItemsL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   100
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   101
public:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   102
    // Functions from base classes
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   103
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   104
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   105
     * From CCoeControl, Draw
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   106
     * Draw this CMCSExampleAppView to the screen.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   107
     * @param aRect the rectangle of this view that needs updating
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   108
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   109
    void Draw(const TRect& aRect) const;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   110
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   111
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   112
     * From CoeControl, SizeChanged.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   113
     * Called by framework when the view size is changed.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   114
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   115
    virtual void SizeChanged();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   116
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   117
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   118
     * From CoeControl, HandlePointerEventL.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   119
     * Called by framework when a pointer touch event occurs.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   120
     * Note: although this method is compatible with earlier SDKs, 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   121
     * it will not be called in SDKs without Touch support.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   122
     * @param aPointerEvent the information about this event
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   123
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   124
    virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   125
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   126
    CCoeControl* ComponentControl( TInt aIndex) const;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   127
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   128
    TInt CountComponentControls() const;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   129
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   130
    void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   131
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   132
private:
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   133
    // Constructors
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   134
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   135
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   136
     * ConstructL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   137
     * 2nd phase constructor.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   138
     * Perform the second phase construction of a
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   139
     * CMCSExampleAppView object.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   140
     * @param aRect The rectangle this view will be drawn to.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   141
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   142
    void ConstructL(const TRect& aRect);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   143
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   144
    /**
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   145
     * CMCSExampleAppView.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   146
     * C++ default constructor.
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   147
     */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   148
    CMCSExampleAppView();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   149
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   150
    CDesCArray* GetArrayL(CArrayPtr<CGulIcon>* aIcons);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   151
    void MakeListBoxL(void);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   152
    void UpdateScrollBar(CEikListBox* aListBox);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   153
    void ShowFormL( TInt aItemIndex);
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   154
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   155
    RMenu iMCSMenu;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   156
    CAknSingleLargeStyleListBox* iListBox;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   157
    RArray<TMenuItem> iItemArray;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   158
    /** MCS asynchronous operation watcher, owned */
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   159
    CMCSExampleWatcher* iWatcher;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   160
    };
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   161
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   162
#endif // __MCSEXAMPLEAPPVIEW_h__
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   163
// End of File