idlehomescreen/nativeuicontroller/src/aistatuspanetouchui.cpp
branchRCL_3
changeset 9 f966699dea19
parent 0 f72a12da539e
child 38 79311d856354
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    13 *
    13 *
    14 * Description:  Choice list.
    14 * Description:  Choice list.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 // System includes
    19 #include <AknLayout2ScalableDef.h>
    19 #include <AknLayout2ScalableDef.h>
    20 #include <aipropertyextension.h>
    20 #include <aknstyluspopupmenu.h>
    21 
    21 #include <AknUtils.h>
       
    22 #include <aknnavide.h>
       
    23 #include <akntitle.h>
       
    24 #include <MProfileEngine.h>
       
    25 #include <viewcli.h>
       
    26 #include <aknlayoutscalable_avkon.cdl.h>
       
    27 #ifdef RD_TACTILE_FEEDBACK
       
    28 #include <touchfeedback.h>
       
    29 #endif
       
    30 
       
    31 // User includes
       
    32 #include <hscontentpublisher.h>
       
    33 #include <hspublisherinfo.h>
    22 #include "aistrcnv.h"
    34 #include "aistrcnv.h"
    23 #include "aistatuspanetouchui.h"
    35 #include "aistatuspanetouchui.h"
    24 #include "aistatuspanel.h"
    36 #include "aistatuspanel.h"
    25 #include "ainativeuiplugins.h"
    37 #include "ainativeuiplugins.h"
    26 #include "aifweventhandler.h"
    38 #include "aifweventhandler.h"
    27 #include "aiconsts.h"
    39 #include "aiconsts.h"
    28 #include "aidevicestatuscontentmodel.h"
    40 #include "aidevicestatuscontentmodel.h"
    29 #include <aknstyluspopupmenu.h>
       
    30 
       
    31 #include <AiNativeUi.rsg>
    41 #include <AiNativeUi.rsg>
    32 #include <AknUtils.h>
       
    33 #include <aknnavide.h>
       
    34 #include <akntitle.h>
       
    35 #include <MProfileEngine.h>
       
    36 #include <viewcli.h>
       
    37 #include <aknlayoutscalable_avkon.cdl.h>
       
    38 
       
    39 #ifdef RD_TACTILE_FEEDBACK
       
    40 #include <touchfeedback.h>
       
    41 #endif
       
    42 
    42 
    43 using namespace AiNativeUiController;
    43 using namespace AiNativeUiController;
    44 
    44 
       
    45 // Constants
    45 _LIT( KProfileSwitchByIndexEvent, "Profile/SwitchProfileByIndex" );
    46 _LIT( KProfileSwitchByIndexEvent, "Profile/SwitchProfileByIndex" );
    46 const TInt KProfileSwitchByIndexEventLength = 28;
    47 const TInt KProfileSwitchByIndexEventLength = 28;
    47 const TInt KRadix = 10;
    48 const TInt KRadix = 10;
    48 const TText16 KEventParameterTerminator = ')';
    49 const TText16 KEventParameterTerminator = ')';
    49 const TInt KExtraItems = 2;
    50 const TInt KExtraItems = 2;
    50 const TInt KStylusMenuMaxItemsDefault = 0;
    51 const TInt KStylusMenuMaxItemsDefault = 0;
    51 
    52 
    52 _LIT( KOpenAppProfiles, "Shortcut/LaunchByValue(localapp:0x100058F8)" );
    53 _LIT( KOpenAppProfiles, "Shortcut/LaunchByValue(localapp:0x100058F8)" );
    53 _LIT( KOpenAppCalendar, "Shortcut/LaunchByValue(localapp:0x10005901)" );
    54 _LIT( KOpenAppCalendar, "Shortcut/LaunchByValue(localapp:0x10005901)" );
    54 
    55 
       
    56 // ======== LOCAL FUNCTIONS ========
       
    57 // ----------------------------------------------------------------------------
       
    58 // IndexLength()
       
    59 //
       
    60 // ----------------------------------------------------------------------------
       
    61 //
    55 static TInt IndexLength( TInt aIndex )
    62 static TInt IndexLength( TInt aIndex )
    56     {
    63     {
    57     TInt length = 0;
    64     TInt length = 0;
    58 
    65 
    59     if ( aIndex < 0 )
    66     if ( aIndex < 0 )
    70     return length;
    77     return length;
    71   }
    78   }
    72 
    79 
    73 // ======== MEMBER FUNCTIONS ========
    80 // ======== MEMBER FUNCTIONS ========
    74 
    81 
    75 
    82 // ----------------------------------------------------------------------------
       
    83 // CAiStatusPaneTouchUi::NewL()
       
    84 //
       
    85 // ----------------------------------------------------------------------------
       
    86 //
    76 CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewL( CAiStatusPanel& aStatusPanel,
    87 CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewL( CAiStatusPanel& aStatusPanel,
    77                           MAiFwEventHandler& aEventHandler )
    88     MAiFwEventHandler& aEventHandler )
    78     {
    89     {
    79     CAiStatusPaneTouchUi* self = CAiStatusPaneTouchUi::NewLC( aStatusPanel, aEventHandler );
    90     CAiStatusPaneTouchUi* self = 
       
    91         CAiStatusPaneTouchUi::NewLC( aStatusPanel, aEventHandler );
    80     CleanupStack::Pop( self );
    92     CleanupStack::Pop( self );
    81 
    93 
    82     return self;
    94     return self;
    83     }
    95     }
    84 
    96 
       
    97 // ----------------------------------------------------------------------------
       
    98 // CAiStatusPaneTouchUi::NewLC()
       
    99 //
       
   100 // ----------------------------------------------------------------------------
       
   101 //
    85 CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewLC( CAiStatusPanel& aStatusPanel,
   102 CAiStatusPaneTouchUi* CAiStatusPaneTouchUi::NewLC( CAiStatusPanel& aStatusPanel,
    86                           MAiFwEventHandler& aEventHandler )
   103     MAiFwEventHandler& aEventHandler )
    87     {
   104     {
    88     CAiStatusPaneTouchUi* self = new (ELeave) CAiStatusPaneTouchUi( aStatusPanel, aEventHandler );
   105     CAiStatusPaneTouchUi* self = 
       
   106         new ( ELeave ) CAiStatusPaneTouchUi( aStatusPanel, aEventHandler );
    89     CleanupStack::PushL( self );
   107     CleanupStack::PushL( self );
    90     self->ConstructL();
   108     self->ConstructL();
    91 
   109 
    92     return self;
   110     return self;
    93     }
   111     }
    94 
   112 
       
   113 // ----------------------------------------------------------------------------
       
   114 // CAiStatusPaneTouchUi::CAiStatusPaneTouchUi()
       
   115 //
       
   116 // ----------------------------------------------------------------------------
       
   117 //
    95 CAiStatusPaneTouchUi::CAiStatusPaneTouchUi( CAiStatusPanel& aStatusPanel,
   118 CAiStatusPaneTouchUi::CAiStatusPaneTouchUi( CAiStatusPanel& aStatusPanel,
    96                           MAiFwEventHandler& aEventHandler )
   119     MAiFwEventHandler& aEventHandler )
    97   :
   120     : iStatusPane( aStatusPanel ), iEventHandler( aEventHandler )
    98   iStatusPane( aStatusPanel ),
   121     {
    99   iEventHandler( aEventHandler )
   122     // no implementation required
   100     {
   123     }
   101   // no implementation required
   124 
   102     }
   125 // ----------------------------------------------------------------------------
   103 
   126 // CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi()
       
   127 //
       
   128 // ----------------------------------------------------------------------------
       
   129 //
   104 CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi()
   130 CAiStatusPaneTouchUi::~CAiStatusPaneTouchUi()
   105     {
   131     {
   106     delete iEventBuffer;
   132     delete iEventBuffer;
   107     delete iMenu;
   133     delete iMenu;
   108     iProfileNamePointerArray.ResetAndDestroy();
   134     iProfileNamePointerArray.ResetAndDestroy();
   109     }
   135     }
   110 
   136 
       
   137 // ----------------------------------------------------------------------------
       
   138 // CAiStatusPaneTouchUi::ConstructL()
       
   139 //
       
   140 // ----------------------------------------------------------------------------
       
   141 //
   111 void CAiStatusPaneTouchUi::ConstructL()
   142 void CAiStatusPaneTouchUi::ConstructL()
   112     {
   143     {
   113     if( AknLayoutUtils::PenEnabled() )
   144     if( AknLayoutUtils::PenEnabled() )
   114         {
   145         {
   115         iStatusPane.SetNaviDecoratorObserver( this );
   146         iStatusPane.SetNaviDecoratorObserver( this );
   116         }
   147         }
   117     }
   148     }
   118 
   149 
       
   150 // ----------------------------------------------------------------------------
       
   151 // CAiStatusPaneTouchUi::LoadUIDefinitionL()
       
   152 //
       
   153 // ----------------------------------------------------------------------------
       
   154 //
   119 void CAiStatusPaneTouchUi::LoadUIDefinitionL()
   155 void CAiStatusPaneTouchUi::LoadUIDefinitionL()
   120     {
   156     {
   121     // If profile popup exists, for example, when screendevicechange occurs,
   157     // If profile popup exists, for example, when screendevicechange occurs,
   122     // the popup is closed
   158     // the popup is closed
   123     if( iMenu )
   159     if( iMenu )
   125         delete iMenu;
   161         delete iMenu;
   126         iMenu = NULL;
   162         iMenu = NULL;
   127         }
   163         }
   128     }
   164     }
   129 
   165 
       
   166 // ----------------------------------------------------------------------------
       
   167 // CAiStatusPaneTouchUi::ProcessCommandL()
       
   168 //
       
   169 // ----------------------------------------------------------------------------
       
   170 //
   130 void CAiStatusPaneTouchUi::ProcessCommandL( TInt aCommandId )
   171 void CAiStatusPaneTouchUi::ProcessCommandL( TInt aCommandId )
   131     {
   172     {
   132     if( aCommandId == EAIGotoCalendarCmdLink )
   173     if( aCommandId == EAIGotoCalendarCmdLink )
   133       {
   174       {
   134       //Open calendar application
   175       //Open calendar application
   160 
   201 
   161       iEventHandler.HandlePluginEvent( event );
   202       iEventHandler.HandlePluginEvent( event );
   162       }
   203       }
   163     }
   204     }
   164 
   205 
   165 
   206 // ----------------------------------------------------------------------------
   166 
   207 // CAiStatusPaneTouchUi::HandleNaviDecoratorEventL()
       
   208 //
       
   209 // ----------------------------------------------------------------------------
       
   210 //
   167 void CAiStatusPaneTouchUi::HandleNaviDecoratorEventL( TInt aEventID )
   211 void CAiStatusPaneTouchUi::HandleNaviDecoratorEventL( TInt aEventID )
   168     {
   212     {
   169     if( aEventID == EAknNaviDecoratorEventNaviLabel )
   213     if( aEventID == EAknNaviDecoratorEventNaviLabel )
   170         {
   214         {
   171 #ifdef RD_TACTILE_FEEDBACK
   215 #ifdef RD_TACTILE_FEEDBACK
   259 
   303 
   260         iMenu->ShowMenu();
   304         iMenu->ShowMenu();
   261         }
   305         }
   262     }
   306     }
   263 
   307 
   264 
   308 // ----------------------------------------------------------------------------
   265 void CAiStatusPaneTouchUi::DoPublishL( MAiPropertyExtension& aPlugin,
   309 // CAiStatusPaneTouchUi::DoPublishL()
   266                     TInt aContent,
   310 //
   267                     const TDesC16& aText,
   311 // ----------------------------------------------------------------------------
   268                     TInt aIndex )
   312 //
   269     {
   313 void CAiStatusPaneTouchUi::DoPublishL( CHsContentPublisher& aPlugin,
   270     if( aPlugin.PublisherInfoL()->iUid == KProfilePluginUid )
   314     TInt aContent, const TDesC16& aText, TInt aIndex )
       
   315     {
       
   316     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
   317     
       
   318     if( info.Uid() == KProfilePluginUid )
   271       {
   319       {
   272       switch( aContent )
   320       switch( aContent )
   273         {
   321         {
   274         case EAiProfileContentProfileName:
   322         case EAiProfileContentProfileName:
   275         {
   323         {
   301       {
   349       {
   302       User::Leave( KErrNotFound );
   350       User::Leave( KErrNotFound );
   303       }
   351       }
   304     }
   352     }
   305 
   353 
   306 void CAiStatusPaneTouchUi::SetEmphasis( CCoeControl* /*aMenuControl*/, TBool /*aEmphasis*/ )
   354 // ----------------------------------------------------------------------------
   307   {
   355 // CAiStatusPaneTouchUi::SetEmphasis()
   308   }
   356 //
   309 
   357 // ----------------------------------------------------------------------------
   310 
   358 //
       
   359 void CAiStatusPaneTouchUi::SetEmphasis( CCoeControl* /*aMenuControl*/, 
       
   360     TBool /*aEmphasis*/ )
       
   361     {
       
   362     }
       
   363 
       
   364 // End of file