idlehomescreen/examples/hscontentcontrolexample/src/HsContentControlListBox.cpp
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:  Content Control example
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
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    19
//  Includes
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    20
#include <aknlists.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    21
#include <akncontext.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    22
#include <akntitle.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    23
#include <aknnavi.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    24
#include <aknnavide.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    25
#include <akntabgrp.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    26
#include <aknstyluspopupmenu.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    27
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    28
#include <aknsinglestyletreelist.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    29
#include <aknsbasicbackgroundcontrolcontext.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    30
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    31
#include <hsccapiclient.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    32
#include <hscontentinfo.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    33
#include <hscontentinfoarray.h>
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    34
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    35
#include "HsContentControlListBox.h"
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    36
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    37
//  Constants
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    38
const TInt KFlags( CAknSingleStyleTreeList::EPersistent | 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    39
        CAknSingleStyleTreeList::EExpanded );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    40
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    41
_LIT( KActivate, "Activate" );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    42
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    43
enum TTabs
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    44
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    45
    ETabFirst = 0,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    46
    ETabActiveConfiguration = ETabFirst,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    47
    ETabConfigurations,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    48
    ETabViews,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    49
    ETabWidgets,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    50
    ETabLast = ETabWidgets 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    51
    };
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    52
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    53
// ============================ LOCAL FUNCTIONS ================================
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    54
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    55
// ============================ MEMBER FUNCTIONS ===============================
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    56
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    57
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    58
// CHsContentControlListBox::CHsContentControlListBox
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    59
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    60
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    61
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    62
CHsContentControlListBox::CHsContentControlListBox()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    63
    {
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
// CHsContentControlListBox::~CHsContentControlListBox
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    68
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    69
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    70
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    71
CHsContentControlListBox::~CHsContentControlListBox()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    72
    {    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    73
    delete iHsCcApiClient;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    74
    delete iCallback;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    75
    delete iPopup;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    76
    delete iListBox;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    77
    delete iBgContext;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    78
    delete iArray;    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    79
    delete iDecorator;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    80
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    81
  
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    82
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    83
// CHsContentControlListBox::NewL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    84
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    85
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    86
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    87
CHsContentControlListBox* CHsContentControlListBox::NewL( const TRect& aRect,  
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    88
    const CCoeControl* aParent, MEikCommandObserver* aCommandObserver )          
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    89
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    90
    CHsContentControlListBox* self = 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    91
        CHsContentControlListBox::NewLC( aRect, aParent, aCommandObserver ); 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    92
    CleanupStack::Pop( self );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    93
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    94
    return self;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    95
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    96
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    97
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    98
// CHsContentControlListBox::NewLC
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
    99
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   100
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   101
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   102
CHsContentControlListBox* CHsContentControlListBox::NewLC( const TRect& aRect,          
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   103
    const CCoeControl* aParent, MEikCommandObserver* aCommandObserver )         
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   104
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   105
    CHsContentControlListBox* self = new ( ELeave ) CHsContentControlListBox();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   106
    CleanupStack::PushL( self );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   107
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   108
    self->ConstructL( aRect, aParent, aCommandObserver );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   109
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   110
    return self;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   111
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   112
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   113
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   114
// CHsContentControlListBox::ConstructL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   115
//
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
void CHsContentControlListBox::ConstructL( const TRect& aRect,          
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   119
    const CCoeControl* aParent, MEikCommandObserver* /*aCommandObserver*/ )         
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   120
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   121
    iHsCcApiClient = CHsCcApiClient::NewL( this );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   122
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   123
    TCallBack cb( PopulateList, this );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   124
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   125
    iCallback = new ( ELeave ) CAsyncCallBack( cb, CActive::EPriorityStandard );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   126
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   127
    if ( !aParent )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   128
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   129
        CreateWindowL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   130
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   131
    else
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   132
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   133
        SetContainerWindowL( *aParent );
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
    InitializeControlsL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   137
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   138
    SetRect( aRect );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   139
               
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   140
    ActivateL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   141
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   142
    PopulateListL();
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
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   146
// CHsContentControlListBox::CountComponentControls
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   147
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   148
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   149
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   150
TInt CHsContentControlListBox::CountComponentControls() const
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   151
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   152
    return 1;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   153
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   154
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   155
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   156
// CHsContentControlListBox::CHsContentControlListBox
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   157
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   158
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   159
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   160
CCoeControl* CHsContentControlListBox::ComponentControl( TInt aIndex ) const
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   161
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   162
    if ( aIndex == 0 )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   163
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   164
        return iListBox;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   165
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   166
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   167
    return NULL;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   168
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   169
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   170
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   171
// CHsContentControlListBox::OfferKeyEventL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   172
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   173
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   174
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   175
TKeyResponse CHsContentControlListBox::OfferKeyEventL(  
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   176
    const TKeyEvent& aKeyEvent, TEventCode aType )         
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   177
    {    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   178
    if ( iListBox->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed )         
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   179
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   180
        return EKeyWasConsumed;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   181
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   182
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   183
    return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   184
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   185
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   186
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   187
// CHsContentControlListBox::HandleResourceChange
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   188
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   189
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   190
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   191
void CHsContentControlListBox::HandleResourceChange( TInt aType )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   192
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   193
    CCoeControl::HandleResourceChange( aType );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   194
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   195
    SetRect( iAvkonAppUi->ClientRect() );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   196
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   197
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   198
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   199
// CHsContentControlListBox::SizeChanged
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   200
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   201
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   202
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   203
void CHsContentControlListBox::SizeChanged()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   204
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   205
    CCoeControl::SizeChanged();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   206
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   207
    LayoutControls();    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   208
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   209
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   210
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   211
// CHsContentControlListBox::MopSupplyObject
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   212
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   213
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   214
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   215
TTypeUid::Ptr CHsContentControlListBox::MopSupplyObject( TTypeUid aId )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   216
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   217
    if ( aId.iUid == MAknsControlContext::ETypeId && iBgContext )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   218
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   219
        return MAknsControlContext::SupplyMopObject( aId, iBgContext );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   220
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   221
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   222
    return CCoeControl::MopSupplyObject( aId );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   223
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   224
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   225
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   226
// CHsContentControlListBox::HandleTreeListEvent
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   227
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   228
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   229
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   230
TInt CHsContentControlListBox::HandleTreeListEvent(       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   231
    CAknTreeList& /*aList*/,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   232
    TAknTreeItemID aItem,
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   233
    TEvent aEvent )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   234
    {        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   235
    if ( aEvent == EItemSelected )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   236
        {        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   237
        if ( !iListBox->IsLeaf( aItem ) && !iListBox->IsMarked( aItem ) )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   238
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   239
            return KErrNone;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   240
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   241
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   242
        const TWsEvent& event( iCoeEnv->LastEvent() );        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   243
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   244
        if ( event.Type() == EEventPointer )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   245
            {                              
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   246
            TInt x, y;            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   247
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   248
            TPointerEvent& pointer( *event.Pointer() );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   249
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   250
            x = pointer.iParentPosition.iX;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   251
            y = pointer.iParentPosition.iY;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   252
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   253
            delete iPopup;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   254
            iPopup = NULL;            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   255
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   256
            iPopup = CAknStylusPopUpMenu::NewL( this, TPoint( x, y ) );             
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   257
                           
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   258
            if ( iTabIndex == ETabConfigurations )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   259
                {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   260
                iSelectedItem = aItem;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   261
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   262
                iPopup->AddMenuItemL( KActivate, 1 );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   263
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   264
                iPopup->SetPosition( TPoint( x, y ), 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   265
                    CAknStylusPopUpMenu::EPositionTypeRightBottom );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   266
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   267
                iPopup->ShowMenu();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   268
                }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   269
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   270
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   271
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   272
    return KErrNone;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   273
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   274
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   275
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   276
// CHsContentControlListBox::ProcessCommandL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   277
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   278
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   279
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   280
void CHsContentControlListBox::ProcessCommandL( TInt aCommandId )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   281
    {  
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   282
    TAknTreeItemID item( iSelectedItem );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   283
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   284
    iSelectedItem = KAknTreeIIDNone;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   285
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   286
    if ( item == KAknTreeIIDNone || aCommandId == KErrCancel )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   287
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   288
        return;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   289
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   290
           
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   291
    // Resolve selected item
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   292
    if ( iTabIndex == ETabConfigurations )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   293
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   294
        TAknTreeItemID id = iListBox->Child( KAknTreeIIDRoot, 0 );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   295
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   296
        TInt count( iListBox->ChildCount( id ) );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   297
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   298
        for ( TInt i = 0; i < count; i++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   299
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   300
            if ( iListBox->Child( id, i ) == item )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   301
                {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   302
                CHsContentInfo* info( iArray->Array()[i] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   303
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   304
                TRAP_IGNORE( iHsCcApiClient->ActivateAppL( *info ) );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   305
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   306
                break;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   307
                }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   308
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   309
        }       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   310
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   311
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   312
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   313
// CHsContentControlListBox::SetEmphasis
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   314
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   315
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   316
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   317
void CHsContentControlListBox::SetEmphasis( CCoeControl* /*aMenuControl*/, 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   318
    TBool /*aEmphasis*/ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   319
    {         
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   320
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   321
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   322
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   323
// CHsContentControlListBox::TabChangedL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   324
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   325
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   326
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   327
void CHsContentControlListBox::TabChangedL( TInt aIndex )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   328
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   329
    if ( aIndex != iTabIndex )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   330
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   331
        iTabIndex = aIndex;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   332
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   333
        iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   334
            CAknNavigationDecorator::ERightButton, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   335
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   336
        iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   337
            CAknNavigationDecorator::ELeftButton, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   338
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   339
        if ( iTabIndex == ETabFirst )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   340
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   341
            iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   342
                CAknNavigationDecorator::ELeftButton, ETrue );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   343
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   344
        else if ( iTabIndex == ETabLast )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   345
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   346
            iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   347
                CAknNavigationDecorator::ERightButton, ETrue );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   348
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   349
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   350
        iCallback->Cancel();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   351
        iCallback->CallBack();        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   352
        }    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   353
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   354
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   355
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   356
// CHsContentControlListBox::NotifyWidgetListChanged
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   357
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   358
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   359
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   360
void CHsContentControlListBox::NotifyWidgetListChanged()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   361
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   362
    iCallback->Cancel();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   363
    iCallback->CallBack();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   364
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   365
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   366
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   367
// CHsContentControlListBox::NotifyViewListChanged
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   368
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   369
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   370
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   371
void CHsContentControlListBox::NotifyViewListChanged()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   372
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   373
    iCallback->Cancel();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   374
    iCallback->CallBack();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   375
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   376
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   377
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   378
// CHsContentControlListBox::NotifyAppListChanged
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   379
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   380
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   381
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   382
void CHsContentControlListBox::NotifyAppListChanged()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   383
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   384
    iCallback->Cancel();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   385
    iCallback->CallBack();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   386
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   387
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   388
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   389
// CHsContentControlListBox::InitializeControlsL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   390
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   391
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   392
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   393
void CHsContentControlListBox::InitializeControlsL()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   394
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   395
    iListBox = CAknSingleStyleTreeList::NewL( *this );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   396
    iListBox->SetContainerWindowL( *this );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   397
    iListBox->AddObserverL( this );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   398
    iListBox->SetFocus( ETrue );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   399
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   400
    iBgContext = CAknsBasicBackgroundControlContext::NewL(
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   401
        KAknsIIDQsnBgScreen, TRect(), ETrue );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   402
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   403
    CEikStatusPane* sp( iAvkonAppUi->StatusPane() );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   404
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   405
    TUid naviPaneUid( TUid::Uid( EEikStatusPaneUidNavi ) );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   406
                                 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   407
    CAknNavigationControlContainer* naviPane = 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   408
        static_cast< CAknNavigationControlContainer* >( sp->ControlL( naviPaneUid ) ); 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   409
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   410
    iDecorator = naviPane->ResourceDecorator();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   411
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   412
    iDecorator->MakeScrollButtonVisible( ETrue );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   413
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   414
    iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   415
        CAknNavigationDecorator::ELeftButton, ETrue );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   416
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   417
    iDecorator->SetScrollButtonDimmed( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   418
        CAknNavigationDecorator::ERightButton, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   419
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   420
    iTabGroup = static_cast< CAknTabGroup* > ( iDecorator->DecoratedControl() );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   421
    iTabGroup->SetObserver( this );       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   422
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   423
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   424
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   425
// CHsContentControlListBox::LayoutControls
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   426
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   427
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   428
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   429
void CHsContentControlListBox::LayoutControls()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   430
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   431
    iListBox->SetRect( Rect() );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   432
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   433
    TRect rect;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   434
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   435
    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect );     
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   436
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   437
    iBgContext->SetRect( rect );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   438
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   439
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   440
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   441
// CHsContentControlListBox::PopulateListL
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   442
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   443
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   444
//    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   445
void CHsContentControlListBox::PopulateListL()
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   446
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   447
    if ( !iListBox->IsEmpty( KAknTreeIIDRoot ) )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   448
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   449
        // Remove all
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   450
        iListBox->RemoveItem( KAknTreeIIDRoot, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   451
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   452
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   453
    delete iArray;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   454
    iArray = NULL;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   455
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   456
    if ( iTabIndex == ETabActiveConfiguration )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   457
        {       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   458
        CHsContentInfo* activeApp = CHsContentInfo::NewL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   459
        CleanupStack::PushL( activeApp );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   460
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   461
        // Get active homescreen configuration
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   462
        iHsCcApiClient->ActiveAppL( *activeApp );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   463
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   464
        _LIT( KActiveConfiguration, "Active configuration" );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   465
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   466
        TAknTreeItemID root = iListBox->AddNodeL( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   467
            KAknTreeIIDRoot, KActiveConfiguration, KFlags, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   468
                       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   469
        CHsContentInfoArray* viewList = CHsContentInfoArray::NewL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   470
        CleanupStack::PushL( viewList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   471
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   472
        // Get view list from the active configuration
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   473
        iHsCcApiClient->ViewListL( *activeApp, *viewList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   474
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   475
        _LIT( KView, "View " );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   476
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   477
        for ( TInt j = 0; j < viewList->Array().Count(); j++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   478
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   479
            TBuf< 32 > viewname;        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   480
            viewname = KView();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   481
            viewname.AppendNum( j + 1 );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   482
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   483
            CHsContentInfo* view( viewList->Array()[j] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   484
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   485
            TAknTreeItemID parent = iListBox->AddNodeL( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   486
                root, viewname, KFlags, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   487
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   488
            CHsContentInfoArray* widgetList = CHsContentInfoArray::NewL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   489
            CleanupStack::PushL( widgetList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   490
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   491
            // Get widget list from the view 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   492
            iHsCcApiClient->WidgetListL( *view, *widgetList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   493
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   494
            for ( TInt k = 0; k < widgetList->Array().Count(); k++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   495
                {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   496
                CHsContentInfo* widget( widgetList->Array()[k] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   497
                
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   498
                iListBox->AddLeafL( parent, widget->Name(), KFlags, EFalse );            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   499
                }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   500
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   501
            CleanupStack::PopAndDestroy( widgetList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   502
            }   
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   503
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   504
        CleanupStack::PopAndDestroy( viewList );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   505
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   506
        CleanupStack::PopAndDestroy( activeApp );    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   507
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   508
    else if ( iTabIndex == ETabConfigurations )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   509
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   510
        _LIT( KConfigurations, "Configurations" );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   511
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   512
        TAknTreeItemID root = iListBox->AddNodeL( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   513
            KAknTreeIIDRoot, KConfigurations, KFlags, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   514
                   
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   515
        iArray = CHsContentInfoArray::NewL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   516
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   517
        // Get all homescreen configurations 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   518
        iHsCcApiClient->AppListL( *iArray );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   519
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   520
        _LIT( KConfiguration, "Configuration " );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   521
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   522
        for ( TInt i = 0; i < iArray->Array().Count(); i++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   523
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   524
            TBuf< 32 > confname;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   525
            confname = KConfiguration();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   526
            confname.AppendNum( i + 1 );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   527
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   528
            CHsContentInfo* app( iArray->Array()[i] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   529
                        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   530
            iListBox->AddLeafL( root, confname, KFlags, EFalse );            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   531
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   532
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   533
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   534
    else if ( iTabIndex == ETabViews )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   535
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   536
        _LIT( KViews, "Views" );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   537
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   538
        TAknTreeItemID root = iListBox->AddNodeL( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   539
            KAknTreeIIDRoot, KViews, KFlags, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   540
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   541
        iArray = CHsContentInfoArray::NewL();        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   542
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   543
        // Get all homescreen views
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   544
        iHsCcApiClient->ViewListL( *iArray );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   545
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   546
        _LIT( KView, "View " );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   547
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   548
        for ( TInt i = 0; i < iArray->Array().Count(); i++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   549
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   550
            TBuf< 32 > viewname;        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   551
            viewname = KView();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   552
            viewname.AppendNum( i + 1 );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   553
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   554
            CHsContentInfo* view( iArray->Array()[i] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   555
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   556
            iListBox->AddLeafL( root, viewname, KFlags, EFalse );                 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   557
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   558
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   559
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   560
    else if ( iTabIndex == ETabWidgets )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   561
        {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   562
        _LIT( KWidgets, "Widgets" );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   563
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   564
        TAknTreeItemID root = iListBox->AddNodeL( 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   565
            KAknTreeIIDRoot, KWidgets, KFlags, EFalse );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   566
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   567
        iArray = CHsContentInfoArray::NewL();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   568
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   569
        // Get all homescreen widgets
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   570
        iHsCcApiClient->WidgetListL( *iArray );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   571
        
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   572
        for ( TInt i = 0; i < iArray->Array().Count(); i++ )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   573
            {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   574
            CHsContentInfo* widget( iArray->Array()[i] );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   575
            
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   576
            iListBox->AddLeafL( root, widget->Name(), KFlags, EFalse );                 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   577
            }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   578
        }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   579
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   580
    DrawNow();
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   581
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   582
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   583
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   584
// CHsContentControlListBox::PopulateList
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   585
//
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   586
// -----------------------------------------------------------------------------
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   587
//    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   588
/*static*/ TInt CHsContentControlListBox::PopulateList( TAny* aAny )
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   589
    {
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   590
    CHsContentControlListBox* self = 
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   591
        static_cast< CHsContentControlListBox* >( aAny );
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   592
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   593
    TRAP_IGNORE( self->PopulateListL() );       
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   594
    
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   595
    return KErrNone;
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   596
    }
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   597
d12a7ea0f775 Example applications for various Homescreen APIs.
jake
parents:
diff changeset
   598
// End of file