diff -r c743ef5928ba -r f966699dea19 idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp --- a/idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp Tue Feb 02 00:04:13 2010 +0200 +++ b/idlehomescreen/nativeuicontroller/src/aisoftkeyrenderer.cpp Fri Feb 19 22:42:37 2010 +0200 @@ -15,11 +15,10 @@ * */ - +// System includes #include #include #include -#include #include #include #include @@ -29,21 +28,25 @@ #include #include #include -#include + +// User includes +#include +#include + +#include #include "ainativeui.hrh" #include "aisoftkeyrenderer.h" #include "ainativeuiplugins.h" -#include "aiscutdefs.h" - using namespace AiNativeUiController; +// Constants // Index for left softkey; defined in avkon -const TInt KNativeUiLeftSoftkeyId = 0; +//const TInt KNativeUiLeftSoftkeyId = 0; // Index for right softkey; defined in avkon -const TInt KNativeUiRightSoftkeyId = 2; +//const TInt KNativeUiRightSoftkeyId = 2; const TInt KControlArrayCBAButton1Posn =0; const TInt KControlArrayCBAButton2Posn =2; @@ -51,7 +54,7 @@ const TInt KWideScreenWidth = 640; - +// ======== LOCAL FUNCTIONS ======== inline TAknWindowComponentLayout DoCompose( TAknWindowComponentLayout aLine1, TAknWindowComponentLayout aLine2 ) { @@ -420,14 +423,23 @@ return size; } - +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::ConstructL() +// +// ---------------------------------------------------------------------------- +// void CAiSoftKeyRenderer::ConstructL() { // load default soft key labels from resource CreateDefaultSoftKeysL(); } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::NewLC() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer* CAiSoftKeyRenderer::NewLC() { CAiSoftKeyRenderer* self = new( ELeave ) CAiSoftKeyRenderer(); @@ -436,7 +448,11 @@ return self; } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::~CAiSoftKeyRenderer() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::~CAiSoftKeyRenderer() { delete iText; @@ -450,136 +466,54 @@ delete iCba; } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CAiSoftKeyRenderer() +// +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CAiSoftKeyRenderer() { iAppUi = iAvkonAppUi; } - - - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC16& aText, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC16& /*aText*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutShortCaption].id ) - { - HBufC* temp = aText.AllocL(); - delete iText; - iText = temp; - - UpdateSoftKeyL( aIndex, NULL ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - TInt aResource, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, TInt /*aResource*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutShortCaption].id ) - { - TInt internalId = KErrNotFound; - switch( aResource ) - { - case EAiScutResourceBackCaption: - { - internalId = R_NATIVEUI_SK_BACK; - break; - } - case EAiScutResourceNewMsgShortCaption: - { - internalId = R_NATIVEUI_SK_NEWMSG; - break; - } - case EAiScutResourceNewEmailShortCaption: - { - internalId = R_NATIVEUI_SK_EMAIL; - break; - } - case EAiScutResourceNewSyncMLMailShortCaption: - { - internalId = R_NATIVEUI_SK_SYNCMLMAIL; - break; - } - case EAiScutResourceNewPostcardShortCaption: - { - internalId = R_NATIVEUI_SK_MMSPOSTCARD; - break; - } - case EAiScutResourceSelectMsgTypeShortCaption: - { - internalId = R_NATIVEUI_SK_MSGTYPE; - break; - } - case EAiScutResourceNewAudioMsgShortCaption: - { - internalId = R_NATIVEUI_SK_AUDIOMSG; - break; - } - case EAiScutResourceChangeThemeShortCaption: - { - internalId = R_NATIVEUI_SK_CHANGETHEME; - break; - } - default: - { - User::Leave( KErrNotFound ); - } - } - - HBufC* temp = StringLoader::LoadL( internalId ); - delete iText; - iText = temp; - - UpdateSoftKeyL( aIndex, NULL ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - -void CAiSoftKeyRenderer::DoPublishL( MAiPropertyExtension& aPlugin, - TInt aContent, - const TDesC8& aBuf, - TInt aIndex ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::DoPublishL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::DoPublishL( CHsContentPublisher& /*aPlugin*/, + TInt /*aContent*/, const TDesC8& /*aBuf*/, TInt /*aIndex*/ ) { - if( aPlugin.PublisherInfoL()->iUid == KShortcutPluginUid ) - { - if( aContent == KAiScutContent[EAiScutContentShortcutSkIcon].id ) - { - CGulIcon* icon = NULL; - TPckg( icon ).Copy( aBuf ); - // icon ownership is transferred - UpdateSoftKeyL( aIndex, icon ); - } - else - { - User::Leave( KErrNotSupported ); - } - } - else - { - User::Leave( KErrNotFound ); - } + User::Leave( KErrNotFound ); } - +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::CreateDefaultSoftKeysL() +// +// ---------------------------------------------------------------------------- +// void CAiSoftKeyRenderer::CreateDefaultSoftKeysL() { // If we already have cba, then do nothing. @@ -611,8 +545,12 @@ ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys ); } - -void CAiSoftKeyRenderer::UpdateSoftKeyL( TInt aKey, CGulIcon* aIcon ) +// ---------------------------------------------------------------------------- +// CAiSoftKeyRenderer::UpdateSoftKeyL() +// +// ---------------------------------------------------------------------------- +// +void CAiSoftKeyRenderer::UpdateSoftKeyL( TInt /*aKey*/, CGulIcon* /*aIcon*/ ) { if( !iCba ) { @@ -620,9 +558,10 @@ } // remove the locked flag if any - aKey &= KScutBitMaskLocked; + // NOTE ai_shortcut_command_api has been removed! + //aKey &= KScutBitMaskLocked; - TInt buttonPosImage; + /*TInt buttonPosImage; TInt buttonPosText; TInt buttonCmd; @@ -672,5 +611,7 @@ *iText ); } - iCba->DrawDeferred(); + iCba->DrawDeferred();*/ } + +// End of file