# HG changeset patch # User jake # Date 1273660607 -10800 # Node ID dbbebe55c824f0bf46d54ab2f04e6c3a7d6b0571 # Parent cb506ec2d869a6b304dd2550b6f1966b1e1449db# Parent 2f40063dfb5cba337ab3d765dd441908b22e87a2 Merge bug fix diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccclientsession/src/ccclientsession.cpp --- a/contentcontrolsrv/ccclientsession/src/ccclientsession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccclientsession/src/ccclientsession.cpp Wed May 12 13:36:47 2010 +0300 @@ -30,6 +30,7 @@ const TUint KCcSrvMajorVersionNumber = 1; const TUint KCcSrvMinorVersionNumber = 0; const TUint KCcSrvBuildVersionNumber = 0; +const TInt KDefaultMessageSlots = 3; // ----------------------------------------------------------------------------- @@ -78,7 +79,7 @@ TInt retry=2; for (;;) { - TInt r = CreateSession( KCcSrvName, ver ); + TInt r = CreateSession( KCcSrvName, ver, KDefaultMessageSlots ); if (r != KErrNotFound && r != KErrServerTerminated) { diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrv/inc/ccsrv.h --- a/contentcontrolsrv/ccsrv/inc/ccsrv.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrv/inc/ccsrv.h Wed May 12 13:36:47 2010 +0300 @@ -114,13 +114,9 @@ /** * Sends message to defined session - * @param aSender Sender session - * @param aReceiver Receiver session * @param aMsgBuf Message buffer */ void SendMsgL( - TUint32 aSender, - TUint32 aReceiver, CCcSrvMsg& aMessage ); private: @@ -160,6 +156,16 @@ }; RArray iProviders; + /** + * Observer list + */ + struct TCcObserver + { + TUint32 iProviderId; + TUint32 iObserver; + }; + RArray iObservers; + }; diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrv/inc/ccsrvsession.h --- a/contentcontrolsrv/ccsrv/inc/ccsrvsession.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrv/inc/ccsrvsession.h Wed May 12 13:36:47 2010 +0300 @@ -90,8 +90,6 @@ * */ void ReceiveMsgL( - TUint32 aSender, - TUint32 aReceiver, CCcSrvMsg& aMessage ); private: diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrv/src/ccsrv.cpp --- a/contentcontrolsrv/ccsrv/src/ccsrv.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrv/src/ccsrv.cpp Wed May 12 13:36:47 2010 +0300 @@ -138,6 +138,7 @@ { iSessions.Close(); iProviders.Close(); + iObservers.Close(); } // ----------------------------------------------------------------------------- @@ -185,6 +186,37 @@ // void CCcSrv::DropSession( CCcSrvSession* aSession ) { + // Remove possible provider + for ( TUint32 i = 0; i < iProviders.Count(); i++ ) + { + if ( iProviders[ i ].iSession->Id() == aSession->Id() ) + { + iProviders.Remove( i ); + break; + } + } + // Unregister possible observations and remove observer + for ( TUint32 i = 0; i < iObservers.Count(); ) + { + if ( iObservers[ i ].iObserver == aSession->Id() ) + { + for ( TUint32 j = 0; j < iProviders.Count(); j++ ) + { + if ( iObservers[ i ].iProviderId == iProviders[ j ].iId ) + { + TRAP_IGNORE( iProviders[ j ].iSession-> + UnregisterObserverSessionL( aSession->Id() ) ); + } + } + iObservers.Remove( i ); + } + else + { + // Get next observer + i++; + } + } + // Remove session for ( TUint32 i = 0; i < iSessions.Count(); i++ ) { if ( iSessions[ i ]->Id() == aSession->Id() ) @@ -193,22 +225,7 @@ break; } } - // Unregister possible observations - for ( TUint32 i = 0; i < iProviders.Count(); i++ ) - { - TRAP_IGNORE( iProviders[ i ].iSession-> - UnregisterObserverSessionL( aSession->Id() ) ); - } - // Remove possible provider - for ( TUint32 i = 0; i < iProviders.Count(); i++ ) - { - if ( iProviders[ i ].iId == aSession->Id() ) - { - iProviders.Remove( i ); - break; - } - } if ( iSessions.Count() == 0 ) { // Last session dropped -> stop server @@ -236,6 +253,15 @@ provider.iSession = aSession; iProviders.Append( provider ); + // Register possible active observers + for ( TUint32 i = 0; i < iObservers.Count(); i++ ) + { + if ( iObservers[ i ].iProviderId == aProvider ) + { + provider.iSession->RegisterObserverSessionL( iObservers[ i ].iObserver ); + } + } + } // ----------------------------------------------------------------------------- @@ -246,19 +272,18 @@ TUint32 aProvider, CCcSrvSession* aSession ) { - TBool found( EFalse ); - for ( TUint32 i = 0; i < iProviders.Count() && !found; i++ ) + for ( TUint32 i = 0; i < iProviders.Count(); i++ ) { if ( iProviders[ i ].iId == aProvider ) { - iProviders[ i ].iSession->RegisterObserverSessionL( aSession->Id() ); - found = ETrue; + iProviders[ i ].iSession->RegisterObserverSessionL( aSession->Id() ); + break; } } - if ( !found ) - { - User::Leave( KErrNotFound ); - } + CCcSrv::TCcObserver observer; + observer.iProviderId = aProvider; + observer.iObserver = aSession->Id(); + iObservers.Append( observer ); } // ----------------------------------------------------------------------------- @@ -299,16 +324,14 @@ // ----------------------------------------------------------------------------- // void CCcSrv::SendMsgL( - TUint32 aSender, - TUint32 aReceiver, CCcSrvMsg& aMessage ) { TBool found( EFalse ); for ( TUint32 i = 0; i < iSessions.Count() && !found; i++ ) { - if ( iSessions[ i ]->Id() == aReceiver ) + if ( iSessions[ i ]->Id() == aMessage.Receiver() ) { - iSessions[ i ]->ReceiveMsgL( aSender, aReceiver, aMessage ); + iSessions[ i ]->ReceiveMsgL( aMessage ); found = ETrue; } } diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrv/src/ccsrvsession.cpp --- a/contentcontrolsrv/ccsrv/src/ccsrvsession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrv/src/ccsrvsession.cpp Wed May 12 13:36:47 2010 +0300 @@ -215,11 +215,35 @@ void CCcSrvSession::HandleWaitForApiReqL( RMessage2& aMessage ) { + // Wait for the next API request or Observer notification CCcSrvMsg* tr = CCcSrvMsg::NewL(); CleanupStack::PushL( tr ); tr->SetMessage( aMessage ); iRequests.AppendL( tr ); CleanupStack::Pop( tr ); + + // Check if there is outstanding requests + for ( TInt i = 0; i < iRequests.Count(); i++ ) + { + CCcSrvMsg* req = iRequests[ i ]; + if ( req->MsgId() == ECcRegisterObserverNtf || + req->MsgId() == ECcUnregisterObserverNtf ) + { + iRequests.Remove( i ); + CleanupStack::PushL( req ); + SendObserverNtfL( req->Sender(), req->MsgId() ); + CleanupStack::PopAndDestroy( req ); + break; + } + else if ( req->Function() == ECcApiReq ) + { + iRequests.Remove( i ); + CleanupStack::PushL( req ); + ReceiveMsgL( *req ); + CleanupStack::PopAndDestroy( req ); + break; + } + } } // ----------------------------------------------------------------------- @@ -234,6 +258,20 @@ tr->SetMessage( aMessage ); iRequests.AppendL( tr ); CleanupStack::Pop( tr ); + + // Check if there is outstanding API notifications + for ( TInt i = 0; i < iRequests.Count(); i++ ) + { + CCcSrvMsg* req = iRequests[ i ]; + if ( req->Function() == ECcApiNtf ) + { + iRequests.Remove( i ); + CleanupStack::PushL( req ); + ReceiveMsgL( *req ); + CleanupStack::PopAndDestroy( req ); + break; + } + } } // ----------------------------------------------------------------------- @@ -289,12 +327,14 @@ message->InternalizeL( stream ); message->SetTrId( Server().GetTrId() ); message->SetMessage( aMessage ); + message->SetSender( iId ); + message->SetReceiver( providerAddress ); - Server().SendMsgL( iId, providerAddress, *message ); + iRequests.AppendL( message ); + CleanupStack::Pop( message ); - iRequests.AppendL( message ); + Server().SendMsgL( *message ); - CleanupStack::Pop( message ); CleanupStack::PopAndDestroy( msgBuf ); } @@ -325,9 +365,11 @@ CleanupStack::PushL( message ); message->InternalizeL( stream ); message->SetMessage( aMessage ); + message->SetSender( sender ); + message->SetReceiver( receiver ); // Forward message to receiver - Server().SendMsgL( sender, receiver, *message ); + Server().SendMsgL( *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( msgBuf ); @@ -396,11 +438,13 @@ CleanupStack::PushL( message ); message->InternalizeL( stream ); message->SetMessage( aMessage ); + message->SetSender( iId ); // Forward notification to observers for ( TInt i = 0; i < iObservers.Count(); i++ ) { - Server().SendMsgL( iId, iObservers[ i ], *message ); + message->SetReceiver( iObservers[ i ] ); + Server().SendMsgL( *message ); } message->Message().Complete( KErrNone ); @@ -414,49 +458,48 @@ // ----------------------------------------------------------------------- // void CCcSrvSession::ReceiveMsgL( - TUint32 aSender, - TUint32 aReceiver, CCcSrvMsg& aMessage ) { TBool found( EFalse ); CCcSrvMsg* req( NULL ); - TInt index( 0 ); for ( TInt i = 0; i < iRequests.Count() && !found; i++ ) { req = iRequests[ i ]; - if ( aMessage.Message().Function() == ECcApiReq && - req->Message().Function() == ECcWaitForApiReq && + if ( aMessage.Function() == ECcApiReq && + req->Function() == ECcWaitForApiReq && !req->Message().IsNull() ) { // Pending WaitForApiReq transaction found - index = i; + iRequests.Remove( i ); found = ETrue; } - else if ( aMessage.Message().Function() == ECcApiResp && + else if ( aMessage.Function() == ECcApiResp && req->TrId() == aMessage.TrId() ) { // Pending ApiReq transaction found - index = i; + iRequests.Remove( i ); found = ETrue; } - else if ( aMessage.Message().Function() == ECcApiNtf && - req->Message().Function() == ECcWaitForApiNtf && + else if ( aMessage.Function() == ECcApiNtf && + req->Function() == ECcWaitForApiNtf && !req->Message().IsNull() ) { // Pending WaitForApiNtf transaction found - index = i; + iRequests.Remove( i ); found = ETrue; } } if ( found ) { + CleanupStack::PushL( req ); + // Write sender of message - TPckgBuf packagedSender( aSender ); + TPckgBuf packagedSender( aMessage.Sender() ); req->Message().WriteL( 1, packagedSender, 0 ); // Write receiver of message - TPckgBuf packagedReceiver( aReceiver ); + TPckgBuf packagedReceiver( aMessage.Receiver() ); req->Message().WriteL( 2, packagedReceiver, 0 ); // Externalize message header @@ -477,27 +520,43 @@ req->Message().WriteL( 3, ptr, 0); CleanupStack::PopAndDestroy( des ); CleanupStack::PopAndDestroy( buf ); - + // Complete request req->Message().Complete( KErrNone ); + if ( aMessage.DataSize() ) { // Store request data to be read later // with GetMsgData() req->SetTrId( aMessage.TrId() ); req->SetData( aMessage.Data() ); + iRequests.AppendL( req ); + CleanupStack::Pop( req ); } else { - // Received request does not contain any data - // -> remove it from request array - iRequests.Remove( index ); - delete req; + CleanupStack::PopAndDestroy( req ); } } else { - User::Leave( KErrNotFound ); + if ( aMessage.Function() == ECcApiReq || + aMessage.Function() == ECcApiNtf ) + { + // Store message to handled later + CCcSrvMsg* msg = CCcSrvMsg::NewL(); + CleanupStack::PushL( msg ); + msg->SetFunction( aMessage.Function() ); + msg->SetSender( aMessage.Sender() ); + msg->SetReceiver( aMessage.Receiver() ); + msg->SetMsgId( aMessage.MsgId() ); + msg->SetTrId( aMessage.TrId() ); + msg->SetStatus( aMessage.Status() ); + msg->SetData( aMessage.Data() ); + iRequests.AppendL( msg ); + CleanupStack::Pop( msg ); + } + // ECcApiResp are ignored } } @@ -509,25 +568,30 @@ TUint32 aSender, TUint32 aNtf ) { + // Create notification + CCcSrvMsg* ntf = CCcSrvMsg::NewL(); + CleanupStack::PushL( ntf ); + ntf->SetMsgId( aNtf ); + ntf->SetSender( aSender ); + // Notify provider of registered observer TBool found( EFalse ); CCcSrvMsg* req( NULL ); - TInt index( 0 ); for ( TInt i = 0; i < iRequests.Count() && !found; i++ ) { req = iRequests[ i ]; - if ( req->Message().Function() == ECcWaitForApiReq && + if ( req->Function() == ECcWaitForApiReq && !req->Message().IsNull() ) { // Pending WaitForApiReq transaction found - index = i; + iRequests.Remove( i ); found = ETrue; } } if ( found ) { // Write sender of message - TPckgBuf packagedSender( aSender ); + TPckgBuf packagedSender( ntf->Sender() ); req->Message().WriteL( 1, packagedSender, 0 ); // Write receiver of message @@ -535,9 +599,6 @@ req->Message().WriteL( 2, packagedReceiver, 0 ); // Externalize notification - CCcSrvMsg* ntf = CCcSrvMsg::NewL(); - CleanupStack::PushL( ntf ); - ntf->SetMsgId( aNtf ); HBufC8* ntfBuf = ntf->MarshalL(); CleanupStack::PushL( ntfBuf ); TPtr8 ntfPtr( NULL, 0); @@ -550,13 +611,14 @@ // Complete request req->Message().Complete( KErrNone ); - iRequests.Remove( index ); delete req; - + } else { - User::Leave( KErrNotFound ); + // Store notification to be sent later + iRequests.AppendL( ntf ); + CleanupStack::Pop( ntf ); } } diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrvapi/bwins/ccsrvapiu.def --- a/contentcontrolsrv/ccsrvapi/bwins/ccsrvapiu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrvapi/bwins/ccsrvapiu.def Wed May 12 13:36:47 2010 +0300 @@ -2,18 +2,24 @@ ?SetStatus@CCcSrvMsg@@QAEXH@Z @ 1 NONAME ; void CCcSrvMsg::SetStatus(int) ?ExternalizeHeaderL@CCcSrvMsg@@QAEXAAVRWriteStream@@@Z @ 2 NONAME ; void CCcSrvMsg::ExternalizeHeaderL(class RWriteStream &) ?DataSize@CCcSrvMsg@@QAEHXZ @ 3 NONAME ; int CCcSrvMsg::DataSize(void) - ?MsgId@CCcSrvMsg@@QAEKXZ @ 4 NONAME ; unsigned long CCcSrvMsg::MsgId(void) - ?SetMsgId@CCcSrvMsg@@QAEXK@Z @ 5 NONAME ; void CCcSrvMsg::SetMsgId(unsigned long) - ?Data@CCcSrvMsg@@QAE?AVTPtrC8@@XZ @ 6 NONAME ; class TPtrC8 CCcSrvMsg::Data(void) - ?MarshalL@CCcSrvMsg@@QAEPAVHBufC8@@XZ @ 7 NONAME ; class HBufC8 * CCcSrvMsg::MarshalL(void) - ?SetTrId@CCcSrvMsg@@QAEXK@Z @ 8 NONAME ; void CCcSrvMsg::SetTrId(unsigned long) - ?InternalizeHeaderL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 9 NONAME ; void CCcSrvMsg::InternalizeHeaderL(class RReadStream &) - ?NewL@CCcSrvMsg@@SAPAV1@XZ @ 10 NONAME ; class CCcSrvMsg * CCcSrvMsg::NewL(void) - ?InternalizeL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void CCcSrvMsg::InternalizeL(class RReadStream &) - ?TrId@CCcSrvMsg@@QAEKXZ @ 12 NONAME ; unsigned long CCcSrvMsg::TrId(void) - ?Message@CCcSrvMsg@@QAE?AVRMessage2@@XZ @ 13 NONAME ; class RMessage2 CCcSrvMsg::Message(void) - ?SetData@CCcSrvMsg@@QAEXABVTDesC8@@@Z @ 14 NONAME ; void CCcSrvMsg::SetData(class TDesC8 const &) - ?ExternalizeL@CCcSrvMsg@@QAEXAAVRWriteStream@@@Z @ 15 NONAME ; void CCcSrvMsg::ExternalizeL(class RWriteStream &) - ?SetMessage@CCcSrvMsg@@QAEXAAVRMessage2@@@Z @ 16 NONAME ; void CCcSrvMsg::SetMessage(class RMessage2 &) - ?Status@CCcSrvMsg@@QAEHXZ @ 17 NONAME ; int CCcSrvMsg::Status(void) + ?SetSender@CCcSrvMsg@@QAEXK@Z @ 4 NONAME ; void CCcSrvMsg::SetSender(unsigned long) + ?Sender@CCcSrvMsg@@QAEKXZ @ 5 NONAME ; unsigned long CCcSrvMsg::Sender(void) + ?MsgId@CCcSrvMsg@@QAEKXZ @ 6 NONAME ; unsigned long CCcSrvMsg::MsgId(void) + ?Receiver@CCcSrvMsg@@QAEKXZ @ 7 NONAME ; unsigned long CCcSrvMsg::Receiver(void) + ?SetFunction@CCcSrvMsg@@QAEXH@Z @ 8 NONAME ; void CCcSrvMsg::SetFunction(int) + ?SetMsgId@CCcSrvMsg@@QAEXK@Z @ 9 NONAME ; void CCcSrvMsg::SetMsgId(unsigned long) + ?Data@CCcSrvMsg@@QAE?AVTPtrC8@@XZ @ 10 NONAME ; class TPtrC8 CCcSrvMsg::Data(void) + ?MarshalL@CCcSrvMsg@@QAEPAVHBufC8@@XZ @ 11 NONAME ; class HBufC8 * CCcSrvMsg::MarshalL(void) + ?SetTrId@CCcSrvMsg@@QAEXK@Z @ 12 NONAME ; void CCcSrvMsg::SetTrId(unsigned long) + ?Function@CCcSrvMsg@@QAEHXZ @ 13 NONAME ; int CCcSrvMsg::Function(void) + ?InternalizeHeaderL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 14 NONAME ; void CCcSrvMsg::InternalizeHeaderL(class RReadStream &) + ?SetReceiver@CCcSrvMsg@@QAEXK@Z @ 15 NONAME ; void CCcSrvMsg::SetReceiver(unsigned long) + ?NewL@CCcSrvMsg@@SAPAV1@XZ @ 16 NONAME ; class CCcSrvMsg * CCcSrvMsg::NewL(void) + ?InternalizeL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 17 NONAME ; void CCcSrvMsg::InternalizeL(class RReadStream &) + ?TrId@CCcSrvMsg@@QAEKXZ @ 18 NONAME ; unsigned long CCcSrvMsg::TrId(void) + ?Message@CCcSrvMsg@@QAE?AVRMessage2@@XZ @ 19 NONAME ; class RMessage2 CCcSrvMsg::Message(void) + ?SetData@CCcSrvMsg@@QAEXABVTDesC8@@@Z @ 20 NONAME ; void CCcSrvMsg::SetData(class TDesC8 const &) + ?ExternalizeL@CCcSrvMsg@@QAEXAAVRWriteStream@@@Z @ 21 NONAME ; void CCcSrvMsg::ExternalizeL(class RWriteStream &) + ?SetMessage@CCcSrvMsg@@QAEXAAVRMessage2@@@Z @ 22 NONAME ; void CCcSrvMsg::SetMessage(class RMessage2 &) + ?Status@CCcSrvMsg@@QAEHXZ @ 23 NONAME ; int CCcSrvMsg::Status(void) diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrvapi/eabi/ccsrvapiu.def --- a/contentcontrolsrv/ccsrvapi/eabi/ccsrvapiu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrvapi/eabi/ccsrvapiu.def Wed May 12 13:36:47 2010 +0300 @@ -1,21 +1,27 @@ EXPORTS _ZN9CCcSrvMsg10SetMessageER9RMessage2 @ 1 NONAME - _ZN9CCcSrvMsg12ExternalizeLER12RWriteStream @ 2 NONAME - _ZN9CCcSrvMsg12InternalizeLER11RReadStream @ 3 NONAME - _ZN9CCcSrvMsg18ExternalizeHeaderLER12RWriteStream @ 4 NONAME - _ZN9CCcSrvMsg18InternalizeHeaderLER11RReadStream @ 5 NONAME - _ZN9CCcSrvMsg4DataEv @ 6 NONAME - _ZN9CCcSrvMsg4NewLEv @ 7 NONAME - _ZN9CCcSrvMsg4TrIdEv @ 8 NONAME - _ZN9CCcSrvMsg5MsgIdEv @ 9 NONAME - _ZN9CCcSrvMsg6StatusEv @ 10 NONAME - _ZN9CCcSrvMsg7MessageEv @ 11 NONAME - _ZN9CCcSrvMsg7SetDataERK6TDesC8 @ 12 NONAME - _ZN9CCcSrvMsg7SetTrIdEm @ 13 NONAME - _ZN9CCcSrvMsg8DataSizeEv @ 14 NONAME - _ZN9CCcSrvMsg8MarshalLEv @ 15 NONAME - _ZN9CCcSrvMsg8SetMsgIdEm @ 16 NONAME - _ZN9CCcSrvMsg9SetStatusEi @ 17 NONAME - _ZTI9CCcSrvMsg @ 18 NONAME - _ZTV9CCcSrvMsg @ 19 NONAME + _ZN9CCcSrvMsg11SetFunctionEi @ 2 NONAME + _ZN9CCcSrvMsg11SetReceiverEm @ 3 NONAME + _ZN9CCcSrvMsg12ExternalizeLER12RWriteStream @ 4 NONAME + _ZN9CCcSrvMsg12InternalizeLER11RReadStream @ 5 NONAME + _ZN9CCcSrvMsg18ExternalizeHeaderLER12RWriteStream @ 6 NONAME + _ZN9CCcSrvMsg18InternalizeHeaderLER11RReadStream @ 7 NONAME + _ZN9CCcSrvMsg4DataEv @ 8 NONAME + _ZN9CCcSrvMsg4NewLEv @ 9 NONAME + _ZN9CCcSrvMsg4TrIdEv @ 10 NONAME + _ZN9CCcSrvMsg5MsgIdEv @ 11 NONAME + _ZN9CCcSrvMsg6SenderEv @ 12 NONAME + _ZN9CCcSrvMsg6StatusEv @ 13 NONAME + _ZN9CCcSrvMsg7MessageEv @ 14 NONAME + _ZN9CCcSrvMsg7SetDataERK6TDesC8 @ 15 NONAME + _ZN9CCcSrvMsg7SetTrIdEm @ 16 NONAME + _ZN9CCcSrvMsg8DataSizeEv @ 17 NONAME + _ZN9CCcSrvMsg8FunctionEv @ 18 NONAME + _ZN9CCcSrvMsg8MarshalLEv @ 19 NONAME + _ZN9CCcSrvMsg8ReceiverEv @ 20 NONAME + _ZN9CCcSrvMsg8SetMsgIdEm @ 21 NONAME + _ZN9CCcSrvMsg9SetSenderEm @ 22 NONAME + _ZN9CCcSrvMsg9SetStatusEi @ 23 NONAME + _ZTI9CCcSrvMsg @ 24 NONAME + _ZTV9CCcSrvMsg @ 25 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrvapi/inc/ccsrvapi.h --- a/contentcontrolsrv/ccsrvapi/inc/ccsrvapi.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrvapi/inc/ccsrvapi.h Wed May 12 13:36:47 2010 +0300 @@ -46,7 +46,7 @@ // - Arg[1]: Registered provider address (out), TUint32 // - Arg[2]: Not used // - Arg[2]: Not used - ECcReqisterProvider = ECcIPCFunctionBase, + ECcReqisterProvider, // ---------------------------------------------------------------------------- // RegisterObserver // ---------------------------------------------------------------------------- @@ -179,7 +179,7 @@ // ---------------------------------------------------------------------------- enum TCcSrvMessages { - ECcMessageBase = 0, + ECcMessageBase, // ---------------------------------------------------------------------------- // RegisterObserverNtf // ---------------------------------------------------------------------------- @@ -190,7 +190,7 @@ // - Message id: EHsCcRegisterObserverNtf // - Transaction id: None // - Message data: None - ECcRegisterObserverNtf = ECcMessageBase, + ECcRegisterObserverNtf, // ---------------------------------------------------------------------------- // UnregisterObserverNtf // ---------------------------------------------------------------------------- @@ -258,6 +258,39 @@ IMPORT_C void SetMessage( RMessage2& aMessage ); /** + * Returns IPC function + */ + IMPORT_C TInt Function(); + + /** + * Stores IPC function + * @param aFunction IPC function + */ + IMPORT_C void SetFunction( TInt aFunction ); + + /** + * Returns sender of the message + */ + IMPORT_C TUint32 Sender(); + + /** + * Stores sender of the message + * @param aSender Message sender + */ + IMPORT_C void SetSender( TUint32 ); + + /** + * Returns receiver of the message + */ + IMPORT_C TUint32 Receiver(); + + /** + * Stores receiver of the message + * @param aReceiver Message receiver + */ + IMPORT_C void SetReceiver( TUint32 ); + + /** * Returns message id */ IMPORT_C TUint32 MsgId(); @@ -343,6 +376,21 @@ RMessage2 iMessage; /** + * IPC function + */ + TInt iFunction; + + /** + * Sender + */ + TUint32 iSender; + + /** + * Receiver + */ + TUint32 iReceiver; + + /** * Message id */ TUint32 iMsgId; diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/ccsrvapi/src/ccsrvmsg.cpp --- a/contentcontrolsrv/ccsrvapi/src/ccsrvmsg.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/ccsrvapi/src/ccsrvmsg.cpp Wed May 12 13:36:47 2010 +0300 @@ -79,6 +79,55 @@ EXPORT_C void CCcSrvMsg::SetMessage( RMessage2& aMessage ) { iMessage = aMessage; + SetFunction( aMessage.Function() ); + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::Sender() +// ----------------------------------------------------------------------------- +EXPORT_C TInt CCcSrvMsg::Function() + { + return( iFunction ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetSender() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetFunction( TInt aFunction ) + { + iFunction = aFunction; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::Sender() +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCcSrvMsg::Sender() + { + return( iSender ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetSender() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetSender( TUint32 aSender ) + { + iSender = aSender; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::Receiver() +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCcSrvMsg::Receiver() + { + return( iReceiver ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetReceiver() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetReceiver( TUint32 aReceiver ) + { + iReceiver = aReceiver; } // ----------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hsccclient/hsccapiclient/inc/hsccapiclient.h --- a/contentcontrolsrv/hsccclient/hsccapiclient/inc/hsccapiclient.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/inc/hsccapiclient.h Wed May 12 13:36:47 2010 +0300 @@ -80,66 +80,91 @@ public: // From MHsContentController /** - * + * See from API documentation */ TInt WidgetListL( CHsContentInfoArray& aArray ); - + /** - * + * See from API documentation + */ + TInt WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); + + /** + * See from API documentation */ TInt ViewListL( CHsContentInfoArray& aArray ); - + /** - * + * See from API documentation + */ + TInt ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); + + /** + * See from API documentation */ TInt AppListL( CHsContentInfoArray& aArray ); /** - * + * See from API documentation */ TInt AddWidgetL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt RemoveWidgetL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt AddViewL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt RemoveViewL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt ActivateViewL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt ActivateAppL( CHsContentInfo& aInfo ); - /** - * - */ + /** + * See from API documentation + */ TInt ActiveViewL( CHsContentInfo& aInfo ); /** - * + * See from API documentation */ TInt ActiveAppL( CHsContentInfo& aInfo ); private: // Functions /** - * + * Requests receiving of content change notification */ void WaitForApiNtfL(); + /** + * Internalize received response message + */ + TInt InternalizeRespL( TPtr8& aResp, TUint32& aTrId, TUint32& aDataSize ); + + /** + * Internalize received CHsContentInfo type response message data + */ + TInt InternalizeContentInfoL( CHsContentInfo& aInfo, TUint32 aTrId, TUint32 aDataSize ); + + /** + * Internalize received CHsContentInfoArray type response message data + */ + TInt InternalizeContentInfoArrayL( CHsContentInfoArray& aInfo, TUint32 aTrId, TUint32 aDataSize ); + private: // Data /** * Session to Homescreen content control server diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hsccclient/hsccapiclient/src/hsccapiclient.cpp --- a/contentcontrolsrv/hsccclient/hsccapiclient/src/hsccapiclient.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/src/hsccapiclient.cpp Wed May 12 13:36:47 2010 +0300 @@ -102,12 +102,27 @@ // void CHsCcApiClient::RunL() { - if ( !iStatus.Int() ) + TInt err( iStatus.Int() ); + HBufC8* header( NULL ); + TPtr8 headerPtr( NULL, 0 ); + + if ( !err ) + { + // Read API request header + header = iApiHeader->AllocL(); + CleanupStack::PushL( header ); + headerPtr.Set( header->Des() ); + } + + // Receive next API notification + WaitForApiNtfL(); + + if ( !err ) { // Get received message header CCcSrvMsg* message = CCcSrvMsg::NewL(); CleanupStack::PushL( message ); - RDesReadStream stream( iApiHeaderPtr ); + RDesReadStream stream( headerPtr ); CleanupClosePushL( stream ); message->InternalizeHeaderL( stream ); CleanupStack::PopAndDestroy( &stream ); @@ -138,10 +153,10 @@ } CleanupStack::PopAndDestroy( message ); } - - // Receive next API notification - WaitForApiNtfL(); - + if ( header ) + { + CleanupStack::PopAndDestroy( header ); + } } // ----------------------------------------------------------------------------- @@ -188,37 +203,73 @@ if ( !err ) { - // Internalize WidgetListResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - if ( !err ) + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) { - if ( respMsg->DataSize() ) - { - // Get API response data - HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); - CleanupStack::PushL( dataBuf ); - TPtr8 dataPtr( NULL, 0 ); - dataPtr.Set( dataBuf->Des() ); - TPckgBuf trId( respMsg->TrId() ); - err = iSession.GetMsgData( trId, dataPtr ); - if ( !err ) - { - // Internalize API response data - RDesReadStream dataStream( dataPtr ); - CleanupClosePushL( dataStream ); - aArray.InternalizeL( dataStream ); - CleanupStack::PopAndDestroy( &dataStream ); - } - CleanupStack::PopAndDestroy( dataBuf ); - } + // Internalize API response data + err = InternalizeContentInfoArrayL( aArray, trId, dataSize ); } - CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::WidgetListL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::WidgetListL( + CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + // Create WidgetListReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcWidgetListReq ); + reqMsg->SetTrId( 0 ); + + // Marshal WidgetListReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) + { + // Internalize API response data + err = InternalizeContentInfoArrayL( aArray, trId, dataSize ); + } } // Cleanup @@ -259,37 +310,73 @@ if ( !err ) { - // Internalize ViewListResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - if ( !err ) + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) { - if ( respMsg->DataSize() ) - { - // Get API response data - HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); - CleanupStack::PushL( dataBuf ); - TPtr8 dataPtr( NULL, 0 ); - dataPtr.Set( dataBuf->Des() ); - TPckgBuf trId( respMsg->TrId() ); - err = iSession.GetMsgData( trId, dataPtr ); - if ( !err ) - { - // Internalize API response data - RDesReadStream dataStream( dataPtr ); - CleanupClosePushL( dataStream ); - aArray.InternalizeL( dataStream ); - CleanupStack::PopAndDestroy( &dataStream ); - } - CleanupStack::PopAndDestroy( dataBuf ); - } + // Internalize API response data + err = InternalizeContentInfoArrayL( aArray, trId, dataSize ); } - CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::ViewListL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::ViewListL( + CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + // Create ViewListReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcViewListReq ); + reqMsg->SetTrId( 0 ); + + // Marshal ViewListReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) + { + // Internalize API response data + err = InternalizeContentInfoArrayL( aArray, trId, dataSize ); + } } // Cleanup @@ -330,37 +417,15 @@ if ( !err ) { - // Internalize AppListResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - if ( !err ) + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) { - if ( respMsg->DataSize() ) - { - // Get API response data - HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); - CleanupStack::PushL( dataBuf ); - TPtr8 dataPtr( NULL, 0 ); - dataPtr.Set( dataBuf->Des() ); - TPckgBuf trId( respMsg->TrId() ); - err = iSession.GetMsgData( trId, dataPtr ); - if ( !err ) - { - // Internalize API response data - RDesReadStream dataStream( dataPtr ); - CleanupClosePushL( dataStream ); - aArray.InternalizeL( dataStream ); - CleanupStack::PopAndDestroy( &dataStream ); - } - CleanupStack::PopAndDestroy( dataBuf ); - } + // Internalize API response data + err = InternalizeContentInfoArrayL( aArray, trId, dataSize ); } - CleanupStack::PopAndDestroy( respMsg ); } // Cleanup @@ -409,15 +474,10 @@ if ( !err ) { - // Internalize AddWidgetResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -466,15 +526,10 @@ if ( !err ) { - // Internalize RemoveWidgetResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -523,15 +578,10 @@ if ( !err ) { - // Internalize AddViewResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -580,15 +630,10 @@ if ( !err ) { - // Internalize RemoveViewResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -637,15 +682,10 @@ if ( !err ) { - // Internalize ActivateViewResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -694,15 +734,10 @@ if ( !err ) { - // Internalize ActivateAppResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - CleanupStack::PopAndDestroy( respMsg ); + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); } // Cleanup @@ -743,37 +778,15 @@ if ( !err ) { - // Internalize AppListResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - if ( !err ) + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) { - if ( respMsg->DataSize() ) - { - // Get API response data - HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); - CleanupStack::PushL( dataBuf ); - TPtr8 dataPtr( NULL, 0 ); - dataPtr.Set( dataBuf->Des() ); - TPckgBuf trId( respMsg->TrId() ); - err = iSession.GetMsgData( trId, dataPtr ); - if ( !err ) - { - // Internalize API response data - RDesReadStream dataStream( dataPtr ); - CleanupClosePushL( dataStream ); - aInfo.InternalizeL( dataStream ); - CleanupStack::PopAndDestroy( &dataStream ); - } - CleanupStack::PopAndDestroy( dataBuf ); - } + // Internalize API response data + err = InternalizeContentInfoL( aInfo, trId, dataSize ); } - CleanupStack::PopAndDestroy( respMsg ); } // Cleanup @@ -814,37 +827,15 @@ if ( !err ) { - // Internalize AppListResp API response - CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); - CleanupStack::PushL( respMsg ); - RDesReadStream respStream( msgPtr ); - CleanupClosePushL( respStream ); - respMsg->InternalizeHeaderL( respStream ); - CleanupStack::PopAndDestroy( &respStream ); - err = respMsg->Status(); - if ( !err ) + // Internalize response message + TUint32 trId; + TUint32 dataSize; + err = InternalizeRespL( msgPtr, trId, dataSize ); + if ( !err && dataSize ) { - if ( respMsg->DataSize() ) - { - // Get API response data - HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); - CleanupStack::PushL( dataBuf ); - TPtr8 dataPtr( NULL, 0 ); - dataPtr.Set( dataBuf->Des() ); - TPckgBuf trId( respMsg->TrId() ); - err = iSession.GetMsgData( trId, dataPtr ); - if ( !err ) - { - // Internalize API response data - RDesReadStream dataStream( dataPtr ); - CleanupClosePushL( dataStream ); - aInfo.InternalizeL( dataStream ); - CleanupStack::PopAndDestroy( &dataStream ); - } - CleanupStack::PopAndDestroy( dataBuf ); - } + // Internalize API response data + err = InternalizeContentInfoL( aInfo, trId, dataSize ); } - CleanupStack::PopAndDestroy( respMsg ); } // Cleanup @@ -878,4 +869,83 @@ } +// ----------------------------------------------------------------------------- +// CHsCcApiClient::InternalizeRespL() +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::InternalizeRespL( + TPtr8& aResp, TUint32& aTrId, TUint32& aDataSize ) + { + TInt err( KErrNone ); + + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( aResp ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + aTrId = respMsg->TrId(); + aDataSize = respMsg->DataSize(); + CleanupStack::PopAndDestroy( respMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::InternalizeContentInfoL() +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::InternalizeContentInfoL( + CHsContentInfo& aInfo, TUint32 aTrId, TUint32 aDataSize ) + { + TInt err( KErrNone ); + + HBufC8* dataBuf = HBufC8::NewL( aDataSize ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( aTrId ); + err = iSession.GetMsgData( trId, dataPtr ); + if ( !err ) + { + // Internalize API response data + RDesReadStream dataStream( dataPtr ); + CleanupClosePushL( dataStream ); + aInfo.InternalizeL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + } + CleanupStack::PopAndDestroy( dataBuf ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::InternalizeContentInfoArrayL() +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::InternalizeContentInfoArrayL( + CHsContentInfoArray& aInfo, TUint32 aTrId, TUint32 aDataSize ) + { + TInt err( KErrNone ); + + HBufC8* dataBuf = HBufC8::NewL( aDataSize ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( aTrId ); + err = iSession.GetMsgData( trId, dataPtr ); + if ( !err ) + { + // Internalize API response data + RDesReadStream dataStream( dataPtr ); + CleanupClosePushL( dataStream ); + aInfo.InternalizeL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + } + CleanupStack::PopAndDestroy( dataBuf ); + + return err; + } + // End of file diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hsccclient/hsccproviderclient/inc/hsccproviderclient.h --- a/contentcontrolsrv/hsccclient/hsccproviderclient/inc/hsccproviderclient.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/inc/hsccproviderclient.h Wed May 12 13:36:47 2010 +0300 @@ -106,84 +106,112 @@ * */ void HandleWidgetListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleRegisterObserverNtfL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleUnregisterObserverNtfL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleAddWidgetReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleRemoveWidgetReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleViewListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleAddViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleRemoveViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleActivateViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleActiveViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleAppListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleActivateAppReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleActiveAppReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** * */ void HandleNotSupportedReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); /** @@ -196,6 +224,8 @@ * */ void SendRespL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ); private: // Data diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp --- a/contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp Wed May 12 13:36:47 2010 +0300 @@ -102,12 +102,32 @@ void CHsCcProviderClient::RunL() { - if ( !iStatus.Int() ) + TInt err( iStatus.Int() ); + HBufC8* header( NULL ); + TPtr8 headerPtr( NULL, 0 ); + TUint32 sender( 0 ); + TUint32 receiver( 0 ); + if ( !err ) + { + // Read API request header + header = iApiHeader->AllocL(); + CleanupStack::PushL( header ); + headerPtr.Set( header->Des() ); + // Read sender + sender = iPckgSender(); + // Read receiver + receiver = iPckgReceiver(); + } + + // Receive next API request + WaitForApiReqL(); + + if ( !err ) { // Get received message header CCcSrvMsg* message = CCcSrvMsg::NewL(); CleanupStack::PushL( message ); - RDesReadStream stream( iApiHeaderPtr ); + RDesReadStream stream( headerPtr ); CleanupClosePushL( stream ); message->InternalizeHeaderL( stream ); CleanupStack::PopAndDestroy( &stream ); @@ -127,54 +147,54 @@ switch ( message->MsgId() ) { case ECcRegisterObserverNtf: - HandleRegisterObserverNtfL( *message ); + HandleRegisterObserverNtfL( sender, receiver, *message ); break; case ECcUnregisterObserverNtf: - HandleUnregisterObserverNtfL( *message ); + HandleUnregisterObserverNtfL( sender, receiver, *message ); break; case EHsCcWidgetListReq: - HandleWidgetListReqL( *message ); + HandleWidgetListReqL( sender, receiver, *message ); break; case EHsCcAddWidgetReq: - HandleAddWidgetReqL( *message ); + HandleAddWidgetReqL( sender, receiver, *message ); break; case EHsCcRemoveWidgetReq: - HandleRemoveWidgetReqL( *message ); + HandleRemoveWidgetReqL( sender, receiver, *message ); break; case EHsCcViewListReq: - HandleViewListReqL( *message ); + HandleViewListReqL( sender, receiver, *message ); break; case EHsCcAddViewReq: - HandleAddViewReqL( *message ); + HandleAddViewReqL( sender, receiver, *message ); break; case EHsCcRemoveViewReq: - HandleRemoveViewReqL( *message ); + HandleRemoveViewReqL( sender, receiver, *message ); break; case EHsCcActivateViewReq: - HandleActivateViewReqL( *message ); + HandleActivateViewReqL( sender, receiver, *message ); break; case EHsCcAppListReq: - HandleAppListReqL( *message ); + HandleAppListReqL( sender, receiver, *message ); break; case EHsCcActivateAppReq: - HandleActivateAppReqL( *message ); + HandleActivateAppReqL( sender, receiver, *message ); break; case EHsCcActiveAppReq: - HandleActiveAppReqL( *message ); + HandleActiveAppReqL( sender, receiver, *message ); break; case EHsCcActiveViewReq: - HandleActiveViewReqL( *message ); + HandleActiveViewReqL( sender, receiver, *message ); break; default: - HandleNotSupportedReqL( *message ); + HandleNotSupportedReqL( sender, receiver, *message ); break; } CleanupStack::PopAndDestroy( message ); } - - // Receive next API request - WaitForApiReqL(); - + if ( header ) + { + CleanupStack::PopAndDestroy( header ); + } } // ----------------------------------------------------------------------------- @@ -255,10 +275,11 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleRegisterObserverNtfL( + TUint32 aSender, + TUint32 /* aReceiver */, CCcSrvMsg& /* aMessage */ ) { - TUint32 observer = iPckgSender(); - iObservers.AppendL( observer ); + iObservers.AppendL( aSender ); } // ----------------------------------------------------------------------------- @@ -266,12 +287,13 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleUnregisterObserverNtfL( + TUint32 aSender, + TUint32 /* aReceiver */, CCcSrvMsg& /* aMessage */ ) { - TUint32 observer = iPckgSender(); for ( TInt i = 0; i < iObservers.Count(); i++ ) { - if ( iObservers[ i ] == observer ) + if ( iObservers[ i ] == aSender ) { iObservers.Remove( i ); break; @@ -284,12 +306,36 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleWidgetListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { + + TInt err( KErrNone ); // Get widget list CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); CleanupStack::PushL( widgets ); - TInt err = iController.WidgetListL( *widgets ); + + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Get list of widgets included in the defined + // application configuration or view + err = iController.WidgetListL( *info, *widgets ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Get list of available widgets + err = iController.WidgetListL( *widgets ); + } // Create and send WidgetListResp CCcSrvMsg* message = CCcSrvMsg::NewL(); @@ -309,7 +355,7 @@ CleanupStack::PopAndDestroy( dataBuf ); } - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( widgets ); @@ -321,6 +367,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleAddWidgetReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -352,7 +400,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -362,6 +410,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleRemoveWidgetReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -393,7 +443,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -403,13 +453,37 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleViewListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { + TInt err( KErrNone ); // Get view list CHsContentInfoArray* views = CHsContentInfoArray::NewL(); CleanupStack::PushL( views ); - TInt err = iController.ViewListL( *views ); + + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + // Get list of views included in the defined + // application configuration + err = iController.ViewListL( *info, *views ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Get list of available views + err = iController.ViewListL( *views ); + } + + // Create and send ViewListResp CCcSrvMsg* message = CCcSrvMsg::NewL(); CleanupStack::PushL( message ); @@ -428,7 +502,7 @@ CleanupStack::PopAndDestroy( dataBuf ); } - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( views ); @@ -440,6 +514,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleAddViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -471,7 +547,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -481,6 +557,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleRemoveViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -512,7 +590,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -522,6 +600,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleActivateViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -553,7 +633,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -563,6 +643,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleActiveViewReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { // Get active view @@ -588,7 +670,7 @@ CleanupStack::PopAndDestroy( dataBuf ); } - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( view ); @@ -600,6 +682,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleAppListReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { // Get app list @@ -624,7 +708,7 @@ CleanupStack::PopAndDestroy( dataBuf ); } - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( apps ); @@ -636,6 +720,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleActivateAppReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { TInt err( KErrNone ); @@ -667,7 +753,7 @@ message->SetStatus( err ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); } @@ -677,6 +763,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleActiveAppReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { // Get active application info @@ -702,7 +790,7 @@ CleanupStack::PopAndDestroy( dataBuf ); } - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( app ); @@ -713,6 +801,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::HandleNotSupportedReqL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { // Create and send NotSupportedResp @@ -723,7 +813,7 @@ message->SetStatus( KErrNone ); message->SetData( KNullDesC8() ); - SendRespL( *message ); + SendRespL( aReceiver, aSender, *message ); CleanupStack::PopAndDestroy( message ); @@ -759,6 +849,8 @@ // ----------------------------------------------------------------------------- // void CHsCcProviderClient::SendRespL( + TUint32 aSender, + TUint32 aReceiver, CCcSrvMsg& aMessage ) { HBufC8* msgBuf = aMessage.MarshalL(); @@ -767,7 +859,9 @@ msgPtr.Set( msgBuf->Des() ); TPckgBuf provider( ECcHomescreen ); - iSession.Send( ECcApiResp, provider, iPckgReceiver, iPckgSender, msgPtr ); + TPckgBuf sender( aSender ); + TPckgBuf receiver( aReceiver ); + iSession.Send( ECcApiResp, provider, sender, receiver, msgPtr ); CleanupStack::PopAndDestroy( msgBuf ); } diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def --- a/contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def Wed May 12 13:36:47 2010 +0300 @@ -14,33 +14,35 @@ ?SetNameL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 13 NONAME ; void CHsContentInfo::SetNameL(class TDesC16 const &) ?InternalizeL@CHsContentInfoArray@@QAEXAAVRReadStream@@@Z @ 14 NONAME ; void CHsContentInfoArray::InternalizeL(class RReadStream &) ?Size@CHsContentInfoArray@@QAEHXZ @ 15 NONAME ; int CHsContentInfoArray::Size(void) - ?PublisherId@CHsContentInfo@@QBEABVTDesC16@@XZ @ 16 NONAME ; class TDesC16 const & CHsContentInfo::PublisherId(void) const - ?SetInstallationTime@CHsContentInfo@@QAEXAAVTTime@@@Z @ 17 NONAME ; void CHsContentInfo::SetInstallationTime(class TTime &) - ?SetIsWrt@CHsContentInfo@@QAEXH@Z @ 18 NONAME ; void CHsContentInfo::SetIsWrt(int) - ?SetPublisherUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 19 NONAME ; void CHsContentInfo::SetPublisherUidL(class TDesC8 const &) - ?NewL@CHsContentInfoArray@@SAPAV1@XZ @ 20 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(void) - ?SetNameL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 21 NONAME ; void CHsContentInfo::SetNameL(class TDesC8 const &) - ?Name@CHsContentInfo@@QBEABVTDesC16@@XZ @ 22 NONAME ; class TDesC16 const & CHsContentInfo::Name(void) const - ?Type@CHsContentInfo@@QBEABVTDesC8@@XZ @ 23 NONAME ; class TDesC8 const & CHsContentInfo::Type(void) const - ?NewLC@CHsContentInfo@@SAPAV1@XZ @ 24 NONAME ; class CHsContentInfo * CHsContentInfo::NewLC(void) - ?InstallationTime@CHsContentInfo@@QBE?AVTTime@@XZ @ 25 NONAME ; class TTime CHsContentInfo::InstallationTime(void) const - ?NewL@CHsContentInfo@@SAPAV1@AAVRReadStream@@@Z @ 26 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(class RReadStream &) - ?CloneL@CHsContentInfo@@QAEPAV1@XZ @ 27 NONAME ; class CHsContentInfo * CHsContentInfo::CloneL(void) - ?SetCanBeAdded@CHsContentInfo@@QAEXH@Z @ 28 NONAME ; void CHsContentInfo::SetCanBeAdded(int) - ?ExternalizeL@CHsContentInfoArray@@QAEXAAVRWriteStream@@@Z @ 29 NONAME ; void CHsContentInfoArray::ExternalizeL(class RWriteStream &) - ?SetUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 30 NONAME ; void CHsContentInfo::SetUidL(class TDesC8 const &) - ?MaxWidgets@CHsContentInfo@@QBEHXZ @ 31 NONAME ; int CHsContentInfo::MaxWidgets(void) const - ?Uid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 32 NONAME ; class TDesC8 const & CHsContentInfo::Uid(void) const - ?MarshalL@CHsContentInfoArray@@QAEPAVHBufC8@@XZ @ 33 NONAME ; class HBufC8 * CHsContentInfoArray::MarshalL(void) - ?SetPublisherIdL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 34 NONAME ; void CHsContentInfo::SetPublisherIdL(class TDesC16 const &) - ?InternalizeL@CHsContentInfo@@QAEXAAVRReadStream@@@Z @ 35 NONAME ; void CHsContentInfo::InternalizeL(class RReadStream &) - ?CanBeRemoved@CHsContentInfo@@QBEHXZ @ 36 NONAME ; int CHsContentInfo::CanBeRemoved(void) const - ?SetCanBeRemoved@CHsContentInfo@@QAEXH@Z @ 37 NONAME ; void CHsContentInfo::SetCanBeRemoved(int) - ?SetIconPathL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 38 NONAME ; void CHsContentInfo::SetIconPathL(class TDesC16 const &) - ?Description@CHsContentInfo@@QBEABVTDesC16@@XZ @ 39 NONAME ; class TDesC16 const & CHsContentInfo::Description(void) const - ?NewL@CHsContentInfo@@SAPAV1@XZ @ 40 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(void) - ?PublisherUid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 41 NONAME ; class TDesC8 const & CHsContentInfo::PublisherUid(void) const - ?NameAs8BitLC@CHsContentInfo@@QBEPAVHBufC8@@XZ @ 42 NONAME ; class HBufC8 * CHsContentInfo::NameAs8BitLC(void) const - ?PluginId@CHsContentInfo@@QBEABVTDesC8@@XZ @ 43 NONAME ; class TDesC8 const & CHsContentInfo::PluginId(void) const - ?NewL@CHsContentInfoArray@@SAPAV1@AAVRReadStream@@@Z @ 44 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(class RReadStream &) + ?SetIsFull@CHsContentInfo@@QAEXH@Z @ 16 NONAME ; void CHsContentInfo::SetIsFull(int) + ?PublisherId@CHsContentInfo@@QBEABVTDesC16@@XZ @ 17 NONAME ; class TDesC16 const & CHsContentInfo::PublisherId(void) const + ?IsFull@CHsContentInfo@@QBEHXZ @ 18 NONAME ; int CHsContentInfo::IsFull(void) const + ?SetInstallationTime@CHsContentInfo@@QAEXAAVTTime@@@Z @ 19 NONAME ; void CHsContentInfo::SetInstallationTime(class TTime &) + ?SetIsWrt@CHsContentInfo@@QAEXH@Z @ 20 NONAME ; void CHsContentInfo::SetIsWrt(int) + ?SetPublisherUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 21 NONAME ; void CHsContentInfo::SetPublisherUidL(class TDesC8 const &) + ?NewL@CHsContentInfoArray@@SAPAV1@XZ @ 22 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(void) + ?SetNameL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 23 NONAME ; void CHsContentInfo::SetNameL(class TDesC8 const &) + ?Name@CHsContentInfo@@QBEABVTDesC16@@XZ @ 24 NONAME ; class TDesC16 const & CHsContentInfo::Name(void) const + ?Type@CHsContentInfo@@QBEABVTDesC8@@XZ @ 25 NONAME ; class TDesC8 const & CHsContentInfo::Type(void) const + ?NewLC@CHsContentInfo@@SAPAV1@XZ @ 26 NONAME ; class CHsContentInfo * CHsContentInfo::NewLC(void) + ?InstallationTime@CHsContentInfo@@QBE?AVTTime@@XZ @ 27 NONAME ; class TTime CHsContentInfo::InstallationTime(void) const + ?NewL@CHsContentInfo@@SAPAV1@AAVRReadStream@@@Z @ 28 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(class RReadStream &) + ?CloneL@CHsContentInfo@@QAEPAV1@XZ @ 29 NONAME ; class CHsContentInfo * CHsContentInfo::CloneL(void) + ?SetCanBeAdded@CHsContentInfo@@QAEXH@Z @ 30 NONAME ; void CHsContentInfo::SetCanBeAdded(int) + ?ExternalizeL@CHsContentInfoArray@@QAEXAAVRWriteStream@@@Z @ 31 NONAME ; void CHsContentInfoArray::ExternalizeL(class RWriteStream &) + ?SetUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 32 NONAME ; void CHsContentInfo::SetUidL(class TDesC8 const &) + ?MaxWidgets@CHsContentInfo@@QBEHXZ @ 33 NONAME ; int CHsContentInfo::MaxWidgets(void) const + ?Uid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 34 NONAME ; class TDesC8 const & CHsContentInfo::Uid(void) const + ?MarshalL@CHsContentInfoArray@@QAEPAVHBufC8@@XZ @ 35 NONAME ; class HBufC8 * CHsContentInfoArray::MarshalL(void) + ?SetPublisherIdL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 36 NONAME ; void CHsContentInfo::SetPublisherIdL(class TDesC16 const &) + ?InternalizeL@CHsContentInfo@@QAEXAAVRReadStream@@@Z @ 37 NONAME ; void CHsContentInfo::InternalizeL(class RReadStream &) + ?CanBeRemoved@CHsContentInfo@@QBEHXZ @ 38 NONAME ; int CHsContentInfo::CanBeRemoved(void) const + ?SetCanBeRemoved@CHsContentInfo@@QAEXH@Z @ 39 NONAME ; void CHsContentInfo::SetCanBeRemoved(int) + ?SetIconPathL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 40 NONAME ; void CHsContentInfo::SetIconPathL(class TDesC16 const &) + ?Description@CHsContentInfo@@QBEABVTDesC16@@XZ @ 41 NONAME ; class TDesC16 const & CHsContentInfo::Description(void) const + ?NewL@CHsContentInfo@@SAPAV1@XZ @ 42 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(void) + ?PublisherUid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 43 NONAME ; class TDesC8 const & CHsContentInfo::PublisherUid(void) const + ?NameAs8BitLC@CHsContentInfo@@QBEPAVHBufC8@@XZ @ 44 NONAME ; class HBufC8 * CHsContentInfo::NameAs8BitLC(void) const + ?PluginId@CHsContentInfo@@QBEABVTDesC8@@XZ @ 45 NONAME ; class TDesC8 const & CHsContentInfo::PluginId(void) const + ?NewL@CHsContentInfoArray@@SAPAV1@AAVRReadStream@@@Z @ 46 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(class RReadStream &) diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def --- a/contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def Wed May 12 13:36:47 2010 +0300 @@ -22,27 +22,29 @@ _ZN14CHsContentInfo8SetNameLERK6TDesC8 @ 21 NONAME _ZN14CHsContentInfo8SetNameLERK7TDesC16 @ 22 NONAME _ZN14CHsContentInfo8SetTypeLERK6TDesC8 @ 23 NONAME - _ZN19CHsContentInfoArray12ExternalizeLER12RWriteStream @ 24 NONAME - _ZN19CHsContentInfoArray12InternalizeLER11RReadStream @ 25 NONAME - _ZN19CHsContentInfoArray4NewLER11RReadStream @ 26 NONAME - _ZN19CHsContentInfoArray4NewLEv @ 27 NONAME - _ZN19CHsContentInfoArray4SizeEv @ 28 NONAME - _ZN19CHsContentInfoArray5ArrayEv @ 29 NONAME - _ZN19CHsContentInfoArray8MarshalLEv @ 30 NONAME - _ZNK14CHsContentInfo10CanBeAddedEv @ 31 NONAME - _ZNK14CHsContentInfo10MaxWidgetsEv @ 32 NONAME - _ZNK14CHsContentInfo11DescriptionEv @ 33 NONAME - _ZNK14CHsContentInfo11PublisherIdEv @ 34 NONAME - _ZNK14CHsContentInfo12CanBeRemovedEv @ 35 NONAME - _ZNK14CHsContentInfo12NameAs8BitLCEv @ 36 NONAME - _ZNK14CHsContentInfo12PublisherUidEv @ 37 NONAME - _ZNK14CHsContentInfo16InstallationTimeEv @ 38 NONAME - _ZNK14CHsContentInfo3UidEv @ 39 NONAME - _ZNK14CHsContentInfo4NameEv @ 40 NONAME - _ZNK14CHsContentInfo4TypeEv @ 41 NONAME - _ZNK14CHsContentInfo5IsWrtEv @ 42 NONAME - _ZNK14CHsContentInfo8IconPathEv @ 43 NONAME - _ZNK14CHsContentInfo8PluginIdEv @ 44 NONAME - _ZTI19CHsContentInfoArray @ 45 NONAME - _ZTV19CHsContentInfoArray @ 46 NONAME + _ZN14CHsContentInfo9SetIsFullEi @ 24 NONAME + _ZN19CHsContentInfoArray12ExternalizeLER12RWriteStream @ 25 NONAME + _ZN19CHsContentInfoArray12InternalizeLER11RReadStream @ 26 NONAME + _ZN19CHsContentInfoArray4NewLER11RReadStream @ 27 NONAME + _ZN19CHsContentInfoArray4NewLEv @ 28 NONAME + _ZN19CHsContentInfoArray4SizeEv @ 29 NONAME + _ZN19CHsContentInfoArray5ArrayEv @ 30 NONAME + _ZN19CHsContentInfoArray8MarshalLEv @ 31 NONAME + _ZNK14CHsContentInfo10CanBeAddedEv @ 32 NONAME + _ZNK14CHsContentInfo10MaxWidgetsEv @ 33 NONAME + _ZNK14CHsContentInfo11DescriptionEv @ 34 NONAME + _ZNK14CHsContentInfo11PublisherIdEv @ 35 NONAME + _ZNK14CHsContentInfo12CanBeRemovedEv @ 36 NONAME + _ZNK14CHsContentInfo12NameAs8BitLCEv @ 37 NONAME + _ZNK14CHsContentInfo12PublisherUidEv @ 38 NONAME + _ZNK14CHsContentInfo16InstallationTimeEv @ 39 NONAME + _ZNK14CHsContentInfo3UidEv @ 40 NONAME + _ZNK14CHsContentInfo4NameEv @ 41 NONAME + _ZNK14CHsContentInfo4TypeEv @ 42 NONAME + _ZNK14CHsContentInfo5IsWrtEv @ 43 NONAME + _ZNK14CHsContentInfo6IsFullEv @ 44 NONAME + _ZNK14CHsContentInfo8IconPathEv @ 45 NONAME + _ZNK14CHsContentInfo8PluginIdEv @ 46 NONAME + _ZTI19CHsContentInfoArray @ 47 NONAME + _ZTV19CHsContentInfoArray @ 48 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp --- a/contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp Wed May 12 13:36:47 2010 +0300 @@ -320,6 +320,9 @@ // externalise iIsWrt aStream.WriteInt16L( iIsWrt ); + + // externalise iIsFull + aStream.WriteInt16L( iIsFull ); } // ----------------------------------------------------------------------- @@ -498,6 +501,9 @@ // internalize iIsWrt iIsWrt = aStream.ReadInt16L(); + + // internalize iIsFull + iIsFull = aStream.ReadInt16L(); } // ----------------------------------------------------------------------- @@ -521,6 +527,7 @@ size = size + sizeof( TUint32 ); // installation time high size = size + PublisherUid().Size();// publisher uid size = size + sizeof( TInt16 ); // is wrt + size = size + sizeof( TInt16 ); // is full return size; } @@ -556,6 +563,24 @@ } // ----------------------------------------------------------------------- +// CHsContentInfo::IsFull() +// ----------------------------------------------------------------------- +// +EXPORT_C TBool CHsContentInfo::IsFull() const + { + return iIsFull; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetIsFull() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetIsFull( TBool aIsFull ) + { + iIsFull = aIsFull; + } + +// ----------------------------------------------------------------------- // CHsContentInfo::IsWrt() // ----------------------------------------------------------------------- // diff -r 2f40063dfb5c -r dbbebe55c824 contentcontrolsrv/hscontentinfo/src/hscontentinfoarray.cpp --- a/contentcontrolsrv/hscontentinfo/src/hscontentinfoarray.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentcontrolsrv/hscontentinfo/src/hscontentinfoarray.cpp Wed May 12 13:36:47 2010 +0300 @@ -32,9 +32,9 @@ // EXPORT_C CHsContentInfoArray* CHsContentInfoArray::NewL() { - CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); - CleanupStack::PushL( self ); - self->ConstructL(); + CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); + CleanupStack::PushL( self ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } @@ -44,13 +44,13 @@ // ----------------------------------------------------------------------- // EXPORT_C CHsContentInfoArray* CHsContentInfoArray::NewL( RReadStream& aStream ) - { - CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); - CleanupStack::PushL( self ); - self->InternalizeL( aStream ); - CleanupStack::Pop( self ); - return self; - } + { + CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); + CleanupStack::PushL( self ); + self->InternalizeL( aStream ); + CleanupStack::Pop( self ); + return self; + } // ----------------------------------------------------------------------- // CHsContentInfoArray::ConstructL() @@ -74,7 +74,7 @@ // CHsContentInfoArray::~CHsContentInfoArray() { - iArray.ResetAndDestroy(); + iArray.ResetAndDestroy(); } // ----------------------------------------------------------------------- @@ -91,15 +91,15 @@ // ----------------------------------------------------------------------- // EXPORT_C void CHsContentInfoArray::ExternalizeL( RWriteStream& aStream ) - { - aStream.WriteInt16L( iArray.Count() ); - - for( int i = 0; i < iArray.Count(); i++ ) - { - CHsContentInfo* info = iArray[i]; - info->ExternalizeL( aStream ); - } - } + { + aStream.WriteInt16L( iArray.Count() ); + + for( int i = 0; i < iArray.Count(); i++ ) + { + CHsContentInfo* info = iArray[i]; + info->ExternalizeL( aStream ); + } + } // ----------------------------------------------------------------------- @@ -107,15 +107,15 @@ // ----------------------------------------------------------------------- // EXPORT_C void CHsContentInfoArray::InternalizeL( RReadStream& aStream ) - { - TInt count = aStream.ReadInt16L(); - - for( int i = 0; i < count; i++ ) - { - CHsContentInfo* info = CHsContentInfo::NewL( aStream ); - iArray.AppendL( info ); - } - } + { + TInt count = aStream.ReadInt16L(); + + for( int i = 0; i < count; i++ ) + { + CHsContentInfo* info = CHsContentInfo::NewL( aStream ); + iArray.AppendL( info ); + } + } // ----------------------------------------------------------------------- // CHsContentInfoArray::Size() @@ -123,7 +123,7 @@ // EXPORT_C TInt CHsContentInfoArray::Size( ) { - TInt size( 0 ); + TInt size( sizeof( TInt16 ) ); for ( TInt i = 0; i < iArray.Count(); i++ ) { size = size + iArray[ i ]->Size(); diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Wed May 12 13:36:47 2010 +0300 @@ -94,10 +94,10 @@ /** * Removes single widget. * @param aType Widget type. - * @param aContentId Widget UID. + * @param aPublisherId Widget UID. */ void RemoveWidgetL( const TDesC& aType, - const TDesC& aContentId ); + const TDesC& aPublisherId ); private: diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -21,14 +21,13 @@ #include #include -#include +#include #include "cpglobals.h" #include "chswiusbhandler.h" #include "chswiusbobserver.h" -_LIT( KHsWidgetPublisher, "hswidgetpublisher"); -_LIT( KHsPublisher, "ai3templatedwidget" ); +_LIT( KHSTemplate, "hstemplate" ); _LIT8( KWidgetUid, "widget_uid"); const TInt KWidgetArrayGran = 8; @@ -162,8 +161,7 @@ inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( KPublisher ) ) ); CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); - filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); - filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); + filter->InsertL( KContentType, TLiwVariant( KHSTemplate )); inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); iCPSInterface->ExecuteCmdL( KGetList, *inparam, *outparam ); @@ -210,7 +208,7 @@ if( KErrNotFound == iApaLsSession.GetAppInfo( appInfo, TUid::Uid( variant.AsTInt32() ) ) ) { - if( map->FindL( KContentId, variant ) ) + if( map->FindL( KPublisherId, variant ) ) { notFoundWidgets->AppendL( variant.AsDes() ); } @@ -248,16 +246,14 @@ // ---------------------------------------------------------------------------- // void CCHSwiPlugin::RemoveWidgetL( const TDesC& aType, - const TDesC& aContentId ) + const TDesC& aPublisherId ) { CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( aType ) ) ); CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); - filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); - filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); - filter->InsertL( KContentId, TLiwVariant( aContentId )); + filter->InsertL( KPublisherId, TLiwVariant( aPublisherId )); inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); iCPSInterface->ExecuteCmdL( KDelete, *inparam, *outparam ); diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbhandler.cpp --- a/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiusbhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -21,7 +21,7 @@ #include "chswiusbhandler.h" #include "chswiplugin.h" #include "chswimassmodeobserver.h" -#include +#include // CONSTANTS const TInt KCallBackDelay = 5000000; diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp --- a/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Wed May 12 13:36:47 2010 +0300 @@ -32,6 +32,7 @@ SOURCE cpnotificationhandler.cpp SOURCE cpserverburlistener.cpp SOURCE cpactionhandlerthread.cpp +SOURCE cpactiondatacache.cpp USERINCLUDE ../inc USERINCLUDE ../../cpsqlitestorage/inc @@ -51,6 +52,8 @@ LIBRARY cputils.lib LIBRARY cpstorage.lib LIBRARY inetprotutil.lib +LIBRARY MemMan.lib + #ifdef CONTENT_PUBLISHER_DEBUG LIBRARY cpdebug.lib #endif diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactiondatacache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactiondatacache.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used by session to handle asynchronous requests + * +*/ + + +#ifndef C_CPACTIONDATACACHE_H +#define C_CPACTIONDATACACHE_H + +#include +#include + +class CLiwDefaultList; + +/** + * Action Data Cache holds a list containing data needed to + * lauch an action fetched from SQL database + * @since S60 v5.0 + */ +class CCPActionDataCache:public CBase + { +public: + + /** + * Creates new instance of CCPActionDataCache. + * + * @return new instance of CCPActionDataCache + */ + static CCPActionDataCache* NewL( ); + + /** + * Creates new instance of CCPActionDataCache. + * + * @return new instance of CCPActionDataCache + */ + static CCPActionDataCache* NewLC( ); + + /** + * Destructor. + */ + virtual ~CCPActionDataCache(); + + /** + * Removes an item from the cache + * + * @param aMap a map containing item identifiers + */ + void HandleCacheRemoveL( const CLiwMap* aMap ); + + /** + * Appends an item to the cache + * + * @param aParamList a list to be added to the cache + */ + void AppendL( const CLiwGenericParamList* aParamList); + + /** + * Checks if it is possible to cache the item. + * Only items that are specified, which means that id or + * all parameters ( publisher, content_type, content_id ) are provided + * + * @param aMap a map containing item identifiers + * @return ETrue if it is possible to cache an item, EFalse if not + */ + TBool IsCacheableL( const CLiwMap* aMap ); + + /** + * Checks if it item exists in the cache. + * + * @param aMap a map containing item identifiers + * @return ETrue if the item exists in the cache, EFalse if not + */ + TBool ExistL( const CLiwMap* aMap ); + + /** + * Gets an item from the cache + * + * @param aMap a map containing item identifiers + * @return aParamList item returned from the cache + */ + void GetL( const CLiwMap* aMap, + CLiwGenericParamList* aParamList ); + +private: + + /* + * Constructor + */ + CCPActionDataCache(); + + /** + * 2nd phase constructor. + */ + void ConstructL( ); + + /** + * Checks if two items match + * + * @param aCachedMap a map from the cache containing item identifiers + * @param aInputMap an input map containing item identifiers + * @return ETrue if items match , EFalse if not + */ + TBool MatchL(const CLiwMap* aCachedMap, const CLiwMap* aInputMap); + + /** + * Checks if two strings contained in both maps match + * + * @param aLeft first map + * @param aRight second map + * @param aKey key + * @return ETrue if items match , EFalse if not + */ + TBool MatchL(const CLiwMap* aLeft, + const CLiwMap* aRight, const TDesC8& aKey ); + + /** + * Checks if a string contained in map is specified + * (it has value different than "all") + * + * @param aMap map + * @param aKey key + * @return ETrue if item is specified , EFalse if not + */ + TBool IsSpecifiedL(const CLiwMap* aMap, + const TDesC8& aKey ); + + /** + * Finds the item in the cache + * + * @param aKey map containing identifiers + * @return id of the item in a cache, KErrNotFound if does not + * exist in the cache + */ + TInt FindL( const CLiwMap* aKey ); + + /** + * Copies variant from one map to another + * + * @param aKey key + * @param aInMap input map + * @param aOutMap output map + */ + void CopyVariantL(const TDesC8& aKey, + const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ); + +private: + + /* + * Internal list. Own + */ + CLiwDefaultList* iInternalList; + }; + +#endif // C_CPACTIONDATACACHE_H diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Wed May 12 13:36:47 2010 +0300 @@ -44,6 +44,7 @@ const TInt KNameArgumentsLimit = 5; const TInt KThreadNameLimit = 64; const TUint KDisablePersist = 0x1000; +const TUint KDisableNotification = 0x2000; _LIT( KService, "CP Service" ); @@ -58,6 +59,8 @@ _LIT8( KDelete, "Delete" ); _LIT8( KRequestNotification, "RequestNotification" ); _LIT8( KExecuteAction, "ExecuteAction" ); +_LIT8( KExecuteMultipleActions, "ExecuteMultipleActions" ); + _LIT8( KCmdCancel, "Cancel" ); _LIT8( KActivate, "Activate" ); _LIT8( KActivateTrigger, "activate" ); @@ -68,6 +71,7 @@ _LIT8( KAction, "action" ); _LIT8( KItem, "item" ); _LIT8( KFilter, "filter" ); +_LIT8( KFilters, "filters" ); _LIT8( KData, "data" ); _LIT8( KSortOrder, "sort_order" ); _LIT8( KItemId, "item_id" ); diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Wed May 12 13:36:47 2010 +0300 @@ -117,7 +117,7 @@ * @param aFilter filter to compare with * @return ETrue if argument matches filter */ - TBool IsProperForFilterL( const CLiwDefaultMap& aMap, + TBool IsProperForFilterL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); /** @@ -127,7 +127,7 @@ * @param aProperty Key of parameter to extract * @param aResult Target for value */ - void GetPropertyL( const CLiwDefaultMap& aMap, const TDesC8& aProperty, + void GetPropertyL( const CLiwMap& aMap, const TDesC8& aProperty, RBuf& aResult ); /** @@ -137,7 +137,7 @@ * @param aFilter filter to compare with * @return ETrue if ID are identical */ - TBool CheckIdL( const CLiwDefaultMap& aMap, const CCPLiwMap& aFilter ); + TBool CheckIdL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); /** * Checks if Properties like publisher,content type @@ -147,7 +147,7 @@ * @param aFilter filter to compare with * @return ETrue if Parameters are identical */ - TBool CheckPropertiesL( const CLiwDefaultMap& aMap, + TBool CheckPropertiesL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); /** @@ -157,7 +157,7 @@ * @param aFilter filter to compare with * @return ETrue if operation types are the same */ - TBool CheckOperationTypeL( const CLiwDefaultMap& aMap, + TBool CheckOperationTypeL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); /** @@ -167,7 +167,7 @@ * @param aFilter filter to compare with * @return ETrue if registry types are the same */ - TBool CheckRegistryTypeL( const CLiwDefaultMap& aMap, + TBool CheckRegistryTypeL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); private: diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Wed May 12 13:36:47 2010 +0300 @@ -110,7 +110,7 @@ /** * Returns notifications array */ - RPointerArray& CCPServer::GetNotifications( ); + RPointerArray& GetNotifications( ); private: // From CActive diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h Wed May 12 13:36:47 2010 +0300 @@ -26,7 +26,7 @@ #endif class CLiwServiceHandler; class MLiwInterface; -class CLiwDefaultMap; +class CLiwMap; /** * Used to execute action using Action Handler Service @@ -88,10 +88,10 @@ /** * Extracts and adds attributes from aMap to aTarget. * @since Series 60 3.2 - * @param aMap CLiwDefaultMap with action. + * @param aMap CLiwMap with action. * @param aTarget CLiwGenericParamList with Uid and Map. */ - void ExtractUidAndMapL( const CLiwDefaultMap& aMap, + void ExtractUidAndMapL( const CLiwMap& aMap, CLiwGenericParamList& aTarget ); private: diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Wed May 12 13:36:47 2010 +0300 @@ -21,6 +21,7 @@ #include #include "cpstorage.h" +#include "cpactiondatacache.h" // FORWARD DECLARATIONS #ifdef CONTENT_PUBLISHER_DEBUG @@ -84,12 +85,14 @@ /** * Fetches action from database * @param aInParamList filter and sorting criteria + * @param aEnableCache flag indicating if action data should be cached * @param aOutParamList results * @param aNotificationList change info list (for notifications) * @return KErrNotFound if data was not found */ - TInt GetActionL( const CCPLiwMap& aMa, - CLiwGenericParamList& aOutParamList, + TInt GetActionsL( const CCPLiwMap& aMap, + TBool aEnableCache, + CLiwGenericParamList& aOutParamList, CLiwDefaultList* aNotificationList = NULL ); /** @@ -183,7 +186,7 @@ void FillActionParamListL( CLiwGenericParamList & aOutParamList, const TLiwGenericParam* aParam, - RBuf8 & aActionTrigger); + const CLiwDefaultList* aActionTriggers); /** * Creates map for GetList request - publisher, content_type @@ -211,6 +214,7 @@ */ void BuildChangeInfoL( const CCPLiwMap* aMap, + const CLiwDefaultList* aActionTriggers, const TLiwGenericParam* aParam, CLiwDefaultList* aChangeInfoList ); /** @@ -221,6 +225,7 @@ */ void BuildDefaultChangeInfoL( const CCPLiwMap* aMap, + const CLiwDefaultList* aActionTriggers, CLiwDefaultList* aChangeInfoList ); /** * Builds change info list when query to database returned nothing @@ -250,6 +255,13 @@ void CopyActionTrigger16L( const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ); + /** + * Converts variant type from TDesC8 to TDesC + * @param aVariant variant to convert + */ + void CopyActionTrigger16L( const TLiwVariant& aVariant, + CLiwDefaultMap* aOutMap ); + private: // data @@ -265,6 +277,13 @@ */ RPointerArray iNotificationsArray; + /* + * Action data cache + * Own. + */ + CCPActionDataCache* iActionDataCache; + + #ifdef CONTENT_PUBLISHER_DEBUG CCPDebug* iDebug; #endif diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Wed May 12 13:36:47 2010 +0300 @@ -39,6 +39,7 @@ ECpServerAddObserver = 23, ECpServerRemoveObserver = 24, ECpServerExecuteAction = 30, + ECpServerExecuteMultipleActions = 31, ECpServerInternal = 100 }; @@ -71,7 +72,7 @@ const TUint KDescriptorPosition( 0); const TUint KReturnPosition( 1); -const TUint KInfoPosition( 2); +const TUint KOptionsPosition( 2); const TUint KTransactionPosition( 3); const TBool KActive( ETrue ); const TBool KInActive( EFalse ); diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Wed May 12 13:36:47 2010 +0300 @@ -1,20 +1,19 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Server Session + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". * -*/ - + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Server Session + * + */ #ifndef C_CCPSERVERSESSION_H #define C_CCPSERVERSESSION_H @@ -51,12 +50,12 @@ /** * Two-phased constructor. */ - static CCPServerSession* NewL( TPointersForSession& aPasser ); + static CCPServerSession* NewL(TPointersForSession& aPasser); /** * Two-phased constructor. */ - static CCPServerSession* NewLC( TPointersForSession& aPasser ); + static CCPServerSession* NewLC(TPointersForSession& aPasser); /** * Destroy the object and release all memory objects @@ -71,14 +70,14 @@ * @param aMessage message from client (containing requested operation * and any data) */ - void ServiceL( const RMessage2& aMessage ); + void ServiceL(const RMessage2& aMessage); /** * Selects correct function from message * @param aMessage message from client (containing requested operation * and any data) */ - void DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient ); + void DispatchMessageL(const RMessage2& aMessage, TBool& aPanicedClient); private: // New methods @@ -91,69 +90,84 @@ /** * Perform the second phase construction of a CCPServerSession object */ - void ConstructL( TPointersForSession& aPasser ); + void ConstructL(TPointersForSession& aPasser); /** * Add Data request * @param Message from client */ - void AddDataL( const RMessage2& aMessage ); + void AddDataL(const RMessage2& aMessage); /** * Specific add data request - data is not actually added to database * but notification is send. * @param Message from client */ - void AddDataNonPersistentL( const RMessage2& aMessage ); + void AddDataNonPersistentL(const RMessage2& aMessage); /** * Get data request - first phase * @param Message from client */ - void GetListSizeL( const RMessage2& aMessage ); + void GetListSizeL(const RMessage2& aMessage); /** * Get data request - second phase * @param Message from client */ - void GetListDataL( const RMessage2& aMessage ); + void GetListDataL(const RMessage2& aMessage); /** * Remove data request * @param Message from client */ - void RemoveDataL( const RMessage2& aMessage ); + void RemoveDataL(const RMessage2& aMessage); /** * Executes action request * @param Message from client */ - void ExecuteActionL( const RMessage2& aMessage ); + void ExecuteActionL(const RMessage2& aMessage); + + /** + * Executes actions and sends notifications + * @param aMap input map from client + * @param aEnableCache indicates if action data should be cached + * @param aOptions command options + */ + void ExecuteActionL(const CCPLiwMap* aMap, + TBool aEnableCache, TUint aOptions); + + /** + * Executes multiple actions request + * @param Message from client + */ + void ExecuteMultipleActionsL(const RMessage2& aMessage); /** * Executes action request * @param aActionParams list with actions */ - void ExecuteL( const CLiwGenericParamList& aActionParams ); + void ExecuteL(const CLiwGenericParamList& aActionParams); /** * Register for notification request * @param Message from client */ - void RegisterObserverL( const RMessage2& aMessage ); + void RegisterObserverL(const RMessage2& aMessage); /** * Adds new observer * @param Message from client */ - void AddObserverL( const RMessage2& aMessage ); + void AddObserverL(const RMessage2& aMessage); /** * Removes observer * @param Message from client */ - void RemoveObserverL( const RMessage2& aMessage ); - + void RemoveObserverL(const RMessage2& aMessage); + /** * Unregister from notification request * @param Message from client @@ -164,7 +178,7 @@ * Send information about change in database to client * @param Message from client */ - void GetChangeInfoDataL( const RMessage2& aMessage ); + void GetChangeInfoDataL(const RMessage2& aMessage); /** * Converts CLiwGenericParamList to descriptor and @@ -172,22 +186,22 @@ * @param Message to complete * @param Parameters for message */ - void ExternalizeAndWriteToClientL( const RMessage2& aMessage, - const CLiwGenericParamList* outParamList ); - - /** - * Unpacks message from client to map - * @param Message to complete - * @return CCPLiwMap with data from client - */ - CCPLiwMap* UnpackFromClientLC( const RMessage2& aMessage ); + void ExternalizeAndWriteToClientL(const RMessage2& aMessage, + const CLiwGenericParamList* outParamList); - /** - * Send notification - * @param aNotificationList - */ - void SendNotificationL( CCPLiwMap* aMap, - CLiwDefaultList* aNotificationList ); + /** + * Unpacks message from client to map + * @param Message to complete + * @return CCPLiwMap with data from client + */ + CCPLiwMap* UnpackFromClientLC(const RMessage2& aMessage); + + /** + * Send notification + * @param aNotificationList + */ + void SendNotificationL(CCPLiwMap* aMap, + CLiwDefaultList* aNotificationList); /** * Get and Execute Activate or Deactivate action from the DB @@ -195,14 +209,29 @@ */ void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList, TBool aInsertTrigger = EFalse ); - + /** * Get Server Lock * @return ETrue if aMessege cannot be processed * because Backup or Restore is running **/ - TBool GetServerLock( const RMessage2& aMessage ); - + TBool GetServerLock(const RMessage2& aMessage); + + /** + * Unpacks data for ExecuteMultipleActions from client + * @param Message from client + * @return list containing input data from the client + **/ + CLiwGenericParamList* UnpackForMultiExecuteLC(const RMessage2& aMessage); + + /** + * Checks map validity of input data and returns list + * that can be used to call execute + * @param aMaps input data + * @return list containing input maps for Execute + **/ + CLiwDefaultList* CheckValidityLC(const CLiwList* aMaps); + private: /* diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactiondatacache.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description + + * +*/ + + +#include +#include +#include + +#include "cpactiondatacache.h" +#include "cpglobals.h" + +using namespace LIW; + +_LIT8(KCachedMap, "cached_map"); + +static const int KMaxCacheItems = 6; + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionDataCache* CCPActionDataCache::NewL() + { + CCPActionDataCache* self = CCPActionDataCache::NewLC(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionDataCache* CCPActionDataCache::NewLC() + { + CCPActionDataCache* self = new (ELeave) CCPActionDataCache; + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionDataCache::ConstructL( ) + { + iInternalList = CLiwDefaultList::NewL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionDataCache::CCPActionDataCache() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionDataCache::~CCPActionDataCache() + { + if (iInternalList) + { + iInternalList->Close(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionDataCache::HandleCacheRemoveL(const CLiwMap* aMap) + { + TInt id = FindL(aMap); + if (id != KErrNotFound) + { + iInternalList->Remove(id); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionDataCache::AppendL( const CLiwGenericParamList* aParamList) + { + const TLiwGenericParam* param; + TInt pos( 0); + param = aParamList->FindFirst( pos, KListMap ); + + if (param && param->Value().TypeId() == EVariantTypeMap) + { + const CLiwMap* inputMap = param->Value().AsMap(); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + CopyVariantL(KId, inputMap, map); + CopyVariantL(KPublisherId, inputMap, map); + CopyVariantL(KContentType, inputMap, map); + CopyVariantL(KContentId, inputMap, map); + map->InsertL(KCachedMap, TLiwVariant(inputMap)); + iInternalList->AppendL(TLiwVariant(map)); + CleanupStack::PopAndDestroy(map); + + if (iInternalList->Count() > KMaxCacheItems) + { + iInternalList->Remove(0); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPActionDataCache::IsCacheableL(const CLiwMap* aMap) + { + TBool result(EFalse); + TLiwVariant value; + value.PushL(); + + if (aMap->FindL(KId, value) && value.AsTInt32() > 0) + { + result = ETrue; + } + else if (IsSpecifiedL(aMap, KPublisherId) && IsSpecifiedL(aMap, + KContentType) && IsSpecifiedL(aMap, KContentId)) + { + result = ETrue; + } + + CleanupStack::PopAndDestroy(&value); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPActionDataCache::ExistL(const CLiwMap* aMap) + { + TBool result(EFalse); + if (FindL(aMap) != KErrNotFound) + { + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionDataCache::GetL(const CLiwMap* aMap, + CLiwGenericParamList* aParamList) + { + TInt id = FindL(aMap); + if (id != KErrNotFound) + { + TLiwVariant value; + value.PushL(); + iInternalList->AtL(id, value); + const CLiwMap* map = value.AsMap(); + if (map->FindL(KCachedMap, value)) + { + CLiwDefaultMap* outMap = CLiwDefaultMap::NewLC(); + value.Get(*outMap); + TLiwGenericParam genericParam(KListMap, TLiwVariant(outMap)); + aParamList->AppendL(genericParam); + CleanupStack::PopAndDestroy(outMap); + } + CleanupStack::PopAndDestroy(&value); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPActionDataCache::MatchL(const CLiwMap* aCachedMap, + const CLiwMap* aInputMap) + { + TBool idMatch(EFalse); + TLiwVariant l, r; + l.PushL(); + r.PushL(); + if (aCachedMap->FindL(KId, l) && aInputMap->FindL(KId, r) && l.AsTInt32() + == r.AsTInt32()) + { + idMatch = ETrue; + } + if (!idMatch) + { + if (MatchL(aCachedMap, aInputMap, KPublisherId) && MatchL(aCachedMap, + aInputMap, KContentType) && MatchL(aCachedMap, aInputMap, + KContentId)) + { + idMatch = ETrue; + } + } + + CleanupStack::PopAndDestroy(&r); + CleanupStack::PopAndDestroy(&l); + return idMatch; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPActionDataCache::MatchL(const CLiwMap* aLeft, const CLiwMap* aRight, + const TDesC8& aKey) + { + TBool match(EFalse); + TLiwVariant l, r; + l.PushL(); + r.PushL(); + if (aLeft->FindL(aKey, l) && aRight->FindL(aKey, r) + && !l.AsDes().Compare(r.AsDes())) + { + match = ETrue; + } + CleanupStack::PopAndDestroy(&r); + CleanupStack::PopAndDestroy(&l); + return match; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPActionDataCache::IsSpecifiedL(const CLiwMap* aMap, + const TDesC8& aKey) + { + TBool result(EFalse); + TLiwVariant value; + value.PushL(); + if (aMap->FindL(aKey, value) && value.AsDes().Compare(KNullDesC) != 0 + && value.AsDes().Compare(KAll) != 0) + { + result = ETrue; + } + CleanupStack::PopAndDestroy(&value); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPActionDataCache::FindL(const CLiwMap* aKey) + { + TInt result(KErrNotFound); + TLiwVariant value; + value.PushL(); + for (TInt i = 0; i < iInternalList->Count(); i++) + { + iInternalList->AtL(i, value); + if (MatchL(value.AsMap(), aKey)) + { + result = i; + break; + } + } + CleanupStack::PopAndDestroy(&value); + return result; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPActionDataCache::CopyVariantL(const TDesC8& aKey, + const CLiwMap* aInMap, CLiwDefaultMap* aOutMap) + { + //TODO: method exist also in data manager - should be refactored + TLiwVariant variant; + variant.PushL(); + if (aInMap->FindL(aKey, variant)) + { + aOutMap->InsertL(aKey, variant); + } + CleanupStack::PopAndDestroy(&variant); + } diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -26,6 +26,7 @@ #include "cpglobals.h" #include "cpserverdef.h" +using namespace LIW; // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -182,7 +183,7 @@ // // ----------------------------------------------------------------------------- // -TBool CCPNotificationHandler::IsProperForFilterL( const CLiwDefaultMap& aMap, +TBool CCPNotificationHandler::IsProperForFilterL( const CLiwMap& aMap, const CCPLiwMap& aFilter ) { CP_DEBUG( _L8("CCPNotificationHandler::IsProperForFilter()") ); @@ -298,21 +299,21 @@ { CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( ); - + TInt count = aListOfMaps->Count( ); //for every item in the input list - for ( TInt j = 0; j < aListOfMaps->Count( ); j++ ) + for ( TInt j = 0; j < count; j++ ) { - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); TLiwVariant variant; variant.PushL( ); aListOfMaps->AtL( j, variant ); - variant.Get( *map ); - if ( IsProperForFilterL( *map, **filter ) ) - { - listOfMatchingMaps->AppendL( TLiwVariant( map ) ); - } - CleanupStack::PopAndDestroy( &variant ); - CleanupStack::PopAndDestroy( map ); + if ( variant.TypeId() == EVariantTypeMap ) + { + if ( IsProperForFilterL( *variant.AsMap(), **filter ) ) + { + listOfMatchingMaps->AppendL( variant ); + } + } + CleanupStack::PopAndDestroy( &variant ); } if ( listOfMatchingMaps->Count( ) ) { @@ -339,7 +340,7 @@ // // ---------------------------------------------------------------------------- // -void CCPNotificationHandler::GetPropertyL( const CLiwDefaultMap& aMap, +void CCPNotificationHandler::GetPropertyL( const CLiwMap& aMap, const TDesC8& aProperty, RBuf& aResult ) { TLiwVariant value; @@ -357,7 +358,7 @@ // // ---------------------------------------------------------------------------- // -TBool CCPNotificationHandler::CheckIdL( const CLiwDefaultMap& aMap, +TBool CCPNotificationHandler::CheckIdL( const CLiwMap& aMap, const CCPLiwMap& aFilter ) { TBool result = EFalse; @@ -386,7 +387,7 @@ // // ---------------------------------------------------------------------------- // -TBool CCPNotificationHandler::CheckPropertiesL( const CLiwDefaultMap& aMap, +TBool CCPNotificationHandler::CheckPropertiesL( const CLiwMap& aMap, const CCPLiwMap& aFilter ) { TBool result( EFalse ); @@ -459,7 +460,7 @@ // // ---------------------------------------------------------------------------- // -TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwDefaultMap& aMap, +TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwMap& aMap, const CCPLiwMap& aFilter ) { TBool result = ETrue; @@ -491,7 +492,7 @@ // // ---------------------------------------------------------------------------- // -TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwDefaultMap& aMap, +TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwMap& aMap, const CCPLiwMap& aFilter ) { TBool result = ETrue; diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,7 +15,7 @@ * */ - +#include #include #include #include @@ -387,7 +387,12 @@ // TInt E32Main() { - return CCPServer::ThreadStart( ); + RAllocator* iAllocator = MemoryManager::SwitchToFastAllocator(); + + //Get the return value (needs to call CloseFastAllocator() before return) + TInt iReturnValue = CCPServer::ThreadStart( ); + MemoryManager::CloseFastAllocator(iAllocator); + return iReturnValue; } // End of File diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp Wed May 12 13:36:47 2010 +0300 @@ -155,10 +155,7 @@ param = aList.FindFirst( pos, KListMap, EVariantTypeMap ); if ( param && pos !=KErrNotFound ) { - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); - param->Value().Get( *map ); - ExtractUidAndMapL( *map, aTarget ); - CleanupStack::PopAndDestroy( map ); + ExtractUidAndMapL( *param->Value().AsMap(), aTarget ); } else { @@ -170,7 +167,7 @@ // CCPActionManager::ExtractUidAndMapL // --------------- -------------------------------------------------------------- // -void CCPActionManager::ExtractUidAndMapL( const CLiwDefaultMap& aMap, +void CCPActionManager::ExtractUidAndMapL( const CLiwMap& aMap, CLiwGenericParamList& aTarget ) { CP_DEBUG( _L8("CCPActionManager::ExtractUidAndMapL()") ); @@ -178,21 +175,23 @@ variant.PushL( ); if ( aMap.FindL( KActionMap, variant ) ) { - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); - variant.Get( *map ); - if ( map->FindL( KDataForActionHandler, variant ) ) - { - TLiwGenericParam param( KDataForActionHandler, variant); - aTarget.AppendL( param ); - } - if ( map->FindL( KPluginUid, variant ) ) - { - TLiwGenericParam param( KPluginUid, variant); - aTarget.AppendL( param ); - } - CleanupStack::PopAndDestroy( map ); + TLiwVariant valueVariant; + valueVariant.PushL( ); + if ( variant.TypeId() == EVariantTypeMap ) + { + if ( variant.AsMap()->FindL( KDataForActionHandler, valueVariant ) ) + { + TLiwGenericParam param( KDataForActionHandler, valueVariant); + aTarget.AppendL( param ); + } + if ( variant.AsMap()->FindL( KPluginUid, valueVariant ) ) + { + TLiwGenericParam param( KPluginUid, valueVariant); + aTarget.AppendL( param ); + } + } + CleanupStack::PopAndDestroy( &valueVariant ); } - CleanupStack::PopAndDestroy( &variant ); } diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Wed May 12 13:36:47 2010 +0300 @@ -38,6 +38,7 @@ // CCPDataManager::~CCPDataManager() { + delete iActionDataCache; iNotificationsArray.Close( ); delete iStorage; } @@ -85,6 +86,7 @@ { iStorage = StorageFactory::NewDatabaseL( ); } + iActionDataCache = CCPActionDataCache::NewL(); } // --------------------------------------------------------------------------- @@ -98,6 +100,8 @@ CCPLiwMap* getlistmap = CreateMapForGetlistLC( aMap ); + iActionDataCache->HandleCacheRemoveL( &aMap ); + TBool activateMap = aMap.GetActivateInfo(); TBool activateDB ( EFalse ); TBool activateSupport =aMap.ActivateActionSupport( ); @@ -158,7 +162,7 @@ // // --------------------------------------------------------------------------- // -TInt CCPDataManager::GetActionL( const CCPLiwMap& aMap, +TInt CCPDataManager::GetActionsL( const CCPLiwMap& aMap, TBool aEnableCache, CLiwGenericParamList& aOutParamList, CLiwDefaultList* aNotificationList ) { CP_DEBUG( _L8("CCPDataManager::GetActionL()") ); @@ -166,12 +170,25 @@ CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( ); TInt result( KErrNone ); - TRAP( result, iStorage->GetListL( &aMap, *paramList ) ); - RBuf8 actionTrigger; - actionTrigger.CleanupClosePushL(); + + CLiwDefaultList* actionTriggers = aMap.GetActionTriggersLC(); - if ( aMap.GetPropertyL( KActionTrigger, actionTrigger ) ) + if ( actionTriggers ) { + TBool cacheable = iActionDataCache->IsCacheableL( &aMap ); + if (aEnableCache && cacheable && iActionDataCache->ExistL( &aMap )) + { + iActionDataCache->GetL( &aMap, paramList ); + } + else + { + TRAP( result, iStorage->GetListL( &aMap, *paramList ) ); + if ( aEnableCache && cacheable && result == KErrNone ) + { + iActionDataCache->AppendL(paramList); + } + } + const TLiwGenericParam* param; TInt pos( 0); @@ -179,14 +196,15 @@ //at least one param should be valid to preceed if ( !param || pos == KErrNotFound ) { - BuildDefaultChangeInfoL(&aMap, aNotificationList); + BuildDefaultChangeInfoL(&aMap, actionTriggers, aNotificationList); } //iteration through paramList items while ( param && pos != KErrNotFound ) { - BuildChangeInfoL( &aMap, param, aNotificationList ); - FillActionParamListL( aOutParamList, param, actionTrigger ); + BuildChangeInfoL( &aMap, actionTriggers, param, + aNotificationList ); + FillActionParamListL( aOutParamList, param, actionTriggers ); param = paramList->FindNext( pos, KListMap ); } } @@ -194,7 +212,8 @@ { User::Leave( KErrNotFound ); } - CleanupStack::PopAndDestroy( &actionTrigger ); + + CleanupStack::PopAndDestroy( actionTriggers ); CleanupStack::PopAndDestroy( paramList ); return result; } @@ -207,7 +226,7 @@ void CCPDataManager::FillActionParamListL( CLiwGenericParamList& aOutParamList, const TLiwGenericParam* aParam, - RBuf8 & aActionTrigger) + const CLiwDefaultList* aActionTriggers) { CP_DEBUG( _L8("CCPDataManager::FillActionParamListL()") ); __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); @@ -219,7 +238,17 @@ RDesReadStream str(actionBinaries); CleanupClosePushL( str ); CLiwDefaultMap* actionMap = CLiwDefaultMap::NewLC( str ); - ExtractTriggerL( aOutParamList, actionMap, aActionTrigger ); + + TLiwVariant trigger; + trigger.PushL(); + TInt count = aActionTriggers->Count(); + for ( TInt i = 0; iAtL( i,trigger ); + ExtractTriggerL( aOutParamList, actionMap, trigger.AsData()); + } + CleanupStack::PopAndDestroy(&trigger); CleanupStack::PopAndDestroy( actionMap ); CleanupStack::PopAndDestroy( &str ); @@ -273,6 +302,7 @@ { CP_DEBUG( _L8("CCPDataManager::RemoveData()") ); __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + iActionDataCache->HandleCacheRemoveL( &aMap ); iStorage->RemoveL( &aMap ); } @@ -301,11 +331,13 @@ { CP_DEBUG( _L8("CCPDataManager::RemoveObserver()") ); TInt index = iNotificationsArray.Find( aNotificationHandler ); - __ASSERT_DEBUG( index >= 0 , User::Panic( _L("cpserver"), 0 ) ); - iNotificationsArray.Remove( index ); - if ( iNotificationsArray.Count( ) == 0 ) + if (index != KErrNotFound) { - iStorage->SetCallback( 0 ); + iNotificationsArray.Remove( index ); + if ( iNotificationsArray.Count( ) == 0 ) + { + iStorage->SetCallback( 0 ); + } } } @@ -374,15 +406,14 @@ void CCPDataManager::ExtractActionL( const TLiwGenericParam* aParam, RBuf8& aAction ) { CP_DEBUG( _L8("CCPDataManager::ExtractActionL()") ); - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); - if ( !aParam->Value().Get( *map ) ) + if ( aParam->Value().TypeId() != EVariantTypeMap ) { User::Leave( KErrArgument ); } TLiwVariant variant; variant.PushL( ); TPtrC8 tempBuf( KNullDesC8 ); - if ( map->FindL( KActionMap, variant ) + if ( aParam->Value().AsMap()->FindL( KActionMap, variant ) && variant.Get( tempBuf ) ) { aAction.CreateL( tempBuf ); @@ -393,7 +424,6 @@ } CleanupStack::PopAndDestroy( &variant ); - CleanupStack::PopAndDestroy( map ); } // ----------------------------------------------------------------------------- @@ -437,15 +467,15 @@ if( pos != KErrNotFound ) { TLiwVariant variant = (*outList)[pos].Value(); - CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); - variant.Get( *map ); - if (map->FindL( KFlag, variant )) - { - TUint flag; - variant.Get( flag ); - result = flag & EActivate; - } - CleanupStack::PopAndDestroy( map ); + if ( variant.TypeId() == EVariantTypeMap ) + { + if (variant.AsMap()->FindL( KFlag, variant )) + { + TUint flag; + variant.Get( flag ); + result = flag & EActivate; + } + } variant.Reset(); } } @@ -458,30 +488,39 @@ // ----------------------------------------------------------------------------- // void CCPDataManager::BuildChangeInfoL( const CCPLiwMap* aMap, + const CLiwDefaultList* aActionTriggers, const TLiwGenericParam* aParam, CLiwDefaultList* aChangeInfoList ) { TLiwVariant resultVar = aParam->Value(); - resultVar.PushL(); - CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap* resultMap = CLiwDefaultMap::NewLC(); - resultVar.Get( *resultMap ); - - CopyVariantL(KId, resultMap, changeInfoMap ); - CopyVariantL(KPublisherId, resultMap, changeInfoMap ); - CopyVariantL(KContentType, resultMap, changeInfoMap ); - CopyVariantL(KContentId, resultMap, changeInfoMap ); - CopyVariantL(KFlag, resultMap, changeInfoMap ); - CopyVariantL(KType, aMap, changeInfoMap ); - CopyVariantL(KActionTrigger, aMap, changeInfoMap ); - CopyActionTrigger16L( aMap, changeInfoMap ); - - changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); - - aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); - CleanupStack::PopAndDestroy( resultMap ); - CleanupStack::PopAndDestroy( changeInfoMap ); - CleanupStack::PopAndDestroy( &resultVar ); + resultVar.PushL(); + if ( resultVar.TypeId() == EVariantTypeMap ) + { + for ( TInt i = 0; iCount(); i++ ) + { + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); + + CopyVariantL(KId, resultVar.AsMap(), changeInfoMap ); + CopyVariantL(KPublisherId, resultVar.AsMap(), changeInfoMap ); + CopyVariantL(KContentType, resultVar.AsMap(), changeInfoMap ); + CopyVariantL(KContentId, resultVar.AsMap(), changeInfoMap ); + CopyVariantL(KFlag, resultVar.AsMap(), changeInfoMap ); + CopyVariantL(KType, aMap, changeInfoMap ); + + TLiwVariant trigger; + trigger.PushL(); + aActionTriggers->AtL(i,trigger); + changeInfoMap->InsertL(KActionTrigger, trigger); + CopyActionTrigger16L(trigger,changeInfoMap); + CleanupStack::PopAndDestroy(&trigger); + + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); + + aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ); + } + } + CleanupStack::PopAndDestroy( &resultVar ); } @@ -490,23 +529,32 @@ // ----------------------------------------------------------------------------- // void CCPDataManager::BuildDefaultChangeInfoL( const CCPLiwMap* aMap, + const CLiwDefaultList* aActionTriggers, CLiwDefaultList* aChangeInfoList ) { - CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); + for ( TInt i = 0; iCount(); i++ ) + { + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); - CopyVariantL(KId, aMap, changeInfoMap ); - CopyVariantL(KPublisherId, aMap, changeInfoMap ); - CopyVariantL(KContentType, aMap, changeInfoMap ); - CopyVariantL(KContentId, aMap, changeInfoMap ); - CopyVariantL(KFlag, aMap, changeInfoMap ); - CopyVariantL(KType, aMap, changeInfoMap ); - CopyVariantL(KActionTrigger, aMap, changeInfoMap ); - CopyActionTrigger16L( aMap, changeInfoMap ); - - changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); - - aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); - CleanupStack::PopAndDestroy( changeInfoMap ); + CopyVariantL(KId, aMap, changeInfoMap ); + CopyVariantL(KPublisherId, aMap, changeInfoMap ); + CopyVariantL(KContentType, aMap, changeInfoMap ); + CopyVariantL(KContentId, aMap, changeInfoMap ); + CopyVariantL(KFlag, aMap, changeInfoMap ); + CopyVariantL(KType, aMap, changeInfoMap ); + + TLiwVariant trigger; + trigger.PushL(); + aActionTriggers->AtL(i,trigger); + changeInfoMap->InsertL(KActionTrigger, trigger); + CopyActionTrigger16L(trigger,changeInfoMap); + CleanupStack::PopAndDestroy(&trigger); + + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); + + aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ); + } } // ----------------------------------------------------------------------------- @@ -561,22 +609,30 @@ variant.PushL(); if ( aInMap->FindL( KActionTrigger(), variant ) ) { - - TPtrC8 result8( KNullDesC8 ); - if( variant.Get( result8 ) ) - { - RBuf actionTrigger; - actionTrigger.CleanupClosePushL(); - actionTrigger.Assign( - EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) ); - - variant.Reset(); - variant.Set( actionTrigger ); - CleanupStack::PopAndDestroy( &actionTrigger ); - } - - aOutMap->InsertL( KActionTrigger16(), variant ); + CopyActionTrigger16L(variant,aOutMap); } CleanupStack::PopAndDestroy( &variant ); } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::CopyActionTrigger16L( const TLiwVariant& aVariant, + CLiwDefaultMap* aOutMap ) + { + if( aVariant.TypeId() == EVariantTypeDesC8 ) + { + TLiwVariant variant; + variant.PushL(); + RBuf desc16; + desc16.CleanupClosePushL(); + desc16.Assign( + EscapeUtils::ConvertToUnicodeFromUtf8L( aVariant.AsData()) ); + variant.Set( desc16 ); + aOutMap->InsertL(KActionTrigger16(),variant); + CleanupStack::PopAndDestroy( &desc16 ); + CleanupStack::PopAndDestroy( &variant ); + } + } + diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Wed May 12 13:36:47 2010 +0300 @@ -33,7 +33,6 @@ #include "cpactionhandlerthread.h" #include "cpnotificationhandler.h" - using namespace LIW; // ================= MEMBER FUNCTIONS ======================= @@ -183,6 +182,9 @@ case ECpServerExecuteAction: ExecuteActionL( aMessage ); break; + case ECpServerExecuteMultipleActions: + ExecuteMultipleActionsL( aMessage ); + break; default: iServer->PanicClient( aMessage, ECPServerBadRequest ); aPanicedClient = ETrue; @@ -282,20 +284,68 @@ // void CCPServerSession::ExecuteActionL( const RMessage2& aMessage ) { - TInt error(KErrNone); CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) ); + TUint options = static_cast( aMessage.Int2() ); // 2 == KOptionsPosition CCPLiwMap* map = UnpackFromClientLC( aMessage ); - CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( ); + ExecuteActionL( map, EFalse, options ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::ExecuteActionL(const CCPLiwMap* aMap, + TBool aEnableCache, TUint aOptions) + { + CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) ); + TInt error(KErrNone); + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); CLiwDefaultList* list = CLiwDefaultList::NewLC(); - error = iDataManager->GetActionL( *map, *paramList, list ); + error = iDataManager->GetActionsL(*aMap, aEnableCache, *paramList, list ); //we notify apart from action execution result. So in fact - //notification means there was an attempt to execute action - iDataManager->HandleChangeL( list ); - User::LeaveIfError( error ); - ExecuteL( *paramList ); - CleanupStack::PopAndDestroy( list ); - CleanupStack::PopAndDestroy( paramList ); - CleanupStack::PopAndDestroy( map ); + //notification means there was an attempt to execute action + if (!(aOptions & KDisableNotification)) + { + iDataManager->HandleChangeL(list); + } + User::LeaveIfError(error); + ExecuteL(*paramList); + CleanupStack::PopAndDestroy(list); + CleanupStack::PopAndDestroy(paramList); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ExecuteMultipleActionsL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::ExecuteMultipleActionsL(const RMessage2& aMessage) + { + CP_DEBUG( _L8("CCPServerSession::ExecuteMultipleActionsL()" ) ); + + CLiwGenericParamList* genericList = UnpackForMultiExecuteLC(aMessage); + TUint options = static_cast (aMessage.Int2()); // 2 == KOptionsPosition + + const TLiwGenericParam* param = NULL; + TInt pos(0); + param = genericList->FindFirst(pos, KFilters); + const CLiwList* maps = param->Value().AsList(); + CLiwDefaultList* cpMaps = CheckValidityLC(maps); + + //execute actions + for (TInt i = 0; i < cpMaps->Count(); i++) + { + TLiwVariant mapVariant; + mapVariant.PushL(); + cpMaps->AtL(i, mapVariant); + const CCPLiwMap* map = + static_cast (mapVariant.AsMap()); + TRAP_IGNORE(ExecuteActionL(map, ETrue, options)); + CleanupStack::PopAndDestroy(&mapVariant); + } + + CleanupStack::PopAndDestroy(cpMaps); + CleanupStack::PopAndDestroy(genericList); } // ----------------------------------------------------------------------------- @@ -333,6 +383,7 @@ iServer->PanicClient( aMessage, ECPServerBadRequest ); User::Leave( KErrGeneral ); } + isRegister = ETrue; if ( !iNotificationHandler ) { iNotificationHandler = CCPNotificationHandler::NewL( @@ -340,7 +391,6 @@ iDataManager->AddObserverL( iNotificationHandler ); } iNotificationHandler->SaveMessageL( aMessage ); - isRegister = ETrue; } else { @@ -382,7 +432,7 @@ void CCPServerSession::UnregisterObserverL() { CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) ); - if ( isRegister ) + if ( isRegister && iNotificationHandler ) { //remove notification handler from an array of sessions in data manager iDataManager->RemoveObserver( iNotificationHandler ); @@ -407,10 +457,10 @@ CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) ); if( iNotificationHandler ) { - isRegister = EFalse; ExternalizeAndWriteToClientL( aMessage, iNotificationHandler->GetPointerToChangeInfoList( ) ); iNotificationHandler->Reset( ); + isRegister = EFalse; } } @@ -482,7 +532,7 @@ aMap->InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) ); } CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); - iDataManager->GetActionL( *aMap, *paramList, aNotificationList ); + iDataManager->GetActionsL( *aMap, EFalse, *paramList, aNotificationList ); iActionHandlerThread->ExecuteL( *paramList ); CleanupStack::PopAndDestroy( paramList ); } @@ -498,4 +548,51 @@ && iServer->GetLock() ); } + +// ----------------------------------------------------------------------------- +// +// --------------- -------------------------------------------------------------- +// +CLiwGenericParamList* CCPServerSession::UnpackForMultiExecuteLC( + const RMessage2& aMessage) + { + TInt deslen = aMessage.GetDesLengthL(KDescriptorPosition); + HBufC8* buffer = HBufC8::NewLC(deslen); + TPtr8 tempDes = buffer->Des(); + aMessage.Read(KDescriptorPosition, tempDes); + RDesReadStream datastrm(*buffer); + CleanupClosePushL(datastrm); + CLiwGenericParamList* genericList = CLiwGenericParamList::NewL(datastrm); + CleanupStack::PopAndDestroy(&datastrm); + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PushL(genericList); + return genericList; + } + +// ----------------------------------------------------------------------------- +// +// --------------- -------------------------------------------------------------- +// +CLiwDefaultList* CCPServerSession::CheckValidityLC(const CLiwList* aMaps) + { + CLiwDefaultList* cpMaps = CLiwDefaultList::NewLC(); + for (TInt i = 0; i < aMaps->Count(); i++) + { + TLiwVariant mapVariant; + mapVariant.PushL(); + aMaps->AtL(i, mapVariant); + if (mapVariant.TypeId() != LIW::EVariantTypeMap) + { + User::Leave(KErrBadName); + } + CCPLiwMap* map = CCPLiwMap::NewL(*mapVariant.AsMap()); + map->PushL(); + map->IsValidForActionL(); + cpMaps->AppendL(TLiwVariant(map)); + CleanupStack::PopAndDestroy(map); + CleanupStack::PopAndDestroy(&mapVariant); + } + return cpMaps; + } + // End of File diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp --- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Wed May 12 13:36:47 2010 +0300 @@ -241,13 +241,10 @@ void CCpStorageEngine::CreateNewDbL() { TSecureId id( KServerUid ); // Uid of CP Server - only this process has access rights - TSecurityPolicy defaultPolicy; - TSecurityPolicy securityPolicy(id); + TSecurityPolicy defaultPolicy( id ); RSqlSecurityPolicy sqlSecurityPolicy; CleanupClosePushL( sqlSecurityPolicy ); User::LeaveIfError( sqlSecurityPolicy.Create( defaultPolicy ) ); - User::LeaveIfError( sqlSecurityPolicy.SetDbPolicy( - RSqlSecurityPolicy::ESchemaPolicy, securityPolicy ) ); #ifdef CONTENT_PUBLISHER_STORAGE_MT iSqlDb.CreateL( KCPpathdatabase, &KMdsSqlDbaConfig ); #else diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def --- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Wed May 12 13:36:47 2010 +0300 @@ -1,8 +1,9 @@ EXPORTS - ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 1 NONAME ; struct DebugData * CCPDebug::Data(void) - ?Enable@CCPDebug@@SAHXZ @ 2 NONAME ; int CCPDebug::Enable(void) - ?EnableLogging@CCPDebug@@SAXH@Z @ 3 NONAME ; void CCPDebug::EnableLogging(int) - ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 4 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &) + ?EnableLogging@CCPDebug@@SAXH@Z @ 1 NONAME ; void CCPDebug::EnableLogging(int) + ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 2 NONAME ; void CCPDebug::Printf(class TRefByValue, ...) + ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 3 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &) + ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 4 NONAME ; struct DebugData * CCPDebug::Data(void) ?NewLC@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 5 NONAME ; class CCPDebug * CCPDebug::NewLC(class TDesC16 const &) - ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 6 NONAME ; void CCPDebug::Printf(class TRefByValue, ...) + ?ExtendedPrint@CCPDebug@@SAXPBDABVCLiwGenericParamList@@@Z @ 6 NONAME ; void CCPDebug::ExtendedPrint(char const *, class CLiwGenericParamList const &) + ?Enable@CCPDebug@@SAHXZ @ 7 NONAME ; int CCPDebug::Enable(void) diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def --- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Wed May 12 13:36:47 2010 +0300 @@ -1,8 +1,9 @@ EXPORTS _ZN8CCPDebug13EnableLoggingEi @ 1 NONAME - _ZN8CCPDebug4DataEv @ 2 NONAME - _ZN8CCPDebug4NewLERK7TDesC16 @ 3 NONAME - _ZN8CCPDebug5NewLCERK7TDesC16 @ 4 NONAME - _ZN8CCPDebug6EnableEv @ 5 NONAME - _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 6 NONAME + _ZN8CCPDebug13ExtendedPrintEPKcRK20CLiwGenericParamList @ 2 NONAME + _ZN8CCPDebug4DataEv @ 3 NONAME + _ZN8CCPDebug4NewLERK7TDesC16 @ 4 NONAME + _ZN8CCPDebug5NewLCERK7TDesC16 @ 5 NONAME + _ZN8CCPDebug6EnableEv @ 6 NONAME + _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 7 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp --- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Wed May 12 13:36:47 2010 +0300 @@ -39,5 +39,7 @@ LIBRARY euser.lib LIBRARY estor.lib LIBRARY efsrv.lib +LIBRARY liwservicehandler.lib + //end of file diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h --- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Wed May 12 13:36:47 2010 +0300 @@ -23,6 +23,7 @@ #include #ifdef CONTENT_PUBLISHER_DEBUG #include +#include _LIT(KCPDebugDirName, "contentpublisher" ); _LIT(KCPDebugFileName, "c:\\contentpublisher.txt" ); @@ -62,6 +63,14 @@ */ IMPORT_C static void Printf(TRefByValue aFormat, ...); + /** + * Print debug text to RDebug + * + */ + IMPORT_C static void ExtendedPrint( const char* aStringParam, + const CLiwGenericParamList& aInParamList ); + + private: CCPDebug(); @@ -84,7 +93,7 @@ }; #define CP_DEBUG(s) CCPDebug::Printf(s) - +#define CP_EXTENDED_DEBUG(s,p) CCPDebug::ExtendedPrint(s,p) /** * Thread local storage space. Writable static data is not supported in * Symbian, so static data is stored in this struct. @@ -100,7 +109,8 @@ #else -#define CP_DEBUG(s) +#define CP_DEBUG(s) +#define CP_EXTENDED_DEBUG(s,p) #endif diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp --- a/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Wed May 12 13:36:47 2010 +0300 @@ -37,7 +37,7 @@ iData->iFileName = aFile; Dll::SetTls( iData ); User::LeaveIfError( iData->iFs.Connect( ) ); - EnableLogging( ETrue ); + EnableLogging( EFalse ); } // --------------------------------------------------------------------------- @@ -161,6 +161,25 @@ // // --------------------------------------------------------------------------- // +EXPORT_C void CCPDebug::ExtendedPrint( const char* aStringParam, + const CLiwGenericParamList& aInParamList ) + { + RDebug::Printf( "CPS Client::Request %s Parameters: \n", aStringParam ); + for ( TInt i = 0; i < aInParamList.Count( ); i++ ) + { + TLiwGenericParam tempParam; + tempParam.PushL(); + TRAP_IGNORE( aInParamList.AtL(i ,tempParam) ); + Dump( tempParam.Value() ); + CleanupStack::Pop(&tempParam); + tempParam.Reset(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// EXPORT_C DebugData* CCPDebug::Data() { return static_cast(Dll::Tls()); diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def --- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Wed May 12 13:36:47 2010 +0300 @@ -1,16 +1,18 @@ EXPORTS - ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 1 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const - ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 2 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const - ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 3 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const - ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 4 NONAME ; void CCPLiwMap::IsValidForActionL(void) const - ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 5 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const - ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 6 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &) + ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const + ?NewL@CCPLiwMap@@SAPAV1@ABVCLiwMap@@@Z @ 2 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwMap const &) + ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 3 NONAME ; void CCPLiwMap::IsValidForActionL(void) const + ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 4 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &) + ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 5 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const + ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 6 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const ?NewL@CCPLiwMap@@SAPAV1@ABVCLiwGenericParamList@@@Z @ 7 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwGenericParamList const &) - ?NewL@CContentMap@@SAPAV1@XZ @ 8 NONAME ; class CContentMap * CContentMap::NewL(void) - ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 9 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void) - ?NewLC@CContentMap@@SAPAV1@XZ @ 10 NONAME ; class CContentMap * CContentMap::NewLC(void) - ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 11 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void) - ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 12 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const - ?Reset@CCPLiwMap@@QBEXXZ @ 13 NONAME ; void CCPLiwMap::Reset(void) const - ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 14 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &) + ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 8 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const + ?Reset@CCPLiwMap@@QBEXXZ @ 9 NONAME ; void CCPLiwMap::Reset(void) const + ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 10 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const + ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 11 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &) + ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 12 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void) + ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 13 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void) + ?GetActionTriggersLC@CCPLiwMap@@QBEPAVCLiwDefaultList@@XZ @ 14 NONAME ; class CLiwDefaultList * CCPLiwMap::GetActionTriggersLC(void) const + ?NewLC@CContentMap@@SAPAV1@XZ @ 15 NONAME ; class CContentMap * CContentMap::NewLC(void) + ?NewL@CContentMap@@SAPAV1@XZ @ 16 NONAME ; class CContentMap * CContentMap::NewL(void) diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def --- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Wed May 12 13:36:47 2010 +0300 @@ -6,13 +6,15 @@ _ZN9CCPLiwMap12SetSecurityLERK9RMessage2 @ 5 NONAME _ZN9CCPLiwMap4NewLER14RDesReadStream @ 6 NONAME _ZN9CCPLiwMap4NewLERK20CLiwGenericParamList @ 7 NONAME - _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 8 NONAME - _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 9 NONAME - _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 10 NONAME - _ZNK9CCPLiwMap15PackForServerLCEv @ 11 NONAME - _ZNK9CCPLiwMap17IsValidForActionLEv @ 12 NONAME - _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 13 NONAME - _ZNK9CCPLiwMap5ResetEv @ 14 NONAME - _ZTI9CCPLiwMap @ 15 NONAME ; ## - _ZTV9CCPLiwMap @ 16 NONAME ; ## + _ZN9CCPLiwMap4NewLERK7CLiwMap @ 8 NONAME + _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 9 NONAME + _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 10 NONAME + _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 11 NONAME + _ZNK9CCPLiwMap15PackForServerLCEv @ 12 NONAME + _ZNK9CCPLiwMap17IsValidForActionLEv @ 13 NONAME + _ZNK9CCPLiwMap19GetActionTriggersLCEv @ 14 NONAME + _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 15 NONAME + _ZNK9CCPLiwMap5ResetEv @ 16 NONAME + _ZTI9CCPLiwMap @ 17 NONAME + _ZTV9CCPLiwMap @ 18 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h --- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Wed May 12 13:36:47 2010 +0300 @@ -24,6 +24,7 @@ class RDesReadStream; class CCPSecurityPolicy; +class TLiwGenericParam; // CLASS DECLARATION /** @@ -74,6 +75,11 @@ IMPORT_C static CCPLiwMap* NewL( const CLiwGenericParamList& aList ); /** + * Two-phased constructor. + */ + IMPORT_C static CCPLiwMap* NewL( const CLiwMap& aMap ); + + /** * Used by client to serialize this object * * @return object serialized to binary @@ -112,7 +118,7 @@ */ IMPORT_C TBool GetPropertyL( const TDesC8& aProperty, RBuf& aResult ) const; - + /** * Fetches value for property(key) from internal map * @@ -133,7 +139,16 @@ IMPORT_C TBool GetProperty( const TDesC8& aProperty, TInt32& aResult ) const; - + + /** + * Return list of action triggers from main map + * Note that these are not triggers from action map + * + * @return list of action triggers, NULL if main map + * doesn't have action trigger + */ + IMPORT_C CLiwDefaultList* GetActionTriggersLC( ) const; + /** * Setter for security policy * @@ -379,6 +394,18 @@ void SetL( const CLiwGenericParamList& aInParamList ); /** + * Sets all parameters according to provided list + * @param aMap map with parameters + */ + void SetL( const CLiwMap& aMap ); + + /** + * Extracts a param and appends it to the internal list + * @param aParam a param to extract + */ + void ExtractParamL(const TLiwGenericParam& aParam); + + /** * Check Get properties * * @return logical sum of TCPProperties of the object @@ -438,7 +465,6 @@ * */ TBool PropertyExists( const TDesC8& aProperty ) const; - /** * Fetches entries from database @@ -588,6 +614,14 @@ * @return result of RSqlStatement::ColumnIndex */ TInt ColumnIndexL( RSqlStatement& aStmt, const TDesC& aColumnName ) const; + + /** + * Returns ETrue if a property has valid name and type + * @param aProperty property name + * @return ETrue if property is valid, EFalse if not + */ + TBool IsPropertyValidL( const TDesC8& aProperty ) const; + protected: /** @@ -599,6 +633,14 @@ * Perform the second phase construction of a CCPLiwMap object. */ void ConstructL(); + + /** + * Checks a type a map + * @param aVariant variant containing a map type + * @return ETrue if a type is Publisher and EFalse if Content + * in other cases method leaves + */ + static TBool IsTypePublisherL(const TLiwVariant& aVariant); protected: // data diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp --- a/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Wed May 12 13:36:47 2010 +0300 @@ -28,6 +28,8 @@ #include "cpublisherregistrymap.h" #include "cpsecuritypolicy.h" +using namespace LIW; + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -55,34 +57,16 @@ CCPLiwMap* map( NULL ); if( param && pos !=KErrNotFound ) { - RBuf typeBuf; - typeBuf.CleanupClosePushL(); - TPtrC type( KNullDesC ); - if( !param->Value().Get( type ) ) + if( IsTypePublisherL(param->Value()) ) { - TPtrC8 type8( KNullDesC8 ); - if( !param->Value().Get( type8 ) ) - { - User::Leave( KErrBadName ); - } - typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) ); + map = CPublisherRegistryMap::NewLC(); } - else - { - typeBuf.CreateL( type ); - } - if( typeBuf.Find( KCpData () ) != KErrNotFound ) + else { map = CContentMap::NewLC(); } - else if ( typeBuf.Find( KPublisher () ) != KErrNotFound ) - { - map = CPublisherRegistryMap::NewLC(); - } - else User::Leave( KErrArgument ); - map->SetL( aList ); - CleanupStack::Pop( map ); - CleanupStack::PopAndDestroy( &typeBuf ); + map->SetL(aList); + CleanupStack::Pop(map); } else { @@ -94,6 +78,38 @@ // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- +// +EXPORT_C CCPLiwMap* CCPLiwMap::NewL( const CLiwMap& aMap ) + { + CP_DEBUG( _L8("CCPLiwMap::NewL") ); + TLiwVariant typeVariant; + typeVariant.PushL(); + CCPLiwMap* map( NULL ); + + if (aMap.FindL(KType, typeVariant)) + { + if( IsTypePublisherL(typeVariant) ) + { + map = CPublisherRegistryMap::NewLC(); + } + else + { + map = CContentMap::NewLC(); + } + map->SetL(aMap); + CleanupStack::Pop(map); + } + else + { + User::Leave( KErrPathNotFound ); + } + CleanupStack::PopAndDestroy(&typeVariant); + return map; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- // EXPORT_C HBufC8* CCPLiwMap::PackForServerLC() const { @@ -281,6 +297,63 @@ return result; } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CLiwDefaultList* CCPLiwMap::GetActionTriggersLC( ) const + { + CP_DEBUG( _L8("CCPLiwMap::GetActionTriggers") ); + TInt pos( 0 ); + CLiwDefaultList* list(NULL); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, + KActionTrigger ); + if ( paramForValue ) + { + if ( paramForValue->Value().TypeId() == EVariantTypeDesC8 ) + { + list = CLiwDefaultList::NewLC(); + list->AppendL(paramForValue->Value()); + } + if ( paramForValue->Value().TypeId() == EVariantTypeDesC ) + { + list = CLiwDefaultList::NewLC(); + RBuf8 desc8; + desc8.CleanupClosePushL(); + desc8.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L( + paramForValue->Value().AsDes() ) ); + list->AppendL(TLiwVariant(desc8)); + CleanupStack::PopAndDestroy( &desc8 ); + } + else if ( paramForValue->Value().TypeId() == EVariantTypeList ) + { + list = CLiwDefaultList::NewLC(); + const CLiwList* sourceList = paramForValue->Value().AsList(); + TInt count = sourceList->Count(); + for (TInt i = 0; i < count; i++) + { + TLiwVariant trigger; + trigger.PushL(); + sourceList->AtL(i,trigger); + if (trigger.TypeId() == EVariantTypeDesC8) + { + list->AppendL(trigger); + } + else if (trigger.TypeId() == EVariantTypeDesC) + { + RBuf8 desc8; + desc8.CleanupClosePushL(); + desc8.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L( + trigger.AsDes() ) ); + list->AppendL(TLiwVariant(desc8)); + CleanupStack::PopAndDestroy( &desc8 ); + } + CleanupStack::PopAndDestroy(&trigger); + } + } + } + return list; + } // --------------------------------------------------------------------------- // @@ -444,49 +517,78 @@ // void CCPLiwMap::SetL( const CLiwGenericParamList& aInParamList ) { - CP_DEBUG( _L8("CCPLiwMap::SetL") ); for ( TInt i = 0; i < aInParamList.Count( ); i++ ) { const TLiwGenericParam& param = aInParamList[i]; - if ( param.Value().TypeId( ) == LIW::EVariantTypeMap ) + ExtractParamL(param); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::SetL( const CLiwMap& aMap ) + { + CP_DEBUG( _L8("CCPLiwMap::SetL") ); + for ( TInt i = 0; i < aMap.Count( ); i++ ) + { + TBuf8<128> key; + aMap.AtL(i, key); + TLiwVariant value; + value.PushL(); + aMap.FindL(key, value); + TLiwGenericParam param(key,value); + ExtractParamL(param); + CleanupStack::PopAndDestroy(&value); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ExtractParamL(const TLiwGenericParam& aParam) + { + CP_DEBUG( _L8("CCPLiwMap::ExtractVariantL") ); + if (aParam.Value().TypeId() == LIW::EVariantTypeMap) + { + const CLiwMap* map = aParam.Value().AsMap(); + for (TInt i = 0; i < map->Count(); i++) { - const CLiwMap* map = param.Value().AsMap( ); - for ( TInt i = 0; i Count( ); i++ ) + TBuf8<128> key; + map->AtL(i, key); + TLiwVariant value; + value.PushL(); + map->FindL(key, value); + if (key == KOperation) { - TBuf8<128> key; - map->AtL( i, key ); - TLiwVariant value; - value.PushL( ); - map->FindL( key, value ); - if ( key == KOperation ) - { - IsProperOperationL( value ); - } - RBuf8 datadesc; - datadesc.CleanupClosePushL(); - if ( value.TypeId( ) == LIW::EVariantTypeMap ) - { - const CLiwMap* internalMap = value.AsMap( ); - datadesc.CreateL( internalMap->Size( ) ); - RDesWriteStream datastrm(datadesc); - CleanupClosePushL( datastrm ); - internalMap->ExternalizeL( datastrm ); - datastrm.CommitL( ); - CleanupStack::PopAndDestroy( &datastrm ); - value.Reset( ); - value.Set( datadesc ); - } - TLiwGenericParam data( key, value); - iMap->AppendL( data ); - CleanupStack::PopAndDestroy( &datadesc ); - CleanupStack::PopAndDestroy( &value ); + IsProperOperationL(value); } + RBuf8 datadesc; + datadesc.CleanupClosePushL(); + if (value.TypeId() == LIW::EVariantTypeMap) + { + const CLiwMap* internalMap = value.AsMap(); + datadesc.CreateL(internalMap->Size()); + RDesWriteStream datastrm(datadesc); + CleanupClosePushL(datastrm); + internalMap->ExternalizeL(datastrm); + datastrm.CommitL(); + CleanupStack::PopAndDestroy(&datastrm); + value.Reset(); + value.Set(datadesc); + } + TLiwGenericParam data(key, value); + iMap->AppendL(data); + CleanupStack::PopAndDestroy(&datadesc); + CleanupStack::PopAndDestroy(&value); } - else - { - iMap->AppendL( param ); - } + } + else + { + iMap->AppendL(aParam); } } @@ -737,16 +839,7 @@ // TBool CCPLiwMap::IsPublisherNameL() const { - TBool result( EFalse ); - RBuf buffer; - buffer.CleanupClosePushL(); - result = GetPropertyL( KPublisherId, buffer ); - if( result && buffer.Length() == KErrNone ) - { - User::Leave( KErrArgument ); - } - CleanupStack::PopAndDestroy( &buffer ); - return result; + return IsPropertyValidL( KPublisherId ); } // --------------------------------------------------------------------------- @@ -755,16 +848,7 @@ // TBool CCPLiwMap::IsContentTypeL() const { - TBool result( EFalse ); - RBuf buffer; - buffer.CleanupClosePushL(); - result = GetPropertyL( KContentType, buffer ); - if( result && buffer.Length() == KErrNone ) - { - User::Leave( KErrArgument ); - } - CleanupStack::PopAndDestroy( &buffer ); - return result; + return IsPropertyValidL( KContentType ); } // --------------------------------------------------------------------------- @@ -773,16 +857,7 @@ // TBool CCPLiwMap::IsContentIdL() const { - TBool result( EFalse ); - RBuf buffer; - buffer.CleanupClosePushL(); - result = GetPropertyL( KContentId, buffer ); - if( result && buffer.Length() == KErrNone ) - { - User::Leave( KErrArgument ); - } - CleanupStack::PopAndDestroy( &buffer ); - return result; + return IsPropertyValidL( KContentId ); } // --------------------------------------------------------------------------- @@ -791,11 +866,21 @@ // TBool CCPLiwMap::IsTriggerL( ) const { - TBool result( EFalse ); - RBuf8 buffer; - buffer.CleanupClosePushL(); - result = GetPropertyL( KActionTrigger, buffer ); - CleanupStack::PopAndDestroy( &buffer ); + TBool result(EFalse); + TInt pos( 0 ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, + KActionTrigger ); + if ( pos != KErrNotFound ) + { + result = ETrue; + LIW::TVariantTypeId variantType = paramForValue->Value().TypeId(); + if ( variantType != EVariantTypeDesC && + variantType != EVariantTypeDesC8 && + variantType != EVariantTypeList ) + { + User::Leave( KErrBadName ); + } + } return result; } @@ -1203,6 +1288,46 @@ // // --------------------------------------------------------------------------- // +TBool CCPLiwMap::IsTypePublisherL( const TLiwVariant& aVariant ) + { + TBool result (EFalse); + RBuf typeBuf; + typeBuf.CleanupClosePushL(); + TPtrC type( KNullDesC ); + if( !aVariant.Get( type ) ) + { + TPtrC8 type8( KNullDesC8 ); + if( !aVariant.Get( type8 ) ) + { + User::Leave( KErrBadName ); + } + typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) ); + } + else + { + typeBuf.CreateL( type ); + } + if( typeBuf.Find( KCpData () ) != KErrNotFound ) + { + result = EFalse; + } + else if ( typeBuf.Find( KPublisher () ) != KErrNotFound ) + { + result = ETrue; + } + else + { + User::Leave( KErrArgument ); + } + CleanupStack::PopAndDestroy( &typeBuf ); + return result; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// void CCPLiwMap::CheckIdentifiersL() const { IsPublisherNameL(); @@ -1266,5 +1391,38 @@ return ret; } - +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsPropertyValidL( const TDesC8& aProperty ) const + { + CP_DEBUG( _L8("CCPLiwMap::IsPropertyValidL") ); + TBool found( EFalse ); + TInt pos( 0 ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty ); + if ( pos != KErrNotFound ) + { + found = ETrue; + TInt length(0); + if( paramForValue->Value().TypeId() == EVariantTypeDesC ) + { + length = paramForValue->Value().AsDes().Length(); + } + else if ( paramForValue->Value().TypeId() == EVariantTypeDesC8 ) + { + length = paramForValue->Value().AsData().Length(); + } + else + { + User::Leave( KErrBadName ); + } + + if ( length == 0 ) + { + User::Leave( KErrArgument ); + } + } + return found; + } diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -22,7 +22,7 @@ // INCLUDES #include #include -#include "cpluginvalidator.h" +#include "cpluginvalidator.h" // FORWARD DECLARATIONS class CBlacklistHandler; @@ -41,7 +41,7 @@ /** * Class used to maintain required ECOM plugins implementations * - * + * * @lib cpclient.dll * @since S60 v 5.0 */ @@ -51,21 +51,21 @@ /** * Two-phased constructor. - * - */ - IMPORT_C static CHarvesterPluginValidator* NewL( TUid aUid, + * + */ + IMPORT_C static CHarvesterPluginValidator* NewL( TUid aUid, TAny *aParameter = NULL ); /** * Two-phased constructor. - * - */ + * + */ IMPORT_C static CHarvesterPluginValidator* NewLC( TUid aUid, TAny *aParameter = NULL ); - + /** * Desctructor. - */ + */ ~CHarvesterPluginValidator(); @@ -73,39 +73,33 @@ /** * C++ default constructor. - */ - CHarvesterPluginValidator( TUid aUid, TAny *aParameter ); + */ + CHarvesterPluginValidator( TUid aUid, TAny *aParameter ); /** * Perform the second phase construction of a CPluginValidator object. - */ + */ void ConstructL(); /** * Loads or destroys plugins - */ + */ void ManagePluginsL(); - + /** * Loads ECOM plugins - */ + */ void LoadPluginL( TPluginInfo& aPluginInfo ); private: - + /** * Blacklist Handler * Own */ CBlacklistHandler* iBlacklist; - - /* - * Startup flag - * - */ - TBool iStartup; - + /* * Property indicating the status of load operation * Own diff -r 2f40063dfb5c -r dbbebe55c824 contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp --- a/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -32,11 +32,11 @@ // // ---------------------------------------------------------------------------- // -EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewL( TUid aUid, +EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewL( TUid aUid, TAny *aParameter ) { - CHarvesterPluginValidator* self = - CHarvesterPluginValidator::NewLC( aUid , aParameter ); + CHarvesterPluginValidator* self = + CHarvesterPluginValidator::NewLC( aUid , aParameter ); CleanupStack::Pop( self ); return self; } @@ -48,8 +48,8 @@ EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewLC( TUid aUid, TAny *aParameter ) { - CHarvesterPluginValidator* self = new( ELeave ) - CHarvesterPluginValidator( aUid, aParameter ); + CHarvesterPluginValidator* self = new( ELeave ) + CHarvesterPluginValidator( aUid, aParameter ); CleanupStack::PushL( self ); self->ConstructL(); return self; @@ -70,12 +70,12 @@ // // ---------------------------------------------------------------------------- // -CHarvesterPluginValidator::CHarvesterPluginValidator( TUid aUid, TAny* aParameter ): - CPluginValidator(aUid, aParameter), - iStartup( ETrue ) - { - - } +CHarvesterPluginValidator::CHarvesterPluginValidator(TUid aUid, + TAny* aParameter) : + CPluginValidator(aUid, aParameter) +{ + +} // ---------------------------------------------------------------------------- // @@ -83,7 +83,7 @@ // void CHarvesterPluginValidator::ConstructL() { - iBlacklist = CBlacklistHandler::NewL( ); + iBlacklist = CBlacklistHandler::NewL(); CPluginValidator::ConstructL(); } @@ -92,76 +92,70 @@ // // ---------------------------------------------------------------------------- // -void CHarvesterPluginValidator::ManagePluginsL() +void CHarvesterPluginValidator::ManagePluginsL() { - TInt errorCode = iInProgressProperty.Define( TUid::Uid( KHarvesterUid ), - KInProgressPropertyKey, RProperty::EInt ); - + TInt errorCode = iInProgressProperty.Define( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, RProperty::EInt ); + if ( KErrAlreadyExists == errorCode ) - { - TInt value(-1); - iInProgressProperty.Get( TUid::Uid( KHarvesterUid ), - KInProgressPropertyKey, value); - if ( value == 1 ) - { - // property value == inprogress - // there was a panic in the previous startup - // so we make unofficial blacklist official - iBlacklist->CopyBlacklistL( EFalse ); - } - } + { + TInt value(-1); + iInProgressProperty.Get( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, value); + if ( value == 1 ) + { + // property value == inprogress + // there was a panic in the previous startup + // so we make unofficial blacklist official + iBlacklist->CopyBlacklistL( EFalse ); + } + } else - { - User::LeaveIfError( errorCode ); - } + { + User::LeaveIfError( errorCode ); + } // copy blacklisted plugins to unoffical blacklist at startup iBlacklist->CopyBlacklistL( ETrue ); - + // set property value to 1 (which means "in progress") - iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), - KInProgressPropertyKey, 1 ); - + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 1 ); + CPluginValidator::ManagePluginsL(); - - if ( iStartup ) - { - RProperty::Set( KPSUidActiveIdle2, - KActiveIdleCpsPluginsUpdated , EPSAiPluginsUpdated ); - iStartup = EFalse; - } + // set property value to 0 (which means "finished") - iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), - KInProgressPropertyKey, 0 ); + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 0 ); } // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // -void CHarvesterPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) +void CHarvesterPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) { if ( !iBlacklist->IsPresentL( aPluginInfo.iImplementationUid ) ) - { - //first we append UID to the blacklist - iBlacklist->AppendL( aPluginInfo.iImplementationUid ); - TAny* plug ( NULL ); - TInt err( KErrNone ); - TRAP( err, plug = REComSession::CreateImplementationL( - aPluginInfo.iImplementationUid, - aPluginInfo.iDtor_ID_Key, iParameter ) ); - if( err==KErrNone && plug ) - { - TRAP_IGNORE( - CleanupStack::PushL( plug ); - aPluginInfo.iPlugin = plug; - iPluginArray.AppendL( aPluginInfo ); - CleanupStack::Pop( plug ); - static_cast( plug )->UpdateL() - ); - } - //no panic during load so we can remove UID from blacklist - iBlacklist->RemoveL( aPluginInfo.iImplementationUid ); - } + { + //first we append UID to the blacklist + iBlacklist->AppendL( aPluginInfo.iImplementationUid ); + TAny* plug ( NULL ); + TInt err( KErrNone ); + TRAP( err, plug = REComSession::CreateImplementationL( + aPluginInfo.iImplementationUid, + aPluginInfo.iDtor_ID_Key, iParameter ) ); + if( err==KErrNone && plug ) + { + TRAP_IGNORE( + CleanupStack::PushL( plug ); + aPluginInfo.iPlugin = plug; + iPluginArray.AppendL( aPluginInfo ); + CleanupStack::Pop( plug ); + static_cast( plug )->UpdateL() + ); + } + //no panic during load so we can remove UID from blacklist + iBlacklist->RemoveL( aPluginInfo.iImplementationUid ); + } } diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/bwins/hgcontextutilityu.def --- a/contextutility/bwins/hgcontextutilityu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -EXPORTS - ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 1 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 2 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray const &, class TTimeIntervalMicroSeconds32 const &) - ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 4 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 5 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ??1CHgContextUtility@@UAE@XZ @ 6 NONAME ; CHgContextUtility::~CHgContextUtility(void) - ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 7 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void) - ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 8 NONAME ; void CHgContextUtility::RePublishWhenFgL(int) - ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 10 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &) - ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 12 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 13 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 14 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) - ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 15 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &) - ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 16 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 17 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &) - ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 18 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &) - ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &) - ?NewL@CHgContextUtility@@SAPAV1@XZ @ 20 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void) - ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 22 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 23 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &) - ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 24 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &) - ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 25 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) - ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) - diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/eabi/hgcontextutilityu.def --- a/contextutility/eabi/hgcontextutilityu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -EXPORTS - _ZN17CHgContextUtility16RePublishWhenFgLEi @ 1 NONAME - _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 2 NONAME - _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 3 NONAME - _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 4 NONAME - _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME - _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 6 NONAME - _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 7 NONAME - _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 8 NONAME - _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 9 NONAME - _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 10 NONAME - _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 11 NONAME - _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 12 NONAME - _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 13 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 15 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 16 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 17 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 18 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 19 NONAME - _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 20 NONAME - _ZN17CHgContextUtility4NewLEv @ 21 NONAME - _ZN17CHgContextUtility5NewLCEv @ 22 NONAME - _ZN17CHgContextUtilityD0Ev @ 23 NONAME - _ZN17CHgContextUtilityD1Ev @ 24 NONAME - _ZN17CHgContextUtilityD2Ev @ 25 NONAME - _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 26 NONAME - _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 27 NONAME - _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 28 NONAME - _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 29 NONAME - _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 30 NONAME - _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 31 NONAME - _ZTI21CHgContextUtilityBase @ 32 NONAME - _ZTV21CHgContextUtilityBase @ 33 NONAME - diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/group/bld.inf --- a/contextutility/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build info file for Context publishing helper DLL. -* -*/ - - -#include - -PRJ_EXPORTS -../rom/hgcontextutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgcontextutility.iby) - - -PRJ_MMPFILES -hgcontextutility.mmp - -PRJ_TESTMMPFILES - - diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/group/hgcontextutility.mmp --- a/contextutility/group/hgcontextutility.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll -* -*/ - - -#include -#include - -TARGETTYPE DLL -TARGET hgcontextutility.dll -UID 0x1000008d -CAPABILITY CAP_GENERAL_DLL - -SOURCEPATH ../src -SOURCE hgcontextutilitybase.cpp -SOURCE hgcontextutility.cpp -SOURCE hgcontextutilityimpl.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../inc - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY estor.lib -LIBRARY bafl.lib -LIBRARY cfclient.lib -LIBRARY cfservices.lib -LIBRARY cone.lib -LIBRARY ws32.lib -LIBRARY mdeclient.lib -LIBRARY vpbkeng.lib - diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/inc/hgcontexttypes.h --- a/contextutility/inc/hgcontexttypes.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CFW source and type names -* -*/ - -#ifndef HGCONTEXTTYPES_H -#define HGCONTEXTTYPES_H - -#include -#include // pull in the public part - -_LIT( KHgCFTypeFgApp, "FgApp" ); // published by fswserver - -_LIT( KHgCFTypeUpdateAvail, "UpdateAvail" ); // for iad source plug-in - -_LIT( KHgCFTypeMdsObjChanged, "MdsObjChanged" ); -_LIT( KHgCFTypeMdsRelChanged, "MdsRelChanged" ); - -_LIT( KHgCFValueDuplicateMarker, "" ); // may be used in PbkContactMulti - -const TInt KHgCFValueLinkMarker = 2; // prefix when Contact holds a vpbk contact link - -_LIT( KHgCFTypeCallState, "CallState" ); -_LIT( KHgCFTypeCallSusp, "CallSusp" ); // see hgcfcallsourceplugin -_LIT( KHgCFTypeContactFromCall, "ContactFromCall" ); // contains "1" if contact is coming from a voice/video call - -#endif // HGCONTEXTTYPES_H diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/inc/hgcontextutilityimpl.h --- a/contextutility/inc/hgcontextutilityimpl.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,434 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll -* -*/ - - -#ifndef HGCONTEXTUTILITYIMPL_H -#define HGCONTEXTUTILITYIMPL_H - -#include -#include -#include -#include -#include -#include -#include - -class CCFClient; -class MVPbkContactLink; -class MVPbkStoreContact; -class CVPbkContactLinkArray; -class CMdESession; - -/** - * Utility class offering static and non-static functions for - * publishing and accessing context through the Context Framework. - */ -NONSHARABLE_CLASS( CHgContextUtilityImpl ) : - public CTimer, - public MCFListener, - public MCoeForegroundObserver - { -public: - static CHgContextUtilityImpl* NewL(); - static CHgContextUtilityImpl* NewLC(); - virtual ~CHgContextUtilityImpl(); - - /** - * Publishes context. - * Also defines the context if it has not been defined. - * Publishing empty value is not allowed, however such errors are ignored - * here so the function will not leave when CFW responds with KErrArgument. - * The security policy for the context will be set to require - * LocalServices capability. - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context - */ - void PublishContextL( const TDesC& aContextType, - const TDesC& aContextData ); - - /** - * Publishes context, the value will contain all the strings - * from the given array, typically by using some separator character. - * @see PublishContextL - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context will be a combined - * version of all the strings from this array - */ - void PublishContextL( const TDesC& aContextType, - const MDesCArray& aContextData ); - - /** - * Static version that uses the given CCFClient instance. - * @param aCFClient a CCFClient instance - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context - */ - static void PublishContextL( CCFClient& aCFClient, - const TDesC& aContextType, const TDesC& aContextData ); - - /** - * Publishes context but only after a short interval, using a timer. - * If it is called again before the timer expires then the timer - * is restarted (and so the previous pending value is never published). - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context - * @param aDelay delay for the timer - */ - void PublishContextDelayedL( const TDesC& aContextType, - const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay ); - - /** - * Overload for delayed publishing of a value combined from multiple strings. - * @param aContextType context type - * @param aContextData string array - * @param aDelay delay for the timer, in microseconds - */ - void PublishContextDelayedL( const TDesC& aContextType, - const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay ); - - /** - * Requests the given context and returns the value for the - * first result. Returns NULL if not found. - * @param aContextType context type, the source is always KHgCFSource - */ - HBufC* GetContextL( const TDesC& aContextType ); - - /** - * Requests the given context and returns the value for the - * first result. Returns NULL if not found. - * @param aContextSource context source - * @param aContextType context type - */ - HBufC* GetContextL( const TDesC& aContextSource, - const TDesC& aContextType ); - - /** - * Creates a combined string from the elements of the given array. - * Returns NULL if the array has less than 2 elements. - * @param aArray string array - * @return combined string or NULL, ownership transferred to caller - */ - static HBufC* BuildCombinedStringL( const MDesCArray& aArray ); - - /** - * Splits the given combined string and appends the components to - * the given array. The initial content of the array is not modified. - * If aString does not seem to be a string combined from multiple entries - * then aString is appended to aArray without any changes. - * @param aString combined string, input - * @param aArray array, output - */ - static void SplitCombinedStringL( const TDesC& aString, - CDesCArray& aArray ); - - /** - * Gets a string that can be published straight via PublishContextL. - * The pointer is left on the cleanup stack. - * Returned & pushed pointer may also be NULL is something goes wrong. - */ - HBufC* MakeLinkPublishableLC( const MVPbkContactLink& aLink ); - - /** - * Publishes contact context. - * @param aContact contact - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( const MVPbkStoreContact& aContact, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes contact context. - * This may include async operations and therefore the actual publishing may happen - * only after this function returns. - * @param aContactLink contact link - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( const MVPbkContactLink& aContactLink, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes contact context. - * Attempts to publish an empty value will be ignored. - * - * Prefer using the overloads taking vpbk contact or link, whenever possible. - * Use this in case of unknown contacts only, that is, a name, phone number, - * or email address that does not belong to a phonebook contact. - * - * @param aContactName formatted name, phone number, or email address, - * or a combination of them, e.g. "firstname lastname", "+12345678", - * "lastname firstname ", "firstname, lastname <0501234567>". - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( const TDesC& aContactName, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Overload for publishing multiple contacts. - * @param aContacts contact array - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( - const RPointerArray& aContacts, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Overload for publishing multiple contacts. - * This may include async operations and therefore the actual publishing may happen - * only after this function returns. - * @param aContactLinks contact link array - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( - const CVPbkContactLinkArray& aContactLinks, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Overload for publishing multiple contacts. - * @param aContactNames string array, for element format - * see PublishContactContextL(const TDesC&) - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishContactContextL( const MDesCArray& aContactNames, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes freetext context. - * Not to be used for bulk text (e.g. full content of some text viewer component). - * @param aText some text, typically the highlighted substring - * from a viewer or editor control - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishTextContextL( const TDesC& aText, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes URL context. - * @param aUrl URL - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishUrlContextL( const TDesC& aUrl, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes date/time context. - * @param aTime time - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishTimeContextL( const TTime& aTime, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes photo context. - * @param aFilename name of image file, with full path - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishPhotoContextL( const TDesC& aFilename, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes photo context. - * @param aMdeItemId item id for the Image object in MDS - * @param aMdeSession opened metadata engine session - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishPhotoContextL( TItemId aMdeItemId, - CMdESession& aMdeSession, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Publishes TV context. - * Pass KNullDesC if some of the needed data is not available. - * @param aChannelName channel name - * @param aProgramName program name - * @param aProgramDescription program description - * @param aGenre genre - */ - void PublishTvContextL( const TDesC& aChannelName, - const TDesC& aProgramName, const TDesC& aProgramDescription, - const TDesC& aGenre ); - - /** - * Publishes an account id as contact context. - * - * @param aServiceId the service prefix, e.g. "Ovi" - * @param aAccountId the account id - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - void PublishServiceIdL( const TDesC& aServiceId, - const TDesC& aAccountId, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Enables or disables automatic re-publishing of the latest - * context (published via this context utility instance) whenever - * the application comes to foreground. - * - * It is DISABLED by default. - * - * By enabling this the applications do not have to care about - * context publishing in HandleForegroundEventL etc. - * - * The feature needs CCoeEnv and calls will be ignored if the - * environment is not available. - * - * @param aEnable flag to turn the feature on/off - */ - void RePublishWhenFgL( TBool aEnable ); - - /** - * Enables or disables context publishing when being in background. - * Applies to all PublishContextL variants. - * If disabled then no context will be published if it seems that the - * caller application is not in foreground. - * Has no effect if there is no CCoeEnv available, publishing is always - * allowed in that case. - * - * It is DISABLED by default, that is, publishing is not allowed - * from applications that are not in foreground. - * - * @param aAllow flag to turn the feature on/off - */ - void AllowPublishFromBackground( TBool aAllow ); - - /** - * @see CHgContextUtility::AddMusicContextInfo - */ - void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData ); - - /** - * @see CHgContextUtility::AddMusicContextInfo - */ - void PublishMusicContextL( - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * @see CHgContextUtility::PublishRadioContextL - */ - void PublishRadioContextL( - const TDesC& aRadioName, - const TDesC& aRadioUrl, - const TDesC& aRadioFrequency, - const TDesC& aRadioRDSPI ); - -private: // from MCFListener - void ContextIndicationL( const CCFContextIndication& aChangedContext ); - void ActionIndicationL( const CCFActionIndication& aActionToExecute ); - void HandleContextFrameworkError( TCFError aError, - const TDesC& aSource, const TDesC& aType ); - TAny* Extension( const TUid& aExtensionUid ) const; - -private: // from MCoeForegroundObserver - void HandleGainingForeground(); - void HandleLosingForeground(); - -private: // from CTimer - void RunL(); - TInt RunError( TInt aError ); - -private: - /** - * Constructor. - */ - CHgContextUtilityImpl(); - - /** - * 2nd phase constructor. - */ - void ConstructL(); - - /** - * Creates CCFClient instance if not yet done. - * Does not leave if creation fails. - * Returns ETrue if iCFClient is usable. - */ - TBool CFReady(); - - /** - * Returns ETrue if the root window's wgid is same as - * the focused window group's wgid. - * Always returns ETrue if CCoeEnv is not available. - */ - TBool IsForeground(); - - /** - * Returns ETrue if publishing context is allowed at the moment. - * Uses IsForeground and the allow-publish-from-background setting. - */ - TBool AllowedToPublish(); - - /** - * Makes sure the specific key contains valid data and publishes it. - * - * @param aKey Key to be checked and published. - * @param aDelay Delay for publishing the context data. - */ - void VerifyAndPublishMusicContextL( - const TDesC& aKey, - const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Simple wrapper to handle between delayed and instant publish. - * @see PublishContextL - * @see PublishContextDelayedL - */ - void PublishContextL( - const TDesC& aContextType, - const TDesC& aContextData, - const TTimeIntervalMicroSeconds32& aDelay ); - - CCFClient* iCFClient; - HBufC* iPendingContextType; - HBufC* iPendingContextData; - CDesCArray* iPendingContextDataArray; - - HBufC* iLastContextType; - HBufC* iLastContextData; - TBool iFgWatchEnabled; - CCoeEnv* iEnv; // not own - TBool iAllowPublishFromBackground; - - /** - * List of parameters to be published. Owns pointers. - */ - RPtrHashMap iMusicContextInfo; - }; - -#endif /* HGCONTEXTUTILITYIMPL_H */ diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/inc/hgctxutilslogging.h --- a/contextutility/inc/hgctxutilslogging.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logging utils -* -*/ - - -#ifdef _DEBUG -_LIT( KHgLogFile, "hgctxutils.txt" ); -_LIT( KHgLogPath, "teleport" ); -#define _HGLOG_LOG_COMPONENT_ID 0x1000008d - -#endif -#include "hglogging.h" diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/inc/hglogging.h --- a/contextutility/inc/hglogging.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logging utils -* -*/ - - -#ifndef HGLOGLOGUTILS_H -#define HGLOGLOGUTILS_H - -/** - * @file - * - * TAKING LOGGING INTO USE: - * - * This step is needed to do once per component. - * - * For each component that uses these common logging macros should specify - * their own logging configuration file, which includes this file. In that - * configuration file, following constants and macros must be defined. - * For example: - * @code - * - * _LIT( KHgLogFile, "text_file_for_logging.txt" ); - * _LIT( KHgLogPath, "folder_for_text_file" ); - * #define _HGLOG_LOG_COMPONENT_ID - * - * #include "hglogging.h" - * - * @/code - * - * KHgLogFile : This is the name of the file, where all the logs for - * this components are being written. - * - * KHgLogPath : This is the folder name under c:\logs, where the file - * is to be stored. For example, if KHgLogPath is "test", - * log file is created into folder c:\logs\test. - * - * _HGLOG_LOG_COMPONENT_ID : Unique number id of the component. This is - * for filtering purposes. - * - * _HGLOG_RDEBUG : When defined tracing instead of file logging. - * Default is for file logging. - * - * -------------------------------------------------------------------------- - * - * USING LOGGING: - * - * Basically the use is simple, register function use with HGLOG_CONTEXT, - * then log function enter by any HGLOG_IN -macro, then possibly use HGLOG - * -macros for function logging and finally HGLOG_OUT -macros for returning - * from the function. - * - * @code - * TInt CGood::Example( TInt aSomething ) - * { - * // Create log context class, which is maintained for lifetime of the - * // method. - * HGLOG_CONTEXT( Example, HGLOG_LOCAL ); - * - * // Indicate we are entering the function. - * HGLOG_IN1( "aSomething contains value %d", aSomething ); - * - * // Your buggy code... - * - * // Before leaving, indicate function execution has ended. - * HGLOG_OUT(); - * - * return 0; - * } - * @/code - */ - -#include -#include - -#include "hglogutils.h" - -#define HGLOG_API 0 -#define HGLOG_LOCAL 1 - -#define HGLOG_INFO 0 -#define HGLOG_WARNING 1 -#define HGLOG_ERROR 2 - -#define HGLOG_ASSERT(_assertion) __HGLOG_ASSERT_DBG(_assertion) -#define HGLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) - -#ifdef _DEBUG - -/***************************************************************************** - LOGGING MACROS - LOGGING ON -*****************************************************************************/ - - /** - * Context initialization - * NOTE: HGLOG_STATIC_CONTEXT is meant for static methods. - * - * @param _fn Name of the function. - * @param _vis Visibility for the client, use values HGLOG_API or HGLOG_LOCAL - * @param _thdId For static functions, thread id can be given here. - */ - #define HGLOG_CONTEXT(_fn, _vis ) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) - #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) - - /** - * Entering function - * - * @param string Custom text. Example: HGLOG_IN0( "Yeah!!!" ); - * @param p1 - p5 For multiple variables in same string. - */ - #define HGLOG_IN() do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) - #define HGLOG0_IN(string) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) - #define HGLOG1_IN(string, p1) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_ENTRY(); } while(0) - #define HGLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_ENTRY(); } while(0) - #define HGLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_ENTRY(); } while(0) - #define HGLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_ENTRY(); } while(0) - #define HGLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_ENTRY(); } while(0) - - /** Leaving function */ - #define HGLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) - #define HGLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) - #define HGLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_EXIT(); } while(0) - #define HGLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_EXIT(); } while(0) - #define HGLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_EXIT(); } while(0) - #define HGLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_EXIT(); } while(0) - #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0) - - /** Leaving function with return value */ - #define HGLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val); _MARK_EXIT(); } while(0); return val;} while(0) - #define HGLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1); _MARK_EXIT(); } while(0); return val;} while(0) - #define HGLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2); _MARK_EXIT(); } while(0); return val;} while(0) - #define HGLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3); _MARK_EXIT(); } while(0); return val;} while(0) - #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4); _MARK_EXIT(); } while(0); return val;} while(0) - #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0); return val;} while(0) - - /** - * General log lines - * - * @param level This can be used as internal information - * field, such as info, error, warning etc. - * @param string Custom string - * @param p1 - p5 For multiple variables in same string. - */ - #define HGLOG0(level, string) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) - #define HGLOG1(level, string, p1) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); } while(0) - #define HGLOG2(level, string, p1, p2) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); } while(0) - #define HGLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); } while(0) - #define HGLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); } while(0) - #define HGLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); } while(0) - - /** Error logging */ - #define __HGLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s Assert:%S:%d:" L ## #_assertion) , _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, &file, __LINE__ ); User::Invariant(); } while( 0 ) - #define __HGLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s ASSERTION FAILED!!! %s file: %s, line: %s"), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, _textToPrint, __FILE__, __LINE__); User::Panic(_L("AssertionFailed"), _panicCode} while(0) - #define HGLOG_TRAPHANDLER() _THgLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) - -/***************************************************************************** - LOGGING MACROS - NO LOGGING -*****************************************************************************/ -#else // _DEBUG - - #define HGLOG_CONTEXT(_fn, _vis ) - #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) - - #define HGLOG_IN() - #define HGLOG0_IN(string) - #define HGLOG1_IN(string, p1) - #define HGLOG2_IN(string, p1, p2) - #define HGLOG3_IN(string, p1, p2, p3) - #define HGLOG4_IN(string, p1, p2, p3, p4) - #define HGLOG5_IN(string, p1, p2, p3, p4, p5) - - #define HGLOG_OUT() - #define HGLOG0_OUT(string) - #define HGLOG1_OUT(string, p1) - #define HGLOG2_OUT(string, p1, p2) - #define HGLOG3_OUT(string, p1, p2, p3) - #define HGLOG4_OUT(string, p1, p2, p3, p4) - #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) - - #define HGLOG0_RET(val, fmtstr) return val - #define HGLOG1_RET(val, fmtstr, p1) return val - #define HGLOG2_RET(val, fmtstr, p1, p2) return val - #define HGLOG3_RET(val, fmtstr, p1, p2, p3) return val - #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val - #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val - - #define HGLOG0(level, string) - #define HGLOG1(level, string, p1) - #define HGLOG2(level, string, p1, p2) - #define HGLOG3(level, string, p1, p2, p3) - #define HGLOG4(level, string, p1, p2, p3, p4) - #define HGLOG5(level, string, p1, p2, p3, p4, p5) - - #define BIND_TRACE_TRAPHANDLER() - #define TRACE_DECL() TInt _iTraceThreadId - #define TRACE_FAST_CREATE(_thdId) _thdId++; - #define TRACE_CREATE() - - #define __HGLOG_ASSERT_DBG(_assertion) - #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) - -#endif // _DEBUG - -#endif // HGLOGLOGUTILS_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/inc/hglogutils.h --- a/contextutility/inc/hglogutils.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logging utils -* -*/ - - -#ifndef HGLOGUTILS_H -#define HGLOGUTILS_H - -/** - * NOTE: This file contains the logic related to logging. Change only if you - * know what you're doing. - */ - - - - - - - - - - -#ifdef _DEBUG - -#include -#include - -static const TUint HGLOGERR = 2; /**< Used to create an error message */ - -// These macros are real macros, that should be used. For temporary purposes, these -// are left out and the logging is done by simple entry logging -#define _HGLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" -#define _HGLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" -#define _HGLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" -#define _HGLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" -#define _HGLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" -#define _HGLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" -#define _HGLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " -#define _HGLOG_API_PREFIX L"_A" -#define _HGLOG_LOCAL_PREFIX L"_L" - -/** -* @file -* trace_utils.h contains definitions needed for advanced tracing features. -* Tracing can be customized using the following compile time flags: -* - _DEBUG -* - With this flag undefined, all traces are disabled -* - __KERNEL_MODE__ -* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) -* - DISABLE_SYNTAX_CHECK -* - If this flag is defined, runtime syntax checking features are disabled from traces -*/ -#ifndef DISABLE_SYNTAX_CHECK - #define _MARK_ENTRY() _dc.inOk=ETrue - #define _DOINCHK() _dc.DoInChk() - #define _CHK_MULTIIN() _dc.ChkMultiIn() - #define _CHK_MULTIOUT() _dc.ChkMultiOut() - #define _MARK_EXIT() _dc.outOk=ETrue -#else - #define _MARK_ENTRY() - #define _DOINCHK() - #define _CHK_MULTIIN() - #define _CHK_MULTIOUT() - #define _MARK_EXIT() -#endif // DISABLE_SYNTAX_CHECK - -/** For tracing */ -#ifdef _HGLOG_RDEBUG - #define _IT(a) (TPtrC((const TText *)(a))) - #define _HGLOGPRINTER RDebug::Print - -/** For filedebug */ -#else // _HGLOG_RDEBUG - - /** Includes */ - #include - #include - #include - #include - -// both of headers defines KLogBufferSize -#ifndef __COMMSDEBUGUTILITY_H__ - #include -#endif - - #define _IT(a) KHgLogPath, KHgLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) - #define _HGLOGPRINTER RFileLogger::WriteFormat -#endif // _HGLOG_RDEBUG - -class _THgLogContext - { - public: - _THgLogContext( - const TText* _fn, - const TUint _id, - const TUint _vis, - const TUint _addr, - const TUint _thdId, - const TUint _category=0 ) - : - iFn(_fn), - iId(_id), - iApi((TBool)_vis), - iAddr(_addr), - iThdId(_thdId), - iVis((_vis == 0 ? (TText*)_HGLOG_API_PREFIX : (TText*)_HGLOG_LOCAL_PREFIX)), - iCategory(_category) - #ifndef DISABLE_SYNTAX_CHECK - ,outOk(EFalse), inOk(EFalse) - #endif - { - } - ~_THgLogContext() - { - #ifndef DISABLE_SYNTAX_CHECK - do - { - DoInChk(); - if (!outOk) - { - _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLER_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); - } - } while (0); - #endif // DISABLE_SYNTAX_CHECK - } - - const TText* iFn; - const TUint iId; - const TText* iVis; - const TUint iAddr; - const TInt iThdId; - const TBool iApi; - const TUint iCategory; - - #ifndef DISABLE_SYNTAX_CHECK - inline void DoInChk() - { - if (!inOk) - { - _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); - inOk = ETrue; - } - } - - inline void ChkMultiIn() - { - if (inOk) - { - _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); - } - } - - inline void ChkMultiOut() - { - if (outOk) - { - _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); - } - } - - TBool inOk; - TBool outOk; - #endif // DISABLE_SYNTAX_CHECK - }; - -class _THgLogTrapHandler: public TTrapHandler - { - public: - - _THgLogTrapHandler(_THgLogContext& _context) : _dc( _context ) - { - RThread me; - iThdId = (TInt)me.Id(); - } - void Trap() - { - _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_ENTRY), 0, HGLOGERR, iThdId, this); - oldHandler->Trap(); - } - void UnTrap() - { - _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_EXIT), 0, HGLOGERR, iThdId, this); - oldHandler->UnTrap(); - } - void Leave(TInt aValue) - { - _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_LEAVE), 0, HGLOGERR, iThdId, this); - oldHandler->Leave(aValue); - } - TTrapHandler* oldHandler; - private: - _THgLogContext& _dc; - TInt iThdId; - }; - -#endif // _DEBUG - -#endif // HGLOGUTILS_H \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/rom/hgcontextutility.iby --- a/contextutility/rom/hgcontextutility.iby Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Iby file -* -*/ - - -#ifndef HGCONTEXTUTILITY_IBY -#define HGCONTEXTUTILITY_IBY - -#include - -file=ABI_DIR\BUILD_DIR\hgcontextutility.dll SHARED_LIB_DIR\hgcontextutility.dll - -#endif // HGCONTEXTUTILITY_IBY diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/src/hgcontextutility.cpp --- a/contextutility/src/hgcontextutility.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll -* -*/ - - -#include -#include "hgcontextutilityimpl.h" - -// ----------------------------------------------------------------------------- -// CHgContextUtility::NewL -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgContextUtility* CHgContextUtility::NewL() - { - CHgContextUtility* self = NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::NewLC -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgContextUtility* CHgContextUtility::NewLC() - { - CHgContextUtility* self = new ( ELeave ) CHgContextUtility; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::CHgContextUtility -// ----------------------------------------------------------------------------- -// -CHgContextUtility::CHgContextUtility() - { - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::ConstructL -// ----------------------------------------------------------------------------- -// -void CHgContextUtility::ConstructL() - { - BaseConstructL(); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::~CHgContextUtility -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgContextUtility::~CHgContextUtility() - { - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const MVPbkStoreContact& aContact, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContact, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const MVPbkContactLink& aContactLink, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContactLink, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const TDesC& aContactName, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContactName, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const RPointerArray& aContacts, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContacts, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const CVPbkContactLinkArray& aContactLinks, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContactLinks, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishContactContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishContactContextL( - const MDesCArray& aContactNames, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContactContextL( aContactNames, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishTextContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishTextContextL( const TDesC& aText, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishTextContextL( aText, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishUrlContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishUrlContextL( const TDesC& aUrl, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishUrlContextL( aUrl, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishTimeContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishTimeContextL( const TTime& aTime, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishTimeContextL( aTime, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishPhotoContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishPhotoContextL( - const TDesC& aFilename, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishPhotoContextL( aFilename, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishPhotoContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishPhotoContextL( - TItemId aMdeItemId, - CMdESession& aMdeSession, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishPhotoContextL( aMdeItemId, aMdeSession, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishTvContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishTvContextL( const TDesC& aChannelName, - const TDesC& aProgramName, const TDesC& aProgramDescription, - const TDesC& aGenre ) - { - iImpl->PublishTvContextL( aChannelName, aProgramName, - aProgramDescription, aGenre ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishServiceIdL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishServiceIdL( const TDesC& aServiceId, - const TDesC& aAccountId, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishServiceIdL( aServiceId, aAccountId, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::RePublishWhenFgL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::RePublishWhenFgL( TBool aEnable ) - { - iImpl->RePublishWhenFgL( aEnable ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::AllowPublishFromBackground -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::AllowPublishFromBackground( TBool aAllow ) - { - iImpl->AllowPublishFromBackground( aAllow ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::AddMusicContextInfoL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::AddMusicContextInfoL( - const TDesC& aKey, const TDesC& aData ) - { - iImpl->AddMusicContextInfoL( aKey, aData ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishMusicContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishMusicContextL( - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishMusicContextL( aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::PublishRadioContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtility::PublishRadioContextL( - const TDesC& aRadioName, - const TDesC& aRadioUrl, - const TDesC& aRadioFrequency, - const TDesC& aRadioRDSPI ) - { - iImpl->PublishRadioContextL( aRadioName, aRadioUrl, - aRadioFrequency, aRadioRDSPI ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtility::BuildCombinedStringL -// ----------------------------------------------------------------------------- -EXPORT_C HBufC* CHgContextUtility::BuildCombinedStringL( const MDesCArray& aArray ) -{ - return CHgContextUtilityImpl::BuildCombinedStringL(aArray); -} - -// ----------------------------------------------------------------------------- -// CHgContextUtility::SplitCombinedStringL -// ----------------------------------------------------------------------------- -EXPORT_C void CHgContextUtility::SplitCombinedStringL( const TDesC& aString, - CDesCArray& aArray ) -{ - CHgContextUtilityImpl::SplitCombinedStringL(aString, aArray); -} -// -// end of file diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/src/hgcontextutilitybase.cpp --- a/contextutility/src/hgcontextutilitybase.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll -* -*/ - - -#include -#include "hgcontextutilityimpl.h" - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::CHgContextUtilityBase -// ----------------------------------------------------------------------------- -// -CHgContextUtilityBase::CHgContextUtilityBase() - { - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::BaseConstructL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityBase::BaseConstructL() - { - iImpl = CHgContextUtilityImpl::NewL(); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::~CHgContextUtilityBase -// ----------------------------------------------------------------------------- -// -CHgContextUtilityBase::~CHgContextUtilityBase() - { - delete iImpl; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::PublishContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType, - const TDesC& aContextData ) - { - iImpl->PublishContextL( aContextType, aContextData ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::PublishContextL -// Array version -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType, - const MDesCArray& aContextData ) - { - iImpl->PublishContextL( aContextType, aContextData ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::GetContextL -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextSource, - const TDesC& aContextType ) - { - return iImpl->GetContextL( aContextSource, aContextType ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::GetContextL -// Version using a fixed context source -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextType ) - { - return iImpl->GetContextL( aContextType ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::PublishContextDelayedL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL( - const TDesC& aContextType, - const TDesC& aContextData, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityBase::PublishContextDelayedL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL( - const TDesC& aContextType, - const MDesCArray& aContextData, - const TTimeIntervalMicroSeconds32& aDelay ) - { - iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay ); - } - - -// end of file diff -r 2f40063dfb5c -r dbbebe55c824 contextutility/src/hgcontextutilityimpl.cpp --- a/contextutility/src/hgcontextutilityimpl.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,972 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "hgcontextutilityimpl.h" -#include "hgcontexttypes.h" - -// max number of entries processed when aContextData is an array in PublishContextL -const TInt KMaxEntriesInMulti = 20; - -// separator character in combined string for multiple entries -const TInt KMultiSepChar = 0x0001; - -// granularity for string array -const TInt KArrayGranularity = 4; - -// argument for CBufFlat ctor when serializing contact links -const TInt KBufGranularity = 64; - -// default security policy (use LocalServices cap) for contexts -_LIT_SECURITY_POLICY_C1( KContextSecurity, ECapabilityLocalServices ); - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::NewL -// ----------------------------------------------------------------------------- -// -CHgContextUtilityImpl* CHgContextUtilityImpl::NewL() - { - CHgContextUtilityImpl* self = NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::NewLC -// ----------------------------------------------------------------------------- -// -CHgContextUtilityImpl* CHgContextUtilityImpl::NewLC() - { - CHgContextUtilityImpl* self = new ( ELeave ) CHgContextUtilityImpl; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::CHgContextUtilityImpl -// ----------------------------------------------------------------------------- -// -CHgContextUtilityImpl::CHgContextUtilityImpl() - : CTimer( CActive::EPriorityStandard ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::ConstructL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::ConstructL() - { - CTimer::ConstructL(); - - iEnv = CCoeEnv::Static(); // may be NULL - - // Do not create iCFClient here as cf server may not be available yet - // if we are early in the boot phase. - - // set defaults - RePublishWhenFgL( EFalse ); - AllowPublishFromBackground( EFalse ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::~CHgContextUtilityImpl -// ----------------------------------------------------------------------------- -// -CHgContextUtilityImpl::~CHgContextUtilityImpl() - { - Cancel(); - delete iPendingContextType; - delete iPendingContextData; - delete iPendingContextDataArray; - delete iCFClient; - delete iLastContextType; - delete iLastContextData; - if ( iFgWatchEnabled && iEnv ) - { - iEnv->RemoveForegroundObserver( *this ); - } - - iMusicContextInfo.ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::CFReady -// ----------------------------------------------------------------------------- -// -TBool CHgContextUtilityImpl::CFReady() - { - if ( !iCFClient ) - { - TRAPD( err, iCFClient = CCFClient::NewL( *this ) ); - if ( err != KErrNone ) - { - RDebug::Printf( "[hgctxutil] cfw not ready" ); - return EFalse; - } - } - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextL -// All other non-static versions of this function will fall back to this one. -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType, - const TDesC& aContextData ) - { - RDebug::Print( _L("[hgctxutil] PublishContextL [%S] [%S]"), - &aContextType, &aContextData ); - // create cf client instance if not yet done - // and check foreground status if needed - if ( CFReady() && AllowedToPublish() ) - { - // call static version with our cf client instance - PublishContextL( *iCFClient, aContextType, aContextData ); - } - // store type and value for later use - // (even when cfserver is not available yet, the data may still be - // used later when the app comes to foreground, for example) - if ( iLastContextType != &aContextType ) - { - delete iLastContextType; iLastContextType = 0; - iLastContextType = aContextType.AllocL(); - } - if ( iLastContextData != &aContextData ) - { - delete iLastContextData; iLastContextData = 0; - iLastContextData = aContextData.AllocL(); - } - } - -// ----------------------------------------------------------------------------- -// AppendCharL -// Appends a char to aDst, calls ReAllocL when needed, assumes that aDst -// is also on cleanupstack (at top position) so it updates that pointer too. -// ----------------------------------------------------------------------------- -// -LOCAL_C void AppendCharL( HBufC*& aDst, TChar aChar ) - { - TPtr des( aDst->Des() ); - if ( des.Length() == des.MaxLength() ) - { - HBufC* oldDst = aDst; - aDst = aDst->ReAllocL( des.MaxLength() * 2 ); - CleanupStack::Pop( oldDst ); // pop the old pointer - CleanupStack::PushL( aDst ); // and push the new (possibly different) one - des.Set( aDst->Des() ); - } - des.Append( aChar ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::BuildCombinedStringL -// ----------------------------------------------------------------------------- -// -HBufC* CHgContextUtilityImpl::BuildCombinedStringL( - const MDesCArray& aArray ) - { - TInt arrayCount = aArray.MdcaCount(); - if ( arrayCount >= 2 ) - { - // Rules: - // 1. escape all separator chars in the input with a preceeding \ - // 2. escape all \ chars in the input with \\ - // 3. take only the first KMaxEntriesInMulti elements from the array - // 4. append a separator also after last entry - // 5. prepend two separators to the combined string - TInt processedEntryCount = Min( arrayCount, KMaxEntriesInMulti ); - // calculate a big enough size so we can avoid ReAllocL calls later - TInt sz = 0; - for ( TInt i = 0; i < processedEntryCount; ++i ) - { - sz += aArray.MdcaPoint( i ).Length() + 1; - } - sz += 2; // for the magic prefix - HBufC* value = HBufC::NewLC( sz ); - AppendCharL( value, KMultiSepChar ); - AppendCharL( value, KMultiSepChar ); - for ( TInt i = 0; i < processedEntryCount; ++i ) - { - TPtrC entry( aArray.MdcaPoint( i ) ); - // append, also do the escaping - for ( TInt j = 0, je = entry.Length(); j != je; ++j ) - { - TChar c = entry[j]; - if ( c == KMultiSepChar || c == '\\' ) - { - AppendCharL( value, '\\' ); - } - AppendCharL( value, c ); - } - AppendCharL( value, KMultiSepChar ); - } - CleanupStack::Pop( value ); - return value; - } - return 0; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::SplitCombinedStringL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::SplitCombinedStringL( - const TDesC& aString, CDesCArray& aArray ) - { - TInt inputLength = aString.Length(); - TBool isMulti = inputLength > 2 - && aString[0] == KMultiSepChar && aString[1] == KMultiSepChar; - if ( isMulti ) - { - // allocate a work buffer that is big enough for sure - HBufC* buf = HBufC::NewLC( inputLength ); - TPtr des( buf->Des() ); - TBool esc = EFalse; - // go through the string, find entries, and add them to output array - for ( TInt i = 2; i < inputLength; ++i ) // start from 2 because of the magic prefix - { - TChar c = aString[i]; - if ( c == '\\' && !esc ) - { - esc = ETrue; - } - else if ( c == KMultiSepChar && !esc ) - { - // found separator: append to output array, clear buffer, and continue - aArray.AppendL( des ); - des.Zero(); - } - else - { - esc = EFalse; - des.Append( c ); - } - } - CleanupStack::PopAndDestroy( buf ); - } - else - { - // not a combined string: append to array as it is - aArray.AppendL( aString ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType, - const MDesCArray& aContextData ) - { - TInt entryCount = aContextData.MdcaCount(); - // do nothing if array is empty - if ( !entryCount ) - { - return; - } - // nothing special when having only 1 item - if ( entryCount == 1 ) - { - PublishContextL( aContextType, aContextData.MdcaPoint( 0 ) ); - return; - } - // at least two items: create the special combined string - HBufC* value = BuildCombinedStringL( aContextData ); - CleanupStack::PushL( value ); - // publish the combined string - PublishContextL( aContextType, *value ); - CleanupStack::PopAndDestroy( value ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextL -// This is the version of the function where the real work is performed. -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextL( CCFClient& aCFClient, - const TDesC& aContextType, const TDesC& aContextData ) - { - CCFContextObject* context = CCFContextObject::NewLC(); - context->SetSourceL( KHgCFSource ); - context->SetTypeL( aContextType ); - context->SetValueL( aContextData ); - TInt err = aCFClient.PublishContext( *context ); - if ( err == KErrNotFound ) - { - User::LeaveIfError( aCFClient.DefineContext( KHgCFSource, - aContextType, KContextSecurity ) ); - err = aCFClient.PublishContext( *context ); - if ( err != KErrArgument ) // ignore -6 which comes e.g. when trying to publish an empty value - { - User::LeaveIfError( err ); - } - } - else if ( err != KErrArgument ) - { - User::LeaveIfError( err ); - } - CleanupStack::PopAndDestroy( context ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::GetContextL -// ----------------------------------------------------------------------------- -// -HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextSource, - const TDesC& aContextType ) - { - HBufC* ret = 0; - if ( CFReady() ) - { - CCFContextQuery* query = CCFContextQuery::NewLC(); - query->SetSourceL( aContextSource ); - query->SetTypeL( aContextType ); - RContextObjectArray result; - TInt err = iCFClient->RequestContext( *query, result ); - if ( err == KErrNone && result.Count() ) - { - ret = result[0]->Value().Alloc(); - } - result.ResetAndDestroy(); - CleanupStack::PopAndDestroy( query ); - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::GetContextL -// ----------------------------------------------------------------------------- -// -HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextType ) - { - return GetContextL( KHgCFSource, aContextType ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextDelayedL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType, - const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay ) - { - Cancel(); - delete iPendingContextType; iPendingContextType = 0; - iPendingContextType = aContextType.AllocL(); - delete iPendingContextData; iPendingContextData = 0; - iPendingContextData = aContextData.AllocL(); - delete iPendingContextDataArray; iPendingContextDataArray = 0; - After( aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextDelayedL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType, - const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay ) - { - Cancel(); - delete iPendingContextType; iPendingContextType = 0; - iPendingContextType = aContextType.AllocL(); - delete iPendingContextData; iPendingContextData = 0; - if ( iPendingContextDataArray ) - { - iPendingContextDataArray->Reset(); - } - else - { - iPendingContextDataArray = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); - } - for ( TInt i = 0, ie = aContextData.MdcaCount(); i != ie; ++i ) - { - iPendingContextDataArray->AppendL( aContextData.MdcaPoint( i ) ); - } - After( aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::RunL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::RunL() - { - if ( iPendingContextType ) - { - if ( iPendingContextData ) - { - PublishContextL( *iPendingContextType, *iPendingContextData ); - } - else if ( iPendingContextDataArray ) - { - PublishContextL( *iPendingContextType, *iPendingContextDataArray ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::RunError -// ----------------------------------------------------------------------------- -// -TInt CHgContextUtilityImpl::RunError( TInt /*aError*/ ) - { - return KErrNone; - } - -// empty implementations for cfw - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::ContextIndicationL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::ContextIndicationL( - const CCFContextIndication& /*aChangedContext*/ ) - { - // empty - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::ActionIndicationL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::ActionIndicationL( - const CCFActionIndication& /*aActionToExecute*/ ) - { - // empty - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::HandleContextFrameworkError -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::HandleContextFrameworkError( TCFError /*aError*/, - const TDesC& /*aSource*/, - const TDesC& /*aType*/ ) - { - // empty - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::Extension -// ----------------------------------------------------------------------------- -// -TAny* CHgContextUtilityImpl::Extension( const TUid& /*aExtensionUid*/ ) const - { - return 0; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::MakeLinkPublishableLC -// ----------------------------------------------------------------------------- -// -HBufC* CHgContextUtilityImpl::MakeLinkPublishableLC( - const MVPbkContactLink& aLink ) - { - HBufC* ret = 0; - // serialize the link and place it into a 16-bit descriptor - // prefixed with one special mark character - const MVPbkStreamable* strm = aLink.Streamable(); - User::LeaveIfNull(strm); - CBufFlat* buf = CBufFlat::NewL( KBufGranularity ); - CleanupStack::PushL( buf ); - RBufWriteStream ws; - CleanupClosePushL( ws ); - ws.Open( *buf ); - strm->ExternalizeL( ws ); - CleanupStack::PopAndDestroy( &ws ); - TPtr8 p( buf->Ptr( 0 ) ); - ret = HBufC::NewLC( p.Length() + 1 ); - TPtr des( ret->Des() ); - des.Copy( p ); - _LIT( KTemp, " " ); - des.Insert( 0, KTemp ); - des[0] = KHgCFValueLinkMarker; // codescanner::accessArrayElementWithoutCheck2 - CleanupStack::Pop( ret ); - CleanupStack::PopAndDestroy( buf ); - CleanupStack::PushL( ret ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const MVPbkStoreContact& aContact, - const TTimeIntervalMicroSeconds32& aDelay ) - { - MVPbkContactLink* link = aContact.CreateLinkLC(); - if ( link ) - { - HBufC* pubstr = MakeLinkPublishableLC( *link ); - PublishContactContextL( *pubstr, aDelay ); - CleanupStack::PopAndDestroy( pubstr ); - } - CleanupStack::PopAndDestroy( );//link - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const MVPbkContactLink& aContactLink, - const TTimeIntervalMicroSeconds32& aDelay ) - { - HBufC* pubstr = MakeLinkPublishableLC( aContactLink ); - PublishContactContextL( *pubstr, aDelay ); - CleanupStack::PopAndDestroy( pubstr ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const TDesC& aContactName, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypeContact, aContactName ); - } - else - { - PublishContextDelayedL( KHgCFTypeContact, aContactName, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const RPointerArray& aContacts, - const TTimeIntervalMicroSeconds32& aDelay ) - { - CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( arr ); - for ( TInt i = 0, ie = aContacts.Count(); i != ie; ++i ) - { - MVPbkContactLink* link = aContacts[i]->CreateLinkLC(); - if ( link ) - { - HBufC* pubstr = MakeLinkPublishableLC( *link ); - arr->AppendL( *pubstr ); - CleanupStack::PopAndDestroy( pubstr ); - } - CleanupStack::PopAndDestroy( );//link - } - PublishContactContextL( *arr, aDelay ); - CleanupStack::PopAndDestroy( arr ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const CVPbkContactLinkArray& aContactLinks, - const TTimeIntervalMicroSeconds32& aDelay ) - { - CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( arr ); - for ( TInt i = 0, ie = aContactLinks.Count(); i != ie; ++i ) - { - HBufC* pubstr = MakeLinkPublishableLC( aContactLinks.At( i ) ); - arr->AppendL( *pubstr ); - CleanupStack::PopAndDestroy( pubstr ); - } - PublishContactContextL( *arr, aDelay ); - CleanupStack::PopAndDestroy( arr ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContactContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContactContextL( - const MDesCArray& aContactNames, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypeContact, aContactNames ); - } - else - { - PublishContextDelayedL( KHgCFTypeContact, aContactNames, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishTextContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishTextContextL( const TDesC& aText, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypeText, aText ); - } - else - { - PublishContextDelayedL( KHgCFTypeText, aText, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishUrlContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishUrlContextL( const TDesC& aUrl, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypeUrl, aUrl ); - } - else - { - PublishContextDelayedL( KHgCFTypeUrl, aUrl, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishTimeContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishTimeContextL( const TTime& aTime, - const TTimeIntervalMicroSeconds32& aDelay ) - { - // YYYYMMDD:HHMMSS.MMMMMM - const TInt KDateTimeLength = 22; - const TInt KYearLength = 4; - const TInt KMonthLength = 2; - const TInt KDayLength = 2; - _LIT( KTimeZero, ":010101.000000"); - - TDateTime dt = aTime.DateTime(); - TBuf buf; - buf.AppendNumFixedWidth( dt.Year(), EDecimal, KYearLength ); - buf.AppendNumFixedWidth( dt.Month(), EDecimal, KMonthLength ); - buf.AppendNumFixedWidth( dt.Day(), EDecimal, KDayLength ); - buf.Append( KTimeZero ); - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypeActiveDate, buf ); - } - else - { - PublishContextDelayedL( KHgCFTypeActiveDate, buf, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishPhotoContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishPhotoContextL( - const TDesC& aFilename, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( KHgCFTypePhoto, aFilename ); - } - else - { - PublishContextDelayedL( KHgCFTypePhoto, aFilename, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishPhotoContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishPhotoContextL( - TItemId aMdeItemId, - CMdESession& aMdeSession, - const TTimeIntervalMicroSeconds32& aDelay ) - { - CMdEObject* obj = aMdeSession.GetObjectL( aMdeItemId ); - if ( obj ) - { - CleanupStack::PushL( obj ); - PublishPhotoContextL( obj->Uri(), aDelay ); - CleanupStack::PopAndDestroy( obj ); - } - else - { - User::Leave( KErrNotFound ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishTvContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishTvContextL( const TDesC& aChannelName, - const TDesC& aProgramName, const TDesC& aProgramDescription, - const TDesC& aGenre ) - { - TPtrC channelName( aChannelName.Length() ? aChannelName - : KHgCFValueUnknownInfo ); - TPtrC programName( aProgramName.Length() ? aProgramName - : KHgCFValueUnknownInfo ); - TPtrC programDesc( aProgramDescription.Length() ? aProgramDescription - : KHgCFValueUnknownInfo ); - TPtrC programGenre( aGenre.Length() ? aGenre : KHgCFValueUnknownInfo ); - - // Publish description/genre first because it is unlikely to have those - // in rules so their content will be available for sure when an action - // is triggered. - PublishContextL( KHgCFTypeTvProgramDesc, programDesc ); - PublishContextL( KHgCFTypeTvProgramGenre, programGenre ); - PublishContextL( KHgCFTypeTvChannelName, channelName ); - PublishContextL( KHgCFTypeTvProgramName, programName ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishServiceIdL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishServiceIdL( const TDesC& aServiceId, - const TDesC& aAccountId, - const TTimeIntervalMicroSeconds32& aDelay ) - { - HBufC* combinedIdBuf = HBufC::NewLC( aServiceId.Length() - + aAccountId.Length() + 1 ); - TPtr combinedId( combinedIdBuf->Des() ); - _LIT( KCombinedFormat, "%S:%S" ); - combinedId.Format( KCombinedFormat, &aServiceId, &aAccountId ); - PublishContactContextL( combinedId, aDelay ); - CleanupStack::PopAndDestroy( combinedIdBuf ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::RePublishWhenFgL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::RePublishWhenFgL( TBool aEnable ) - { - if ( iEnv ) - { - if ( iFgWatchEnabled ) - { - iEnv->RemoveForegroundObserver( *this ); - } - iFgWatchEnabled = aEnable; - if ( iFgWatchEnabled ) - { - iEnv->AddForegroundObserverL( *this ); - } - } - } - -// callbacks from CCoeEnv - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::HandleGainingForeground -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::HandleGainingForeground() - { - if ( iLastContextType && iLastContextData ) - { - TRAP_IGNORE( PublishContextL( *iLastContextType, *iLastContextData ) ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::HandleLosingForeground -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::HandleLosingForeground() - { - // nothing to do here - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::IsForeground -// ----------------------------------------------------------------------------- -// -TBool CHgContextUtilityImpl::IsForeground() - { - if ( iEnv ) - { - TInt rootWgId = iEnv->RootWin().WindowGroupId(); - TInt focusWgId = iEnv->WsSession().GetFocusWindowGroup(); - return rootWgId == focusWgId; - } - else - { - return ETrue; - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::AllowedToPublish -// ----------------------------------------------------------------------------- -// -TBool CHgContextUtilityImpl::AllowedToPublish() - { - TBool result = !iEnv || iAllowPublishFromBackground || IsForeground(); - RDebug::Printf( "[hgctxutil] AllowedToPublish = %d", result ); - return result; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::AllowPublishFromBackground -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::AllowPublishFromBackground( TBool aAllow ) - { - iAllowPublishFromBackground = aAllow; - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::AddMusicContextInfoL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::AddMusicContextInfoL( - const TDesC& aKey, const TDesC& aData ) - { - // Key needs to be provided and also it shouldn't exist in the table. - // Latter case is simple safe measure, as RPtrHasMap won't delete existing - // objects in InsertL, so adding same key twice would cause memory leak. - // The use case of adding same key twice is not 'real world' case, so - // this method can simply leave, when same key is offered again. - __ASSERT_ALWAYS( aKey.Length(), User::Leave( KErrNotFound ) ); - __ASSERT_ALWAYS( - !iMusicContextInfo.Find( aKey ), User::Leave( KErrAlreadyExists ) ); - - // Hash table needs pointers and it should own the pointers, so allocate - // key and data, and add them to table. In case the data is empty, add - // unknown information, since some data needs to be in the action field. - HBufC* key = aKey.AllocLC(); - HBufC* data = aData.Length() ? - aData.AllocLC() : KHgCFValueUnknownInfo().AllocLC(); - iMusicContextInfo.InsertL( key, data ); - CleanupStack::Pop( 2, key ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishMusicContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishMusicContextL( - const TTimeIntervalMicroSeconds32& aDelay ) - { - // If nothing has been done, just leave. No point of publishing entirely - // empty music context. - __ASSERT_ALWAYS( iMusicContextInfo.Count(), User::Leave( KErrNotReady ) ); - - // Before publishing anything, make sure all keys contain at least some - // data. - VerifyAndPublishMusicContextL( KHgCFTypeMusicState, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicArtist, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicTitle, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbum, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbumArt, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicUri, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicGenre, aDelay ); - VerifyAndPublishMusicContextL( KHgCFTypeMusicType, aDelay ); - - // Clear all data from hash table, so new music context can be published. - iMusicContextInfo.ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::VerifyAndPublishMusicContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::VerifyAndPublishMusicContextL( - const TDesC& aKey, - const TTimeIntervalMicroSeconds32& aDelay ) - { - TDesC* data = iMusicContextInfo.Find( aKey ); - if ( !data ) - { - // Key didn't contain any data, just create the key with empty info. - AddMusicContextInfoL( aKey, KNullDesC ); - data = iMusicContextInfo.Find( aKey ); - } - - PublishContextL( aKey, *data, aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishContextL( - const TDesC & aContextType, - const TDesC & aContextData, - const TTimeIntervalMicroSeconds32& aDelay ) - { - if ( !aDelay.Int() ) - { - PublishContextL( aContextType, aContextData ); - } - else - { - PublishContextDelayedL( aContextType, aContextData, aDelay ); - } - } - -// ----------------------------------------------------------------------------- -// CHgContextUtilityImpl::PublishRadioContextL -// ----------------------------------------------------------------------------- -// -void CHgContextUtilityImpl::PublishRadioContextL( - const TDesC& aRadioName, - const TDesC& aRadioUrl, - const TDesC& aRadioFrequency, - const TDesC& aRadioRDSPI ) - { - TPtrC radioName( aRadioName.Length() ? aRadioName - : KHgCFValueUnknownInfo ); - TPtrC radioUrl( aRadioUrl.Length() ? aRadioUrl - : KHgCFValueUnknownInfo ); - TPtrC radioFrequency( aRadioFrequency.Length() ? aRadioFrequency - : KHgCFValueUnknownInfo ); - TPtrC radioRDSPI( aRadioRDSPI.Length() ? aRadioRDSPI - : KHgCFValueUnknownInfo ); - - PublishContextL( KHgCFTypeMusicRadioRDSPI, radioRDSPI ); - PublishContextL( KHgCFTypeMusicRadioFrequency, radioFrequency ); - PublishContextL( KHgCFTypeMusicRadioUrl, radioUrl ); - PublishContextL( KHgCFTypeMusicRadioName, radioName ); - } - -// end of file diff -r 2f40063dfb5c -r dbbebe55c824 group/bld.inf --- a/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -27,7 +27,6 @@ #include "../backsteppingsrv/group/bld.inf" #include "../contentpublishingsrv/group/bld.inf" #include "../homescreensrv_plat/group/bld.inf" -#include "../contextutility/group/bld.inf" #include "../contentcontrolsrv/group/bld.inf" diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/conf/hsps.confml Binary file homescreenpluginsrv/conf/hsps.confml has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/conf/hsps_200159c9.crml Binary file homescreenpluginsrv/conf/hsps_200159c9.crml has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/homescreen_settings_api/bwins/hspluginsettings.def --- a/homescreenpluginsrv/homescreen_settings_api/bwins/hspluginsettings.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/homescreen_settings_api/bwins/hspluginsettings.def Wed May 12 13:36:47 2010 +0300 @@ -3,10 +3,10 @@ ?NewLC@CPluginMap@HSPluginSettingsIf@@SAPAV12@XZ @ 2 NONAME ; class HSPluginSettingsIf::CPluginMap * HSPluginSettingsIf::CPluginMap::NewLC(void) ?SetPluginUidL@CPluginMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 3 NONAME ; class HSPluginSettingsIf::CPluginMap & HSPluginSettingsIf::CPluginMap::SetPluginUidL(class TDesC8 const &) ?NewL@CItemMap@HSPluginSettingsIf@@SAPAV12@XZ @ 4 NONAME ; class HSPluginSettingsIf::CItemMap * HSPluginSettingsIf::CItemMap::NewL(void) - ?NewLC@CHomescreenSettings@HSPluginSettingsIf@@SAPAV12@ABVTDesC8@@0PAVMHomeScreenSettingsObserver@2@@Z @ 5 NONAME ; class HSPluginSettingsIf::CHomescreenSettings * HSPluginSettingsIf::CHomescreenSettings::NewLC(class TDesC8 const &, class TDesC8 const &, class HSPluginSettingsIf::MHomeScreenSettingsObserver *) - ?Name@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 6 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Name(void) const - ??1CItemMap@HSPluginSettingsIf@@UAE@XZ @ 7 NONAME ; HSPluginSettingsIf::CItemMap::~CItemMap(void) - ?NewLC@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 8 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewLC(void) + ?Name@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 5 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Name(void) const + ??1CItemMap@HSPluginSettingsIf@@UAE@XZ @ 6 NONAME ; HSPluginSettingsIf::CItemMap::~CItemMap(void) + ?NewLC@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 7 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewLC(void) + ?InitializeL@CHomescreenSettings@HSPluginSettingsIf@@SAXABVTDesC8@@@Z @ 8 NONAME ; void HSPluginSettingsIf::CHomescreenSettings::InitializeL(class TDesC8 const &) ?AddObjectMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCObjectMap@2@@Z @ 9 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddObjectMapL(class HSPluginSettingsIf::CObjectMap *) ?Value@CPropertyMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 10 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPropertyMap::Value(void) const ?PluginInfo@CHspsConfiguration@HSPluginSettingsIf@@QAEAAVCPluginInfo@2@XZ @ 11 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CHspsConfiguration::PluginInfo(void) @@ -22,43 +22,45 @@ ?PluginUid@CPluginMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 21 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginMap::PluginUid(void) const ?PluginId@CPluginMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 22 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginMap::PluginId(void) const ?SetMediaTypeL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 23 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetMediaTypeL(class TDesC8 const &) - ?NewL@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 24 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewL(void) - ?GetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@AAV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@@Z @ 25 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::GetSettingsL(class TDesC8 const &, class RPointerArray &) - ?NewLC@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 26 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewLC(void) - ?NameL@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 27 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::NameL(void) const - ?SetItemNameL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 28 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemNameL(class TDesC8 const &) - ?SetUidL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 29 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetUidL(class TDesC8 const &) - ?Properties@CItemMap@HSPluginSettingsIf@@QBEAAV?$RPointerArray@VCPropertyMap@HSPluginSettingsIf@@@@XZ @ 30 NONAME ; class RPointerArray & HSPluginSettingsIf::CItemMap::Properties(void) const - ?NewL@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 31 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewL(void) - ?Type@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 32 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Type(void) const - ??1CPluginMap@HSPluginSettingsIf@@UAE@XZ @ 33 NONAME ; HSPluginSettingsIf::CPluginMap::~CPluginMap(void) + ?Instance@CHomescreenSettings@HSPluginSettingsIf@@SAPAV12@XZ @ 24 NONAME ; class HSPluginSettingsIf::CHomescreenSettings * HSPluginSettingsIf::CHomescreenSettings::Instance(void) + ?NewL@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 25 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewL(void) + ?GetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@AAV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@@Z @ 26 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::GetSettingsL(class TDesC8 const &, class RPointerArray &) + ?NewLC@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 27 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewLC(void) + ?NameL@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 28 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::NameL(void) const + ?SetItemNameL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 29 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemNameL(class TDesC8 const &) + ?SetUidL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 30 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetUidL(class TDesC8 const &) + ?Properties@CItemMap@HSPluginSettingsIf@@QBEAAV?$RPointerArray@VCPropertyMap@HSPluginSettingsIf@@@@XZ @ 31 NONAME ; class RPointerArray & HSPluginSettingsIf::CItemMap::Properties(void) const + ?NewL@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 32 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewL(void) + ?Type@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 33 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Type(void) const ?MediaType@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 34 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::MediaType(void) const - ?SetPluginIdL@CPluginMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 35 NONAME ; class HSPluginSettingsIf::CPluginMap & HSPluginSettingsIf::CPluginMap::SetPluginIdL(class TDesC8 const &) - ?Resources@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCObjectMap@HSPluginSettingsIf@@@@XZ @ 36 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::Resources(void) - ?Path@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 37 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::Path(void) const - ?SetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@H@Z @ 38 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::SetSettingsL(class TDesC8 const &, class RPointerArray const &, int) - ?Name@CPropertyMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 39 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPropertyMap::Name(void) const - ?NewL@CObjectMap@HSPluginSettingsIf@@SAPAV12@XZ @ 40 NONAME ; class HSPluginSettingsIf::CObjectMap * HSPluginSettingsIf::CObjectMap::NewL(void) - ?NewL@CPluginMap@HSPluginSettingsIf@@SAPAV12@XZ @ 41 NONAME ; class HSPluginSettingsIf::CPluginMap * HSPluginSettingsIf::CPluginMap::NewL(void) - ?SetPathL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 42 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetPathL(class TDesC8 const &) - ?PluginMaps@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCPluginMap@HSPluginSettingsIf@@@@XZ @ 43 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::PluginMaps(void) - ?NewL@CHomescreenSettings@HSPluginSettingsIf@@SAPAV12@ABVTDesC8@@0PAVMHomeScreenSettingsObserver@2@@Z @ 44 NONAME ; class HSPluginSettingsIf::CHomescreenSettings * HSPluginSettingsIf::CHomescreenSettings::NewL(class TDesC8 const &, class TDesC8 const &, class HSPluginSettingsIf::MHomeScreenSettingsObserver *) + ??1CPluginMap@HSPluginSettingsIf@@UAE@XZ @ 35 NONAME ; HSPluginSettingsIf::CPluginMap::~CPluginMap(void) + ?SetPluginIdL@CPluginMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 36 NONAME ; class HSPluginSettingsIf::CPluginMap & HSPluginSettingsIf::CPluginMap::SetPluginIdL(class TDesC8 const &) + ?Resources@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCObjectMap@HSPluginSettingsIf@@@@XZ @ 37 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::Resources(void) + ?Path@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 38 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::Path(void) const + ?SetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@H@Z @ 39 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::SetSettingsL(class TDesC8 const &, class RPointerArray const &, int) + ?Name@CPropertyMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPropertyMap::Name(void) const + ?NewL@CObjectMap@HSPluginSettingsIf@@SAPAV12@XZ @ 41 NONAME ; class HSPluginSettingsIf::CObjectMap * HSPluginSettingsIf::CObjectMap::NewL(void) + ?NewL@CPluginMap@HSPluginSettingsIf@@SAPAV12@XZ @ 42 NONAME ; class HSPluginSettingsIf::CPluginMap * HSPluginSettingsIf::CPluginMap::NewL(void) + ?SetPathL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 43 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetPathL(class TDesC8 const &) + ?PluginMaps@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCPluginMap@HSPluginSettingsIf@@@@XZ @ 44 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::PluginMaps(void) ??1CPropertyMap@HSPluginSettingsIf@@UAE@XZ @ 45 NONAME ; HSPluginSettingsIf::CPropertyMap::~CPropertyMap(void) ?SetInterfaceL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 46 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetInterfaceL(class TDesC8 const &) ?ConfId@CHspsConfiguration@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 47 NONAME ; class TDesC8 const & HSPluginSettingsIf::CHspsConfiguration::ConfId(void) const ?Uid@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 48 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Uid(void) const - ?SetValueL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 49 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetValueL(class TDesC8 const &) - ?Interface@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 50 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Interface(void) const - ?SetTypeL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 51 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetTypeL(class TDesC8 const &) - ??1CHomescreenSettings@HSPluginSettingsIf@@UAE@XZ @ 52 NONAME ; HSPluginSettingsIf::CHomescreenSettings::~CHomescreenSettings(void) - ?SetNameL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetNameL(class TDesC8 const &) - ?NewL@CPluginInfo@HSPluginSettingsIf@@SAPAV12@XZ @ 54 NONAME ; class HSPluginSettingsIf::CPluginInfo * HSPluginSettingsIf::CPluginInfo::NewL(void) - ?SetItemIdL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 55 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemIdL(class TDesC8 const &) - ?NewLC@CItemMap@HSPluginSettingsIf@@SAPAV12@XZ @ 56 NONAME ; class HSPluginSettingsIf::CItemMap * HSPluginSettingsIf::CItemMap::NewLC(void) - ?AddItemMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCItemMap@2@@Z @ 57 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddItemMapL(class HSPluginSettingsIf::CItemMap *) - ??1CHspsConfiguration@HSPluginSettingsIf@@UAE@XZ @ 58 NONAME ; HSPluginSettingsIf::CHspsConfiguration::~CHspsConfiguration(void) - ?SetConfIdL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 59 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::SetConfIdL(class TDesC8 const &) - ?SetNameL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 60 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetNameL(class TDesC8 const &) - ?SetNameL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 61 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetNameL(class TDesC8 const &) - ??1CObjectMap@HSPluginSettingsIf@@UAE@XZ @ 62 NONAME ; HSPluginSettingsIf::CObjectMap::~CObjectMap(void) + ?AddObserverL@CHomescreenSettings@HSPluginSettingsIf@@QAEXPAVMHomeScreenSettingsObserver@2@@Z @ 49 NONAME ; void HSPluginSettingsIf::CHomescreenSettings::AddObserverL(class HSPluginSettingsIf::MHomeScreenSettingsObserver *) + ?UnInitialize@CHomescreenSettings@HSPluginSettingsIf@@SAXXZ @ 50 NONAME ; void HSPluginSettingsIf::CHomescreenSettings::UnInitialize(void) + ?SetValueL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 51 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetValueL(class TDesC8 const &) + ?Interface@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 52 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Interface(void) const + ?SetTypeL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetTypeL(class TDesC8 const &) + ?SetNameL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 54 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetNameL(class TDesC8 const &) + ?NewL@CPluginInfo@HSPluginSettingsIf@@SAPAV12@XZ @ 55 NONAME ; class HSPluginSettingsIf::CPluginInfo * HSPluginSettingsIf::CPluginInfo::NewL(void) + ?SetItemIdL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 56 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemIdL(class TDesC8 const &) + ?NewLC@CItemMap@HSPluginSettingsIf@@SAPAV12@XZ @ 57 NONAME ; class HSPluginSettingsIf::CItemMap * HSPluginSettingsIf::CItemMap::NewLC(void) + ?AddItemMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCItemMap@2@@Z @ 58 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddItemMapL(class HSPluginSettingsIf::CItemMap *) + ??1CHspsConfiguration@HSPluginSettingsIf@@UAE@XZ @ 59 NONAME ; HSPluginSettingsIf::CHspsConfiguration::~CHspsConfiguration(void) + ?RemoveObserver@CHomescreenSettings@HSPluginSettingsIf@@QAEXPAVMHomeScreenSettingsObserver@2@@Z @ 60 NONAME ; void HSPluginSettingsIf::CHomescreenSettings::RemoveObserver(class HSPluginSettingsIf::MHomeScreenSettingsObserver *) + ?SetConfIdL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 61 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::SetConfIdL(class TDesC8 const &) + ?SetNameL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 62 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetNameL(class TDesC8 const &) + ?SetNameL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 63 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetNameL(class TDesC8 const &) + ??1CObjectMap@HSPluginSettingsIf@@UAE@XZ @ 64 NONAME ; HSPluginSettingsIf::CObjectMap::~CObjectMap(void) diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/homescreen_settings_api/eabi/hspluginsettings.def --- a/homescreenpluginsrv/homescreen_settings_api/eabi/hspluginsettings.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/homescreen_settings_api/eabi/hspluginsettings.def Wed May 12 13:36:47 2010 +0300 @@ -44,13 +44,13 @@ _ZN18HSPluginSettingsIf18CHspsConfigurationD0Ev @ 43 NONAME _ZN18HSPluginSettingsIf18CHspsConfigurationD1Ev @ 44 NONAME _ZN18HSPluginSettingsIf18CHspsConfigurationD2Ev @ 45 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 46 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 47 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettings4NewLERK6TDesC8S3_PNS_27MHomeScreenSettingsObserverE @ 48 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettings5NewLCERK6TDesC8S3_PNS_27MHomeScreenSettingsObserverE @ 49 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettingsD0Ev @ 50 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettingsD1Ev @ 51 NONAME - _ZN18HSPluginSettingsIf19CHomescreenSettingsD2Ev @ 52 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings11InitializeLERK6TDesC8 @ 46 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12AddObserverLEPNS_27MHomeScreenSettingsObserverE @ 47 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 48 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 49 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12UnInitializeEv @ 50 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings14RemoveObserverEPNS_27MHomeScreenSettingsObserverE @ 51 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings8InstanceEv @ 52 NONAME _ZN18HSPluginSettingsIf8CItemMap10SetItemIdLERK6TDesC8 @ 53 NONAME _ZN18HSPluginSettingsIf8CItemMap12SetItemNameLERK6TDesC8 @ 54 NONAME _ZN18HSPluginSettingsIf8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 55 NONAME @@ -80,15 +80,13 @@ _ZTIN18HSPluginSettingsIf11CPluginInfoE @ 79 NONAME _ZTIN18HSPluginSettingsIf12CPropertyMapE @ 80 NONAME _ZTIN18HSPluginSettingsIf18CHspsConfigurationE @ 81 NONAME - _ZTIN18HSPluginSettingsIf19CHomescreenSettingsE @ 82 NONAME - _ZTIN18HSPluginSettingsIf8CItemMapE @ 83 NONAME - _ZTVN18HSPluginSettingsIf10CObjectMapE @ 84 NONAME - _ZTVN18HSPluginSettingsIf10CPluginMapE @ 85 NONAME - _ZTVN18HSPluginSettingsIf11CPluginInfoE @ 86 NONAME - _ZTVN18HSPluginSettingsIf12CPropertyMapE @ 87 NONAME - _ZTVN18HSPluginSettingsIf18CHspsConfigurationE @ 88 NONAME - _ZTVN18HSPluginSettingsIf19CHomescreenSettingsE @ 89 NONAME - _ZTVN18HSPluginSettingsIf8CItemMapE @ 90 NONAME - _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 91 NONAME - _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 92 NONAME + _ZTIN18HSPluginSettingsIf8CItemMapE @ 82 NONAME + _ZTVN18HSPluginSettingsIf10CObjectMapE @ 83 NONAME + _ZTVN18HSPluginSettingsIf10CPluginMapE @ 84 NONAME + _ZTVN18HSPluginSettingsIf11CPluginInfoE @ 85 NONAME + _ZTVN18HSPluginSettingsIf12CPropertyMapE @ 86 NONAME + _ZTVN18HSPluginSettingsIf18CHspsConfigurationE @ 87 NONAME + _ZTVN18HSPluginSettingsIf8CItemMapE @ 88 NONAME + _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 89 NONAME + _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 90 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/homescreen_settings_api/src/hspluginsettings.cpp --- a/homescreenpluginsrv/homescreen_settings_api/src/hspluginsettings.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/homescreen_settings_api/src/hspluginsettings.cpp Wed May 12 13:36:47 2010 +0300 @@ -23,19 +23,14 @@ #include #include "hspsconfiguration.h" -//#include "pluginmap.h" #include "itemmap.h" #include "propertymap.h" -//#include "objectmap.h" -//#include "plugininfo.h" #include #include _LIT8( KHSPS, "Service.HSPS" ); _LIT8( KHSPSConfigurationIf, "IConfiguration" ); - - _LIT8( KHSPSCommandGetPluginConf, "GetPluginConf" ); _LIT8( KHSPSSetPluginSettings, "SetPluginSettings" ); _LIT8( KPluginConfKey, "pluginConf" ); @@ -46,7 +41,6 @@ _LIT8( KKeyStoringParams, "storingParams" ); - _LIT8( KKeyStorePluginRefence, "storePluginConf" ); _LIT8( KKeyStoreAppConf, "storeAppConf" ); @@ -58,17 +52,115 @@ _LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KSettingsChanged, "PluginSettingsChanged" ); -_LIT8( KSettingsChanged, "PluginSettingsChanged" ); namespace HSPluginSettingsIf{ +NONSHARABLE_CLASS( CTlsEntry ): public CBase + { +public: + /** + * Instance to home screen settings. + */ + CHomescreenSettings* iInstance; + + /** + * Reference count. + */ + TInt iRefCount; + }; +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHomescreenSettings* CHomescreenSettings::Instance() + { + CHomescreenSettings* instance = NULL; + + CTlsEntry* entry = static_cast( Dll::Tls() ); + if( entry ) + { + instance = entry->iInstance; + } + + return instance; + } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -CHomescreenSettings::CHomescreenSettings(MHomeScreenSettingsObserver* aObserver, const TDesC8& aPluginId ) - : iObserver( aObserver ), iPluginId( aPluginId ) +EXPORT_C void CHomescreenSettings::InitializeL( const TDesC8& aAppUid ) + { + CTlsEntry* entry = static_cast( Dll::Tls() ); + + if( !entry ) + { + entry = new (ELeave) CTlsEntry(); + entry->iInstance = NULL; + entry->iRefCount = 1; + + CleanupStack::PushL( entry ); + entry->iInstance = CHomescreenSettings::NewL( aAppUid ); + CleanupStack::Pop( entry ); + + Dll::SetTls( entry ); + } + else + { + entry->iRefCount++; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CHomescreenSettings::UnInitialize() + { + CTlsEntry* entry = static_cast( Dll::Tls() ); + + if( !entry ) + { + return; + } + + entry->iRefCount--; + + if( entry->iRefCount == 0 ) + { + delete entry->iInstance; + entry->iInstance = NULL; + delete entry; + Dll::SetTls( NULL ); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CHomescreenSettings::AddObserverL( MHomeScreenSettingsObserver* aObserver ) + { + if( iObservers.Find( aObserver ) == KErrNotFound ) + { + iObservers.AppendL( aObserver ); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C void CHomescreenSettings::RemoveObserver( MHomeScreenSettingsObserver* aObserver ) + { + const TInt index = iObservers.Find( aObserver ); + if( index != KErrNotFound ) + { + iObservers.Remove( index ); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CHomescreenSettings::CHomescreenSettings() { } @@ -118,48 +210,42 @@ inParamList.Reset(); outParamList.Reset(); - if( iObserver ) - { - iTransactionId = -1; - iHspsInterface->ExecuteCmdL( KRequestNotification, - inParamList, - outParamList, - KLiwOptASyncronous, - this ); - const TLiwGenericParam* outParam( NULL ); - - TInt pos( 0 ); - outParam = outParamList.FindFirst( pos, _L8("status") ); - - if ( outParam ) - { - TInt retval; - retval = outParam->Value().AsTInt32(); - if(retval == KErrNone ) - { - pos = 0; - outParam = outParamList.FindFirst( pos, _L8("TransactionID") ); - if( outParam ) - { - retval = outParam->Value().AsTInt32(); - iTransactionId = retval; - } - } - - } - + iTransactionId = -1; + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptASyncronous, + this ); + + const TLiwGenericParam* outParam( NULL ); + + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("status") ); + + if( outParam ) + { + TInt retval; + retval = outParam->Value().AsTInt32(); + if( retval == KErrNone ) + { + pos = 0; + outParam = outParamList.FindFirst( pos, _L8( "TransactionID" ) ); + if( outParam ) + { + retval = outParam->Value().AsTInt32(); + iTransactionId = retval; + } + } } } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C CHomescreenSettings* CHomescreenSettings::NewL( - const TDesC8& aAppUid, - const TDesC8& aPluginId, - MHomeScreenSettingsObserver* aObserver) +CHomescreenSettings* CHomescreenSettings::NewL( + const TDesC8& aAppUid ) { - CHomescreenSettings* self = CHomescreenSettings::NewLC(aAppUid, aPluginId, aObserver); + CHomescreenSettings* self = CHomescreenSettings::NewLC( aAppUid ); CleanupStack::Pop( self ); return self; } @@ -167,22 +253,23 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C CHomescreenSettings* CHomescreenSettings::NewLC( - const TDesC8& aAppUid, - const TDesC8& aPluginId, - MHomeScreenSettingsObserver* aObserver) - { - CHomescreenSettings* self = new( ELeave ) CHomescreenSettings( aObserver, aPluginId ); +CHomescreenSettings* CHomescreenSettings::NewLC( + const TDesC8& aAppUid ) + { + CHomescreenSettings* self = new( ELeave ) CHomescreenSettings(); CleanupStack::PushL( self ); - self->ConstructL(aAppUid); + self->ConstructL( aAppUid ); + return self; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -EXPORT_C CHomescreenSettings::~CHomescreenSettings() +CHomescreenSettings::~CHomescreenSettings() { + iObservers.Reset(); + if( iHspsInterface ) { // Close interface @@ -202,10 +289,6 @@ delete iServiceHandler; } - - - - // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // @@ -529,7 +612,7 @@ { TInt retval( KErrNone ); - if( iObserver && iTransactionId == aCmdId ) + if( iTransactionId == aCmdId && iObservers.Count() > 0 ) { const TLiwGenericParam* outParam( NULL ); @@ -566,16 +649,16 @@ variant = outParam->Value(); const CLiwMap* notifMap( variant.AsMap() ); - + if ( notifMap->FindL( _L8("event"), variant ) ) { event = variant.AsData().AllocLC(); pushCount++; } - + variant.Reset(); - if ( event->Des().Compare( KSettingsChanged ) == 0 ) + if ( event && event->Des().Compare( KSettingsChanged ) == 0 ) { if( notifMap->FindL( _L8("name"), variant ) ) { @@ -610,20 +693,19 @@ HBufC8* pluginId( NULL ); pluginId = variant.AsData().AllocLC(); - if( pluginId->Des().Compare(iPluginId)== 0 ) + for( TInt i = 0; i < iObservers.Count(); i++ ) { - retval = iObserver->SettingsChangedL( + iObservers[i]->SettingsChangedL( ( event ) ? *event : KNullDesC8(), ( pluginName ) ? *pluginName : KNullDesC8(), ( pluginUid ) ? *pluginUid : KNullDesC8(), - ( pluginId ) ? * pluginId : KNullDesC8() ); - } + ( pluginId ) ? *pluginId : KNullDesC8() ); + } + CleanupStack::PopAndDestroy( pluginId ); - variant.Reset(); - - } - + variant.Reset(); + } } } @@ -679,11 +761,10 @@ } } - } - + } return retval; - } + } } //End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/bwins/hspsdomdocumentu.def --- a/homescreenpluginsrv/hspsdom/bwins/hspsdomdocumentu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/bwins/hspsdomdocumentu.def Wed May 12 13:36:47 2010 +0300 @@ -1,74 +1,75 @@ EXPORTS - ??1ChspsDomAttribute@@UAE@XZ @ 1 NONAME ; ChspsDomAttribute::~ChspsDomAttribute(void) - ??1ChspsDomDepthIterator@@UAE@XZ @ 2 NONAME ; ChspsDomDepthIterator::~ChspsDomDepthIterator(void) - ??1ChspsDomDocument@@UAE@XZ @ 3 NONAME ; ChspsDomDocument::~ChspsDomDocument(void) - ?AddChildL@ChspsDomNode@@QAEXPAV1@@Z @ 4 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *) - ?AddChildL@ChspsDomNode@@QAEXPAV1@H@Z @ 5 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *, int) - ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 6 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *) - ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@H@Z @ 7 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *, int) - ?AddStringL@ChspsDomStringPool@@QAEHABVTDesC8@@@Z @ 8 NONAME ; int ChspsDomStringPool::AddStringL(class TDesC8 const &) - ?AppendPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 9 NONAME ; void ChspsDomNode::AppendPCDataL(class TDesC8 const &) - ?AttributeList@ChspsDomNode@@QBEAAVChspsDomList@@XZ @ 10 NONAME ; class ChspsDomList & ChspsDomNode::AttributeList(void) const - ?AttributeValue@ChspsDomNode@@QBEABVTDesC8@@ABV2@@Z @ 11 NONAME ; class TDesC8 const & ChspsDomNode::AttributeValue(class TDesC8 const &) const - ?ChildNodes@ChspsDomNode@@QAEAAVChspsDomList@@XZ @ 12 NONAME ; class ChspsDomList & ChspsDomNode::ChildNodes(void) - ?CloneL@ChspsDomAttribute@@QAEPAV1@XZ @ 13 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::CloneL(void) - ?CloneL@ChspsDomDocument@@QAEPAV1@XZ @ 14 NONAME ; class ChspsDomDocument * ChspsDomDocument::CloneL(void) - ?CloneL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@@Z @ 15 NONAME ; class ChspsDomNode * ChspsDomNode::CloneL(class ChspsDomStringPool &) - ?CloneWithoutKidsL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@@Z @ 16 NONAME ; class ChspsDomNode * ChspsDomNode::CloneWithoutKidsL(class ChspsDomStringPool &) - ?ContentType@ChspsDomNode@@QAEABW4TContentType@@XZ @ 17 NONAME ; enum TContentType const & ChspsDomNode::ContentType(void) - ?CreateElementNSL@ChspsDomDocument@@QAEPAVChspsDomNode@@ABVTDesC8@@0@Z @ 18 NONAME ; class ChspsDomNode * ChspsDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) - ?CreateRefNodeL@ChspsDomNode@@QAEPAV1@XZ @ 19 NONAME ; class ChspsDomNode * ChspsDomNode::CreateRefNodeL(void) - ?DeleteAttributeList@ChspsDomNode@@QAEXXZ @ 20 NONAME ; void ChspsDomNode::DeleteAttributeList(void) - ?DeleteChild@ChspsDomNode@@QAEXPAV1@@Z @ 21 NONAME ; void ChspsDomNode::DeleteChild(class ChspsDomNode *) - ?DeleteItem@ChspsDomList@@QAEXH@Z @ 22 NONAME ; void ChspsDomList::DeleteItem(int) - ?DeleteItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 23 NONAME ; void ChspsDomList::DeleteItem(class MhspsDomListItem *) - ?DescendantCount@ChspsDomNode@@QBEHXZ @ 24 NONAME ; int ChspsDomNode::DescendantCount(void) const - ?DomNodeCount@ChspsDomDocument@@QBEHXZ @ 25 NONAME ; int ChspsDomDocument::DomNodeCount(void) const - ?ExternalizeL@ChspsDomDocument@@QBEXAAVRWriteStream@@@Z @ 26 NONAME ; void ChspsDomDocument::ExternalizeL(class RWriteStream &) const - ?FindByName@ChspsDomList@@QAEPAVMhspsDomListItem@@ABVTDesC8@@@Z @ 27 NONAME ; class MhspsDomListItem * ChspsDomList::FindByName(class TDesC8 const &) - ?First@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 28 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::First(void) - ?First@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 29 NONAME ; class MhspsDomListItem * ChspsDomList::First(void) - ?InternalizeL@ChspsDomDocument@@QAEXAAVRReadStream@@@Z @ 30 NONAME ; void ChspsDomDocument::InternalizeL(class RReadStream &) - ?IsRefNode@ChspsDomNode@@QBEHXZ @ 31 NONAME ; int ChspsDomNode::IsRefNode(void) const - ?Item@ChspsDomList@@QBEPAVMhspsDomListItem@@H@Z @ 32 NONAME ; class MhspsDomListItem * ChspsDomList::Item(int) const - ?ItemIndex@ChspsDomList@@QBEHABVMhspsDomListItem@@@Z @ 33 NONAME ; int ChspsDomList::ItemIndex(class MhspsDomListItem const &) const - ?ItemIndex@ChspsDomNode@@QBEHABVMhspsDomListItem@@@Z @ 34 NONAME ; int ChspsDomNode::ItemIndex(class MhspsDomListItem const &) const - ?Last@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 35 NONAME ; class MhspsDomListItem * ChspsDomList::Last(void) - ?LastNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 36 NONAME ; class ChspsDomNode * ChspsDomDocument::LastNode(void) const - ?LayoutNode@ChspsDomNode@@QAEPAVChspsNode@@XZ @ 37 NONAME ; class ChspsNode * ChspsDomNode::LayoutNode(void) - ?Length@ChspsDomList@@QBEHXZ @ 38 NONAME ; int ChspsDomList::Length(void) const - ?MarshallL@ChspsDomDocument@@QAEPAVHBufC8@@XZ @ 39 NONAME ; class HBufC8 * ChspsDomDocument::MarshallL(void) - ?Name@ChspsDomAttribute@@UAEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & ChspsDomAttribute::Name(void) - ?Name@ChspsDomNode@@UAEABVTDesC8@@XZ @ 41 NONAME ; class TDesC8 const & ChspsDomNode::Name(void) - ?NameStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 42 NONAME ; short ChspsDomAttribute::NameStringPoolIndex(void) const - ?Namespace@ChspsDomNode@@QAEABVTDesC8@@XZ @ 43 NONAME ; class TDesC8 const & ChspsDomNode::Namespace(void) - ?NewL@ChspsDomAttribute@@SAPAV1@ABVTDesC8@@AAVChspsDomStringPool@@@Z @ 44 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::NewL(class TDesC8 const &, class ChspsDomStringPool &) - ?NewL@ChspsDomDepthIterator@@SAPAV1@AAVChspsDomNode@@@Z @ 45 NONAME ; class ChspsDomDepthIterator * ChspsDomDepthIterator::NewL(class ChspsDomNode &) - ?NewL@ChspsDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 46 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class RReadStream &) - ?NewL@ChspsDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 47 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class HBufC8 const *) - ?NewL@ChspsDomDocument@@SAPAV1@XZ @ 48 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(void) - ?NextL@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 49 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextL(void) - ?NextSibling@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@AAV2@@Z @ 50 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextSibling(class ChspsDomNode &) - ?NodeId@ChspsDomNode@@QBEHXZ @ 51 NONAME ; int ChspsDomNode::NodeId(void) const - ?PCData@ChspsDomNode@@QAEABVTDesC8@@XZ @ 52 NONAME ; class TDesC8 const & ChspsDomNode::PCData(void) - ?Parent@ChspsDomNode@@QBEPAV1@XZ @ 53 NONAME ; class ChspsDomNode * ChspsDomNode::Parent(void) const - ?RemoveItem@ChspsDomList@@QAEXH@Z @ 54 NONAME ; void ChspsDomList::RemoveItem(int) - ?RemoveItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 55 NONAME ; void ChspsDomList::RemoveItem(class MhspsDomListItem *) - ?ReplaceChildL@ChspsDomNode@@QAEXPAV1@0@Z @ 56 NONAME ; void ChspsDomNode::ReplaceChildL(class ChspsDomNode *, class ChspsDomNode *) - ?Reset@ChspsDomList@@QAEXXZ @ 57 NONAME ; void ChspsDomList::Reset(void) - ?RootNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 58 NONAME ; class ChspsDomNode * ChspsDomDocument::RootNode(void) const - ?SetContentType@ChspsDomNode@@QAEXABW4TContentType@@@Z @ 59 NONAME ; void ChspsDomNode::SetContentType(enum TContentType const &) - ?SetLayoutNode@ChspsDomNode@@QAEXPAVChspsNode@@@Z @ 60 NONAME ; void ChspsDomNode::SetLayoutNode(class ChspsNode *) - ?SetNodeId@ChspsDomNode@@QAEXH@Z @ 61 NONAME ; void ChspsDomNode::SetNodeId(int) - ?SetPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 62 NONAME ; void ChspsDomNode::SetPCDataL(class TDesC8 const &) - ?SetParent@ChspsDomNode@@QAEXPAV1@@Z @ 63 NONAME ; void ChspsDomNode::SetParent(class ChspsDomNode *) - ?SetRefNode@ChspsDomNode@@QAEXH@Z @ 64 NONAME ; void ChspsDomNode::SetRefNode(int) - ?SetRootNode@ChspsDomDocument@@QAEXPAVChspsDomNode@@@Z @ 65 NONAME ; void ChspsDomDocument::SetRootNode(class ChspsDomNode *) - ?SetValueL@ChspsDomAttribute@@QAEXABVTDesC8@@@Z @ 66 NONAME ; void ChspsDomAttribute::SetValueL(class TDesC8 const &) - ?Size@ChspsDomDocument@@QBEHXZ @ 67 NONAME ; int ChspsDomDocument::Size(void) const - ?StringPool@ChspsDomDocument@@QBEAAVChspsDomStringPool@@XZ @ 68 NONAME ; class ChspsDomStringPool & ChspsDomDocument::StringPool(void) const - ?StringPool@ChspsDomList@@QBEAAVChspsDomStringPool@@XZ @ 69 NONAME ; class ChspsDomStringPool & ChspsDomList::StringPool(void) const - ?StringPool@ChspsDomNode@@QBEAAVChspsDomStringPool@@XZ @ 70 NONAME ; class ChspsDomStringPool & ChspsDomNode::StringPool(void) const - ?Value@ChspsDomAttribute@@QAEABVTDesC8@@XZ @ 71 NONAME ; class TDesC8 const & ChspsDomAttribute::Value(void) - ?ValueStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 72 NONAME ; short ChspsDomAttribute::ValueStringPoolIndex(void) const + ?MarshallL@ChspsDomDocument@@QAEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * ChspsDomDocument::MarshallL(void) + ?NewL@ChspsDomDepthIterator@@SAPAV1@AAVChspsDomNode@@@Z @ 2 NONAME ; class ChspsDomDepthIterator * ChspsDomDepthIterator::NewL(class ChspsDomNode &) + ?RemoveItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 3 NONAME ; void ChspsDomList::RemoveItem(class MhspsDomListItem *) + ?LayoutNode@ChspsDomNode@@QAEPAVChspsNode@@XZ @ 4 NONAME ; class ChspsNode * ChspsDomNode::LayoutNode(void) + ?First@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 5 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::First(void) + ?Length@ChspsDomList@@QBEHXZ @ 6 NONAME ; int ChspsDomList::Length(void) const + ?ExternalizeL@ChspsDomDocument@@QBEXAAVRWriteStream@@@Z @ 7 NONAME ; void ChspsDomDocument::ExternalizeL(class RWriteStream &) const + ?SetLayoutNode@ChspsDomNode@@QAEXPAVChspsNode@@@Z @ 8 NONAME ; void ChspsDomNode::SetLayoutNode(class ChspsNode *) + ?ChildNodes@ChspsDomNode@@QAEAAVChspsDomList@@XZ @ 9 NONAME ; class ChspsDomList & ChspsDomNode::ChildNodes(void) + ?FindByName@ChspsDomList@@QAEPAVMhspsDomListItem@@ABVTDesC8@@@Z @ 10 NONAME ; class MhspsDomListItem * ChspsDomList::FindByName(class TDesC8 const &) + ?Last@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 11 NONAME ; class MhspsDomListItem * ChspsDomList::Last(void) + ?RemoveItem@ChspsDomList@@QAEXH@Z @ 12 NONAME ; void ChspsDomList::RemoveItem(int) + ?InternalizeL@ChspsDomDocument@@QAEXAAVRReadStream@@@Z @ 13 NONAME ; void ChspsDomDocument::InternalizeL(class RReadStream &) + ?PCData@ChspsDomNode@@QAEABVTDesC8@@XZ @ 14 NONAME ; class TDesC8 const & ChspsDomNode::PCData(void) + ?CloneWithoutKidsL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@@Z @ 15 NONAME ; class ChspsDomNode * ChspsDomNode::CloneWithoutKidsL(class ChspsDomStringPool &) + ?AddStringL@ChspsDomStringPool@@QAEHABVTDesC8@@@Z @ 16 NONAME ; int ChspsDomStringPool::AddStringL(class TDesC8 const &) + ?DeleteItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 17 NONAME ; void ChspsDomList::DeleteItem(class MhspsDomListItem *) + ?Size@ChspsDomDocument@@QBEHXZ @ 18 NONAME ; int ChspsDomDocument::Size(void) const + ?StringPool@ChspsDomList@@QBEAAVChspsDomStringPool@@XZ @ 19 NONAME ; class ChspsDomStringPool & ChspsDomList::StringPool(void) const + ?SetValueL@ChspsDomAttribute@@QAEXABVTDesC8@@@Z @ 20 NONAME ; void ChspsDomAttribute::SetValueL(class TDesC8 const &) + ?NewL@ChspsDomAttribute@@SAPAV1@ABVTDesC8@@AAVChspsDomStringPool@@@Z @ 21 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::NewL(class TDesC8 const &, class ChspsDomStringPool &) + ?ItemIndex@ChspsDomNode@@QBEHABVMhspsDomListItem@@@Z @ 22 NONAME ; int ChspsDomNode::ItemIndex(class MhspsDomListItem const &) const + ?AddChildL@ChspsDomNode@@QAEXPAV1@H@Z @ 23 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *, int) + ?NodeId@ChspsDomNode@@QBEHXZ @ 24 NONAME ; int ChspsDomNode::NodeId(void) const + ?SetNodeId@ChspsDomNode@@QAEXH@Z @ 25 NONAME ; void ChspsDomNode::SetNodeId(int) + ?Item@ChspsDomList@@QBEPAVMhspsDomListItem@@H@Z @ 26 NONAME ; class MhspsDomListItem * ChspsDomList::Item(int) const + ?ItemIndex@ChspsDomList@@QBEHABVMhspsDomListItem@@@Z @ 27 NONAME ; int ChspsDomList::ItemIndex(class MhspsDomListItem const &) const + ?SetValueL@ChspsDomAttribute@@QAEXH@Z @ 28 NONAME ; void ChspsDomAttribute::SetValueL(int) + ?NextSibling@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@AAV2@@Z @ 29 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextSibling(class ChspsDomNode &) + ?ValueStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 30 NONAME ; short ChspsDomAttribute::ValueStringPoolIndex(void) const + ?CreateElementNSL@ChspsDomDocument@@QAEPAVChspsDomNode@@ABVTDesC8@@0@Z @ 31 NONAME ; class ChspsDomNode * ChspsDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) + ?DeleteChild@ChspsDomNode@@QAEXPAV1@@Z @ 32 NONAME ; void ChspsDomNode::DeleteChild(class ChspsDomNode *) + ?SetRootNode@ChspsDomDocument@@QAEXPAVChspsDomNode@@@Z @ 33 NONAME ; void ChspsDomDocument::SetRootNode(class ChspsDomNode *) + ?ContentType@ChspsDomNode@@QAEABW4TContentType@@XZ @ 34 NONAME ; enum TContentType const & ChspsDomNode::ContentType(void) + ?Namespace@ChspsDomNode@@QAEABVTDesC8@@XZ @ 35 NONAME ; class TDesC8 const & ChspsDomNode::Namespace(void) + ?CloneL@ChspsDomAttribute@@QAEPAV1@XZ @ 36 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::CloneL(void) + ?AddChildL@ChspsDomNode@@QAEXPAV1@@Z @ 37 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *) + ?NewL@ChspsDomDocument@@SAPAV1@XZ @ 38 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(void) + ?IsRefNode@ChspsDomNode@@QBEHXZ @ 39 NONAME ; int ChspsDomNode::IsRefNode(void) const + ?SetPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 40 NONAME ; void ChspsDomNode::SetPCDataL(class TDesC8 const &) + ?Value@ChspsDomAttribute@@QAEABVTDesC8@@XZ @ 41 NONAME ; class TDesC8 const & ChspsDomAttribute::Value(void) + ??1ChspsDomDepthIterator@@UAE@XZ @ 42 NONAME ; ChspsDomDepthIterator::~ChspsDomDepthIterator(void) + ?CreateRefNodeL@ChspsDomNode@@QAEPAV1@XZ @ 43 NONAME ; class ChspsDomNode * ChspsDomNode::CreateRefNodeL(void) + ?Reset@ChspsDomList@@QAEXXZ @ 44 NONAME ; void ChspsDomList::Reset(void) + ?StringPool@ChspsDomNode@@QBEAAVChspsDomStringPool@@XZ @ 45 NONAME ; class ChspsDomStringPool & ChspsDomNode::StringPool(void) const + ?AttributeValue@ChspsDomNode@@QBEABVTDesC8@@ABV2@@Z @ 46 NONAME ; class TDesC8 const & ChspsDomNode::AttributeValue(class TDesC8 const &) const + ?SetContentType@ChspsDomNode@@QAEXABW4TContentType@@@Z @ 47 NONAME ; void ChspsDomNode::SetContentType(enum TContentType const &) + ?NextL@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 48 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextL(void) + ?CloneL@ChspsDomDocument@@QAEPAV1@XZ @ 49 NONAME ; class ChspsDomDocument * ChspsDomDocument::CloneL(void) + ?AttributeList@ChspsDomNode@@QBEAAVChspsDomList@@XZ @ 50 NONAME ; class ChspsDomList & ChspsDomNode::AttributeList(void) const + ?LastNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 51 NONAME ; class ChspsDomNode * ChspsDomDocument::LastNode(void) const + ??1ChspsDomAttribute@@UAE@XZ @ 52 NONAME ; ChspsDomAttribute::~ChspsDomAttribute(void) + ?NewL@ChspsDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 53 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class RReadStream &) + ?NewL@ChspsDomAttribute@@SAPAV1@HAAVChspsDomStringPool@@@Z @ 54 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::NewL(int, class ChspsDomStringPool &) + ?SetParent@ChspsDomNode@@QAEXPAV1@@Z @ 55 NONAME ; void ChspsDomNode::SetParent(class ChspsDomNode *) + ?RootNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 56 NONAME ; class ChspsDomNode * ChspsDomDocument::RootNode(void) const + ?Name@ChspsDomNode@@UAEABVTDesC8@@XZ @ 57 NONAME ; class TDesC8 const & ChspsDomNode::Name(void) + ?First@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 58 NONAME ; class MhspsDomListItem * ChspsDomList::First(void) + ?NameStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 59 NONAME ; short ChspsDomAttribute::NameStringPoolIndex(void) const + ?CloneL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@H@Z @ 60 NONAME ; class ChspsDomNode * ChspsDomNode::CloneL(class ChspsDomStringPool &, int) + ?Name@ChspsDomAttribute@@UAEABVTDesC8@@XZ @ 61 NONAME ; class TDesC8 const & ChspsDomAttribute::Name(void) + ?NewL@ChspsDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 62 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class HBufC8 const *) + ?ReplaceChildL@ChspsDomNode@@QAEXPAV1@0@Z @ 63 NONAME ; void ChspsDomNode::ReplaceChildL(class ChspsDomNode *, class ChspsDomNode *) + ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 64 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *) + ?AppendPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 65 NONAME ; void ChspsDomNode::AppendPCDataL(class TDesC8 const &) + ?SetRefNode@ChspsDomNode@@QAEXH@Z @ 66 NONAME ; void ChspsDomNode::SetRefNode(int) + ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@H@Z @ 67 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *, int) + ?Parent@ChspsDomNode@@QBEPAV1@XZ @ 68 NONAME ; class ChspsDomNode * ChspsDomNode::Parent(void) const + ?StringPool@ChspsDomDocument@@QBEAAVChspsDomStringPool@@XZ @ 69 NONAME ; class ChspsDomStringPool & ChspsDomDocument::StringPool(void) const + ??1ChspsDomDocument@@UAE@XZ @ 70 NONAME ; ChspsDomDocument::~ChspsDomDocument(void) + ?DeleteItem@ChspsDomList@@QAEXH@Z @ 71 NONAME ; void ChspsDomList::DeleteItem(int) + ?DescendantCount@ChspsDomNode@@QBEHXZ @ 72 NONAME ; int ChspsDomNode::DescendantCount(void) const + ?DomNodeCount@ChspsDomDocument@@QBEHXZ @ 73 NONAME ; int ChspsDomDocument::DomNodeCount(void) const diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/eabi/hspsdomdocumentu.def --- a/homescreenpluginsrv/hspsdom/eabi/hspsdomdocumentu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/eabi/hspsdomdocumentu.def Wed May 12 13:36:47 2010 +0300 @@ -21,81 +21,82 @@ _ZN12ChspsDomNode14CreateRefNodeLEv @ 20 NONAME _ZN12ChspsDomNode14SetContentTypeERK12TContentType @ 21 NONAME _ZN12ChspsDomNode17CloneWithoutKidsLER18ChspsDomStringPool @ 22 NONAME - _ZN12ChspsDomNode19DeleteAttributeListEv @ 23 NONAME - _ZN12ChspsDomNode4NameEv @ 24 NONAME - _ZN12ChspsDomNode6CloneLER18ChspsDomStringPool @ 25 NONAME - _ZN12ChspsDomNode6PCDataEv @ 26 NONAME - _ZN12ChspsDomNode9AddChildLEPS_ @ 27 NONAME - _ZN12ChspsDomNode9AddChildLEPS_i @ 28 NONAME - _ZN12ChspsDomNode9NamespaceEv @ 29 NONAME - _ZN12ChspsDomNode9SetNodeIdEi @ 30 NONAME - _ZN12ChspsDomNode9SetParentEPS_ @ 31 NONAME - _ZN16ChspsDomDocument11SetRootNodeEP12ChspsDomNode @ 32 NONAME - _ZN16ChspsDomDocument12InternalizeLER11RReadStream @ 33 NONAME - _ZN16ChspsDomDocument16CreateElementNSLERK6TDesC8S2_ @ 34 NONAME - _ZN16ChspsDomDocument4NewLEPK6HBufC8 @ 35 NONAME - _ZN16ChspsDomDocument4NewLER11RReadStream @ 36 NONAME - _ZN16ChspsDomDocument4NewLEv @ 37 NONAME - _ZN16ChspsDomDocument6CloneLEv @ 38 NONAME - _ZN16ChspsDomDocument9MarshallLEv @ 39 NONAME - _ZN16ChspsDomDocumentD0Ev @ 40 NONAME - _ZN16ChspsDomDocumentD1Ev @ 41 NONAME - _ZN16ChspsDomDocumentD2Ev @ 42 NONAME - _ZN17ChspsDomAttribute4NameEv @ 43 NONAME - _ZN17ChspsDomAttribute4NewLERK6TDesC8R18ChspsDomStringPool @ 44 NONAME + _ZN12ChspsDomNode4NameEv @ 23 NONAME + _ZN12ChspsDomNode6CloneLER18ChspsDomStringPooli @ 24 NONAME + _ZN12ChspsDomNode6PCDataEv @ 25 NONAME + _ZN12ChspsDomNode9AddChildLEPS_ @ 26 NONAME + _ZN12ChspsDomNode9AddChildLEPS_i @ 27 NONAME + _ZN12ChspsDomNode9NamespaceEv @ 28 NONAME + _ZN12ChspsDomNode9SetNodeIdEi @ 29 NONAME + _ZN12ChspsDomNode9SetParentEPS_ @ 30 NONAME + _ZN16ChspsDomDocument11SetRootNodeEP12ChspsDomNode @ 31 NONAME + _ZN16ChspsDomDocument12InternalizeLER11RReadStream @ 32 NONAME + _ZN16ChspsDomDocument16CreateElementNSLERK6TDesC8S2_ @ 33 NONAME + _ZN16ChspsDomDocument4NewLEPK6HBufC8 @ 34 NONAME + _ZN16ChspsDomDocument4NewLER11RReadStream @ 35 NONAME + _ZN16ChspsDomDocument4NewLEv @ 36 NONAME + _ZN16ChspsDomDocument6CloneLEv @ 37 NONAME + _ZN16ChspsDomDocument9MarshallLEv @ 38 NONAME + _ZN16ChspsDomDocumentD0Ev @ 39 NONAME + _ZN16ChspsDomDocumentD1Ev @ 40 NONAME + _ZN16ChspsDomDocumentD2Ev @ 41 NONAME + _ZN17ChspsDomAttribute4NameEv @ 42 NONAME + _ZN17ChspsDomAttribute4NewLERK6TDesC8R18ChspsDomStringPool @ 43 NONAME + _ZN17ChspsDomAttribute4NewLEiR18ChspsDomStringPool @ 44 NONAME _ZN17ChspsDomAttribute5ValueEv @ 45 NONAME _ZN17ChspsDomAttribute6CloneLEv @ 46 NONAME _ZN17ChspsDomAttribute9SetValueLERK6TDesC8 @ 47 NONAME - _ZN17ChspsDomAttributeD0Ev @ 48 NONAME - _ZN17ChspsDomAttributeD1Ev @ 49 NONAME - _ZN17ChspsDomAttributeD2Ev @ 50 NONAME - _ZN18ChspsDomStringPool10AddStringLERK6TDesC8 @ 51 NONAME - _ZN21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 52 NONAME - _ZN21ChspsDomDepthIterator4NewLER12ChspsDomNode @ 53 NONAME - _ZN21ChspsDomDepthIterator5FirstEv @ 54 NONAME - _ZN21ChspsDomDepthIterator5NextLEv @ 55 NONAME - _ZN21ChspsDomDepthIteratorD0Ev @ 56 NONAME - _ZN21ChspsDomDepthIteratorD1Ev @ 57 NONAME - _ZN21ChspsDomDepthIteratorD2Ev @ 58 NONAME - _ZNK12ChspsDomList10StringPoolEv @ 59 NONAME - _ZNK12ChspsDomList4ItemEi @ 60 NONAME - _ZNK12ChspsDomList6LengthEv @ 61 NONAME - _ZNK12ChspsDomList9ItemIndexERK16MhspsDomListItem @ 62 NONAME - _ZNK12ChspsDomNode10StringPoolEv @ 63 NONAME - _ZNK12ChspsDomNode13AttributeListEv @ 64 NONAME - _ZNK12ChspsDomNode14AttributeValueERK6TDesC8 @ 65 NONAME - _ZNK12ChspsDomNode15DescendantCountEv @ 66 NONAME - _ZNK12ChspsDomNode6NodeIdEv @ 67 NONAME - _ZNK12ChspsDomNode6ParentEv @ 68 NONAME - _ZNK12ChspsDomNode9IsRefNodeEv @ 69 NONAME - _ZNK12ChspsDomNode9ItemIndexERK16MhspsDomListItem @ 70 NONAME - _ZNK16ChspsDomDocument10StringPoolEv @ 71 NONAME - _ZNK16ChspsDomDocument12DomNodeCountEv @ 72 NONAME - _ZNK16ChspsDomDocument12ExternalizeLER12RWriteStream @ 73 NONAME - _ZNK16ChspsDomDocument4SizeEv @ 74 NONAME - _ZNK16ChspsDomDocument8LastNodeEv @ 75 NONAME - _ZNK16ChspsDomDocument8RootNodeEv @ 76 NONAME - _ZNK17ChspsDomAttribute19NameStringPoolIndexEv @ 77 NONAME - _ZNK17ChspsDomAttribute20ValueStringPoolIndexEv @ 78 NONAME - _ZTI12ChspsDomList @ 79 NONAME ; ## - _ZTI12ChspsDomNode @ 80 NONAME ; ## - _ZTI16ChspsDomDocument @ 81 NONAME ; ## - _ZTI17ChspsDomAttribute @ 82 NONAME ; ## - _ZTI18ChspsDomStringPool @ 83 NONAME ; ## - _ZTI21ChspsDomDepthIterator @ 84 NONAME ; ## - _ZTV12ChspsDomList @ 85 NONAME ; ## - _ZTV12ChspsDomNode @ 86 NONAME ; ## - _ZTV16ChspsDomDocument @ 87 NONAME ; ## - _ZTV17ChspsDomAttribute @ 88 NONAME ; ## - _ZTV18ChspsDomStringPool @ 89 NONAME ; ## - _ZTV21ChspsDomDepthIterator @ 90 NONAME ; ## - _ZThn4_N12ChspsDomNode4NameEv @ 91 NONAME ; ## - _ZThn4_N17ChspsDomAttribute4NameEv @ 92 NONAME ; ## - _ZThn4_N17ChspsDomAttributeD0Ev @ 93 NONAME ; ## - _ZThn4_N17ChspsDomAttributeD1Ev @ 94 NONAME ; ## - _ZThn4_N21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 95 NONAME ; ## - _ZThn4_N21ChspsDomDepthIterator5FirstEv @ 96 NONAME ; ## - _ZThn4_N21ChspsDomDepthIterator5NextLEv @ 97 NONAME ; ## - _ZThn4_N21ChspsDomDepthIteratorD0Ev @ 98 NONAME ; ## - _ZThn4_N21ChspsDomDepthIteratorD1Ev @ 99 NONAME ; ## + _ZN17ChspsDomAttribute9SetValueLEi @ 48 NONAME + _ZN17ChspsDomAttributeD0Ev @ 49 NONAME + _ZN17ChspsDomAttributeD1Ev @ 50 NONAME + _ZN17ChspsDomAttributeD2Ev @ 51 NONAME + _ZN18ChspsDomStringPool10AddStringLERK6TDesC8 @ 52 NONAME + _ZN21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 53 NONAME + _ZN21ChspsDomDepthIterator4NewLER12ChspsDomNode @ 54 NONAME + _ZN21ChspsDomDepthIterator5FirstEv @ 55 NONAME + _ZN21ChspsDomDepthIterator5NextLEv @ 56 NONAME + _ZN21ChspsDomDepthIteratorD0Ev @ 57 NONAME + _ZN21ChspsDomDepthIteratorD1Ev @ 58 NONAME + _ZN21ChspsDomDepthIteratorD2Ev @ 59 NONAME + _ZNK12ChspsDomList10StringPoolEv @ 60 NONAME + _ZNK12ChspsDomList4ItemEi @ 61 NONAME + _ZNK12ChspsDomList6LengthEv @ 62 NONAME + _ZNK12ChspsDomList9ItemIndexERK16MhspsDomListItem @ 63 NONAME + _ZNK12ChspsDomNode10StringPoolEv @ 64 NONAME + _ZNK12ChspsDomNode13AttributeListEv @ 65 NONAME + _ZNK12ChspsDomNode14AttributeValueERK6TDesC8 @ 66 NONAME + _ZNK12ChspsDomNode15DescendantCountEv @ 67 NONAME + _ZNK12ChspsDomNode6NodeIdEv @ 68 NONAME + _ZNK12ChspsDomNode6ParentEv @ 69 NONAME + _ZNK12ChspsDomNode9IsRefNodeEv @ 70 NONAME + _ZNK12ChspsDomNode9ItemIndexERK16MhspsDomListItem @ 71 NONAME + _ZNK16ChspsDomDocument10StringPoolEv @ 72 NONAME + _ZNK16ChspsDomDocument12DomNodeCountEv @ 73 NONAME + _ZNK16ChspsDomDocument12ExternalizeLER12RWriteStream @ 74 NONAME + _ZNK16ChspsDomDocument4SizeEv @ 75 NONAME + _ZNK16ChspsDomDocument8LastNodeEv @ 76 NONAME + _ZNK16ChspsDomDocument8RootNodeEv @ 77 NONAME + _ZNK17ChspsDomAttribute19NameStringPoolIndexEv @ 78 NONAME + _ZNK17ChspsDomAttribute20ValueStringPoolIndexEv @ 79 NONAME + _ZTI12ChspsDomList @ 80 NONAME + _ZTI12ChspsDomNode @ 81 NONAME + _ZTI16ChspsDomDocument @ 82 NONAME + _ZTI17ChspsDomAttribute @ 83 NONAME + _ZTI18ChspsDomStringPool @ 84 NONAME + _ZTI21ChspsDomDepthIterator @ 85 NONAME + _ZTV12ChspsDomList @ 86 NONAME + _ZTV12ChspsDomNode @ 87 NONAME + _ZTV16ChspsDomDocument @ 88 NONAME + _ZTV17ChspsDomAttribute @ 89 NONAME + _ZTV18ChspsDomStringPool @ 90 NONAME + _ZTV21ChspsDomDepthIterator @ 91 NONAME + _ZThn4_N12ChspsDomNode4NameEv @ 92 NONAME + _ZThn4_N17ChspsDomAttribute4NameEv @ 93 NONAME + _ZThn4_N17ChspsDomAttributeD0Ev @ 94 NONAME + _ZThn4_N17ChspsDomAttributeD1Ev @ 95 NONAME + _ZThn4_N21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 96 NONAME + _ZThn4_N21ChspsDomDepthIterator5FirstEv @ 97 NONAME + _ZThn4_N21ChspsDomDepthIterator5NextLEv @ 98 NONAME + _ZThn4_N21ChspsDomDepthIteratorD0Ev @ 99 NONAME + _ZThn4_N21ChspsDomDepthIteratorD1Ev @ 100 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/group/hspsdomdocument.mmp --- a/homescreenpluginsrv/hspsdom/group/hspsdomdocument.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/group/hspsdomdocument.mmp Wed May 12 13:36:47 2010 +0300 @@ -32,6 +32,7 @@ SOURCE hspsdomlist.cpp SOURCE hspsdomdepthiterator.cpp SOURCE hspsdomstringpool.cpp +SOURCE hspsdomstringpooloptimizer.cpp USERINCLUDE . USERINCLUDE ../inc diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp --- a/homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp Wed May 12 13:36:47 2010 +0300 @@ -35,7 +35,6 @@ { } - // ----------------------------------------------------------------------------- // ChspsDomAttribute::ConstructL // Symbian 2nd phase constructor can leave. @@ -45,6 +44,17 @@ { iNameRef = iStringPool.AddStringL( aName ); } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomAttribute::ConstructL( const TInt aName ) + { + iNameRef = aName; + } + // ----------------------------------------------------------------------------- // ChspsDomAttribute::NewL // Two-phased constructor. @@ -63,6 +73,23 @@ return self; } +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomAttribute* ChspsDomAttribute::NewL( + const TInt aName, + ChspsDomStringPool& aStringPool ) + { + ChspsDomAttribute* self = new( ELeave ) ChspsDomAttribute( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL( aName ); + CleanupStack::Pop( self ); + + return self; + } // ----------------------------------------------------------------------------- // ChspsDomAttribute::NewL @@ -106,18 +133,38 @@ // ChspsDomAttribute::CloneL // ----------------------------------------------------------------------------- // -ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool ) - { - const TDesC8& name = iStringPool.String( iNameRef ); +ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool, + const TBool aFastClone ) + { + ChspsDomAttribute* clone = NULL; - ChspsDomAttribute* clone = ChspsDomAttribute::NewL( name, aStringPool ); + if( aFastClone ) + { + clone = ChspsDomAttribute::NewL( iNameRef, aStringPool ); + } + else + { + const TDesC8& name = iStringPool.String( iNameRef ); + clone = ChspsDomAttribute::NewL( name, aStringPool ); + } + CleanupStack::PushL( clone ); + if ( iValueRef > KErrNotFound ) { - const TDesC8& value = iStringPool.String( iValueRef ); - clone->SetValueL( value ); + if( aFastClone ) + { + clone->SetValueL( iValueRef ); + } + else + { + const TDesC8& value = iStringPool.String( iValueRef ); + clone->SetValueL( value ); + } } + CleanupStack::Pop( clone ); + return clone; } @@ -169,6 +216,14 @@ iValueRef = iStringPool.AddStringL( aValue ); } +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::SetValueL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomAttribute::SetValueL( const TInt aValue ) + { + iValueRef = aValue; + } // ----------------------------------------------------------------------------- // ChspsDomAttribute::Size diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/src/hspsdomdocument.cpp --- a/homescreenpluginsrv/hspsdom/src/hspsdomdocument.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomdocument.cpp Wed May 12 13:36:47 2010 +0300 @@ -38,7 +38,7 @@ clone->iDomStringPool = iDomStringPool->CloneL(); if ( iRootNode ) { - clone->iRootNode = iRootNode->CloneL( *clone->iDomStringPool ); + clone->iRootNode = iRootNode->CloneL( *clone->iDomStringPool, ETrue ); } CleanupStack::Pop( clone ); @@ -101,6 +101,7 @@ ChspsDomDocument* self = new( ELeave ) ChspsDomDocument; CleanupStack::PushL( self ); + self->ConstructL(); aStream >> *self; CleanupStack::Pop(self); @@ -174,13 +175,9 @@ // EXPORT_C void ChspsDomDocument::InternalizeL( RReadStream& aStream ) { - if(iDomStringPool) - { - delete iDomStringPool; - iDomStringPool = NULL; - } - iDomStringPool = ChspsDomStringPool::NewL( aStream ); - + iDomStringPool->Reset(); + iDomStringPool->InternalizeL( aStream ); + if ( iRootNode ) { delete iRootNode; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/src/hspsdomnode.cpp --- a/homescreenpluginsrv/hspsdom/src/hspsdomnode.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomnode.cpp Wed May 12 13:36:47 2010 +0300 @@ -54,7 +54,29 @@ { iNameRef = iStringPool.AddStringL( aName ); iNSRef = iStringPool.AddStringL( aNS ); - + Construct2L(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomNode::ConstructL( + const TInt aName, + const TInt aNS ) + { + iNameRef = aName; + iNSRef = aNS; + Construct2L(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::Construct2L +// ----------------------------------------------------------------------------- +// +void ChspsDomNode::Construct2L() + { iChildList = ChspsDomList::NewL( ChspsDomList::ENodeList, iStringPool ); iAttributeList = ChspsDomList::NewL( ChspsDomList::EAttributeList, iStringPool ); } @@ -80,6 +102,25 @@ // ----------------------------------------------------------------------------- // ChspsDomNode::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomNode* ChspsDomNode::NewL( + const TInt aName, + const TInt aNS, + ChspsDomStringPool& aStringPool ) + { + ChspsDomNode* self = new( ELeave ) ChspsDomNode( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL( aName, aNS ); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::NewL // Two-phased stream constructor. // ----------------------------------------------------------------------------- // @@ -109,26 +150,38 @@ // Clones this node and it's child nodes. This is a recursive function. // ----------------------------------------------------------------------------- // -EXPORT_C ChspsDomNode* ChspsDomNode::CloneL( ChspsDomStringPool& aStringPool ) +EXPORT_C ChspsDomNode* ChspsDomNode::CloneL( ChspsDomStringPool& aStringPool, + const TBool aFastClone ) { - const TDesC8& name = iStringPool.String( iNameRef ); - const TDesC8& ns = iStringPool.String( iNSRef ); + ChspsDomNode* clone = NULL; - ChspsDomNode* clone = ChspsDomNode::NewL( name, ns, aStringPool ); + if( aFastClone ) + { + clone = ChspsDomNode::NewL( iNameRef, iNSRef, aStringPool ); + } + else + { + const TDesC8& name = iStringPool.String( iNameRef ); + const TDesC8& ns = iStringPool.String( iNSRef ); + clone = ChspsDomNode::NewL( name, ns, aStringPool ); + } + CleanupStack::PushL( clone ); + if ( iPCData ) { clone->AppendPCDataL( *iPCData ); } + clone->iNodeId = iNodeId; clone->iRefNode = iRefNode; TInt childCount( iChildList->Length() ); - for ( TInt i=0; i( iChildList->Item(i) )->CloneL( aStringPool ); + static_cast( iChildList->Item(i) )->CloneL( aStringPool, aFastClone ); CleanupStack::PushL( childClone ); childClone->iParentNode = clone; clone->iChildList->AddItemL( childClone ); @@ -136,10 +189,10 @@ } TInt attrCount( iAttributeList->Length() ); - for ( TInt j=0; j( iAttributeList->Item(j) )->CloneL( aStringPool ); + static_cast( iAttributeList->Item(j) )->CloneL( aStringPool, aFastClone ); CleanupStack::PushL( attrClone ); clone->iAttributeList->AddItemL( attrClone ); CleanupStack::Pop( attrClone ); @@ -490,8 +543,7 @@ // ----------------------------------------------------------------------------- // void ChspsDomNode::ExternalizeL( RWriteStream& aStream ) const - { - + { aStream.WriteInt16L( iNameRef ); aStream.WriteInt16L( iNSRef ); aStream.WriteInt8L( iRefNode ); @@ -571,19 +623,6 @@ return count; } - - -// ----------------------------------------------------------------------------- -// ChspsDomNode::DeleteAttributeList -// Deletes the attribute list -// ----------------------------------------------------------------------------- -// -EXPORT_C void ChspsDomNode::DeleteAttributeList() - { - delete iAttributeList; - iAttributeList = NULL; - - } // ----------------------------------------------------------------------------- // ChspsDomNode::AttributeValue diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsdom/src/hspsdomstringpool.cpp --- a/homescreenpluginsrv/hspsdom/src/hspsdomstringpool.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomstringpool.cpp Wed May 12 13:36:47 2010 +0300 @@ -20,42 +20,8 @@ // INCLUDE FILES #include "hspsdomstringpool.h" +// ============================ LOCAL FUNCTIONS ================================ -// ============================ LOCAL FUNCTIONS ================================ -// ----------------------------------------------------------------------------- -// Adds string to string pool. If string doesn't appear yet, it is added to -// the string pool and index to pool is returned. -// @param aString String to add -// @param aArray A pool which holds strings -// @return Index to string pool -// ----------------------------------------------------------------------------- -// -LOCAL_C TInt AddToStringPoolL( const TDesC8& aString, RPointerArray& aArray ) - { - TBool found( EFalse ); - TInt index( 0 ); - - TInt count( aArray.Count() ); - for (; index < count && !found; ) - { - if ( aArray[ index ]->Des().Compare( aString ) == 0 ) - { - found = ETrue; - } - else - { - index++; - } - } - if ( !found ) - { - HBufC8* tmp = aString.AllocLC(); - aArray.AppendL( tmp ); - CleanupStack::Pop( tmp ); - index = aArray.Count()-1; //Last item - } - return index; - } // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- // ChspsDomStringPool::ChspsDomStringPool @@ -63,7 +29,8 @@ // might leave. // ----------------------------------------------------------------------------- // -ChspsDomStringPool::ChspsDomStringPool() +ChspsDomStringPool::ChspsDomStringPool( const TBool aAllowDuplicates ) : + iAllowDuplicates( aAllowDuplicates ) { } @@ -81,9 +48,10 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -ChspsDomStringPool* ChspsDomStringPool::NewL() +ChspsDomStringPool* ChspsDomStringPool::NewL( const TBool aAllowDuplicates ) { - ChspsDomStringPool* self = new( ELeave ) ChspsDomStringPool; + ChspsDomStringPool* self = + new( ELeave ) ChspsDomStringPool( aAllowDuplicates ); CleanupStack::PushL( self ); self->ConstructL(); @@ -98,9 +66,10 @@ // Two-phased stream constructor. // ----------------------------------------------------------------------------- // -ChspsDomStringPool* ChspsDomStringPool::NewL( RReadStream& aStream ) +ChspsDomStringPool* ChspsDomStringPool::NewL( RReadStream& aStream, + const TBool aAllowDuplicates ) { - ChspsDomStringPool* self = new( ELeave ) ChspsDomStringPool; + ChspsDomStringPool* self = new( ELeave ) ChspsDomStringPool( aAllowDuplicates ); CleanupStack::PushL( self ); aStream >> *self; CleanupStack::Pop(self); @@ -116,6 +85,7 @@ ChspsDomStringPool::~ChspsDomStringPool() { iStringPool.ResetAndDestroy(); + iStringPoolOptimizer.Close(); } // ----------------------------------------------------------------------------- @@ -123,15 +93,23 @@ // ----------------------------------------------------------------------------- // ChspsDomStringPool* ChspsDomStringPool::CloneL() - { - ChspsDomStringPool* clone = ChspsDomStringPool::NewL(); + { + ChspsDomStringPool* clone = NULL; + if( iAllowDuplicates ) + { + clone = ChspsDomStringPool::NewL( ETrue ); + } + else + { + clone = ChspsDomStringPool::NewL( EFalse ); + } CleanupStack::PushL( clone ); TInt count( iStringPool.Count() ); - for ( TInt i=0; iDes().AllocLC(); - clone->iStringPool.AppendL( tmp ); + clone->DoAddStringL( tmp ); CleanupStack::Pop( tmp ); } CleanupStack::Pop( clone ); @@ -139,26 +117,94 @@ } // ----------------------------------------------------------------------------- -// ChspsDomNode::AddStringL +// ChspsDomStringPool::Reset +// ----------------------------------------------------------------------------- +// +void ChspsDomStringPool::Reset() + { + if( iStringPool.Count() > 0 ) + { + iStringPool.ResetAndDestroy(); + } + + if( iStringPoolOptimizer.Count() > 0 ) + { + iStringPoolOptimizer.Reset(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::AddStringL // ----------------------------------------------------------------------------- // EXPORT_C TInt ChspsDomStringPool::AddStringL( const TDesC8& aString ) - { - return AddToStringPoolL( aString, iStringPool ); + { + TInt index = iStringPoolOptimizer.GetIndex( aString ); + + if( index == KErrNotFound ) + { + HBufC8* string = aString.AllocLC(); + index = DoAddStringL( string ); + CleanupStack::Pop( string ); + } + + return index; } // ----------------------------------------------------------------------------- -// ChspsDomNode::String +// ChspsDomStringPool::AddStringL +// ----------------------------------------------------------------------------- +// +TInt ChspsDomStringPool::AddStringL( HBufC8* aString ) + { + if( !aString ) + { + User::Leave( KErrArgument ); + } + + TInt index = iStringPoolOptimizer.GetIndex( *aString ); + + if( index == KErrNotFound ) + { + index = DoAddStringL( aString ); + } + else + { + delete aString; + } + + return index; + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::AddStringL +// ----------------------------------------------------------------------------- +// +void ChspsDomStringPool::AddAllL( ChspsDomStringPool& aStringPool ) + { + const TInt count = aStringPool.Count(); + for( TInt i = 0; i < count; i++ ) + { + AddStringL( aStringPool.String( i ) ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::String // ----------------------------------------------------------------------------- // const TDesC8& ChspsDomStringPool::String( const TInt aStringRef ) - { - if ( aStringRef < iStringPool.Count() ) + { + if( aStringRef >= 0 && aStringRef < iStringPool.Count() ) + { return (*iStringPool[ aStringRef ]); + } else + { return KNullDesC8; + } } - + // ----------------------------------------------------------------------------- // ChspsDomStringPool::Size // ----------------------------------------------------------------------------- @@ -179,6 +225,15 @@ } // ----------------------------------------------------------------------------- +// ChspsDomStringPool::Count +// ----------------------------------------------------------------------------- +// +TInt ChspsDomStringPool::Count() const + { + return iStringPool.Count(); + } + +// ----------------------------------------------------------------------------- // ChspsDomStringPool::ExternalizeL // ----------------------------------------------------------------------------- // @@ -201,15 +256,39 @@ void ChspsDomStringPool::InternalizeL( RReadStream& aStream ) { TInt len(0); - TInt16 count ( aStream.ReadInt16L() ); - + TInt16 count ( aStream.ReadInt16L() ); + for ( TInt i=0; i 0 ) + { + const TInt estimate = FindInsertionIndexEstimate( + aEntry.iString, + 0, + iEntries.Count() - 1 ); + + if( estimate != KErrNotFound ) + { + for( TInt i = estimate; i < iEntries.Count(); i++ ) + { + if( aEntry.iString.Compare( iEntries[i].iString ) < 0 ) + { + positionFound = ETrue; + iEntries.InsertL( aEntry, i ); + break; + } + } + } + } + + if( !positionFound ) + { + iEntries.AppendL( aEntry ); + } + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::ThspsDomStringPoolOptimizerGetIndex +// ----------------------------------------------------------------------------- +// +TInt ThspsDomStringPoolOptimizer::GetIndex( const TDesC8& aString ) + { + if( iEntries.Count() == 0 ) + { + return KErrNotFound; + } + + TInt index = FindEntry( aString, 0, iEntries.Count() - 1 ); + if( index >= 0 && index < iEntries.Count() ) + { + return iEntries[index].iIndex; + } + else + { + // Error code. + return index; + } + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::Close +// ----------------------------------------------------------------------------- +// +void ThspsDomStringPoolOptimizer::Close() + { + iEntries.Close(); + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::Count +// ----------------------------------------------------------------------------- +// +TInt ThspsDomStringPoolOptimizer::Count() + { + return iEntries.Count(); + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::Entry +// ----------------------------------------------------------------------------- +// +ThspsDomStringPoolOptimizerEntry& ThspsDomStringPoolOptimizer::Entry( + const TInt aIndex ) + { + return iEntries[ aIndex ]; + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::Reset +// ----------------------------------------------------------------------------- +// +void ThspsDomStringPoolOptimizer::Reset() + { + iEntries.Reset(); + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::FindEntry +// ----------------------------------------------------------------------------- +// +TInt ThspsDomStringPoolOptimizer::FindEntry( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ) + { + if( aLeft > aRight ) + { + return KErrNotFound; + } + + const TUint middle = ( aLeft + aRight ) >> 1; // >> 1 means "divided by two". + ThspsDomStringPoolOptimizerEntry& entryAtMiddle = iEntries[ middle ]; + const TInt comparisonResult = aString.Compare( entryAtMiddle.iString ); + + if( comparisonResult > 0 ) + { + return FindEntry( aString, middle + 1, aRight); + } + else if( comparisonResult < 0 ) + { + return FindEntry( aString, aLeft, middle - 1 ); + } + else + { + return middle; + } + } + +// ----------------------------------------------------------------------------- +// ThspsDomStringPoolOptimizer::FindEntry +// ----------------------------------------------------------------------------- +// +TInt ThspsDomStringPoolOptimizer::FindInsertionIndexEstimate( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ) + { + if( ( aRight - aLeft ) <= KMaxEstimateThreshold ) + { + return aLeft; + } + + const TUint middle = ( aLeft + aRight ) >> 1; + + ThspsDomStringPoolOptimizerEntry& entryAtMiddle = iEntries[ middle ]; + const TInt comparisonResult = aString.Compare( entryAtMiddle.iString ); + + if( comparisonResult > 0 ) + { + return FindInsertionIndexEstimate( aString, middle, aRight); + } + else if( comparisonResult < 0 ) + { + return FindInsertionIndexEstimate( aString, aLeft, middle ); + } + else + { + // Should not go here. There should be only one of a kind in the list. + return KErrNotFound; + } + } + +// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/bwins/hspsclientsessionu.def --- a/homescreenpluginsrv/hspsmanager/bwins/hspsclientsessionu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/bwins/hspsclientsessionu.def Wed May 12 13:36:47 2010 +0300 @@ -1,28 +1,28 @@ EXPORTS - ?GetListHeaders@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 1 NONAME ; int RhspsClientSession::GetListHeaders(class TDes8 &, class TDesC8 const &, class TDes8 &) - ?CancelRequest@RhspsClientSession@@IAEXHAAVTDes8@@H@Z @ 2 NONAME ; void RhspsClientSession::CancelRequest(int, class TDes8 &, int) - ?SetConfState@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamSetConfState@@@Z @ 3 NONAME ; int RhspsClientSession::SetConfState(class TDes8 &, struct ThspsParamSetConfState const &) - ?CopyResourceFiles@RhspsClientSession@@IAEHAAVTDes8@@AAVTDesC16@@1@Z @ 4 NONAME ; int RhspsClientSession::CopyResourceFiles(class TDes8 &, class TDesC16 &, class TDesC16 &) - ?Connect@RhspsClientSession@@IAEHXZ @ 5 NONAME ; int RhspsClientSession::Connect(void) - ?GetODT@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC8@@AAVTDes16@@@Z @ 6 NONAME ; int RhspsClientSession::GetODT(class TDes8 &, struct ThspsConfiguration const &, class TDesC8 const &, class TDes16 &) + ?CancelRequest@RhspsClientSession@@IAEXHAAVTDes8@@H@Z @ 1 NONAME ; void RhspsClientSession::CancelRequest(int, class TDes8 &, int) + ?SetConfState@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamSetConfState@@@Z @ 2 NONAME ; int RhspsClientSession::SetConfState(class TDes8 &, struct ThspsParamSetConfState const &) + ?CopyResourceFiles@RhspsClientSession@@IAEHAAVTDes8@@AAVTDesC16@@1@Z @ 3 NONAME ; int RhspsClientSession::CopyResourceFiles(class TDes8 &, class TDesC16 &, class TDesC16 &) + ?Connect@RhspsClientSession@@IAEHXZ @ 4 NONAME ; int RhspsClientSession::Connect(void) + ?GetODT@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC8@@AAVTDes16@@@Z @ 5 NONAME ; int RhspsClientSession::GetODT(class TDes8 &, struct ThspsConfiguration const &, class TDesC8 const &, class TDes16 &) + ?GetListHeaders@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@H0@Z @ 6 NONAME ; int RhspsClientSession::GetListHeaders(class TDes8 &, class TDesC8 const &, int, class TDes8 &) ?MovePlugins@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamMovePlugins@@@Z @ 7 NONAME ; int RhspsClientSession::MovePlugins(class TDes8 &, struct ThpsParamMovePlugins const &) ?SetActiveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 8 NONAME ; int RhspsClientSession::SetActiveTheme(class TDes8 &, class TDesC8 const &, class TDes8 &) ?SetActivePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamSetActivePlugin@@@Z @ 9 NONAME ; int RhspsClientSession::SetActivePlugin(class TDes8 &, struct ThpsParamSetActivePlugin const &) - ?ReplacePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReplacePlugin@@@Z @ 10 NONAME ; int RhspsClientSession::ReplacePlugin(class TDes8 &, struct ThspsParamReplacePlugin const &) - ?InstallNextPhase@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 11 NONAME ; void RhspsClientSession::InstallNextPhase(class TDes8 &, class TDes8 &, class TRequestStatus &) - ?SetPluginSettings@RhspsClientSession@@IAEHAAVTDes8@@0UThspsParamSetPluginSettings@@0@Z @ 12 NONAME ; int RhspsClientSession::SetPluginSettings(class TDes8 &, class TDes8 &, struct ThspsParamSetPluginSettings, class TDes8 &) - ?RemovePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamRemovePlugin@@@Z @ 13 NONAME ; int RhspsClientSession::RemovePlugin(class TDes8 &, struct ThpsParamRemovePlugin const &) - ?GetNextHeader@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 14 NONAME ; void RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &, class TRequestStatus &) - ?RemoveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@@Z @ 15 NONAME ; int RhspsClientSession::RemoveTheme(class TDes8 &, class TDesC8 const &) - ?AddPlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamAddPlugin@@AAH@Z @ 16 NONAME ; int RhspsClientSession::AddPlugin(class TDes8 &, struct ThpsParamAddPlugin const &, int &) - ?Close@RhspsClientSession@@IAEXXZ @ 17 NONAME ; void RhspsClientSession::Close(void) - ?GetPluginOdt@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamGetPluginOdt@@AAVTDes16@@@Z @ 18 NONAME ; int RhspsClientSession::GetPluginOdt(class TDes8 &, struct ThspsParamGetPluginOdt const &, class TDes16 &) - ?RestoreDefault@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 19 NONAME ; int RhspsClientSession::RestoreDefault(class TDes8 &, class TDesC8 const &, class TDes8 &) - ?GetNextHeader@RhspsClientSession@@IAEHAAVTDes8@@0@Z @ 20 NONAME ; int RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &) - ?RestoreActiveAppConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreActiveAppConf@@@Z @ 21 NONAME ; int RhspsClientSession::RestoreActiveAppConf(class TDes8 &, struct ThspsParamRestoreActiveAppConf const &) - ?InstallTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC16@@0@Z @ 22 NONAME ; int RhspsClientSession::InstallTheme(class TDes8 &, class TDesC16 const &, class TDes8 &) - ?AccessResourceFile@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC16@@AAH@Z @ 23 NONAME ; int RhspsClientSession::AccessResourceFile(class TDes8 &, struct ThspsConfiguration const &, class TDesC16 const &, int &) - ?GetODTUpdate@RhspsClientSession@@IAEXAAVTDes8@@00AAVTRequestStatus@@@Z @ 24 NONAME ; void RhspsClientSession::GetODTUpdate(class TDes8 &, class TDes8 &, class TDes8 &, class TRequestStatus &) - ?ReinstallConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReinstallConf@@@Z @ 25 NONAME ; int RhspsClientSession::ReinstallConf(class TDes8 &, struct ThspsParamReinstallConf const &) - ?RestoreConfigurations@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreConfigurations@@@Z @ 26 NONAME ; int RhspsClientSession::RestoreConfigurations(class TDes8 &, struct ThspsParamRestoreConfigurations const &) + ?RestoreConfigurations@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreConfigurations@@@Z @ 10 NONAME ; int RhspsClientSession::RestoreConfigurations(class TDes8 &, struct ThspsParamRestoreConfigurations const &) + ?ReplacePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReplacePlugin@@@Z @ 11 NONAME ; int RhspsClientSession::ReplacePlugin(class TDes8 &, struct ThspsParamReplacePlugin const &) + ?InstallNextPhase@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 12 NONAME ; void RhspsClientSession::InstallNextPhase(class TDes8 &, class TDes8 &, class TRequestStatus &) + ?SetPluginSettings@RhspsClientSession@@IAEHAAVTDes8@@0UThspsParamSetPluginSettings@@0@Z @ 13 NONAME ; int RhspsClientSession::SetPluginSettings(class TDes8 &, class TDes8 &, struct ThspsParamSetPluginSettings, class TDes8 &) + ?RemovePlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamRemovePlugin@@@Z @ 14 NONAME ; int RhspsClientSession::RemovePlugin(class TDes8 &, struct ThpsParamRemovePlugin const &) + ?GetNextHeader@RhspsClientSession@@IAEXAAVTDes8@@0AAVTRequestStatus@@@Z @ 15 NONAME ; void RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &, class TRequestStatus &) + ?RemoveTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@@Z @ 16 NONAME ; int RhspsClientSession::RemoveTheme(class TDes8 &, class TDesC8 const &) + ?AddPlugin@RhspsClientSession@@IAEHAAVTDes8@@ABUThpsParamAddPlugin@@AAH@Z @ 17 NONAME ; int RhspsClientSession::AddPlugin(class TDes8 &, struct ThpsParamAddPlugin const &, int &) + ?Close@RhspsClientSession@@IAEXXZ @ 18 NONAME ; void RhspsClientSession::Close(void) + ?GetPluginOdt@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamGetPluginOdt@@AAVTDes16@@@Z @ 19 NONAME ; int RhspsClientSession::GetPluginOdt(class TDes8 &, struct ThspsParamGetPluginOdt const &, class TDes16 &) + ?RestoreDefault@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC8@@0@Z @ 20 NONAME ; int RhspsClientSession::RestoreDefault(class TDes8 &, class TDesC8 const &, class TDes8 &) + ?GetNextHeader@RhspsClientSession@@IAEHAAVTDes8@@0@Z @ 21 NONAME ; int RhspsClientSession::GetNextHeader(class TDes8 &, class TDes8 &) + ?RestoreActiveAppConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamRestoreActiveAppConf@@@Z @ 22 NONAME ; int RhspsClientSession::RestoreActiveAppConf(class TDes8 &, struct ThspsParamRestoreActiveAppConf const &) + ?InstallTheme@RhspsClientSession@@IAEHAAVTDes8@@ABVTDesC16@@0@Z @ 23 NONAME ; int RhspsClientSession::InstallTheme(class TDes8 &, class TDesC16 const &, class TDes8 &) + ?AccessResourceFile@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsConfiguration@@ABVTDesC16@@AAH@Z @ 24 NONAME ; int RhspsClientSession::AccessResourceFile(class TDes8 &, struct ThspsConfiguration const &, class TDesC16 const &, int &) + ?GetODTUpdate@RhspsClientSession@@IAEXAAVTDes8@@00AAVTRequestStatus@@@Z @ 25 NONAME ; void RhspsClientSession::GetODTUpdate(class TDes8 &, class TDes8 &, class TDes8 &, class TRequestStatus &) + ?ReinstallConf@RhspsClientSession@@IAEHAAVTDes8@@ABUThspsParamReinstallConf@@@Z @ 26 NONAME ; int RhspsClientSession::ReinstallConf(class TDes8 &, struct ThspsParamReinstallConf const &) diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def --- a/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/bwins/hspsclientu.def Wed May 12 13:36:47 2010 +0300 @@ -8,9 +8,9 @@ ?GethspsResult@ChspsClient@@QAEXAAVChspsResult@@@Z @ 7 NONAME ; void ChspsClient::GethspsResult(class ChspsResult &) ?NewLC@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 8 NONAME ; class ChspsClient * ChspsClient::NewLC(class MhspsThemeManagementServiceObserver &) ?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVChspsODT@@@Z @ 9 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class ChspsODT &) - ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 10 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, class CArrayPtrFlat &) - ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int) - ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &) + ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 10 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int) + ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &) + ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, int) ?hspsReplacePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHH@Z @ 13 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin(int, int, int) ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 14 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class ChspsODT const &, class ChspsODT &) ?hspsPluginUpdateL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 15 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL(class ChspsODT const &) @@ -22,11 +22,11 @@ ?hspsSetActivePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 21 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin(int, int) ?hspsCancelInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 22 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme(void) ?hspsGetNextHeader@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 23 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader(void) - ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &) - ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *) - ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int) - ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat const &) - ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, class CArrayPtrFlat &) - ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 29 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &) - ?hspsRestoreConfigurations@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 30 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreConfigurations(int, int) + ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, int, class CArrayPtrFlat &) + ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &) + ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *) + ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int) + ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat const &) + ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@HAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 29 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, int, class CArrayPtrFlat &) + ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 30 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &) diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/client/hspsclient.cpp --- a/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Wed May 12 13:36:47 2010 +0300 @@ -236,8 +236,10 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders( const ChspsODT& aSearchMask, - CArrayPtrFlat& aHeaderList ) +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders( + const ChspsODT& aSearchMask, + const TBool aCopyLogos, + CArrayPtrFlat& aHeaderList ) { ThspsServiceCompletedMessage ret = EhspsServiceRequestError; TBuf8 headerData; @@ -263,8 +265,11 @@ // cancel previous subscription first hspsCancelGetListHeaders(); } - ret = (ThspsServiceCompletedMessage)iSession.GetListHeaders(iResultData, - iSearchMaskData->Des(),headerData ); + ret = (ThspsServiceCompletedMessage)iSession.GetListHeaders( + iResultData, + iSearchMaskData->Des(), + aCopyLogos, + headerData ); #ifdef HSPS_LOG_ACTIVE if( iLogBus ) @@ -534,8 +539,10 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -EXPORT_C TInt ChspsClient::hspsGetHeaders( const ChspsODT& aSearchMask, - CArrayPtrFlat& aHeaderList ) +EXPORT_C TInt ChspsClient::hspsGetHeaders( + const ChspsODT& aSearchMask, + const TBool aCopyLogos, + CArrayPtrFlat& aHeaderList ) { iHeaderList = &aHeaderList; // Convert search mask ODT to binary stream @@ -553,6 +560,7 @@ ( ThspsServiceCompletedMessage )iSession.GetListHeaders( iResultData, iSearchMaskData->Des(), + aCopyLogos, iHeaderData ); if ( ret == EhspsGetListHeadersSuccess ) diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp --- a/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Wed May 12 13:36:47 2010 +0300 @@ -153,11 +153,13 @@ // ----------------------------------------------------------------------------- // EXPORT_C TInt RhspsClientSession::GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData, - TDes8& aHeaderData) + const TBool aCopyLogos, TDes8& aHeaderData) { aHeaderData.Zero(); aResultData.Zero(); - return SendReceive(EhspsGetListHeaders, TIpcArgs(&aResultData, &aSearchMaskData, &aHeaderData)); + TPckg intPkg( aCopyLogos ); + return SendReceive( EhspsGetListHeaders, + TIpcArgs(&aResultData, &aSearchMaskData, &aHeaderData, &intPkg) ); } // ----------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def --- a/homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,7 @@ _ZN18RhspsClientSession13GetNextHeaderER5TDes8S1_R14TRequestStatus @ 10 NONAME _ZN18RhspsClientSession13ReinstallConfER5TDes8RK23ThspsParamReinstallConf @ 11 NONAME _ZN18RhspsClientSession13ReplacePluginER5TDes8RK23ThspsParamReplacePlugin @ 12 NONAME - _ZN18RhspsClientSession14GetListHeadersER5TDes8RK6TDesC8S1_ @ 13 NONAME + _ZN18RhspsClientSession14GetListHeadersER5TDes8RK6TDesC8iS1_ @ 13 NONAME _ZN18RhspsClientSession14RestoreDefaultER5TDes8RK6TDesC8S1_ @ 14 NONAME _ZN18RhspsClientSession14SetActiveThemeER5TDes8RK6TDesC8S1_ @ 15 NONAME _ZN18RhspsClientSession15SetActivePluginER5TDes8RK24ThpsParamSetActivePlugin @ 16 NONAME @@ -20,9 +20,9 @@ _ZN18RhspsClientSession17SetPluginSettingsER5TDes8S1_27ThspsParamSetPluginSettingsS1_ @ 19 NONAME _ZN18RhspsClientSession18AccessResourceFileER5TDes8RK18ThspsConfigurationRK7TDesC16Ri @ 20 NONAME _ZN18RhspsClientSession20RestoreActiveAppConfER5TDes8RK30ThspsParamRestoreActiveAppConf @ 21 NONAME - _ZN18RhspsClientSession5CloseEv @ 22 NONAME - _ZN18RhspsClientSession6GetODTER5TDes8RK18ThspsConfigurationRK6TDesC8R6TDes16 @ 23 NONAME - _ZN18RhspsClientSession7ConnectEv @ 24 NONAME - _ZN18RhspsClientSession9AddPluginER5TDes8RK18ThpsParamAddPluginRi @ 25 NONAME - _ZN18RhspsClientSession21RestoreConfigurationsER5TDes8RK31ThspsParamRestoreConfigurations @ 26 NONAME + _ZN18RhspsClientSession21RestoreConfigurationsER5TDes8RK31ThspsParamRestoreConfigurations @ 22 NONAME + _ZN18RhspsClientSession5CloseEv @ 23 NONAME + _ZN18RhspsClientSession6GetODTER5TDes8RK18ThspsConfigurationRK6TDesC8R6TDes16 @ 24 NONAME + _ZN18RhspsClientSession7ConnectEv @ 25 NONAME + _ZN18RhspsClientSession9AddPluginER5TDes8RK18ThpsParamAddPluginRi @ 26 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def --- a/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Wed May 12 13:36:47 2010 +0300 @@ -1,7 +1,7 @@ EXPORTS _ZN11ChspsClient13GethspsResultER11ChspsResult @ 1 NONAME _ZN11ChspsClient13hspsAddPluginEiiiiRi @ 2 NONAME - _ZN11ChspsClient14hspsGetHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 3 NONAME + _ZN11ChspsClient14hspsGetHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 3 NONAME _ZN11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 4 NONAME _ZN11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 5 NONAME _ZN11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 6 NONAME @@ -14,7 +14,7 @@ _ZN11ChspsClient17hspsReinstallConfEii @ 13 NONAME _ZN11ChspsClient17hspsReplacePluginEiii @ 14 NONAME _ZN11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 15 NONAME - _ZN11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 16 NONAME + _ZN11ChspsClient18hspsGetListHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 16 NONAME _ZN11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 17 NONAME _ZN11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 18 NONAME _ZN11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 19 NONAME @@ -25,32 +25,32 @@ _ZN11ChspsClient22hspsCancelInstallThemeEv @ 24 NONAME _ZN11ChspsClient24hspsCancelGetListHeadersEv @ 25 NONAME _ZN11ChspsClient24hspsRestoreActiveAppConfEii @ 26 NONAME - _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 27 NONAME - _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 28 NONAME - _ZN11ChspsClient9SetLogBusEPv @ 29 NONAME - _ZTI11ChspsClient @ 30 NONAME - _ZTV11ChspsClient @ 31 NONAME - _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 32 NONAME - _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 33 NONAME - _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 34 NONAME - _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 35 NONAME - _ZThn28_N11ChspsClient22hspsCancelInstallThemeEv @ 36 NONAME - _ZThn32_N11ChspsClient13hspsAddPluginEiiiiRi @ 37 NONAME - _ZThn32_N11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 38 NONAME - _ZThn32_N11ChspsClient16hspsRemovePluginEii @ 39 NONAME - _ZThn32_N11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 40 NONAME - _ZThn32_N11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 41 NONAME - _ZThn32_N11ChspsClient17hspsGetNextHeaderEv @ 42 NONAME - _ZThn32_N11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 43 NONAME - _ZThn32_N11ChspsClient17hspsReplacePluginEiii @ 44 NONAME - _ZThn32_N11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 45 NONAME - _ZThn32_N11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 46 NONAME - _ZThn32_N11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 47 NONAME - _ZThn32_N11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 48 NONAME - _ZThn32_N11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 49 NONAME - _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 50 NONAME - _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 51 NONAME - _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 52 NONAME - _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 53 NONAME - _ZN11ChspsClient25hspsRestoreConfigurationsEii @ 54 NONAME + _ZN11ChspsClient25hspsRestoreConfigurationsEii @ 27 NONAME + _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 28 NONAME + _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 29 NONAME + _ZN11ChspsClient9SetLogBusEPv @ 30 NONAME + _ZTI11ChspsClient @ 31 NONAME + _ZTV11ChspsClient @ 32 NONAME + _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 33 NONAME + _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 34 NONAME + _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 35 NONAME + _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 36 NONAME + _ZThn28_N11ChspsClient22hspsCancelInstallThemeEv @ 37 NONAME + _ZThn32_N11ChspsClient13hspsAddPluginEiiiiRi @ 38 NONAME + _ZThn32_N11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 39 NONAME + _ZThn32_N11ChspsClient16hspsRemovePluginEii @ 40 NONAME + _ZThn32_N11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 41 NONAME + _ZThn32_N11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 42 NONAME + _ZThn32_N11ChspsClient17hspsGetNextHeaderEv @ 43 NONAME + _ZThn32_N11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 44 NONAME + _ZThn32_N11ChspsClient17hspsReplacePluginEiii @ 45 NONAME + _ZThn32_N11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 46 NONAME + _ZThn32_N11ChspsClient18hspsGetListHeadersERK8ChspsODTiR13CArrayPtrFlatIS0_E @ 47 NONAME + _ZThn32_N11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 48 NONAME + _ZThn32_N11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 49 NONAME + _ZThn32_N11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 50 NONAME + _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 51 NONAME + _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 52 NONAME + _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 53 NONAME + _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 54 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp --- a/homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp Wed May 12 13:36:47 2010 +0300 @@ -52,6 +52,7 @@ SOURCE hspsbrobserver.cpp SOURCE hspsbrhandler.cpp SOURCE hspsinstaller.cpp +SOURCE hspsfamily.cpp #if defined(WINSCW) || defined(__WINS__) SOURCE hspsfamilylistener.cpp #endif @@ -81,15 +82,14 @@ LIBRARY hspsdomdocument.lib LIBRARY hspsdefinitionengineinterface.lib LIBRARY ecom.lib // definition engine +LIBRARY MemMan.lib +LIBRARY ws32.lib // RWsSession + #ifdef _hsps_DEBUG_ LIBRARY flogger.lib #endif // _hsps_DEBUG_ LIBRARY sysversioninfo.lib LIBRARY abclient.lib -#if defined(WINSCW) || defined(__WINS__) -LIBRARY ws32.lib // RWsSession -LIBRARY featmgr.lib // FeatureManager -#endif // defined(WINSCW) LANG SC diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsfamily.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsfamily.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* +*/ + +#ifndef HSPSFAMILY_H_ +#define HSPSFAMILY_H_ + +#include +#include + +#include "hspsthememanagement.h" + + + +/** +* @ingroup group_hspsserver +* ChspsFamily is used to get UI's resolution and orientation. +* +* @lib hspsThemeServer.exe +* @since S60 9.2 +*/ +class ChspsFamily + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsFamily* NewL(); + + /** + * ~ChspsFamilyListener + * Destructor. + */ + virtual ~ChspsFamily(); + + /** + * Retrieves family type from a string + * @since S60 9.2 + */ + static ThspsFamily GetFamilyType( + const TDesC8& aFamilyString ); + + /** + * Retrieves family type from the current resolution. + * @since S60 5.0 + * @return Family id + */ + ThspsFamily GetFamilyType(); + + /** + * Retrieves window server session + * @since S60 9.2 + * @return Window server session + */ + inline RWsSession& WsSession(); + + protected: + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + protected: + /** + * C++ default constructor. + */ + ChspsFamily(); + + + /** + * Retrieves used display code. + */ + void GetFamilyString( + TDes8& aFamily ); + + private: // Data + + // Window server session. + RWsSession iWsSession; + + // Client-side handle to a server-side window group. + RWindowGroup iWindowGroup; + + // Screen device, own. + CWsScreenDevice* iScreenDevice; + + }; + + +// Inline methods + + +// ----------------------------------------------------------------------------- +// ChspsFamily::WsSession +// ----------------------------------------------------------------------------- +// +RWsSession& ChspsFamily::WsSession() + { + return iWsSession; + } + + + +#endif /* HSPSFAMILY_H_ */ + +// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h Wed May 12 13:36:47 2010 +0300 @@ -24,12 +24,9 @@ #ifndef HSPSFAMILYLISTENER_H_ #define HSPSFAMILYLISTENER_H_ -#include -#include +#include "hspsfamily.h" -#include "hspsthememanagement.h" - - +class ChspsFamilyListener; /** * @ingroup group_hspsserver * HandleFamilyChangeL. @@ -47,45 +44,44 @@ virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0; }; -/** -* @ingroup group_hspsserver -* ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation. -* Used on emulator environment only. -* -* @lib hspsThemeServer.exe -* @since S60 5.0 -*/ -class ChspsFamilyListener : public CActive - { + +class ChspsFamilyListenerActive : public CActive + { public: // Constructors and destructor /** * NewL * Two-phased constructor. */ - static ChspsFamilyListener* NewL( + static ChspsFamilyListenerActive* NewL( + ChspsFamilyListener& aListener, MhspsFamilyObserver& aObserver ); /** * ~ChspsFamilyListener * Destructor. */ - virtual ~ChspsFamilyListener(); + virtual ~ChspsFamilyListenerActive(); + + private: + /** - * Retrieves family type from a string - * @since S60 5.0 + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + ChspsFamilyListenerActive( + ChspsFamilyListener& aListener, + MhspsFamilyObserver& iObserver); + + public: + /** + * Start listener. */ - static ThspsFamily GetFamilyType( - const TDesC8& aFamilyString ); - - /** - * Retrieves family type from the current resolution. - * @since S60 5.0 - * @return Family id - */ - ThspsFamily GetFamilyType(); - + void Queue(); + protected: // Functions from base classes /** @@ -108,6 +104,42 @@ * @since S60 5.0 */ TInt RunError(TInt aError); + + private: // data + + // Listener reference, not owned + ChspsFamilyListener& iListener; + + // Observer which is called when RunL occurs + MhspsFamilyObserver& iObserver; + + }; + +/** +* @ingroup group_hspsserver +* ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation. +* Used on emulator environment only. +* +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsFamilyListener : public ChspsFamily + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsFamilyListener* NewL( + MhspsFamilyObserver& aObserver ); + + /** + * ~ChspsFamilyListener + * Destructor. + */ + virtual ~ChspsFamilyListener(); + private: @@ -115,19 +147,14 @@ * ConstructL * By default Symbian 2nd phase constructor is private. */ - void ConstructL(); + void ConstructL( MhspsFamilyObserver& aObserver ); /** * ChspsCenRepListener * C++ default constructor. */ - ChspsFamilyListener( - MhspsFamilyObserver& aObserver ); + ChspsFamilyListener(); - /** - * Start listener. - */ - void Queue(); /** * Retrieves used display code. @@ -137,20 +164,10 @@ private: // Data - // Observer which is called when RunL occurs - MhspsFamilyObserver& iObserver; - - // Window server session. - RWsSession iWsSession; - // Client-side handle to a server-side window group. RWindowGroup iWindowGroup; - CWsScreenDevice* iScreenDevice; - - TUint32 iActiveFamily; - - TBool iFeatureManagerLoaded; + ChspsFamilyListenerActive* iFamilyListenerActive; }; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Wed May 12 13:36:47 2010 +0300 @@ -239,6 +239,14 @@ ThspsServiceCompletedMessage hspsInstallTheme( const TDesC& aManifestFileName, TDes8& aHeaderData ); + + /** + * Parses the manifest file and requests installation of next phases. + * @since S60 5.2 + * @param aManifest is full path of the installation script file - a manifest file + */ + void DoInstallThemeL( + const TDesC& aManifest ); /** * From MhspsInstallationService hspsInstallNextPhaseL @@ -596,18 +604,20 @@ const TDesC& aPath, const TLanguage aLanguage ); + /** + * Finds all language specific folders and resources + * under the interface path in ROM or UDA drive. + * @since S60 5.0 + * @path aPath Xuikon path + */ void AddInterfaceResourcesV2L( const TDesC& aPath ); - - void AddLocalizedResourcesV2L( - const TDesC& aPath, - const TLanguage aLanguage ); /** * Validates manifest contents and installs files into the Plug-in Repository. * @since S60 5.0 */ - void ValidateL(); + void FinalizeParsingL(); /** * Validates provided UID value. @@ -640,7 +650,7 @@ HBufC8& aValue8, const TDesC8& aTag, HBufC*& aResultString ); - + public: ChspsResult* iResult; @@ -693,7 +703,7 @@ TBool iDefaultSpecificationSet; // Path to installation files - TPtrC iThemeFilePath; + TPath iThemeFilePath; // Application or interface UID of the installed theme TUint iRootUid; @@ -770,8 +780,8 @@ // Set if "EhspsODTAdded" -notifications should be blocked (e.g. ROM installations) TBool iDisableNotifications; - // Set if installation files are located in ROM - TBool iRomInstallation; + // Set if installation files are located in ROM or in UDA, validation is not required + TBool iTrustedInstallation; // Set if widget mutliinstance flag TInt32 iMultiInstance; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Wed May 12 13:36:47 2010 +0300 @@ -343,6 +343,7 @@ * @return ThspsServiceCompletedMessage expressing the result of the call. */ ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& /*aSearchMask*/ + , const TBool /*aCopyLogos*/ , CArrayPtrFlat& /*aHeaderList*/); /** @@ -806,14 +807,6 @@ ChspsDomNode& aPluginNode ); /** - * Copies logo icons to Homescreen's private folder - * @since S60 5.1 - * @param aAppUid Identifies the client process - */ - void CopyIconsToHomescreenL( - const TUint aAppUid ); - - /** * Appends missing plugin with a dummy configuration where status="Error" * @since S60 5.0 * @param aAppDom is a DOM of an application configuration @@ -884,8 +877,7 @@ TBool iSubscription; TInt iDeliveryCount; ChspsODT* iSearchMask; - ChspsODT* iSetMask; - TLanguage iLanguage; + ChspsODT* iSetMask; ChspsThemeServer& iThemeServer; // Identifies the client application @@ -899,6 +891,7 @@ CArrayPtrSeg& iHeaderListCache; ChspsThemeServerSession* iServerSession; // Not owned. CFileMan* iFileMan; + TBool iMaintainLogoResources; #ifdef HSPS_LOG_ACTIVE /** * Log bus. diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h Wed May 12 13:36:47 2010 +0300 @@ -77,26 +77,16 @@ virtual ~ChspsRomInstaller(); public: // New functions - - /** - * Finds plugin_*.dat and app_*.dat files from Z\private\200159C0\install - * File names are stored into iImportsArrayV1 member array - * @since S60 5.0 - */ - void FindImportsV1L(); - - /** - * Imports. - * Returns a reference to the imports list, which is maintained by the class. - * Contents of the list is set in FindImportsL() function. - * @since S60 5.0 - * @return an array of *.DAT files which were found from the ROM drive. - */ - const RPointerArray& ImportsV1(); + /** - * InstallTheme - * Synchronous service for installing configurations from provided manifest files. + * Installs all plugin configurations which can be found from ROM and C drives (UDA). + * @since S60 5.2 + */ + void InstallL(); + + /** + * Installs a plugin configuration from the provided manifest file (synchronous). * @since S60 5.0 * @param aFileName is name of the manifest file to be installed. * @return ThspsServiceCompletedMessage error code @@ -105,25 +95,16 @@ const TDesC& aFileName ); /** - * ReinstallThemeL. - * Synchronous service for re-installing corrupted application configurations - * from an import (imports\app_*.dat file). + * Re-installs an application plugin configuration (synchronous). * @since S60 5.0 * @param aAppUid is UID of an application - * @param aConfigurationUid is UID of a HSPS configuration + * @param aConfigurationUid is UID of an application plugin configuration * @return ThspsServiceCompletedMessage error code */ ThspsServiceCompletedMessage ReinstallThemeL( const TInt aAppUid, const TInt aConfigurationUid ); - - /** - * Gets names of the folders which should be installed from Z\private\200159C0\install - * @since S60 5.0 - */ - void GetInstallationFoldersL( - RPointerArray& aFolders ); - + #ifdef HSPS_LOG_ACTIVE /** * Set log bus. @@ -175,18 +156,29 @@ * @since S60 5.0 */ void ConstructL(); + + /** + * Retrieves manifest files from both Z and C drives located in + * \\private\200159C0\install\ paths. + * @since S60 5.0 + */ + void FindInstallationFilesL( + RPointerArray& aFolders ); + + void DoFindInstallationFilesL( + RPointerArray& aFolders, + const TDesC& aPath ); /** - * SetImportsFilterL. - * Finds specific imports ("plugin_*.dat"/"app_*.dat" files) from ROM drive's - * import folder. Search results are appended into iImportsArray member. - * @since S60 5.0 - * @param aFileFilter is a filter for finding the imports - * @param - * @return ETrue if files were found and added into the array + * Finds an installation file from a directory structure + * which has UID in hex format as folder name. + * @since S60 5.2 + * @param aConfigurationUid Configuration to be found + * @param aManifest Found manifest file */ - TBool SetImportsFilterL( - const TDesC& aFileFilter ); + void FindInstallationFileL( + const TInt aConfigurationUid, + TFileName& aManifest ); private: // Data @@ -199,10 +191,7 @@ ChspsInstallationHandler* iInstallationHandler; // Required by the installation process - TBuf8 iHeaderData; - - // An array of found *.DAT files - RPointerArray iImportsArrayV1; + TBuf8 iHeaderData; // Results of the previous installation ThspsServiceCompletedMessage iRet; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Wed May 12 13:36:47 2010 +0300 @@ -462,13 +462,13 @@ const TDesC8& aAttrValue ); /** - * Retrieves a filename from a file declaration. - * @since S60 5.1 + * Retrieves filename from a logo declaration. + * @since S60 5.2 * @param aFileDeclaration "SKIN():MIF()", "MIF()", "UID()" or "file.ext" string * @param aFilename Referred file name or NULL * @return True if a file was referred from the declaration */ - static TBool hspsServerUtil::IsFile( + static TBool IsLogoFile( const TDesC& aFileDeclaration, TFileName& aFilename ); @@ -523,6 +523,63 @@ const TDesC8& aNodeTag, ChspsDomNode& aDomNode ); + /** + * Eclipsing enabler for customization where the input is + * searched from all secure unremovable drives. + * Drives are searched in descending alphabetical order, + * from Y: to A:, and ending with the Z: drive. + * All drives which end-user can freely modify/crack + * are skipped from the search. + * @since S60 5.2 + * @param aFs is a reference to open file server session handle + * @param aPath is path of the file + * @param aFilename is name and extension of the file + * @param aDrivePathName Full path with a drive letter to the + * resource file (output) + */ + static TInt FindFile( + RFs& aFs, + const TDesC& aPath, + const TDesC& aFilename, + TFileName& aDrivePathName ); + + /** + * Resolves icon path information from the provided logo declaration. + * Example: + * Decl. = "mif(536999050\270513751\268475903\1.0\sources\icon.mif)" + * Source = "c\private\200159c0\themes\536999050\270513751\268475903\1.0\sources\icon.mif" + * Target = "c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif" + * Up.decl = "mif(c\private\102750f0\536999050\270513751\268475903\1.0\sources\icon.mif)" + * @since S60 5.2 + * @param aLogoDeclaration Skin():mif(), mif(), uid(), icon.mif declaration + * @param aAppUid Identifies the private directory where the logo file is copied to + * @param aTargetPath Empty or location of the target file + * @param aSourcePath Empty or location of the source file + * @param aUpdatedDeclaration Empty or declaration which points to the target location + */ + static void PopulateLogoPathsL( + const TDesC& aLogoDeclaration, + const TUint aAppUid, + RBuf& aTargetPath, + RBuf& aSourcePath, + RBuf& aUpdatedDeclaration ); + + /** + * Finds ecplised files from the provided path in given drive order. + * @since S60 5.2 + * @param aFs is a reference to open file server session handle + * @param aDriveArray An array of drives in search order + * @param aPath Relative path to be found + * @param aFolders Search results or empty + * @param aRecursive True if files should be found from any sudirectories + */ + static void FindFilesRecursivelyL( + RFs& aFs, + const RArray& aDriveArray, + const TDesC& aPath, + RPointerArray& aFolders, + TBool aRecursive = EFalse ); + private: /** * Internal method. Do not call directly! diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Wed May 12 13:36:47 2010 +0300 @@ -179,7 +179,7 @@ _LIT(KhspsThemeServerName,"hspsthemeserver"); /** Supported manifest version */ -_LIT(KhspsSupportedManifestVersion,"1.0"); +_LIT(KhspsSupportedManifestVersion,"2.0"); /** hspsThemeServer Uid3 = SECUREID. */ const TUid KhspsThemeServerUid3 = {0x200159C0}; //old uid 0x10207254}; @@ -209,6 +209,8 @@ class ChspsSecurityEnforcer; class ChspsRomInstaller; class ChspsAutoInstaller; +class ChspsThemeServerSession; +class ChspsFamily; #ifdef HSPS_LOG_ACTIVE class ChspsLogBus; @@ -396,15 +398,21 @@ /** * AddSession + * + * @param aSession Session that is added. Ownership not transferred!. + * * @since S60 3.1 */ - void AddSession(); + void AddSession( ChspsThemeServerSession* aSession ); /** * DropSession + * + * @param aSession Session that is dropped. Ownership not transferred!. + * * @since S60 3.1 */ - void DropSession(); + void DropSession( ChspsThemeServerSession* aSession ); public: // public functions @@ -624,7 +632,19 @@ * @returns The active family */ TUint32 GetActiveFamilyL( - const TInt aAppUid ); + const TInt aAppUid ); + + /** + * Installs widgets located at \private\200159C0\install\ directories. + * @since S60 5.0 + */ + void InstallWidgetsL(); + + /** + * Install all widgets from uda + * @since S60 5.2 + */ + void InstallUDAWidgetsL(); public: // from MhspsFileChangeObserver @@ -664,10 +684,11 @@ void HandleCenRepChangeL( const TUint32 aId ); -#if defined(WINSCW) || defined(__WINS__) + public: // from MshspFamilyObserver TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ); -#endif // defined(WINSCW) + + ChspsFamily* Family(); private: @@ -799,23 +820,7 @@ * @since S60 5.0 */ void HandleRomInstallationsL(); - - /** - * Executes installation of manifest files from the ROM drive. - * @since S60 5.0 - */ - void InstallManifestsFromRomDriveL(); - - /** - * V2 method for finding manifest files from Z\private\200159C0\install subfolders, - * these folders should have a "hsps" subfolder. - * Appends iManifestFiles array. - * @since S60 5.0 - * @param aPluginFolders holds names of the plugin folders which are V2 based - */ - void FindRomInstallationsV2L( - RPointerArray& aPluginFolders ); - + /** * Initiates uninstallation of a manifest file located under the imports folder. * @since S60 5.0 @@ -980,9 +985,8 @@ */ void RestoreConfigurationL( ChspsODT& aOdt ); - -#if defined(WINSCW) || defined(__WINS__) +#if defined(WINSCW) || defined(__WINS__) /** * Executed at startup to activate root configurations which were designed * for the current resolution. @@ -990,12 +994,8 @@ */ void ActivateRootConfigurationsL(); -#endif // defined(WINSCW) - - -private: - TInt iSessionCount; - +#endif // defined(WINSCW) || defined(__WINS__) + #ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ CShutdown* iShutdown; #endif // _hsps_SERVER_SHUTDOWN_ENABLED_ @@ -1067,10 +1067,10 @@ CHSPSBRHandler* iBRHandler; -#if defined(WINSCW) || defined(__WINS__) - // Listener for resolution and orientation changes - ChspsFamilyListener* iFamilyListener; -#endif // defined(WINSCW) + + // Family handler, own + ChspsFamily* iFamily; + #ifdef HSPS_LOG_ACTIVE /** @@ -1078,6 +1078,8 @@ */ ChspsLogBus* iLogBus; #endif + + RPointerArray iSessions; // Sessions not owned! }; #endif //__hspsTHEMESERVER_H__ diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h Wed May 12 13:36:47 2010 +0300 @@ -63,6 +63,41 @@ * @return Reference to RFs instance */ RFs& FileSystem(); + + /** + * Return whether icon file copy required. + * + * @return TBool ETrue if icon file copy is required. Otherwise false. + */ + TBool IconFileCopyRequired() const; + + /** + * Set icon file copy requirement flag. + * + * @param aCopyRequired Value to be set. + */ + void SetIconFileCopyRequired( const TBool aCopyRequired ); + + /** + * Return whether resource file copy required. + * + * @return TBool ETrue if icon file copy is required. Otherwise false. + */ + TBool ResourceFileCopyRequired() const; + + /** + * Set resource file copy requirement flag. + * + * @param aCopyRequired Value to be set. + */ + void SetResourceFileCopyRequired( const TBool aCopyRequired ); + + /** + * Get app uid of session + * + * @return App uid. + */ + TInt AppUid() const; private: @@ -304,6 +339,17 @@ TBool iHoldingResources; TInt iAppUid; + + /** + * Boolean to indicate that icon files need to be copied. + */ + TBool iIconFileCopyRequired; + + /** + * Boolean to indicate that resource files need to be copied. + */ + TBool iResourceFileCopyRequired; + #ifdef HSPS_LOG_ACTIVE /** * Log bus. diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -703,61 +703,70 @@ { // Check parent element parentNode = node->Parent(); - const TDesC8& parentName = parentNode->Name(); - + const TDesC8& parentName = parentNode->Name(); if( parentName == KPluginElement ) { - ChspsDomList& initial_settings_childList = node->ChildNodes(); - - ChspsDomNode* initialSettingsNode = static_cast(initial_settings_childList.FindByName( KSettingsElement )); - - ChspsDomList& initial_items = initialSettingsNode->ChildNodes(); - - ChspsDomNode* controlNode = hspsServerUtil::FindNodeByTagL(KControlElement, *parentNode ); - - if( controlNode ) + ChspsDomList& initial_settings_childList = node->ChildNodes(); + ChspsDomNode* initialSettingsNode = + static_cast(initial_settings_childList.FindByName( KSettingsElement )); + if( initialSettingsNode ) { - ChspsDomList& controlNode_childList = controlNode->ChildNodes(); - - ChspsDomNode* settingsNode = static_cast(controlNode_childList.FindByName( KSettingsElement )); - - if( settingsNode ) + + ChspsDomList& initial_items = initialSettingsNode->ChildNodes(); + ChspsDomNode* controlNode = hspsServerUtil::FindNodeByTagL(KControlElement, *parentNode ); + + if( controlNode ) { - ChspsDomList& items = settingsNode->ChildNodes(); - - if( items.Length() == initial_items.Length() ) + ChspsDomList& controlNode_childList = controlNode->ChildNodes(); + + ChspsDomNode* settingsNode = static_cast(controlNode_childList.FindByName( KSettingsElement )); + + if( settingsNode ) { - TInt index = controlNode->ItemIndex( *settingsNode ); - controlNode->DeleteChild(settingsNode); - ChspsDomNode* clone = initialSettingsNode->CloneL( aAppODT.DomDocument().StringPool() ); - CleanupStack::PushL( clone ); - controlNode->AddChildL( clone, index ); - clone->SetParent( controlNode ); - CleanupStack::Pop( clone ); - } - else if( items.Length() > initial_items.Length() ) - { - error = ParseInitialSettingsItemsL(*initialSettingsNode,*settingsNode); + ChspsDomList& items = settingsNode->ChildNodes(); + + if( items.Length() == initial_items.Length() ) + { + TInt index = controlNode->ItemIndex( *settingsNode ); + controlNode->DeleteChild(settingsNode); + ChspsDomNode* clone = initialSettingsNode->CloneL( aAppODT.DomDocument().StringPool() ); + CleanupStack::PushL( clone ); + controlNode->AddChildL( clone, index ); + clone->SetParent( controlNode ); + CleanupStack::Pop( clone ); + } + else if( items.Length() > initial_items.Length() ) + { + error = ParseInitialSettingsItemsL(*initialSettingsNode,*settingsNode); + } + else + { + error = KErrCorrupt; + } } else { - error = KErrCorrupt; + error = KErrNotFound; } } else { - error = KErrNotFound; + error = KErrCorrupt; } - } + + // clean settings under initialsettings + node->ChildNodes().RemoveItem( initialSettingsNode ); + delete initialSettingsNode; + initialSettingsNode = NULL; + + } else { + // initialSettingsNode (KSettingsElement) not found error = KErrCorrupt; } - // clean settings under initialsettings - node->ChildNodes().RemoveItem( initialSettingsNode ); - delete initialSettingsNode; - initialSettingsNode = NULL; - } + + } } prevNode = node; @@ -955,11 +964,14 @@ ChspsDomAttribute* attr = static_cast( attrList.FindByName( KItemAttrId )); - const TDesC8& value = attr->Value(); - if( value.Compare( aNodeIdentifier ) == 0 ) - { - found = ETrue; - targetNode = node; + if( attr ) + { + const TDesC8& value = attr->Value(); + if( value.CompareF( aNodeIdentifier ) == 0 ) + { + found = ETrue; + targetNode = node; + } } } node = iter->NextL(); diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsfamily.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsfamily.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Family gets resolution and orientation +* +*/ + +#include "hspsfamily.h" +#include "hsps_builds_cfg.hrh" +#include "hspsmanifest.h" +#include + + +_LIT8(KTch, "_tch"); +const TInt KMaxFamilyLength( 20 ); + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// ChspsFamily::NewL +// ----------------------------------------------------------------------------- +// +ChspsFamily* ChspsFamily::NewL() + { + ChspsFamily* self = new(ELeave) ChspsFamily(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsFamily::ChspsFamily +// ----------------------------------------------------------------------------- +// +ChspsFamily::ChspsFamily() + { + } + +// ----------------------------------------------------------------------------- +// ChspsFamily::ConstructL +// ----------------------------------------------------------------------------- +// +void ChspsFamily::ConstructL() + { + + User::LeaveIfError( iWsSession.Connect() ); + + iScreenDevice = new (ELeave) CWsScreenDevice( iWsSession ); + + User::LeaveIfError( iScreenDevice->Construct() ); + + } + + +// ------------------------------------------------------------------------------ +// ChspsFamily::~ChspsFamily +// ------------------------------------------------------------------------------ +ChspsFamily::~ChspsFamily() + { + + delete iScreenDevice; + iWsSession.Close(); + } + +// ----------------------------------------------------------------------------- +// ChspsFamily::GetFamilyString +// ----------------------------------------------------------------------------- +void ChspsFamily::GetFamilyString( + TDes8& aFamily ) + { + // Append input with a prefix based on the active screen resolution + TPixelsTwipsAndRotation sizeAndRotation; + iScreenDevice->GetDefaultScreenSizeAndRotation( sizeAndRotation ); + TSize resolution( sizeAndRotation.iPixelSize ); + if( resolution.iWidth > resolution.iHeight ) + { + TInt temp = resolution.iHeight; + resolution.iHeight = resolution.iWidth; + resolution.iWidth = temp; + } + switch( resolution.iHeight ) + { + case 320: + { + if ( resolution.iWidth == 240 ) + { + aFamily.Append( KFamilyQvga ); + } + } + break; + case 640: + { + if( resolution.iWidth == 360 ) + { + aFamily.Append( KFamilyQhd ); + } + else if( resolution.iWidth == 480 ) + { + aFamily.Append( KFamilyVga ); + } + } + break; + + default: + break; + } + if( aFamily.Length() > 0 ) + { + aFamily.Append( KTch ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsFamily::GetFamilyType +// ----------------------------------------------------------------------------- +ThspsFamily ChspsFamily::GetFamilyType( + const TDesC8& aFamilyString ) + { + ThspsFamily family( EhspsFamilyUnknown ); + + if( aFamilyString == KFamilyQvga ) + { + family = EhspsFamilyQvga; + } + else if( aFamilyString == KFamilyQvga2 ) + { + family = EhspsFamilyQvga2; + } + else if( aFamilyString == KFamilyVga ) + { + family = EhspsFamilyVga; + } + else if( aFamilyString == KFamilyVga3 ) + { + family = EhspsFamilyVga3; + } + else if( aFamilyString == KFamilyQhd ) + { + family = EhspsFamilyQhd; + } + else if( aFamilyString == KFamilyQhd_tch ) + { + family = EhspsFamilyQhd_tch; + } + else if( aFamilyString == KFamilyVga_tch ) + { + family = EhspsFamilyVga_tch; + } + + return family; + } + +// ----------------------------------------------------------------------------- +// ChspsFamily::GetFamilyType +// ----------------------------------------------------------------------------- +ThspsFamily ChspsFamily::GetFamilyType() + { + TBuf8 familyString; + GetFamilyString( familyString ); + return GetFamilyType( familyString ); + } + + + +// End of File + diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp Wed May 12 13:36:47 2010 +0300 @@ -19,7 +19,6 @@ #include "hspsfamilylistener.h" #include "hsps_builds_cfg.hrh" #include "hspsmanifest.h" -#include _LIT8(KTch, "_tch"); @@ -35,9 +34,9 @@ // ChspsFamilyListener* ChspsFamilyListener::NewL( MhspsFamilyObserver& aObserver ) { - ChspsFamilyListener* self = new(ELeave) ChspsFamilyListener( aObserver ); + ChspsFamilyListener* self = new(ELeave) ChspsFamilyListener( ); CleanupStack::PushL( self ); - self->ConstructL(); + self->ConstructL( aObserver ); CleanupStack::Pop( self ); return self; } @@ -46,41 +45,77 @@ // ChspsFamilyListener::ChspsFamilyListener // ----------------------------------------------------------------------------- // -ChspsFamilyListener::ChspsFamilyListener( MhspsFamilyObserver& aObserver ) - : CActive( EPriorityStandard ), iObserver( aObserver), iActiveFamily( EhspsFamilyUnknown ) +ChspsFamilyListener::ChspsFamilyListener() { - CActiveScheduler::Add(this); } // ----------------------------------------------------------------------------- // ChspsFamilyListener::ConstructL // ----------------------------------------------------------------------------- // -void ChspsFamilyListener::ConstructL() +void ChspsFamilyListener::ConstructL( MhspsFamilyObserver& aObserver ) { - User::LeaveIfError( iWsSession.Connect() ); - + + // ChspsFamily::ConstructL ChspsFamily's second phase constructor call + ChspsFamily::ConstructL(); + + iFamilyListenerActive = ChspsFamilyListenerActive::NewL( *this, aObserver ); + // A group needs to be instansiated so that we're able to receive events - iWindowGroup = RWindowGroup( iWsSession ); + iWindowGroup = RWindowGroup( WsSession() ); User::LeaveIfError( iWindowGroup.Construct(2,ETrue) ); // '2' is a meaningless handle // Enables for EEventScreenDeviceChanged events iWindowGroup.EnableScreenChangeEvents(); - - iScreenDevice = new (ELeave) CWsScreenDevice( iWsSession ); - User::LeaveIfError( iScreenDevice->Construct() ); // Start the listener - Queue(); + iFamilyListenerActive->Queue(); } + + + + +ChspsFamilyListenerActive* ChspsFamilyListenerActive::NewL( + ChspsFamilyListener& aListener, + MhspsFamilyObserver& aObserver ) + { + ChspsFamilyListenerActive* self = new( ELeave ) ChspsFamilyListenerActive( + aListener, + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +ChspsFamilyListenerActive::~ChspsFamilyListenerActive() + { + Cancel(); + } + +void ChspsFamilyListenerActive::ConstructL() + { + } + +ChspsFamilyListenerActive::ChspsFamilyListenerActive( + ChspsFamilyListener& aListener, + MhspsFamilyObserver& aObserver ) + :CActive( EPriorityStandard ), + iListener( aListener), + iObserver( aObserver ) + { + CActiveScheduler::Add(this); + } + + // ------------------------------------------------------------------------------ -// ChspsFamilyListener::Queue +// ChspsFamilyListenerActive::Queue // ------------------------------------------------------------------------------ -void ChspsFamilyListener::Queue() +void ChspsFamilyListenerActive::Queue() { ASSERT ( !IsActive() ); - iWsSession.EventReady( &iStatus ); + iListener.WsSession().EventReady( &iStatus ); SetActive(); } @@ -89,139 +124,31 @@ // ------------------------------------------------------------------------------ ChspsFamilyListener::~ChspsFamilyListener() { - Cancel(); - if ( iFeatureManagerLoaded ) + if ( iFamilyListenerActive ) { - FeatureManager::UnInitializeLib(); + delete iFamilyListenerActive; } - delete iScreenDevice; iWindowGroup.Close(); - iWsSession.Close(); } + + + // ----------------------------------------------------------------------------- -// ChspsFileChangeListener::GetFamilyString +// ChspsFamilyListener::RunL // ----------------------------------------------------------------------------- -void ChspsFamilyListener::GetFamilyString( - TDes8& aFamily ) - { - // Append input with a prefix based on the active screen resolution - TPixelsTwipsAndRotation sizeAndRotation; - iScreenDevice->GetDefaultScreenSizeAndRotation( sizeAndRotation ); - TSize resolution( sizeAndRotation.iPixelSize ); - if( resolution.iWidth > resolution.iHeight ) - { - TInt temp = resolution.iHeight; - resolution.iHeight = resolution.iWidth; - resolution.iWidth = temp; - } - switch( resolution.iHeight ) - { - case 320: - { - if ( resolution.iWidth == 240 ) - { - aFamily.Append( KFamilyQvga ); - } - } - break; - case 640: - { - if( resolution.iWidth == 360 ) - { - aFamily.Append( KFamilyQhd ); - } - else if( resolution.iWidth == 480 ) - { - aFamily.Append( KFamilyVga ); - } - } - break; - - default: - break; - } - if( aFamily.Length() > 0 ) - { -// // Append input with a suffix based on the touch support -// if ( !iFeatureManagerLoaded ) -// { -// FeatureManager::InitializeLibL(); -// iFeatureManagerLoaded = ETrue; -// } -// if ( FeatureManager::FeatureSupported( KFeatureIdPenSupport ) ) -// { - aFamily.Append( KTch ); -// } - } - } - -// ----------------------------------------------------------------------------- -// ChspsFileChangeListener::GetFamilyType -// ----------------------------------------------------------------------------- -ThspsFamily ChspsFamilyListener::GetFamilyType( - const TDesC8& aFamilyString ) - { - ThspsFamily family( EhspsFamilyUnknown ); - - if( aFamilyString == KFamilyQvga ) - { - family = EhspsFamilyQvga; - } - else if( aFamilyString == KFamilyQvga2 ) - { - family = EhspsFamilyQvga2; - } - else if( aFamilyString == KFamilyVga ) - { - family = EhspsFamilyVga; - } - else if( aFamilyString == KFamilyVga3 ) - { - family = EhspsFamilyVga3; - } - else if( aFamilyString == KFamilyQhd ) - { - family = EhspsFamilyQhd; - } - else if( aFamilyString == KFamilyQhd_tch ) - { - family = EhspsFamilyQhd_tch; - } - else if( aFamilyString == KFamilyVga_tch ) - { - family = EhspsFamilyVga_tch; - } - - return family; - } - -// ----------------------------------------------------------------------------- -// ChspsFileChangeListener::GetFamilyType -// ----------------------------------------------------------------------------- -ThspsFamily ChspsFamilyListener::GetFamilyType() - { - TBuf8 familyString; - GetFamilyString( familyString ); - return GetFamilyType( familyString ); - } - -// ----------------------------------------------------------------------------- -// ChspsFileChangeListener::RunL -// ----------------------------------------------------------------------------- -void ChspsFamilyListener::RunL() +void ChspsFamilyListenerActive::RunL() { TWsEvent wsEvent; - iWsSession.GetEvent(wsEvent); + iListener.WsSession().GetEvent(wsEvent); switch( wsEvent.Type() ) { case EEventScreenDeviceChanged: { - ThspsFamily newFamily = GetFamilyType(); + ThspsFamily newFamily = iListener.GetFamilyType(); if ( newFamily > EhspsFamilyUnknown ) { iObserver.HandleFamilyChangeL( newFamily ); - iActiveFamily = newFamily; } break; } @@ -236,15 +163,15 @@ // ChspsFileChangeListener::DoCancel // ----------------------------------------------------------------------------- // -void ChspsFamilyListener::DoCancel() +void ChspsFamilyListenerActive::DoCancel() { - iWsSession.EventReadyCancel(); + iListener.WsSession().EventReadyCancel(); } // ----------------------------------------------------------------------------- // ChspsFileChangeListener::RunError // ----------------------------------------------------------------------------- -TInt ChspsFamilyListener::RunError(TInt /*aError*/) +TInt ChspsFamilyListenerActive::RunError(TInt /*aError*/) { return KErrNone; } diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -56,8 +56,9 @@ _LIT8(KhspsDefinitionEngine, "hspsdefinitionengine"); _LIT(KPathDelim, "\\"); +_LIT(KPrivateInstall, "\\private\\200159c0\\install\\"); _LIT(KHsps, "\\hsps\\" ); -_LIT(KXuikon, "xuikon\\" ); +_LIT(KXuikon, "xuikon" ); const TInt KMaxMediaTypeLength = 100; @@ -99,7 +100,7 @@ iDefaultSpecificationSet = EFalse; iDefaultSpecification = ELangNone; iInstallationMode = EServiceHandler; - iRomInstallation = EFalse; + iTrustedInstallation = EFalse; iInstallationType = EInstallationTypeNew; iFamilyMask = 0; } @@ -297,9 +298,11 @@ // ----------------------------------------------------------------------------- void ChspsInstallationHandler::ResetL() { + iThemeFilePath.FillZ(); iFamilyMask = 0; iInstallationPhase = EhspsPhaseInitialise; - iThemeStatus = EhspsThemeStatusNone; + iThemeStatus = EhspsThemeStatusNone; + iTrustedInstallation = EFalse; iFileNotFound = EFalse; delete iMediaType; iMediaType = NULL; @@ -357,109 +360,109 @@ TDes8& aHeaderData) { // Assume that the installation fails - ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; - iResult->iXuikonError = KErrManifestFileCorrupted; - - // Reset memeber variables - TInt errorCode = KErrNone; - TRAP( errorCode, ResetL() ); - if ( !errorCode ) - { - // Get manifest file path - iThemeFilePath.Set( TParsePtrC( aManifestFileName ).DriveAndPath() ); - // Check if ROM installation is requested - iRomInstallation = EFalse; - TParse driveParser; - driveParser.Set( iThemeFilePath, NULL, NULL ); - TInt driveNumber; - if ( RFs::CharToDrive( driveParser.Drive()[0], driveNumber ) == KErrNone ) - { - if ( driveNumber == EDriveZ ) - { - iRomInstallation = ETrue; - } - } - -#ifdef HSPS_LOG_ACTIVE - if ( iLogBus ) - { - iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme() - *** Parsing a manifest file:" ) ); - } -#endif - if( BaflUtils::FileExists( iFsSession, aManifestFileName ) ) - { - // Parse XML from the manifest file - TRAP( errorCode, Xml::ParseL( *iXmlParser, iFsSession, aManifestFileName )); - } - else - { -#ifdef HSPS_LOG_ACTIVE - if ( iLogBus ) - { - iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme() - Manifest was not found!" ) ); - } -#endif - iFileNotFound = ETrue; - errorCode = KErrNotFound; - } + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + iResult->iXuikonError = 0; + iResult->iIntValue2 = 0; + + TRAPD( err, DoInstallThemeL(aManifestFileName) ); + if( !err ) + { + // correct headerdata is in iHeaderData set by CheckHeaderL() + aHeaderData = iHeaderData->Des(); + + // Set next phase + iInstallationPhase = EhspsPhaseCleanup; + ret = EhspsInstallThemeSuccess; } - - if ( !errorCode && !iFileNotFound ) - { - // The manifest file has been read at this point and following callbacks have been executed: - // (unless the manifest was invalid): OnContent, OnStartElement, OnEndElement - - // Detect installation type. - // Performance optimization: do not check if installing from rom. - if( !iRomInstallation ) - { - // Check type of installation - TBool instancesFound = EFalse; - TRAP( errorCode, instancesFound = IsPluginUsedInAppConfsL() ); - if( iThemeServer.PluginInHeaderCache( TUid::Uid( iThemeUid ) ) && instancesFound ) - { - // Plugin should be found from cache, update notifications are - // sent only when plugins are used by one/more app configurations - iInstallationType = EInstallationTypeUpdate; - } - else - { - iInstallationType = EInstallationTypeNew; - } - } - if ( !errorCode ) - { - // Check the manifest - TRAP( errorCode, ValidateL() ); - } - if ( !errorCode ) - { - // correct headerdata is in iHeaderData set by CheckHeaderL() - aHeaderData = iHeaderData->Des(); - - ret = EhspsInstallThemeSuccess; - - // Set next phase - iInstallationPhase = EhspsPhaseCleanup; - - // number of all resources to iResult - iResult->iIntValue2 = 0; - } - } - - if ( errorCode ) + else { #ifdef HSPS_LOG_ACTIVE if( iLogBus ) { iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme(): - Installation failed with error code %d" ), - errorCode ); + err ); } -#endif +#endif } + + iResult->iSystemError = err; + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::DoInstallThemeL() +// ----------------------------------------------------------------------------- +void ChspsInstallationHandler::DoInstallThemeL( + const TDesC& aManifest ) + { + // Reset memeber variables + ResetL(); + + TParsePtrC parsePtr( aManifest ); + + // Store the path to the installation file + __ASSERT_DEBUG( aManifest.Length() < KMaxFileName, User::Leave( KErrBadName ) ); + iThemeFilePath.Copy( parsePtr.DriveAndPath() ); + + // If trying to install widgets from one of our private install directories + const TPath path = parsePtr.Path(); + if( path.Length() > KPrivateInstall().Length() + && path.Left( KPrivateInstall().Length() ) == KPrivateInstall() ) + { + // Check if ROM or UDA installation was requested + if( parsePtr.DrivePresent() ) + { + TInt driveNumber; + if ( RFs::CharToDrive( parsePtr.Drive()[0], driveNumber ) == KErrNone ) + { + iTrustedInstallation = ( driveNumber == EDriveZ || driveNumber == EDriveC ); + } + } + } + + if( !BaflUtils::FileExists( iFsSession, aManifest ) ) + { +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::DoInstallThemeL() - *** Manifest was not found!" ) ); + } +#endif + User::Leave( KErrNotFound ); + } + +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::DoInstallThemeL() - *** Parsing a manifest file" ) ); + } +#endif - iResult->iSystemError = errorCode; - return ret; + // Parse XML from the manifest file + Xml::ParseL( *iXmlParser, iFsSession, aManifest ); + + // The manifest file has been read at this point and following callbacks have been executed: + // OnContent(), OnStartElement() and OnEndElement() + + // Performance optimization: do not check if installing from rom. + if( !iTrustedInstallation ) + { + // Check type of installation + TBool instancesFound = IsPluginUsedInAppConfsL(); + if( iThemeServer.PluginInHeaderCache( TUid::Uid( iThemeUid ) ) && instancesFound ) + { + // Plugin should be found from cache, update notifications are + // sent only when plugins are used by one/more app configurations + iInstallationType = EInstallationTypeUpdate; + } + else + { + iInstallationType = EInstallationTypeNew; + } + } + + // Check the parsed input + FinalizeParsingL(); } // ----------------------------------------------------------------------------- @@ -479,7 +482,8 @@ { pathParser.PopDir(); // pop "hsps" folder path.Copy( pathParser.FullName() ); - path.Append( KXuikon ); + path.Append( KXuikon ); + path.Append( KPathDelim ); } return path; } @@ -488,8 +492,9 @@ // ChspsInstallationHandler::ValidateL() // ----------------------------------------------------------------------------- // -void ChspsInstallationHandler::ValidateL() - { +void ChspsInstallationHandler::FinalizeParsingL() + { + // Check resources TFileName interfacePath( GetInterfacePath() ); if ( interfacePath.Length() ) { @@ -513,7 +518,7 @@ AddLocalesL( iThemeFilePath ); } - // Validate input from the manifest + // Validate other input from the manifest CheckHeaderL(); if ( iSecurityEnforcer.CheckThemeLockingL( *iOdt ) ) @@ -747,7 +752,7 @@ _L8( "0" ) ); } - if ( iRomInstallation ) + if ( iTrustedInstallation ) { // Update configuration state to KConfStateConfirmed hspsServerUtil::SetAttributeValueL( @@ -798,13 +803,24 @@ User::Leave( KErrNotSupported ); } - else + + ChspsFamily* family = iThemeServer.Family(); + if ( !family ) { - // Store package version - iOdt->SetPackageVersionL( *iPackageVersion ); + User::Leave( KErrNotSupported ); } - // Set the resolution family + ThspsFamily familyType = family->GetFamilyType(); + if ( familyType == EhspsFamilyUnknown ) + { + User::Leave( KErrNotSupported ); + } +#if !defined(WINSCW) && !defined(__WINS__) + if ( !( familyType & iFamilyMask ) ) + { + User::Leave( KErrNotSupported ); + } +#endif // !defined(WINSCW) && !defined(__WINS__) iOdt->SetFamily( iFamilyMask ); // Store root, provider and theme uid @@ -1671,7 +1687,11 @@ iPackageVersion = HBufC::NewL( KMaxFileName ); iPackageVersion->Des().Copy( aAttributes[argIndex].Value().DesC() ); // Is manifest supported by this parser? - iPackageVerSupported = ETrue; //TODO temporarily enable till 0.3 to 1.0 changes have been integrated ( iPackageVersion->Des().Compare(KhspsSupportedManifestVersion) == 0); + iPackageVerSupported = EFalse; + if ( iPackageVersion->Des().Compare( KhspsSupportedManifestVersion ) == 0 ) + { + iPackageVerSupported = ETrue; + } break; } } @@ -1739,7 +1759,7 @@ iMultiInstance = KMultiInstanceDefaultValue; } } - + // ----------------------------------------------------------------------------- // Parsing of the manifest elements. // ----------------------------------------------------------------------------- @@ -1750,10 +1770,8 @@ if ( localName == KFamily ) { -#if defined(WINSCW) || defined(__WINS__) const TPtrC8 familyPtr( iContent->Des() ); - iFamilyMask |= ChspsFamilyListener::GetFamilyType( familyPtr ); -#endif // defined(WINSCW) + iFamilyMask |= ChspsFamily::GetFamilyType( familyPtr ); } else if ( localName == KConfigurationType ) { @@ -1934,28 +1952,28 @@ } else if ( localName == KFileXML ) { - delete iXmlFile; - iXmlFile = NULL; - iXmlFile = HBufC::NewL( KMaxFileName ); - TPtr fileDes( iXmlFile->Des() ); - - fileDes.Copy( iThemeFilePath ); - HBufC* data = CnvUtfConverter::ConvertToUnicodeFromUtf8L( *iContent ); - fileDes.Append( *data ); - delete data; - - if( !BaflUtils::FileExists( iFsSession, fileDes ) ) + if( iContent ) { -#ifdef HSPS_LOG_ACTIVE - if( iLogBus ) + // Convert from 8 to 16bit string + HBufC* nameBuf = CnvUtfConverter::ConvertToUnicodeFromUtf8L( *iContent ); + // Find full path to the file + TFileName fullName; + hspsServerUtil::FindFile( + iFsSession, + iThemeFilePath, + nameBuf->Des(), + fullName ); + delete nameBuf; + nameBuf = NULL; + if( !fullName.Length() ) { - iLogBus->LogText( _L( "ChspsInstallationHandler::OnEndElementL(): - XML file does not exist '%S'" ), - &fileDes ); + iFileNotFound = ETrue; + iResult->iXuikonError = KErrXmlFileNotFound; + User::Leave( KErrNotFound ); } -#endif - - iFileNotFound = ETrue; - iResult->iXuikonError = KErrXmlFileNotFound; + delete iXmlFile; + iXmlFile = NULL; + iXmlFile = fullName.AllocL(); } } else if ( localName == KFileDTD ) @@ -2256,105 +2274,114 @@ CleanupStack::PopAndDestroy( dtdPath ); } +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::AddInterfaceResourcesV2L +// ----------------------------------------------------------------------------- +// void ChspsInstallationHandler::AddInterfaceResourcesV2L( const TDesC& aPath ) - { - // Find all locale specific subfolders - TFindFile fileFinder( iFsSession ); - _LIT( KFilter, "*" ); - CDir* fileList( NULL ); - fileFinder.FindWildByDir( KFilter, aPath, fileList ); - if ( fileList ) - { - CleanupStack::PushL( fileList ); - TFileName localePath; - for( TInt i = 0; i < fileList->Count(); i++ ) + { + RArray driveArray; + CleanupClosePushL( driveArray ); + + // Set search order for eclipsing, only the ROM and UDA drives should be scanned + driveArray.Append( EDriveC ); + driveArray.Append( EDriveZ ); + + // Find all unique locale entries under the Xuikon folders in either drive + RPointerArray locales; + CleanupClosePushL( locales ); + hspsServerUtil::FindFilesRecursivelyL( + iFsSession, + driveArray, + aPath, + locales, + EFalse ); + + // Find all file entries under the Xuikon folders in either drive + RPointerArray folders; + CleanupClosePushL( folders ); + hspsServerUtil::FindFilesRecursivelyL( + iFsSession, + driveArray, + aPath, + folders, + ETrue ); + + // Loop language folders + for(TInt localeIndex=0; localeIndex < locales.Count(); localeIndex++ ) + { + TParsePtrC localeParser( locales[ localeIndex ]->Des() ); + TPath localePath = localeParser.Path(); + + TPath tempPath = locales[ localeIndex ]->Des(); + if( tempPath.Right( KPathDelim().Length() ).Compare( KPathDelim() ) == 0 ) { - const TEntry& entry = (*fileList)[i]; - if ( entry.IsDir() ) + tempPath.Delete( tempPath.Length() - KPathDelim().Length(), KPathDelim().Length() ); + } + TParsePtrC tempParser( tempPath ); + TFileName localeName = tempParser.Name(); + TInt languageIndex = 0; + TLex lex( localeName ); + if( lex.Val( languageIndex ) != KErrNone ) + { + continue; + } + if( languageIndex < ELangTest ) + { + User::Leave( KErrIllegalInstallation ); + } + + // If we found the first language specification + if ( !iDefaultSpecificationSet ) + { + // Assume this is the default language shown when device language is not supported + iDefaultSpecification = (TLanguage)languageIndex; + iDefaultSpecificationSet = ETrue; + } + + // Loop file resources which should be found from either drive + ChspsResource* resource = NULL; + for( TInt resourceIndex=0; resourceIndex < iTempLocalizedResourceList->Count(); resourceIndex++ ) + { + resource = iTempLocalizedResourceList->At( resourceIndex ); + TFileName file; + + for( TInt folderIndex=0; folderIndex < folders.Count(); folderIndex++ ) { - TInt languageIndex = 0; - TLex lex( entry.iName ); - TInt error = lex.Val( languageIndex ); - - // See enumarations from e32lang.h - if( !error && languageIndex >= ELangTest ) - { - // If we found the first language specification - if ( !iDefaultSpecificationSet ) + TParsePtrC folderParser( folders[ folderIndex ]->Des() ); + TPath folderPath = folderParser.Path(); + TFileName name = folderParser.Name(); + + if( localePath.CompareF( folderPath ) == 0 ) + { + TFileName fixedName = hspsServerUtil::GetFixedOdtName( folderParser.NameAndExt() ); + if( fixedName.CompareF( resource->FileName() ) == 0 ) { - // Assume this is the default language shown incase - // there is no locale for the active UI language - iDefaultSpecification = (TLanguage)languageIndex; - iDefaultSpecificationSet = ETrue; + file = folders[ folderIndex ]->Des(); + break; } - - // Setup a path to the subdirectory - localePath.Copy( aPath ); - localePath.Append( entry.iName ); - localePath.Append( KPathDelim ); - - // Find localized resources - AddLocalizedResourcesV2L( - localePath, - (TLanguage)languageIndex ); - } + } } - - } - CleanupStack::PopAndDestroy( fileList ); - fileList = NULL; - } - - // If no DTD files were found - if ( iDefaultSpecification != ELangTest || !iDefaultSpecificationSet ) - { - // Halt installation, test language was not found - User::Leave( KErrNotFound ); - } - } - -void ChspsInstallationHandler::AddLocalizedResourcesV2L( - const TDesC& aPath, - const TLanguage aLanguage ) - { - TFindFile fileFinder( iFsSession ); - _LIT( KFilter, "*" ); - CDir* fileList( NULL ); - fileFinder.FindWildByDir( KFilter, aPath, fileList ); - if ( fileList ) - { - CleanupStack::PushL( fileList ); - - TFileName localePath; - ChspsResource* resource = NULL; - for( TInt i = 0; i < fileList->Count(); i++ ) - { - const TEntry& entry = (*fileList)[i]; - if ( !entry.IsDir() ) - { - TParsePtrC parserPtr( entry.iName ); - TFileName modName = hspsServerUtil::GetFixedOdtName( entry.iName ); - - TBool addingOk = EFalse; - for( TInt resourceIndex=0; resourceIndex < iTempLocalizedResourceList->Count(); resourceIndex++ ) - { - resource = iTempLocalizedResourceList->At( resourceIndex ); - if( modName.CompareF( resource->FileName() ) == 0 ) + + if( file.Length() ) + { + TBool duplicate = EFalse; + for( TInt i=0; i< iResourceList->Count(); i++ ) + { + ChspsResource* r = iResourceList->At(i); + if( r->Language() == languageIndex + && r->FileName().CompareF( file ) == 0 ) { - addingOk = ETrue; + duplicate = ETrue; break; } } - if ( addingOk ) - { - HBufC* resourcePath = HBufC::NewLC( aPath.Length() + entry.iName.Length() ); - resourcePath->Des().Copy( aPath ); - resourcePath->Des().Append( entry.iName ); - + if( !duplicate ) + { + TPtrC8 mimeType; - TPtrC8 tag; - + TPtrC8 tag; HBufC8* tagBuf8 = NULL; if ( resource->Tags().Length() ) { @@ -2362,12 +2389,12 @@ tagBuf8->Des().Copy( resource->Tags() ); tag.Set( tagBuf8->Des() ); } - + // Add localized files into the resource array AddResourceL( *iResourceList, - *resourcePath, - aLanguage, + file, + (TLanguage)languageIndex, EResourceOther, mimeType, tag ); @@ -2376,16 +2403,24 @@ { CleanupStack::PopAndDestroy( tagBuf8 ); } - CleanupStack::PopAndDestroy( resourcePath ); - } + + } } } - - CleanupStack::PopAndDestroy( fileList ); - fileList = NULL; - } - } + } + + folders.ResetAndDestroy(); + locales.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 3, &driveArray ); // driveArray, locales, folders, + + if ( iDefaultSpecification != ELangTest || !iDefaultSpecificationSet ) + { + // Halt installation, test language was not found + User::Leave( KErrNotFound ); + } + } + // ----------------------------------------------------------------------------- // Finds locale specific subdirectories and resources and appends those // into the resource array @@ -2576,7 +2611,7 @@ // check whether skin/mif/uid declarations were used TFileName filename; - if ( hspsServerUtil::IsFile( resultPtr, filename ) ) + if ( hspsServerUtil::IsLogoFile( resultPtr, filename ) ) { // check whether the file reference is valid TPath fullname; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -91,14 +91,15 @@ ChspsThemeServer& aThemeServer, const TUint aSecureId ): CTimer(EPriorityLow), - iLanguage ( aThemeServer.DeviceLanguage() ), iThemeServer( aThemeServer ), iSecureId( aSecureId ), iCentralRepository( aThemeServer.CentralRepository() ), iDefinitionRepository( aThemeServer.DefinitionRepository() ), iSecurityEnforcer( aThemeServer.SecurityEnforcer() ), iHeaderListCache( aThemeServer.HeaderListCache() ), - iFileMan( NULL ) + iServerSession( NULL ), + iFileMan( NULL ), + iMaintainLogoResources( EFalse ) { iDeliveryCount = 0; iSubscription = EFalse; @@ -194,11 +195,11 @@ } iSearchMask = ChspsODT::NewL(); iSearchMask->UnMarshalHeaderL(searchMaskData); - - // check the device language - iLanguage = iThemeServer.DeviceLanguage(); - iSearchMask->SetOdtLanguage( (TInt)iLanguage ); - + + iMaintainLogoResources = EFalse; + TPckg intPkg( iMaintainLogoResources ); + messagePtr.ReadL(3, intPkg ); + // now there is a subscription iSubscription = ETrue; // fetch the header list from repository @@ -242,9 +243,6 @@ // is there headers to delivere left if (iHeaderDataList->Count() > iDeliveryCount) { - // Handle copying of logo icon resources - CopyIconsToHomescreenL( aMessage.SecureId().iId ); - // at least one header on the list TPtr8 bufPtr( iHeaderDataList->At(iDeliveryCount)->Des() ); iMessagePtr.WriteL(2, bufPtr, 0); @@ -262,82 +260,6 @@ } } -// ----------------------------------------------------------------------------- -// ChspsMaintenanceHandler::CopyIconsToHomescreenL -// ----------------------------------------------------------------------------- -// -void ChspsMaintenanceHandler::CopyIconsToHomescreenL( - const TUint aAppUid ) - { - HBufC8* headerData = iHeaderDataList->At(iDeliveryCount); - ChspsODT* header = ChspsODT::UnMarshalHeaderLC( headerData->Des() ); - if ( iServerSession && header ) - { - if( header->LogoFile().Length() ) - { - // If a file reference was found from the logo declaration - TFileName filename; - if ( hspsServerUtil::IsFile( header->LogoFile(), filename ) ) - { - if ( !iFileMan ) - { - iFileMan = CFileMan::NewL( iServerSession->FileSystem() ); - } - - // Get client's private directory: - // We should use some common directory if there are more than one SAPI clients, - // for now we can copy files to AI3's private folder - _LIT( KPrivatePath, "c:\\private\\%X\\"); - TPath privatePath; - privatePath.Format( KPrivatePath, aAppUid ); - - // Append private path to the logo file reference - TInt offset = header->LogoFile().FindF( filename ); - if ( offset >= 0 ) - { - // Insert private path prior to the file reference - HBufC* logoBuf = HBufC::NewLC( - privatePath.Length() + header->LogoFile().Length() ); - logoBuf->Des().Copy( header->LogoFile() ); - logoBuf->Des().Insert( offset, privatePath ); - header->SetLogoFileL( logoBuf->Des() ); - CleanupStack::PopAndDestroy( logoBuf ); - - // Replace the serialized header descriptor - HBufC8* newHeaderData = header->MarshalHeaderL(); - CleanupStack::PushL( newHeaderData ); - iHeaderDataList->InsertL( - iDeliveryCount, - newHeaderData ); - CleanupStack::Pop( newHeaderData ); - delete headerData; - headerData = 0; - iHeaderDataList->Delete( iDeliveryCount + 1 ); - } - - // Set target directory for file copying - TPath targetPath; - targetPath.Copy( privatePath ); - targetPath.Append( filename ); - - // Set source directory for file copying - TFileName sourceFile; - _LIT( KThemesFolder, "themes\\" ); - iServerSession->FileSystem().SessionPath( sourceFile ); - sourceFile.Append( KThemesFolder ); - sourceFile.Append( filename ); - - // Create the target path and copy files when required - hspsServerUtil::CopyResourceFileL( - iServerSession->FileSystem(), - *iFileMan, - targetPath, - sourceFile ); - } - } - } - CleanupStack::PopAndDestroy( header ); - } // ----------------------------------------------------------------------------- // ChspsMaintenanceHandler::SetServerSession @@ -1120,7 +1042,7 @@ CleanupStack::PushL( pluginIter ); ChspsDomNode* pluginNode = pluginIter->First(); TBool steppingtoConfNode(EFalse); - while(pluginNode && !steppingtoConfNode) + while( pluginNode && !steppingtoConfNode ) { const TDesC8& pluginNodeName = pluginNode->Name(); @@ -1135,10 +1057,18 @@ } CleanupStack::PopAndDestroy( pluginIter ); - // Copy the plugin configuration to the main document. - ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); - rootCopy->SetParent( node ); - node->AddChildL( rootCopy ); + if ( pluginNode ) + { + // Copy the plugin configuration to the main document. + ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); + rootCopy->SetParent( node ); + node->AddChildL( rootCopy ); + } + else + { + // configuration is corrupted + User::Leave( KErrCorrupt ); + } } CleanupStack::PopAndDestroy( pluginOdt ); @@ -1859,14 +1789,20 @@ { TBool isView = EFalse; - ChspsDomNode* confNode = - (ChspsDomNode*)aPluginNode.ChildNodes().FindByName( KConfigurationElement ); + ChspsDomNode* confNode = static_cast( + aPluginNode.ChildNodes().FindByName( KConfigurationElement )); + if( confNode ) { - ChspsDomAttribute* typeAttr = - (ChspsDomAttribute*)confNode->AttributeList().FindByName( KConfigurationAttrType ); - isView = ( typeAttr->Value().CompareF( KConfTypeView ) == 0 ); + ChspsDomAttribute* typeAttr = static_cast( + confNode->AttributeList().FindByName( KConfigurationAttrType )); + + if( typeAttr ) + { + isView = ( typeAttr->Value().CompareF( KConfTypeView ) == 0 ); + } } + return isView; } @@ -3841,8 +3777,10 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders(const ChspsODT& /*aSearchMask*/, - CArrayPtrFlat& /*aHeaderList*/) +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders( + const ChspsODT& /*aSearchMask*/, + const TBool /*aCopyLogos*/, + CArrayPtrFlat& /*aHeaderList*/) { return EhspsServiceNotSupported; } @@ -4052,6 +3990,18 @@ { After(KHeaderListUpdatePollingTimeSpan); } + + else if( aRepositoryInfo.iEventType & EhspsODTAdded + || aRepositoryInfo.iEventType & EhspsODTUpdated ) + { + // If a widget has been installed or updated + if( iServerSession ) + { + // Make sure all logos are copied when user retrieves the list + iServerSession->SetIconFileCopyRequired( ETrue ); + } + } + return EFalse; } @@ -4315,37 +4265,83 @@ void ChspsMaintenanceHandler::GetHeaderListL( CArrayPtrSeg& aHeaderDataList, const ChspsODT& aSearchMask ) - { - HBufC8* headerBuf = aSearchMask.MarshalHeaderL(); - if ( !headerBuf ) - { - User::Leave(KErrGeneral); - } - CleanupStack::PushL( headerBuf ); - ChspsODT* searchOdt = ChspsODT::UnMarshalHeaderLC( *headerBuf ); - + { // Reset search results aHeaderDataList.ResetAndDestroy(); + + if( !iFileMan ) + { + iFileMan = CFileMan::NewL( iServerSession->FileSystem() ); + } for ( TInt i = 0; i < iHeaderListCache.Count(); i++ ) { ChspsODT* header = iHeaderListCache.At( i ); - // Check whether the header matches the search criteria - if ( FilterHeader( *searchOdt, *header ) ) + // Header clone is needed because it prevents modifying list cache + ChspsODT* clone = header->CloneL(); + CleanupStack::PushL( clone ); + + // Check whether the header matches the search criteria (family etc) + if ( FilterHeader( aSearchMask, *clone ) ) { - // Append to the search results - HBufC8* data = header->MarshalHeaderL(); + + // Update file paths into the existing logo declarations + if( clone->LogoFile().Length() && + iMaintainLogoResources && + ( header->ConfigurationType() == EhspsWidgetConfiguration || + header->ConfigurationType() == EhspsTemplateConfiguration ) ) + { + + RBuf targetFile; + CleanupClosePushL( targetFile ); + targetFile.CreateL( KMaxFileName ); + + RBuf sourceFile; + CleanupClosePushL( sourceFile ); + sourceFile.CreateL( KMaxFileName ); + + RBuf newDeclaration; + CleanupClosePushL( newDeclaration ); + newDeclaration.CreateL( clone->LogoFile().Length() + KMaxFileName ); + + // Find location of the logo file and location where it shold be copied + hspsServerUtil::PopulateLogoPathsL( + clone->LogoFile(), + iSecureId, + targetFile, + sourceFile, + newDeclaration ); + + if( targetFile.Length() + && sourceFile.Length() + && newDeclaration.Length() ) + { + // Update private path information to the logo declaration + clone->SetLogoFileL( newDeclaration ); + + hspsServerUtil::CopyResourceFileL( + iServerSession->FileSystem(), + *iFileMan, + targetFile, + sourceFile ); + } + + CleanupStack::PopAndDestroy( 3, &targetFile ); // targetFile, sourceFile, newDeclaration + } + + // Convert the header to a descriptor + HBufC8* data = clone->MarshalHeaderL(); if ( data ) { + // Append to the search results CleanupStack::PushL( data ); aHeaderDataList.AppendL( data ); CleanupStack::Pop( data ); } } - } - - CleanupStack::PopAndDestroy( 2, headerBuf ); // searchOdt, headerBuf + CleanupStack::PopAndDestroy( clone ); + } } // ----------------------------------------------------------------------------- @@ -4555,7 +4551,7 @@ ) && ( - ( aMask.ConfigurationType() && aMask.ConfigurationType() == aHeader.ConfigurationType() ) + ( aMask.ConfigurationType() && ( aHeader.ConfigurationType() == aMask.ConfigurationType() ) ) || ( !aMask.ConfigurationType() ) ) @@ -4580,14 +4576,15 @@ ChspsODT& aOdt) { + // If active application configuration is LicenceeRestorable if ( aHeader->Flags() & EhspsThemeStatusLicenceeRestorable ) { - // Licensee restorable configuration active -> Reinstall configuration + // Reinstall the configuration from ROM iThemeServer.ReinstallConfL( aHeader->RootUid(), aHeader->ThemeUid() ); } else { - // Get licensee restorable configuation + // Try to activate a configuation with the LicenceeRestorable status ChspsODT* searchMask = ChspsODT::NewL(); CleanupStack::PushL( searchMask ); searchMask->SetRootUid( aHeader->RootUid() ); @@ -4722,10 +4719,7 @@ // Get active root configuration for the client application ChspsODT* appODT = ChspsODT::NewL(); - CleanupStack::PushL( appODT ); - iThemeServer.GetActivateAppConfigurationL( - params.appUid, - *appODT ); + CleanupStack::PushL( appODT ); #ifdef HSPS_LOG_ACTIVE if( iLogBus ) @@ -4740,12 +4734,20 @@ TInt err = KErrNone; if ( !params.restoreAll ) { - // Remove all widgets from the active view - err = RestoreActiveViewL( *appODT ); - } + // reinstall all widgets + TRAP( err, iThemeServer.InstallWidgetsL(); + iThemeServer.InstallUDAWidgetsL() ); + + // Force updating of the header cache + iThemeServer.UpdateHeaderListCacheL(); + } + + iThemeServer.GetActivateAppConfigurationL( + params.appUid, + *appODT ); // As a backup, if restoration of the active view fails, - // or if all views but the locked view should be removed + // or if all views but the locked view should be removedc if ( err || params.restoreAll ) { // Remove all views but the locked one and reset active view diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp Wed May 12 13:36:47 2010 +0300 @@ -27,8 +27,14 @@ #include "hspsclientrequesthandler.h" #include "hspsserverutil.h" -_LIT( KInstallDirectoryZ, "z:\\private\\200159c0\\install\\" ); -_LIT( KHsps, "hsps"); +_LIT(KPrivateInstallZ, "Z:\\private\\200159c0\\install\\"); +_LIT(KPrivateInstallC, "C:\\private\\200159c0\\install\\"); +_LIT(KMaskAllFiles, "*"); +_LIT(KBackslash, "\\"); +_LIT(KHsps, "hsps"); +_LIT(KTestLanguage, "00"); +_LIT(KManifest, "manifest.dat"); + // ========================= MEMBER FUNCTIONS ================================== @@ -95,108 +101,189 @@ ChspsRomInstaller::~ChspsRomInstaller() { Cancel(); // Causes call to DoCancel() - delete iInstallationHandler; - iImportsArrayV1.ResetAndDestroy(); + delete iInstallationHandler; } // ----------------------------------------------------------------------------- -// ChspsRomInstaller::SetImportsFilterL() +// ChspsRomInstaller::InstallL() // ----------------------------------------------------------------------------- // -TBool ChspsRomInstaller::SetImportsFilterL( - const TDesC& aFileFilter ) +void ChspsRomInstaller::InstallL() { - TFindFile fileFinder( iFsSession ); - CDir* fileList( NULL ); - fileFinder.FindWildByDir( aFileFilter, KInstallDirectoryZ, fileList ); - if ( fileList ) - { - CleanupStack::PushL( fileList ); + RPointerArray pluginFolders; + CleanupClosePushL( pluginFolders ); + + // Find UDA and ROM widgets to be installed + FindInstallationFilesL( pluginFolders ); + + // Install the manifest files + for( TInt index=0; index < pluginFolders.Count(); index++ ) + { + TPtrC namePtr( pluginFolders[index]->Des() ); - TFileName sourceName; - for( TInt i = 0; i < fileList->Count(); i++ ) + // Synchronous method + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + TRAP_IGNORE( ret = InstallThemeL( namePtr ) ); + if ( ret != EhspsInstallThemeSuccess ) { - const TEntry& entry = (*fileList)[i]; - sourceName.Copy( KInstallDirectoryZ ); - sourceName.Append( entry.iName ); - iImportsArrayV1.AppendL( sourceName.AllocL() ); +// User::Leave( KErrAbort ); } + } + + if ( pluginFolders.Count() == 0 ) + { + // Mandatory plugins were missing + User::Leave( KErrCorrupt ); + } - CleanupStack::PopAndDestroy( fileList ); - fileList = NULL; - } - - return EFalse; + pluginFolders.ResetAndDestroy(); + CleanupStack::PopAndDestroy( 1, &pluginFolders ); + } + + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::FindInstallationFilesL() +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::FindInstallationFilesL( + RPointerArray& aFolders ) + { + __ASSERT_DEBUG( aFolders.Count() == 0, User::Leave( KErrArgument ) ); + + DoFindInstallationFilesL( aFolders, KPrivateInstallC ); + DoFindInstallationFilesL( aFolders, KPrivateInstallZ ); } // ----------------------------------------------------------------------------- -// ChspsRomInstaller::GetInstallationFoldersL() +// ChspsRomInstaller::DoFindInstallationFilesL() // ----------------------------------------------------------------------------- // -void ChspsRomInstaller::GetInstallationFoldersL( - RPointerArray& aFolders ) - { - aFolders.ResetAndDestroy(); - - _LIT(KAllFolders, "*"); - _LIT(KFolderSuffix, "\\"); - CDir* fileList( NULL ); +void ChspsRomInstaller::DoFindInstallationFilesL( + RPointerArray& aFolders, + const TDesC& aPath ) + { TFindFile fileFinder( iFsSession ); - fileFinder.FindWildByDir( KAllFolders, KInstallDirectoryZ, fileList ); - if ( fileList ) + fileFinder.SetFindMask( + KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted ); + CDir* dirList( NULL ); + fileFinder.FindWildByDir( KMaskAllFiles, aPath, dirList ); + if ( dirList ) { - CleanupStack::PushL( fileList ); - - TFileName sourceName; - TBool verChecked = EFalse; - for( TInt i = 0; i < fileList->Count(); i++ ) + CleanupStack::PushL( dirList ); + + const TInt count = dirList->Count(); + const TInt KMaxEntryLength = KMaxFileName - 50; + for( TInt i = 0; i < count; i++ ) { - const TEntry& entry = (*fileList)[i]; - if ( entry.IsDir() ) - { - const TEntry& entry = (*fileList)[i]; - sourceName.Copy( KInstallDirectoryZ ); - sourceName.Append( entry.iName ); - sourceName.Append( KFolderSuffix ); + const TEntry& dirEntry = (*dirList)[i]; + if ( dirEntry.IsDir() ) + { + // Populate path for the manifest file + const TEntry& folderEntry = (*dirList)[i]; - if ( !verChecked ) + // Check for length of the directory name + if( dirEntry.iName.Length() > KMaxEntryLength ) { - // Check whether the V2 directory structure is available - TFileName nameV2; - nameV2.Copy( sourceName ); - nameV2.Append( KHsps ); - nameV2.Append( KFolderSuffix ); - if( !BaflUtils::FolderExists( iFsSession, nameV2 ) ) - { - CleanupStack::PopAndDestroy( fileList ); - return; - } - verChecked = ETrue; + // Skip plugins which have too long name + continue; } - aFolders.AppendL( sourceName.AllocL() ); + TFileName manifest( aPath ); + manifest.Append( dirEntry.iName ); + manifest.Append( KBackslash ); + manifest.Append( KHsps ); + manifest.Append( KBackslash ); + manifest.Append( KTestLanguage ); + manifest.Append( KBackslash ); + manifest.Append( KManifest ); + + if( !BaflUtils::FileExists( iFsSession, manifest ) ) + { + continue; + } + + // Check for duplicates + TBool isShadowed = EFalse; + TParsePtrC manifestPtr( manifest ); + for( TInt i=0; i < aFolders.Count(); i++ ) + { + TParsePtrC ptr( aFolders[i]->Des() ); + if( ptr.Path() == manifestPtr.Path() ) + { + isShadowed = ETrue; + break; + } + } + + if( !isShadowed ) + { + // Append the drive information (C or Z) + TFileName driveIncluded; + hspsServerUtil::FindFile( + iFsSession, + manifest, + KNullDesC, + driveIncluded ); + if( driveIncluded.Length() ) + { + HBufC* nameBuf = driveIncluded.AllocLC(); + aFolders.AppendL( nameBuf ); + CleanupStack::Pop( nameBuf ); + } + } } } - CleanupStack::PopAndDestroy( fileList ); - fileList = NULL; - } - } - -void ChspsRomInstaller::FindImportsV1L() - { - iImportsArrayV1.ResetAndDestroy(); - SetImportsFilterL( KFilterAllPluginImportsV1 ); - SetImportsFilterL( KFilterAllAppImportsV1 ); + CleanupStack::PopAndDestroy( dirList ); + dirList = 0; + } } // ----------------------------------------------------------------------------- -// ChspsRomInstaller::ImportsV1 +// ChspsRomInstaller::FindInstallationFileL // ----------------------------------------------------------------------------- // -const RPointerArray& ChspsRomInstaller::ImportsV1() - { - return iImportsArrayV1; +void ChspsRomInstaller::FindInstallationFileL( + const TInt aConfigurationUid, + TFileName& aManifest ) + { + aManifest.FillZ(); + + _LIT(KFormat, "*_%X"); + TFileName fileMask; + fileMask.Format( KFormat, aConfigurationUid ); + + TFindFile fileFinder( iFsSession ); + CDir* dirList( NULL ); + fileFinder.FindWildByDir( fileMask, KPrivateInstallZ, dirList ); + if ( !dirList ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PushL( dirList ); + + const TInt count = dirList->Count(); + for( TInt i = 0; i < count; i++ ) + { + const TEntry& dirEntry = (*dirList)[i]; + if ( dirEntry.IsDir() ) + { + // Populate path for the manifest file + const TEntry& folderEntry = (*dirList)[i]; + + aManifest.Copy( KPrivateInstallZ ); + aManifest.Append( dirEntry.iName ); + aManifest.Append( KBackslash ); + aManifest.Append( KHsps ); + aManifest.Append( KBackslash ); + aManifest.Append( KTestLanguage ); + aManifest.Append( KBackslash ); + aManifest.Append( KManifest ); + break; + } + } + CleanupStack::PopAndDestroy( dirList ); } // ----------------------------------------------------------------------------- @@ -209,7 +296,9 @@ // Start installation by reading the manifest file iRet = iInstallationHandler->hspsInstallTheme( aFileName, iHeaderData ); if ( iRet == EhspsInstallThemeSuccess && !IsActive() ) - { + { + iRet = EhspsInstallThemeFailed; + // Continue with remaining installation phases SetActive(); iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); @@ -228,52 +317,44 @@ ThspsServiceCompletedMessage ChspsRomInstaller::ReinstallThemeL( const TInt aAppUid, const TInt aConfigurationUid ) - { + { + __ASSERT_DEBUG( aAppUid > 0 && aConfigurationUid > 0, User::Leave( KErrArgument ) ); + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; - iImportsArrayV1.ResetAndDestroy(); - - if ( aAppUid > 0 && aConfigurationUid > 0 ) - { - // Setup a filter for finding a specific import - _LIT(KFormat, "app_%X_*_%X_1.0.dat"); - HBufC* filter = HBufC::NewLC( KMaxFileName ); - filter->Des().AppendFormat( KFormat, aAppUid, aConfigurationUid ); - SetImportsFilterL( *filter ); - CleanupStack::PopAndDestroy( filter ); - - // There should be only one import matching the UIDs - if ( iImportsArrayV1.Count() == 1 ) - { - // Get path for a manifest from the import's file name - HBufC* manifestBuf = iThemeServer.GetManifestFromImportLC( - iImportsArrayV1[0]->Des(), - KInstallDirectoryZ ); - if ( manifestBuf ) - { - // Sync request - ret = InstallThemeL( manifestBuf->Des() ); - CleanupStack::PopAndDestroy( manifestBuf ); - } + // Find an installation file from the ROM + TFileName manifest; + FindInstallationFileL( + aConfigurationUid, + manifest ); + if ( manifest.Length() > 0 ) + { + // Install the plugin configuration (sync request) + ret = InstallThemeL( manifest ); + } + if( ret == EhspsInstallThemeSuccess ) + { + // The installed application configuration should now hold only plugin references, + // in addition it hasn't been updated to the header cache + iThemeServer.UpdateHeaderListCacheL(); + + // Complete reinstallation of the application configuration + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + User::LeaveIfError( iThemeServer.GetConfigurationL( aAppUid, aConfigurationUid, *odt ) ); + if ( odt->ConfigurationType() == EhspsAppConfiguration ) + { + ChspsClientRequestHandler* clientReqHandler = ChspsClientRequestHandler::NewL( iThemeServer ); + CleanupStack::PushL( clientReqHandler ); + + // Append configurations from referred plugins to the application configuration's DOM + clientReqHandler->HandlePluginReferencesL( *odt ); + + CleanupStack::PopAndDestroy( clientReqHandler ); } - - iImportsArrayV1.ResetAndDestroy(); + CleanupStack::PopAndDestroy( odt ); } - // Complete application configuration reinstallation - ChspsODT* odt = ChspsODT::NewL(); - CleanupStack::PushL( odt ); - User::LeaveIfError( iThemeServer.GetConfigurationL( aAppUid, aConfigurationUid, *odt ) ); - if ( odt->ConfigurationType() == EhspsAppConfiguration ) - { - // Add plugin configurations to the application configuration - ChspsClientRequestHandler* clientReqHandler = ChspsClientRequestHandler::NewL( iThemeServer ); - CleanupStack::PushL( clientReqHandler ); - clientReqHandler->HandlePluginReferencesL( *odt ); - CleanupStack::PopAndDestroy( clientReqHandler ); - } - CleanupStack::PopAndDestroy( odt ); - return ret; } @@ -295,6 +376,7 @@ // TInt ChspsRomInstaller::RunError( TInt /*aError*/ ) { + iRet = EhspsInstallThemeFailed; // Called when error occurred in asynchronous request CActiveScheduler::Stop(); return KErrNone; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Wed May 12 13:36:47 2010 +0300 @@ -1660,10 +1660,10 @@ } // ----------------------------------------------------------------------------- -// hspsServerUtil::IsFile +// hspsServerUtil::IsLogoFile // ----------------------------------------------------------------------------- // -TBool hspsServerUtil::IsFile( +TBool hspsServerUtil::IsLogoFile( const TDesC& aFileDeclaration, TFileName& aFilename ) { @@ -1842,6 +1842,177 @@ CleanupStack::PopAndDestroy( iter ); return targetNode; } + + +// ----------------------------------------------------------------------------- + // hspsServerUtil::FindFile + // Eclipsing support for customization + // ----------------------------------------------------------------------------- + // + TInt hspsServerUtil::FindFile( + RFs& aFs, + const TDesC& aPath, + const TDesC& aFilename, + TFileName& aDrivePathName ) + { + TInt err = KErrNotFound; + + TParsePtrC parser( aPath ); + const TPath path = parser.Path(); + + TFileName filename( aFilename ); + if( filename.Length() == 0 ) + { + filename.Copy( parser.NameAndExt() ); + } + + if( filename.Length() > 0 && path.Length() > 0 ) + { + // Find the input file, search from the user area (UDA) first, + // exclude external/remote drives from the search - otherwise end-users + // could introduce fixed configurations (e.g. operator locks wouldn't work) + TFindFile fileFinder( aFs ); + fileFinder.SetFindMask( + KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted ); + aFs.SetSessionToPrivate( EDriveE ); + err = fileFinder.FindByDir( filename, path ); + aFs.SetSessionToPrivate( EDriveC ); + if( !err ) + { + // Return the path with a drive reference + aDrivePathName = fileFinder.File(); + TParsePtrC drvParser( aDrivePathName ); + if( !drvParser.DrivePresent() ) + { + err = KErrNotFound; + } + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::ResolveLogoPathL +// ----------------------------------------------------------------------------- +void hspsServerUtil::PopulateLogoPathsL( + const TDesC& aLogoDeclaration, + const TUint aAppUid, + RBuf& aTargetPath, + RBuf& aSourcePath, + RBuf& aUpdatedDeclaration) + { + // Process widget types only + if ( aLogoDeclaration.Length() && aAppUid > 0 ) + { + // Get possible file name from the optional logo declaration + // and if found, populate the paths and update the declaration + TFileName filename; + if( IsLogoFile( aLogoDeclaration, filename ) ) + { + // Get client's private directory + _LIT( KClientPrivatePath, "c:\\private\\%X\\"); + TPath clientPath; + clientPath.Format( KClientPrivatePath, aAppUid ); + + // Updated logo declaration + TInt offset = aLogoDeclaration.FindF( filename ); + __ASSERT_DEBUG( offset != KErrNotFound, User::Leave( KErrCorrupt ) ); + if( aLogoDeclaration.Length() + aLogoDeclaration.Mid( offset ).Length() < KMaxFileName ) + { + aUpdatedDeclaration.Copy( aLogoDeclaration ); + aUpdatedDeclaration.Insert( offset, clientPath ); + + // Set path and name of the target file + if( clientPath.Length() + filename.Length() < KMaxFileName ) + { + aTargetPath.Copy( clientPath ); + aTargetPath.Append( filename ); + + // Set name of the source file + _LIT( KServerPrivateFolder, "c:\\private\\200159c0\\themes\\" ); + if( KServerPrivateFolder().Length() + filename.Length() < KMaxFileName ) + { + aSourcePath.Copy( KServerPrivateFolder ); + aSourcePath.Append( filename ); + } + } + } + + } + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::FindFilesRecursivelyL +// ----------------------------------------------------------------------------- +void hspsServerUtil::FindFilesRecursivelyL( + RFs& aFs, + const RArray& aDriveArray, + const TDesC& aPath, + RPointerArray& aFolders, + TBool aRecursive ) + { + TParsePtrC parser( aPath ); + + TFindFile fileFinder( aFs ); + fileFinder.SetFindMask( KDriveAttExclude|KDriveAttRemovable|KDriveAttRemote|KDriveAttSubsted ); + + _LIT(KMaskFile, "*"); + for( TInt driveIndex=0; driveIndex < aDriveArray.Count(); driveIndex++ ) + { + TChar driveChar; + User::LeaveIfError( RFs::DriveToChar( aDriveArray[driveIndex], driveChar ) ); + TBuf16<2> driveBuf(2); + driveBuf[0] = TUint( driveChar ); + driveBuf[1] = TUint( TChar(':') ); + + TPath path; + path.Copy( driveBuf ); + path.Append( parser.Path() ); + + CDir* dirList( NULL ); + fileFinder.FindWildByDir( KMaskFile, path, dirList ); + if ( dirList ) + { + CleanupStack::PushL( dirList ); + + const TInt count = dirList->Count(); + for( TInt entryIndex = 0; entryIndex < count; entryIndex++ ) + { + const TEntry& entry = (*dirList)[ entryIndex ]; + + TFileName file( path ); + file.Append( entry.iName ); + if( entry.IsDir() ) + { + file.Append( KDoubleBackSlash ); + } + + if( !BaflUtils::FileExists( aFs, file ) ) + { + continue; + } + if( entry.IsDir() && aRecursive ) + { + FindFilesRecursivelyL( aFs, aDriveArray, file, aFolders ); + } + else + { + HBufC* nameBuf = file.AllocLC(); + aFolders.AppendL( nameBuf ); + CleanupStack::Pop( nameBuf ); + } + } + + CleanupStack::PopAndDestroy( dirList ); + dirList = 0; + } // dirlist + + } // driveIndex + } + + // ----------------------------------------------------------------------------- // hspsServerUtil::hspsServerUtil // ----------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -19,6 +19,7 @@ #define __INCLUDE_CAPABILITY_NAMES__ // INCLUDE FILES +#include #include #include #include @@ -34,6 +35,7 @@ #include "hspsdefinitionrepository.h" #include "hspsdefinitionengineinterface.h" #include "hspsconfiguration.h" +#include "hspsfamily.h" #ifdef _hsps_PERFORMANCE_TEST_ #include "hspstimemon.h" #endif //_hsps_PERFORMANCE_TEST_ @@ -55,8 +57,6 @@ // Directory for the SISX installation files _LIT( KImportDirectoryC, "c:\\private\\200159c0\\import\\" ); -// Directory for the ROM based installation files - // Directories for backup folders _LIT( KBackupThemesDirectoryC, "c:\\private\\200159c0\\backup\\themes\\" ); @@ -181,6 +181,8 @@ // TInt E32Main() { + RAllocator* iAllocator = MemoryManager::SwitchToFastAllocator(); + __UHEAP_MARK; CTrapCleanup* cleanup=CTrapCleanup::New(); TInt r=KErrNoMemory; @@ -190,6 +192,9 @@ delete cleanup; } __UHEAP_MARKEND; + + MemoryManager::CloseFastAllocator(iAllocator); + return r; } @@ -312,7 +317,10 @@ // Get active device language iDeviceLanguage = GetDeviceLanguage(); - +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage() %d" ), iDeviceLanguage ); +#endif + // Setup a search mask for finding headers from the cache iCacheMask = ChspsODT::NewL(); @@ -341,10 +349,13 @@ // Start observing the notifications iDefinitionRepository->RegisterObserverL( *this ); - // Resolution & orientation change listener + #if defined(WINSCW) || defined(__WINS__) - iFamilyListener = ChspsFamilyListener::NewL( *this ); -#endif // defined(WINSCW) + // Resolution & orientation change listener + iFamily = ChspsFamilyListener::NewL( *this ); +#else + iFamily = ChspsFamily::NewL(); +#endif //defined(WINSCW) || defined(__WINS__) // Auto-localize ODTs in the Definition Repository when the device language has changed HandleLanguageChangeL(); @@ -400,6 +411,8 @@ delete iLogBus; iLogBus = NULL; #endif + + iSessions.Reset(); } #ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ @@ -434,11 +447,12 @@ DisableAutoInstallation(); #endif //__DISABLE_SISX_INSTALLATION_ -#if defined(WINSCW) || defined(__WINS__) - delete iFamilyListener; - iFamilyListener = NULL; -#endif // defined(WINSCW) - + if ( iFamily ) + { + delete iFamily; + iFamily = NULL; + } + delete iCenRepListener; iCenRepListener = NULL; @@ -491,9 +505,14 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void ChspsThemeServer::AddSession() +void ChspsThemeServer::AddSession( ChspsThemeServerSession* aSession ) { - iSessionCount++; + if( aSession == NULL ) + { + return; + } + + iSessions.Append( aSession ); #ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ if( iShutdown->IsActive() ) @@ -504,7 +523,7 @@ #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "ChspsThemeServer::AddSession(): - now %d concurrent sessions." ), - iSessionCount ); + iSessions.Count() ); #endif } @@ -515,12 +534,16 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void ChspsThemeServer::DropSession() +void ChspsThemeServer::DropSession( ChspsThemeServerSession* aSession ) { - iSessionCount--; + const TInt index = iSessions.Find( aSession ); + if( index != KErrNotFound ) + { + iSessions.Remove( index ); + } #ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ - if( iSessionCount == 0 ) + if( iSessions.Count() == 0 ) { iShutdown->Cancel(); iShutdown->Start(); @@ -529,7 +552,7 @@ #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "ChspsThemeServer::DropSession(): - %d concurrent sessions left." ), - iSessionCount ); + iSessions.Count() ); #endif } @@ -579,7 +602,20 @@ #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "--------------------------------------------------------" ) ); #endif - + + if( aRepositoryInfo.iEventType & EhspsODTUpdated || + aRepositoryInfo.iEventType & EhspsODTModified || + aRepositoryInfo.iEventType & EhspsPluginReplaced ) + { + for( TInt i = 0; i < iSessions.Count(); i++ ) + { + if( iSessions[i]->AppUid() == aRepositoryInfo.iAppUid ) + { + iSessions[i]->SetResourceFileCopyRequired( ETrue ); + } + } + } + // If header cache should be updated from files in the Plug-in Repository if (mask & EhspsCacheUpdate) { @@ -1854,10 +1890,6 @@ // TLanguage ChspsThemeServer::GetDeviceLanguage() { -#ifdef HSPS_LOG_ACTIVE - iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage(): %d returned" ), User::Language() ); -#endif - return User::Language(); } @@ -2241,6 +2273,7 @@ ChspsODT& aOdt ) { TBool localized = ETrue; + iFsSession.SetSessionToPrivate( EDriveC ); TLanguage requestedLanguage = DeviceLanguage(); if ( requestedLanguage == ELangNone ) @@ -2580,6 +2613,47 @@ } // ----------------------------------------------------------------------------- +// ChspsThemeServer::InstallUDAWidgetsL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::InstallUDAWidgetsL() + { + //Get list of uda dir's + TPtrC filter( KFilterAllPluginImportsV1 ); + CDir* importDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( filter, KImportDirectoryC, importDir ); + CleanupStack::PushL( importDir ); + + if ( importDir && importDir->Count() > 0 ) + { + CHSPSInstaller* installer = CHSPSInstaller::NewL( *this ); + CleanupStack::PushL( installer ); + + for ( TInt i = 0; i < importDir->Count(); i++ ) + { + TPtrC udaName( (*importDir)[i].iName ); + // Get manifest path + HBufC* manifestBuf = GetManifestFromImportLC( + udaName, + KImportDirectoryC ); + + //install + TRAPD( err, installer->InstallConfigurationL( *manifestBuf ) ); + if ( err != KErrNone ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::InstallUDAWidgetsL(): - Installation failed" ) ); +#endif + } + CleanupStack::PopAndDestroy( manifestBuf ); + } + CleanupStack::PopAndDestroy( installer ); + } + CleanupStack::PopAndDestroy( importDir ); + } + +// ----------------------------------------------------------------------------- // ChspsThemeServer::HandleRomInstallationsL() // ----------------------------------------------------------------------------- // @@ -2612,9 +2686,12 @@ if( ( errorCode == KErrNone ) && ( fwVersion.Length() == 0 ) ) { - // Install manifest files from ROM - InstallManifestsFromRomDriveL(); + // Install widgets from \private\200159C0\install\ directories (ROM and UDA image) + InstallWidgetsL(); + // Install widgets from \private\200159C0\imports\ directory (UDA image) + InstallUDAWidgetsL(); + // Post RFS installations have been done, prevent re-installations at next startup // by reading firmware version and saving it to cenrep. GetFWVersion( fwVersion ); @@ -2647,7 +2724,7 @@ { // Phone software has been updated. CreateBackupDataL(); - InstallManifestsFromRomDriveL(); + InstallWidgetsL(); RestoreApplicationConfigurationsL(); // Save new firmware version to cenrep if ( errorCode == KErrNone ) @@ -2684,76 +2761,27 @@ // Activate client specific root configurations from active display resolution ActivateRootConfigurationsL(); #endif // defined(WINSCW) - + res.Close(); CleanupStack::PopAndDestroy(1, &res); } // ----------------------------------------------------------------------------- -// ChspsThemeServer::InstallManifestsFromRomDriveL() +// ChspsThemeServer::InstallWidgetsL() // ----------------------------------------------------------------------------- // -void ChspsThemeServer::InstallManifestsFromRomDriveL() - { - if ( iRomInstaller || iManifestFiles.Count() ) - { - // Invalid usage - User::Leave( KErrGeneral ); - } +void ChspsThemeServer::InstallWidgetsL() + { + __ASSERT_DEBUG( !iRomInstaller, User::Leave( KErrGeneral) ); iRomInstaller = ChspsRomInstaller::NewL( *this, iFsSession ); #ifdef HSPS_LOG_ACTIVE iRomInstaller->SetLogBus( iLogBus ); #endif - - // An array for installation files with V2 directory structure - RPointerArray pluginFolders; - CleanupClosePushL( pluginFolders ); - - // Retrieve an array of folder names - iRomInstaller->GetInstallationFoldersL( pluginFolders ); - // Add manifest files from the subfolders - FindRomInstallationsV2L( pluginFolders ); - - pluginFolders.ResetAndDestroy(); - - if ( iManifestFiles.Count() < 1 ) - { -#ifdef HSPS_LOG_ACTIVE - iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - mandatory plugins were not found from the ROM drive!" ) ); -#endif - // Mandatory plugins were missing from the ROM drive - User::Leave( KErrGeneral ); - } - - CleanupStack::PopAndDestroy( 1, &pluginFolders ); - - - // Install configurations from the manifest files - ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; - for( TInt manifestIndex=0; manifestIndex < iManifestFiles.Count(); manifestIndex++ ) - { - // Synchronous API call - TPtr name( iManifestFiles[manifestIndex]->Des() ); -#ifdef HSPS_LOG_ACTIVE - iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - installing ROM configuration from: %S" ), &name ); -#endif - ret = iRomInstaller->InstallThemeL( name ); - if ( ret != EhspsInstallThemeSuccess ) - { -#ifdef HSPS_LOG_ACTIVE - iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - configuration is corrupted, critical error - shutting down!" ) ); -#endif -// User::Leave( KErrAbort ); - } - } - - // Cancel any actions done in the previous functionality - iManifestFiles.ResetAndDestroy(); - - // The ROM installer is not needed anymore and therefore it can be released + iRomInstaller->InstallL(); + delete iRomInstaller; - iRomInstaller = NULL; + iRomInstaller = 0; // Force updating of the header cache ThspsRepositoryInfo info( EhspsCacheUpdate ); @@ -2761,34 +2789,6 @@ } // ----------------------------------------------------------------------------- -// ChspsThemeServer::FindRomInstallationsV2L() -// ----------------------------------------------------------------------------- -// -void ChspsThemeServer::FindRomInstallationsV2L( - RPointerArray& aPluginFolders ) - { - _LIT(KHspsFolder, "hsps\\"); - TFileName hspsPath; - for( TInt folderIndex=0; folderIndex < aPluginFolders.Count(); folderIndex++ ) - { - // Set path - hspsPath.Copy( aPluginFolders[folderIndex]->Des() ); - hspsPath.Append( KHspsFolder ); - - // Add full path into the installation queue - TInt len = hspsPath.Length() + 3 + KDoubleBackSlash().Length() + KManifestFile().Length(); - HBufC* manifestBuf = HBufC::NewLC( len ); - manifestBuf->Des().Copy( hspsPath ); - manifestBuf->Des().Append( _L("00") ); - manifestBuf->Des().Append( KDoubleBackSlash ); - manifestBuf->Des().Append( KManifestFile ); - - iManifestFiles.AppendL( manifestBuf ); - CleanupStack::Pop( manifestBuf ); - } - } - -// ----------------------------------------------------------------------------- // ChspsThemeServer::GetConfigurationHeader() // ----------------------------------------------------------------------------- // @@ -3329,6 +3329,16 @@ { // Invalid configuration state.Set( KConfStateError ); + // Delete related resource files + const TInt count = aOdt.ResourceCount(); + for( TInt j( 0 ); j < count; j++ ) + { + ChspsResource& resource = aOdt.ResourceL( j ); + if( resource.ConfigurationUid() == uids[ i ] ) + { + aOdt.DeleteResourceL( j ); + } + } } else if ( state.CompareF( KConfStateError ) != 0 ) { @@ -3474,7 +3484,7 @@ void ChspsThemeServer::ActivateRootConfigurationsL() { // Get family from the active resolution - const ThspsFamily family = iFamilyListener->GetFamilyType(); + const ThspsFamily family = iFamily->GetFamilyType(); // Try to activate an application configuration which was designed // for the active resolution @@ -3484,6 +3494,8 @@ HandleFamilyChangeL( KDefaultFamily ); } } +#endif // defined(WINSCW) || defined(__WINS__) + // ----------------------------------------------------------------------------- // ChspsThemeServer::HandleFamilyChangeL() @@ -3589,7 +3601,14 @@ return activated; } -#endif // defined(WINSCW) +// ----------------------------------------------------------------------------- +// ChspsThemeServer::Family() +// ----------------------------------------------------------------------------- +// +ChspsFamily* ChspsThemeServer::Family() + { + return iFamily; + } // end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Wed May 12 13:36:47 2010 +0300 @@ -49,9 +49,11 @@ // ----------------------------------------------------------------------------- // ChspsThemeServerSession::ChspsThemeServerSession( - const TInt aAppUid ) + const TInt aAppUid ) : + iAppUid( aAppUid ), + iIconFileCopyRequired( ETrue ), + iResourceFileCopyRequired( ETrue ) { - iAppUid = aAppUid; } // ----------------------------------------------------------------------------- @@ -68,7 +70,7 @@ iLogBus->LogText( _L( "--------------------------------------------------------" ) ); #endif - Server().AddSession(); + Server().AddSession( this ); iHoldingResources = EFalse; User::LeaveIfError( iFs.Connect() ); Server().CheckConfigurationL( iAppUid ); @@ -93,7 +95,7 @@ } delete iClientRequestHandler; - Server().DropSession(); + Server().DropSession( this ); #ifdef HSPS_LOG_ACTIVE if( iLogBus ) @@ -284,7 +286,15 @@ #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "DoServiceL: EhspsCopyResources" ) ); #endif - CopyResourceFilesL( aMessage ); + if( iResourceFileCopyRequired ) + { + CopyResourceFilesL( aMessage ); + iResourceFileCopyRequired = EFalse; + } + else + { + aMessage.Complete( EhspsResourceCopySuccess ); + } break; } case EhspsAddPlugin: @@ -1001,5 +1011,50 @@ return iFs; } +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::IconFileCopyRequired +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServerSession::IconFileCopyRequired() const + { + return iIconFileCopyRequired; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetIconFileCopyRequired +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetIconFileCopyRequired( const TBool aCopyRequired ) + { + iIconFileCopyRequired = aCopyRequired; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ResourceFileCopyRequired +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServerSession::ResourceFileCopyRequired() const + { + return iResourceFileCopyRequired; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetResourceFileCopyRequired +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetResourceFileCopyRequired( const TBool aCopyRequired ) + { + iResourceFileCopyRequired = aCopyRequired; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::AppUid +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServerSession::AppUid() const + { + return iAppUid; + } + // end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsodt/bwins/hspsodtu.def --- a/homescreenpluginsrv/hspsodt/bwins/hspsodtu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsodt/bwins/hspsodtu.def Wed May 12 13:36:47 2010 +0300 @@ -1,52 +1,52 @@ EXPORTS - ?AddResourceL@ChspsODT@@QAEXPAVChspsResource@@@Z @ 1 NONAME ; void ChspsODT::AddResourceL(class ChspsResource *) - ?CloneL@ChspsODT@@QAEPAV1@XZ @ 2 NONAME ; class ChspsODT * ChspsODT::CloneL(void) - ?ConfigurationType@ChspsODT@@QBEIXZ @ 3 NONAME ; unsigned int ChspsODT::ConfigurationType(void) const - ?CopyDomDocumentL@ChspsODT@@QAEXAAVChspsDomDocument@@@Z @ 4 NONAME ; void ChspsODT::CopyDomDocumentL(class ChspsDomDocument &) - ?DeleteResourceL@ChspsODT@@QAEXH@Z @ 5 NONAME ; void ChspsODT::DeleteResourceL(int) - ?DomDocument@ChspsODT@@QBEAAVChspsDomDocument@@XZ @ 6 NONAME ; class ChspsDomDocument & ChspsODT::DomDocument(void) const - ?ExternalizeHeaderL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 7 NONAME ; void ChspsODT::ExternalizeHeaderL(class RWriteStream &) const - ?ExternalizeL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 8 NONAME ; void ChspsODT::ExternalizeL(class RWriteStream &) const - ?ExternalizeResourceListL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 9 NONAME ; void ChspsODT::ExternalizeResourceListL(class RWriteStream &) const - ?Flags@ChspsODT@@QBEIXZ @ 10 NONAME ; unsigned int ChspsODT::Flags(void) const - ?InternalizeHeaderL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void ChspsODT::InternalizeHeaderL(class RReadStream &) - ?InternalizeL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void ChspsODT::InternalizeL(class RReadStream &) - ?InternalizeResourceListL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 13 NONAME ; void ChspsODT::InternalizeResourceListL(class RReadStream &) - ?MarshalHeaderL@ChspsODT@@QBEPAVHBufC8@@XZ @ 14 NONAME ; class HBufC8 * ChspsODT::MarshalHeaderL(void) const - ?NewL@ChspsODT@@SAPAV1@XZ @ 15 NONAME ; class ChspsODT * ChspsODT::NewL(void) - ?NewLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 16 NONAME ; class ChspsODT * ChspsODT::NewLC(class TDesC8 const &) - ?OdtLanguage@ChspsODT@@QBEHXZ @ 17 NONAME ; int ChspsODT::OdtLanguage(void) const - ?PackageVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & ChspsODT::PackageVersion(void) const - ?ProviderName@ChspsODT@@QBEABVTDesC16@@XZ @ 19 NONAME ; class TDesC16 const & ChspsODT::ProviderName(void) const - ?ProviderUid@ChspsODT@@QBEHXZ @ 20 NONAME ; int ChspsODT::ProviderUid(void) const - ?ResourceCount@ChspsODT@@QBEHXZ @ 21 NONAME ; int ChspsODT::ResourceCount(void) const - ?ResourceL@ChspsODT@@QBEAAVChspsResource@@H@Z @ 22 NONAME ; class ChspsResource & ChspsODT::ResourceL(int) const - ?RootUid@ChspsODT@@QBEHXZ @ 23 NONAME ; int ChspsODT::RootUid(void) const - ?SetConfigurationType@ChspsODT@@QAEXI@Z @ 24 NONAME ; void ChspsODT::SetConfigurationType(unsigned int) - ?SetFlags@ChspsODT@@QAEXI@Z @ 25 NONAME ; void ChspsODT::SetFlags(unsigned int) - ?SetOdtLanguage@ChspsODT@@QAEXH@Z @ 26 NONAME ; void ChspsODT::SetOdtLanguage(int) - ?SetPackageVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 27 NONAME ; void ChspsODT::SetPackageVersionL(class TDesC16 const &) - ?SetProviderNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 28 NONAME ; void ChspsODT::SetProviderNameL(class TDesC16 const &) - ?SetProviderUid@ChspsODT@@QAEXH@Z @ 29 NONAME ; void ChspsODT::SetProviderUid(int) - ?SetRootUid@ChspsODT@@QAEXH@Z @ 30 NONAME ; void ChspsODT::SetRootUid(int) - ?SetThemeFullNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 31 NONAME ; void ChspsODT::SetThemeFullNameL(class TDesC16 const &) - ?SetThemeShortNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 32 NONAME ; void ChspsODT::SetThemeShortNameL(class TDesC16 const &) - ?SetThemeUid@ChspsODT@@QAEXH@Z @ 33 NONAME ; void ChspsODT::SetThemeUid(int) - ?SetThemeVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 34 NONAME ; void ChspsODT::SetThemeVersionL(class TDesC16 const &) - ?ThemeFullName@ChspsODT@@QBEABVTDesC16@@XZ @ 35 NONAME ; class TDesC16 const & ChspsODT::ThemeFullName(void) const + ?SetRootUid@ChspsODT@@QAEXH@Z @ 1 NONAME ; void ChspsODT::SetRootUid(int) + ?SetProviderNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 2 NONAME ; void ChspsODT::SetProviderNameL(class TDesC16 const &) + ?NewL@ChspsODT@@SAPAV1@XZ @ 3 NONAME ; class ChspsODT * ChspsODT::NewL(void) + ?InternalizeL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 4 NONAME ; void ChspsODT::InternalizeL(class RReadStream &) + ?Flags@ChspsODT@@QBEIXZ @ 5 NONAME ; unsigned int ChspsODT::Flags(void) const + ?Description@ChspsODT@@QBEABVTDesC16@@XZ @ 6 NONAME ; class TDesC16 const & ChspsODT::Description(void) const + ?SetConfigurationType@ChspsODT@@QAEXI@Z @ 7 NONAME ; void ChspsODT::SetConfigurationType(unsigned int) + ?DomDocument@ChspsODT@@QBEAAVChspsDomDocument@@XZ @ 8 NONAME ; class ChspsDomDocument & ChspsODT::DomDocument(void) const + ?Family@ChspsODT@@QBEKXZ @ 9 NONAME ; unsigned long ChspsODT::Family(void) const + ?UnMarshalHeaderLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 10 NONAME ; class ChspsODT * ChspsODT::UnMarshalHeaderLC(class TDesC8 const &) + ?ExternalizeResourceListL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 11 NONAME ; void ChspsODT::ExternalizeResourceListL(class RWriteStream &) const + ?SetThemeFullNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 12 NONAME ; void ChspsODT::SetThemeFullNameL(class TDesC16 const &) + ?SetFlags@ChspsODT@@QAEXI@Z @ 13 NONAME ; void ChspsODT::SetFlags(unsigned int) + ?ResourceCount@ChspsODT@@QBEHXZ @ 14 NONAME ; int ChspsODT::ResourceCount(void) const + ?SetThemeShortNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 15 NONAME ; void ChspsODT::SetThemeShortNameL(class TDesC16 const &) + ?PreviewFile@ChspsODT@@QBEABVTDesC16@@XZ @ 16 NONAME ; class TDesC16 const & ChspsODT::PreviewFile(void) const + ?DeleteResourceL@ChspsODT@@QAEXH@Z @ 17 NONAME ; void ChspsODT::DeleteResourceL(int) + ?ThemeVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & ChspsODT::ThemeVersion(void) const + ?SetThemeUid@ChspsODT@@QAEXH@Z @ 19 NONAME ; void ChspsODT::SetThemeUid(int) + ?CopyDomDocumentL@ChspsODT@@QAEXAAVChspsDomDocument@@@Z @ 20 NONAME ; void ChspsODT::CopyDomDocumentL(class ChspsDomDocument &) + ?SetLogoFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 21 NONAME ; void ChspsODT::SetLogoFileL(class TDesC16 const &) + ?SetFamily@ChspsODT@@QAEXK@Z @ 22 NONAME ; void ChspsODT::SetFamily(unsigned long) + ?CloneL@ChspsODT@@QBEPAV1@XZ @ 23 NONAME ; class ChspsODT * ChspsODT::CloneL(void) const + ?AddResourceL@ChspsODT@@QAEXPAVChspsResource@@@Z @ 24 NONAME ; void ChspsODT::AddResourceL(class ChspsResource *) + ?SetMultiInstance@ChspsODT@@QAEXH@Z @ 25 NONAME ; void ChspsODT::SetMultiInstance(int) + ?MultiInstance@ChspsODT@@QBEHXZ @ 26 NONAME ; int ChspsODT::MultiInstance(void) const + ?ConfigurationType@ChspsODT@@QBEIXZ @ 27 NONAME ; unsigned int ChspsODT::ConfigurationType(void) const + ?NewLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 28 NONAME ; class ChspsODT * ChspsODT::NewLC(class TDesC8 const &) + ?ProviderName@ChspsODT@@QBEABVTDesC16@@XZ @ 29 NONAME ; class TDesC16 const & ChspsODT::ProviderName(void) const + ?ResourceL@ChspsODT@@QBEAAVChspsResource@@H@Z @ 30 NONAME ; class ChspsResource & ChspsODT::ResourceL(int) const + ?OdtLanguage@ChspsODT@@QBEHXZ @ 31 NONAME ; int ChspsODT::OdtLanguage(void) const + ?MarshalHeaderL@ChspsODT@@QBEPAVHBufC8@@XZ @ 32 NONAME ; class HBufC8 * ChspsODT::MarshalHeaderL(void) const + ?RootUid@ChspsODT@@QBEHXZ @ 33 NONAME ; int ChspsODT::RootUid(void) const + ?ProviderUid@ChspsODT@@QBEHXZ @ 34 NONAME ; int ChspsODT::ProviderUid(void) const + ?SetDescriptionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void ChspsODT::SetDescriptionL(class TDesC16 const &) ?ThemeShortName@ChspsODT@@QBEABVTDesC16@@XZ @ 36 NONAME ; class TDesC16 const & ChspsODT::ThemeShortName(void) const - ?ThemeUid@ChspsODT@@QBEHXZ @ 37 NONAME ; int ChspsODT::ThemeUid(void) const - ?ThemeVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 38 NONAME ; class TDesC16 const & ChspsODT::ThemeVersion(void) const - ?UnMarshalHeaderL@ChspsODT@@QAEXABVTDesC8@@@Z @ 39 NONAME ; void ChspsODT::UnMarshalHeaderL(class TDesC8 const &) - ?UnMarshalHeaderLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 40 NONAME ; class ChspsODT * ChspsODT::UnMarshalHeaderLC(class TDesC8 const &) - ?Family@ChspsODT@@QBEKXZ @ 41 NONAME ; unsigned long ChspsODT::Family(void) const - ?SetFamily@ChspsODT@@QAEXK@Z @ 42 NONAME ; void ChspsODT::SetFamily(unsigned long) - ?SetMultiInstance@ChspsODT@@QAEXH@Z @ 43 NONAME ; void ChspsODT::SetMultiInstance(int) - ?MultiInstance@ChspsODT@@QBEHXZ @ 44 NONAME ; int ChspsODT::MultiInstance(void) const - ?Description@ChspsODT@@QBEABVTDesC16@@XZ @ 45 NONAME ; class TDesC16 const & ChspsODT::Description(void) const - ?PreviewFile@ChspsODT@@QBEABVTDesC16@@XZ @ 46 NONAME ; class TDesC16 const & ChspsODT::PreviewFile(void) const - ?SetLogoFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 47 NONAME ; void ChspsODT::SetLogoFileL(class TDesC16 const &) - ?SetDescriptionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 48 NONAME ; void ChspsODT::SetDescriptionL(class TDesC16 const &) - ?SetPreviewFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 49 NONAME ; void ChspsODT::SetPreviewFileL(class TDesC16 const &) - ?LogoFile@ChspsODT@@QBEABVTDesC16@@XZ @ 50 NONAME ; class TDesC16 const & ChspsODT::LogoFile(void) const + ?ThemeFullName@ChspsODT@@QBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & ChspsODT::ThemeFullName(void) const + ?SetThemeVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 38 NONAME ; void ChspsODT::SetThemeVersionL(class TDesC16 const &) + ?InternalizeResourceListL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 39 NONAME ; void ChspsODT::InternalizeResourceListL(class RReadStream &) + ?CloneL@ChspsODT@@QAEXAAV1@@Z @ 40 NONAME ; void ChspsODT::CloneL(class ChspsODT &) + ?SetPreviewFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 41 NONAME ; void ChspsODT::SetPreviewFileL(class TDesC16 const &) + ?SetOdtLanguage@ChspsODT@@QAEXH@Z @ 42 NONAME ; void ChspsODT::SetOdtLanguage(int) + ?ExternalizeHeaderL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 43 NONAME ; void ChspsODT::ExternalizeHeaderL(class RWriteStream &) const + ?InternalizeHeaderL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 44 NONAME ; void ChspsODT::InternalizeHeaderL(class RReadStream &) + ?ExternalizeL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 45 NONAME ; void ChspsODT::ExternalizeL(class RWriteStream &) const + ?SetProviderUid@ChspsODT@@QAEXH@Z @ 46 NONAME ; void ChspsODT::SetProviderUid(int) + ?UnMarshalHeaderL@ChspsODT@@QAEXABVTDesC8@@@Z @ 47 NONAME ; void ChspsODT::UnMarshalHeaderL(class TDesC8 const &) + ?DeleteAllResources@ChspsODT@@QAEXXZ @ 48 NONAME ; void ChspsODT::DeleteAllResources(void) + ?LogoFile@ChspsODT@@QBEABVTDesC16@@XZ @ 49 NONAME ; class TDesC16 const & ChspsODT::LogoFile(void) const + ?ThemeUid@ChspsODT@@QBEHXZ @ 50 NONAME ; int ChspsODT::ThemeUid(void) const diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsodt/eabi/hspsodtu.def --- a/homescreenpluginsrv/hspsodt/eabi/hspsodtu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsodt/eabi/hspsodtu.def Wed May 12 13:36:47 2010 +0300 @@ -3,51 +3,51 @@ _ZN8ChspsODT11SetThemeUidEi @ 2 NONAME _ZN8ChspsODT12AddResourceLEP13ChspsResource @ 3 NONAME _ZN8ChspsODT12InternalizeLER11RReadStream @ 4 NONAME - _ZN8ChspsODT14SetOdtLanguageEi @ 5 NONAME - _ZN8ChspsODT14SetProviderUidEi @ 6 NONAME - _ZN8ChspsODT15DeleteResourceLEi @ 7 NONAME - _ZN8ChspsODT16CopyDomDocumentLER16ChspsDomDocument @ 8 NONAME - _ZN8ChspsODT16SetProviderNameLERK7TDesC16 @ 9 NONAME - _ZN8ChspsODT16SetThemeVersionLERK7TDesC16 @ 10 NONAME - _ZN8ChspsODT16UnMarshalHeaderLERK6TDesC8 @ 11 NONAME - _ZN8ChspsODT17SetThemeFullNameLERK7TDesC16 @ 12 NONAME - _ZN8ChspsODT17UnMarshalHeaderLCERK6TDesC8 @ 13 NONAME - _ZN8ChspsODT18InternalizeHeaderLER11RReadStream @ 14 NONAME - _ZN8ChspsODT18SetPackageVersionLERK7TDesC16 @ 15 NONAME - _ZN8ChspsODT18SetThemeShortNameLERK7TDesC16 @ 16 NONAME - _ZN8ChspsODT20SetConfigurationTypeEj @ 17 NONAME - _ZN8ChspsODT24InternalizeResourceListLER11RReadStream @ 18 NONAME - _ZN8ChspsODT4NewLEv @ 19 NONAME - _ZN8ChspsODT5NewLCERK6TDesC8 @ 20 NONAME - _ZN8ChspsODT6CloneLEv @ 21 NONAME - _ZN8ChspsODT8SetFlagsEj @ 22 NONAME - _ZNK8ChspsODT11DomDocumentEv @ 23 NONAME - _ZNK8ChspsODT11OdtLanguageEv @ 24 NONAME - _ZNK8ChspsODT11ProviderUidEv @ 25 NONAME - _ZNK8ChspsODT12ExternalizeLER12RWriteStream @ 26 NONAME - _ZNK8ChspsODT12ProviderNameEv @ 27 NONAME - _ZNK8ChspsODT12ThemeVersionEv @ 28 NONAME - _ZNK8ChspsODT13ResourceCountEv @ 29 NONAME - _ZNK8ChspsODT13ThemeFullNameEv @ 30 NONAME - _ZNK8ChspsODT14MarshalHeaderLEv @ 31 NONAME - _ZNK8ChspsODT14PackageVersionEv @ 32 NONAME - _ZNK8ChspsODT14ThemeShortNameEv @ 33 NONAME - _ZNK8ChspsODT17ConfigurationTypeEv @ 34 NONAME - _ZNK8ChspsODT24ExternalizeResourceListLER12RWriteStream @ 35 NONAME - _ZNK8ChspsODT5FlagsEv @ 36 NONAME - _ZNK8ChspsODT7RootUidEv @ 37 NONAME - _ZNK8ChspsODT8ThemeUidEv @ 38 NONAME - _ZNK8ChspsODT9ResourceLEi @ 39 NONAME - _ZTI8ChspsODT @ 40 NONAME ; ## - _ZTV8ChspsODT @ 41 NONAME ; ## - _ZN8ChspsODT9SetFamilyEm @ 42 NONAME - _ZNK8ChspsODT6FamilyEv @ 43 NONAME - _ZN8ChspsODT16SetMultiInstanceEi @ 44 NONAME - _ZNK8ChspsODT13MultiInstanceEv @ 45 NONAME - _ZN8ChspsODT12SetLogoFileLERK7TDesC16 @ 46 NONAME - _ZN8ChspsODT15SetDescriptionLERK7TDesC16 @ 47 NONAME - _ZN8ChspsODT15SetPreviewFileLERK7TDesC16 @ 48 NONAME - _ZNK8ChspsODT11DescriptionEv @ 49 NONAME - _ZNK8ChspsODT11PreviewFileEv @ 50 NONAME - _ZNK8ChspsODT8LogoFileEv @ 51 NONAME + _ZN8ChspsODT12SetLogoFileLERK7TDesC16 @ 5 NONAME + _ZN8ChspsODT14SetOdtLanguageEi @ 6 NONAME + _ZN8ChspsODT14SetProviderUidEi @ 7 NONAME + _ZN8ChspsODT15DeleteResourceLEi @ 8 NONAME + _ZN8ChspsODT15SetDescriptionLERK7TDesC16 @ 9 NONAME + _ZN8ChspsODT15SetPreviewFileLERK7TDesC16 @ 10 NONAME + _ZN8ChspsODT16CopyDomDocumentLER16ChspsDomDocument @ 11 NONAME + _ZN8ChspsODT16SetMultiInstanceEi @ 12 NONAME + _ZN8ChspsODT16SetProviderNameLERK7TDesC16 @ 13 NONAME + _ZN8ChspsODT16SetThemeVersionLERK7TDesC16 @ 14 NONAME + _ZN8ChspsODT16UnMarshalHeaderLERK6TDesC8 @ 15 NONAME + _ZN8ChspsODT17SetThemeFullNameLERK7TDesC16 @ 16 NONAME + _ZN8ChspsODT17UnMarshalHeaderLCERK6TDesC8 @ 17 NONAME + _ZN8ChspsODT18DeleteAllResourcesEv @ 18 NONAME + _ZN8ChspsODT18InternalizeHeaderLER11RReadStream @ 19 NONAME + _ZN8ChspsODT18SetThemeShortNameLERK7TDesC16 @ 20 NONAME + _ZN8ChspsODT20SetConfigurationTypeEj @ 21 NONAME + _ZN8ChspsODT24InternalizeResourceListLER11RReadStream @ 22 NONAME + _ZN8ChspsODT4NewLEv @ 23 NONAME + _ZN8ChspsODT5NewLCERK6TDesC8 @ 24 NONAME + _ZN8ChspsODT6CloneLERS_ @ 25 NONAME + _ZN8ChspsODT8SetFlagsEj @ 26 NONAME + _ZN8ChspsODT9SetFamilyEm @ 27 NONAME + _ZNK8ChspsODT11DescriptionEv @ 28 NONAME + _ZNK8ChspsODT11DomDocumentEv @ 29 NONAME + _ZNK8ChspsODT11OdtLanguageEv @ 30 NONAME + _ZNK8ChspsODT11PreviewFileEv @ 31 NONAME + _ZNK8ChspsODT11ProviderUidEv @ 32 NONAME + _ZNK8ChspsODT12ExternalizeLER12RWriteStream @ 33 NONAME + _ZNK8ChspsODT12ProviderNameEv @ 34 NONAME + _ZNK8ChspsODT12ThemeVersionEv @ 35 NONAME + _ZNK8ChspsODT13MultiInstanceEv @ 36 NONAME + _ZNK8ChspsODT13ResourceCountEv @ 37 NONAME + _ZNK8ChspsODT13ThemeFullNameEv @ 38 NONAME + _ZNK8ChspsODT14MarshalHeaderLEv @ 39 NONAME + _ZNK8ChspsODT14ThemeShortNameEv @ 40 NONAME + _ZNK8ChspsODT17ConfigurationTypeEv @ 41 NONAME + _ZNK8ChspsODT24ExternalizeResourceListLER12RWriteStream @ 42 NONAME + _ZNK8ChspsODT5FlagsEv @ 43 NONAME + _ZNK8ChspsODT6CloneLEv @ 44 NONAME + _ZNK8ChspsODT6FamilyEv @ 45 NONAME + _ZNK8ChspsODT7RootUidEv @ 46 NONAME + _ZNK8ChspsODT8LogoFileEv @ 47 NONAME + _ZNK8ChspsODT8ThemeUidEv @ 48 NONAME + _ZNK8ChspsODT9ResourceLEi @ 49 NONAME + _ZTI8ChspsODT @ 50 NONAME + _ZTV8ChspsODT @ 51 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsodt/src/hspsodt.cpp --- a/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,7 +15,6 @@ * */ - #include "hspsodt.h" #include #include @@ -23,8 +22,8 @@ #include "hspsdomdocument.h" #include "hspsresource.h" -/* Literal delim is used in separation of theme header and and other data in ODT-streaming. */ -_LIT(KDelim, "#"); +// ODT version number +_LIT( KHpspOdtVersion, "3.0" ); // ============================ MEMBER FUNCTIONS =============================== @@ -50,6 +49,46 @@ } // ----------------------------------------------------------------------------- +// ChspsODT::CopyODTDataL() +// Helper to ODT cloning. Prevents duplicate code in two clone methods. +// ----------------------------------------------------------------------------- +// +void ChspsODT::CopyODTDataL( const ChspsODT& aSource, ChspsODT& aTarget ) + { + // Properties. + aTarget.SetFamily( aSource.Family() ); + aTarget.SetConfigurationType( aSource.ConfigurationType() ); + aTarget.SetRootUid( aSource.RootUid() ); + aTarget.SetProviderUid( aSource.ProviderUid() ); + aTarget.SetThemeUid( aSource.ThemeUid() ); + aTarget.SetProviderNameL( aSource.ProviderName() ); + aTarget.SetThemeFullNameL( aSource.ThemeFullName() ); + aTarget.SetThemeShortNameL( aSource.ThemeShortName() ); + aTarget.SetThemeVersionL( aSource.ThemeVersion() ); + aTarget.SetDescriptionL( aSource.Description() ); + aTarget.SetLogoFileL( aSource.LogoFile() ); + aTarget.SetPreviewFileL( aSource.PreviewFile() ); + aTarget.SetMultiInstance( aSource.MultiInstance() ); + aTarget.SetOdtLanguage( aSource.OdtLanguage() ); + aTarget.SetFlags( aSource.Flags() ); + + // Resources. + aTarget.DeleteAllResources(); + TInt resourceCount = aSource.ResourceCount(); + for ( TInt index = 0; index < resourceCount ; index++ ) + { + ChspsResource* resource = ( aSource.ResourceL( index ) ).CloneL(); + CleanupStack::PushL( resource ); + aTarget.AddResourceL( resource ); + CleanupStack::Pop( resource ); + resource = NULL; + } + + // DOM tree. + aTarget.CopyDomDocumentL( aSource.DomDocument() ); + } + +// ----------------------------------------------------------------------------- // ChspsODT::NewL // Two-phased constructor. // ----------------------------------------------------------------------------- @@ -89,7 +128,6 @@ delete iThemeFullName; delete iThemeShortName; delete iThemeVersion; - delete iPackageVersion; // clean up the array if( iResourceList ) { @@ -107,20 +145,16 @@ // ----------------------------------------------------------------------------- EXPORT_C HBufC8* ChspsODT::MarshalHeaderL() const { - CBufFlat* buf = CBufFlat::NewL( KMaxHeaderDataLength8 ); - CleanupStack::PushL( buf ); - RBufWriteStream stream( *buf ); //stream over the buffer - CleanupClosePushL( stream ); + HBufC8* buf = HBufC8::NewLC( HeaderSize() ); + TPtr8 ptr = buf->Des(); + RDesWriteStream stream( ptr ); + stream.PushL(); ExternalizeHeaderL( stream ); - CleanupStack::PopAndDestroy( &stream ); + stream.Pop(); + stream.Close(); + CleanupStack::Pop( buf ); - //Create a heap descriptor from the buffer - HBufC8* des = HBufC8::NewL( buf->Size() ); - TPtr8 ptr( des->Des() ); - buf->Read( 0, ptr, buf->Size() ); - CleanupStack::PopAndDestroy( buf ); - - return des; + return buf; } // ----------------------------------------------------------------------------- @@ -147,7 +181,6 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::UnMarshalHeaderL( const TDesC8& aStreamData ) { - RDesReadStream stream( aStreamData ); CleanupClosePushL( stream ); InternalizeHeaderL( stream ); @@ -174,9 +207,8 @@ EXPORT_C void ChspsODT::InternalizeL( RReadStream& aStream ) { InternalizeHeaderL( aStream ); - // consumes header delimiter - aStream.ReadInt16L(); InternalizeResourceListL( aStream ); + delete iDomDocument; iDomDocument = NULL; iDomDocument = ChspsDomDocument::NewL( aStream ); @@ -189,84 +221,139 @@ // ----------------------------------------------------------------------------- void ChspsODT::ExternalizeHeaderL( RWriteStream& aStream ) const { - if ( iPackageVersion ) - { - aStream << *iPackageVersion; - } - else + aStream.WriteInt32L( KHpspOdtVersion().Length() ); + aStream << KHpspOdtVersion(); + + aStream.WriteUint32L( iThemeUid ); + + const TDesC& providerName = ProviderName(); + aStream.WriteInt32L( providerName.Length() ); + if( providerName.Length() > 0 ) { - aStream << KNullDesC; - } + aStream << providerName; + } + + const TDesC& themeFullName = ThemeFullName(); + aStream.WriteInt32L( themeFullName.Length() ); + if( themeFullName.Length() > 0 ) + { + aStream << themeFullName; + } - aStream.WriteUint32L( iFamilyMask ); - aStream.WriteUint32L( iConfigurationType ); - aStream.WriteUint32L( iRootUid ); - aStream.WriteUint32L( iProviderUid ); - aStream.WriteUint32L( iThemeUid ); - aStream.WriteInt32L( iMultiInstance ); - if ( iDescription ) + const TDesC& themeShortName = ThemeShortName(); + aStream.WriteInt32L( themeShortName.Length() ); + if( themeShortName.Length() > 0 ) { - aStream << *iDescription; - } - else - { - aStream << KNullDesC; - } - if ( iLogoFile ) - { - aStream << *iLogoFile; + aStream << themeShortName; } - else + + const TDesC& themeVersion = ThemeVersion(); + aStream.WriteInt32L( themeVersion.Length() ); + if( themeVersion.Length() > 0 ) + { + aStream << themeVersion; + } + + const TDesC& description = Description(); + aStream.WriteInt32L( description.Length() ); + if( description.Length() > 0 ) { - aStream << KNullDesC; - } - if ( iPreviewFile ) + aStream << description; + } + + const TDesC& logoFile = LogoFile(); + aStream.WriteInt32L( logoFile.Length() ); + if( logoFile.Length() > 0 ) { - aStream << *iPreviewFile; - } - else + aStream << logoFile; + } + + const TDesC& previewFile = PreviewFile(); + aStream.WriteInt32L( previewFile.Length() ); + if( previewFile.Length() > 0 ) { - aStream << KNullDesC; - } - if ( iProviderName ) - { - aStream << *iProviderName; - } - else + aStream << previewFile; + } + + aStream.WriteUint32L( iFamilyMask ); + aStream.WriteUint32L( iConfigurationType ); + aStream.WriteUint32L( iRootUid ); + aStream.WriteUint32L( iProviderUid ); + aStream.WriteUint32L( iFlags ); + + aStream.WriteInt32L( iLanguage ); + aStream.WriteInt32L( iMultiInstance ); + } + + +// ----------------------------------------------------------------------------- +// ChspsODT::HeaderSize +// Calculate header size in bytes. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsODT::HeaderSize() const + { + TInt size = sizeof( TInt32 ); + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += KHpspOdtVersion().Size(); + + size += sizeof( TUint32 ); // iThemeUid + + size += sizeof( TInt32 ); + if( ProviderName().Length() > 0 ) { - aStream << KNullDesC; - } + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += ProviderName().Size(); + } - if ( iThemeFullName ) - { - aStream << *iThemeFullName; - } - else + size += sizeof( TInt32 ); + if( ThemeFullName().Length() > 0 ) { - aStream << KNullDesC; - } - - if ( iThemeShortName ) + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += ThemeFullName().Size(); + } + + size += sizeof( TInt32 ); + if( ThemeShortName().Length() > 0 ) { - aStream << *iThemeShortName; - } - else + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += ThemeShortName().Size(); + } + + size += sizeof( TInt32 ); + if( ThemeVersion().Length() > 0 ) + { + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += ThemeVersion().Size(); + } + + size += sizeof( TInt32 ); + if( Description().Length() > 0 ) { - aStream << KNullDesC; - } - - if ( iThemeVersion ) + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += Description().Size(); + } + + size += sizeof( TInt32 ); + if( LogoFile().Length() > 0 ) { - aStream << *iThemeVersion; - } - else + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += LogoFile().Size(); + } + + size += sizeof( TInt32 ); + if( PreviewFile().Length() > 0 ) { - aStream << KNullDesC; - } - aStream.WriteInt32L( iLanguage ); - aStream.WriteUint32L( iFlags ); - // end of the header delimiter - aStream.WriteL( KDelim ); + size += sizeof( TUint32 ); // String streaming insert also max. 32bit member of TCardinality. + size += PreviewFile().Size(); + } + + size += sizeof( TUint32 ) * 5; // iFamilyMask, iConfigurationType, + // iRootUid, iProviderUid, iFlags + + size += sizeof( TInt32 ) * 2; // iLanguage, iMultiInstance + + return size; } // ----------------------------------------------------------------------------- @@ -275,59 +362,87 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::InternalizeHeaderL( RReadStream& aStream ) - { - HBufC* version = HBufC::NewL( aStream, KMaxFileName ); - CleanupStack::PushL( version ); - if ( iPackageVersion && version->Des().Compare( iPackageVersion->Des() ) != 0 ) + { + TInt len = aStream.ReadInt32L(); + HBufC* odtVersion = NULL; + if ( len > 0 ) { - // Package version check requested (iPackageVersion defined) - // and package version not supported + odtVersion = HBufC::NewL( aStream, len ); + } + CleanupStack::PushL( odtVersion ); + // ODT version check. + if ( KHpspOdtVersion() != *odtVersion ) + { User::Leave( KErrNotSupported ); } - if ( !iPackageVersion && version->Length() ) - { - // Package version check not requested - iPackageVersion = version->AllocL(); - } - CleanupStack::PopAndDestroy( version ); - - iFamilyMask = aStream.ReadUint32L(); - iConfigurationType = aStream.ReadUint32L(); - iRootUid = aStream.ReadUint32L(); - iProviderUid = aStream.ReadUint32L(); + CleanupStack::PopAndDestroy( odtVersion ); + iThemeUid = aStream.ReadUint32L(); - iMultiInstance = aStream.ReadInt32L(); - - delete iDescription; - iDescription = NULL; - iDescription = HBufC::NewL(aStream, KMaxDescLength ); - - delete iLogoFile; - iLogoFile = NULL; - iLogoFile = HBufC::NewL(aStream, KMaxFileName ); - - delete iPreviewFile; - iPreviewFile = NULL; - iPreviewFile = HBufC::NewL(aStream, KMaxFileName ); - + delete iProviderName; iProviderName = NULL; - iProviderName = HBufC::NewL(aStream, KMaxFileName ); + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iProviderName = HBufC::NewL( aStream, len ); + } delete iThemeFullName; iThemeFullName = NULL; - iThemeFullName = HBufC::NewL(aStream, KMaxFileName ); + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iThemeFullName = HBufC::NewL( aStream, len ); + } delete iThemeShortName; iThemeShortName = NULL; - iThemeShortName = HBufC::NewL(aStream, KMaxFileName ); - + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iThemeShortName = HBufC::NewL( aStream, len ); + } + delete iThemeVersion; iThemeVersion = NULL; - iThemeVersion = HBufC::NewL(aStream, KMaxFileName ); - + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iThemeVersion = HBufC::NewL( aStream, len ); + } + + delete iDescription; + iDescription = NULL; + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iDescription = HBufC::NewL( aStream, len ); + } + + delete iLogoFile; + iLogoFile = NULL; + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iLogoFile = HBufC::NewL( aStream, len ); + } + + delete iPreviewFile; + iPreviewFile = NULL; + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iPreviewFile = HBufC::NewL( aStream, len ); + } + + iFamilyMask = aStream.ReadUint32L(); + iConfigurationType = aStream.ReadUint32L(); + iRootUid = aStream.ReadUint32L(); + iProviderUid = aStream.ReadUint32L(); + iFlags = aStream.ReadUint32L(); + iLanguage = aStream.ReadInt32L(); - iFlags = aStream.ReadUint32L(); + iMultiInstance = aStream.ReadInt32L(); } // ----------------------------------------------------------------------------- @@ -394,6 +509,16 @@ } // ----------------------------------------------------------------------------- +// ChspsODT::DeleteResourceListL +// Deletes all resources from the ODT. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::DeleteAllResources() + { + iResourceList->ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- // ChspsODT::ResourceL // Get the resource by the index // (other items were commented in a header). @@ -462,7 +587,6 @@ } } - // ----------------------------------------------------------------------------- // ChspsODT::SetRootUid // Set RootUid @@ -530,9 +654,16 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetProviderNameL( const TDesC& aName ) { - delete iProviderName; - iProviderName = NULL; - iProviderName = aName.AllocL(); + if( iProviderName ) + { + delete iProviderName; + iProviderName = NULL; + } + + if( aName.Length() != 0 ) + { + iProviderName = aName.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -559,9 +690,16 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetThemeFullNameL( const TDesC& aName ) { - delete iThemeFullName; - iThemeFullName = NULL; - iThemeFullName = aName.AllocL(); + if( iThemeFullName ) + { + delete iThemeFullName; + iThemeFullName = NULL; + } + + if( aName.Length() != 0 ) + { + iThemeFullName = aName.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -588,9 +726,16 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetThemeShortNameL( const TDesC& aName ) { - delete iThemeShortName; - iThemeShortName = NULL; - iThemeShortName = aName.AllocL(); + if( iThemeShortName ) + { + delete iThemeShortName; + iThemeShortName = NULL; + } + + if( aName.Length() != 0 ) + { + iThemeShortName = aName.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -617,9 +762,16 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetThemeVersionL( const TDesC& aVersion ) { - delete iThemeVersion; - iThemeVersion = NULL; - iThemeVersion = aVersion.AllocL(); + if( iThemeVersion ) + { + delete iThemeVersion; + iThemeVersion = NULL; + } + + if( aVersion.Length() != 0 ) + { + iThemeVersion = aVersion.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -689,61 +841,30 @@ { return *iDomDocument; } - + // ----------------------------------------------------------------------------- // ChspsODT::CloneL() // Makes a clone of this ODT and returns pointer to it // (other items were commented in a header). // ----------------------------------------------------------------------------- // -EXPORT_C ChspsODT* ChspsODT::CloneL() +EXPORT_C ChspsODT* ChspsODT::CloneL() const { - ChspsODT* clone = new (ELeave) ChspsODT; - CleanupStack::PushL( clone ); - clone->ConstructL(); - clone->SetConfigurationType( iConfigurationType ); - clone->SetRootUid( iRootUid ); - clone->SetProviderUid( iProviderUid ); - clone->SetThemeUid( iThemeUid ); - if( iProviderName ) - { - clone->SetProviderNameL( *iProviderName ); - } - if( iThemeFullName ) - { - clone->SetThemeFullNameL( *iThemeFullName ); - } - if( iThemeShortName ) - { - clone->SetThemeShortNameL( *iThemeShortName ); - } - if( iThemeVersion ) - { - clone->SetThemeVersionL( *iThemeVersion ); - } - if( iPackageVersion ) - { - clone->SetPackageVersionL( *iPackageVersion ); - } - if( iDescription ) - { - clone->SetDescriptionL( *iDescription ); - } - clone->SetOdtLanguage( iLanguage ); - clone->SetFlags( iFlags ); - - TInt resourceCount = iResourceList->Count(); - - for ( TInt index = 0; index < resourceCount ; index++ ) - { - ChspsResource& resource = ResourceL( index ); - clone->AddResourceL( resource.CloneL() ); - } - - CleanupStack::Pop( clone ); + ChspsODT* clone = ChspsODT::NewL(); + CleanupStack::PushL( clone ); + ChspsODT::CopyODTDataL( *this, *clone ); + CleanupStack::Pop( clone ); return clone; } - + +// ----------------------------------------------------------------------------- +// Copies data from an exisiting ODT +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::CloneL( ChspsODT& aODT ) + { + ChspsODT::CopyODTDataL( aODT, *this ); + } + // ----------------------------------------------------------------------------- // ChspsODT::CopyDomDocumentL() // Clones the aDom and sets it as this ChspsODT's DomDocument @@ -776,35 +897,6 @@ } // ----------------------------------------------------------------------------- -// ChspsODT::SetPackageVersionL -// Set package version -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -EXPORT_C void ChspsODT::SetPackageVersionL( const TDesC& aVersion ) - { - delete iPackageVersion; - iPackageVersion = NULL; - iPackageVersion = aVersion.AllocL(); - } - -// ----------------------------------------------------------------------------- -// ChspsODT::PackageVersion -// Get package version -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -EXPORT_C const TDesC& ChspsODT::PackageVersion() const - { - if ( iPackageVersion ) - { - return *iPackageVersion; - } - else - { - return KNullDesC; - } - } - -// ----------------------------------------------------------------------------- // ChspsODT::SetFamily // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetFamily( const TUint32 aFamilyMask ) @@ -845,9 +937,16 @@ // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetDescriptionL( const TDesC& aDesc ) { - delete iDescription; - iDescription = NULL; - iDescription = aDesc.AllocL(); + if( iDescription ) + { + delete iDescription; + iDescription = NULL; + } + + if( aDesc.Length() != 0 ) + { + iDescription = aDesc.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -869,10 +968,17 @@ // ChspsODT::SetLogoFileL // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetLogoFileL( const TDesC& aPath ) - { - delete iLogoFile; - iLogoFile = NULL; - iLogoFile = aPath.AllocL(); + { + if( iLogoFile ) + { + delete iLogoFile; + iLogoFile = NULL; + } + + if( aPath.Length() != 0 ) + { + iLogoFile = aPath.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -894,10 +1000,17 @@ // ChspsODT::SetPreviewFileL // ----------------------------------------------------------------------------- EXPORT_C void ChspsODT::SetPreviewFileL( const TDesC& aPath ) - { - delete iPreviewFile; - iPreviewFile = NULL; - iPreviewFile = aPath.AllocL(); + { + if( iPreviewFile ) + { + delete iPreviewFile; + iPreviewFile = NULL; + } + + if( aPath.Length() != 0 ) + { + iPreviewFile = aPath.AllocL(); + } } // ----------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp --- a/homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp Wed May 12 13:36:47 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include #include "hsps_builds_cfg.hrh" @@ -63,8 +64,9 @@ // might leave. // ----------------------------------------------------------------------------- // -ChspsDefinitionRepository::ChspsDefinitionRepository() - { +ChspsDefinitionRepository::ChspsDefinitionRepository() : + iCacheLastODT( NULL ) + { } // ----------------------------------------------------------------------------- @@ -122,6 +124,8 @@ iObservers.Close(); delete iPath; + delete iCacheLastODT; + iTempFileName1 = KNullDesC; iTempFileName2 = KNullDesC; } @@ -200,6 +204,13 @@ } #endif + if( aODT.ConfigurationType() == EhspsAppConfiguration ) + { + delete iCacheLastODT; + iCacheLastODT = NULL; + iCacheLastODT = aODT.CloneL(); + } + return ret; } @@ -212,6 +223,7 @@ EXPORT_C TInt ChspsDefinitionRepository::GetOdtL( ChspsODT& aODT ) { TInt errorCode = KErrNone; + if ( aODT.Flags() & EhspsThemeStatusLicenceeDefault ) { iLicenseDefault = ETrue; @@ -221,12 +233,23 @@ iLicenseDefault = EFalse; } - TRAP( errorCode, GetPathL( aODT, EResourceODT )); - if ( !errorCode ) - { - errorCode = ReadFromFileL( *iPath, aODT ); - } - iLicenseDefault = EFalse; + if( iCacheLastODT && + iCacheLastODT->RootUid() == aODT.RootUid() && + iCacheLastODT->ThemeUid() == aODT.ThemeUid() ) + { + aODT.CloneL( *iCacheLastODT ); + } + else + { + TRAP( errorCode, GetPathL( aODT, EResourceODT )); + if ( !errorCode ) + { + errorCode = ReadFromFileL( *iPath, aODT ); + } + } + + iLicenseDefault = EFalse; + return errorCode; } @@ -616,8 +639,7 @@ } CleanupStack::PopAndDestroy( fileName ); - - + // Set drive information iTempFileName1.Format( _L("%S"), &res->FileName() ); TParsePtr f( iTempFileName1 ); @@ -1026,19 +1048,22 @@ if ( !errorCode ) { // Create the directory structure - TInt err = iFs.MkDirAll( *iPath ); - if ( err != KErrNone && err != KErrAlreadyExists ) - { - errorCode = err; - + if( !BaflUtils::FolderExists( iFs, *iPath ) ) + { + TInt err = iFs.MkDirAll( *iPath ); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + errorCode = err; + #ifdef HSPS_LOG_ACTIVE - if( iLogBus ) - { - iLogBus->LogText( _L( "ChspsDefinitionRepository::WriteToFileL(): - error %d." ), - err ); + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::WriteToFileL(): - error %d." ), + err ); + } +#endif } -#endif - } + } if ( !errorCode ) { diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsresource/src/hspsresource.cpp --- a/homescreenpluginsrv/hspsresource/src/hspsresource.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsresource/src/hspsresource.cpp Wed May 12 13:36:47 2010 +0300 @@ -63,16 +63,20 @@ EXPORT_C ChspsResource* ChspsResource::CloneL() { ChspsResource* clone = ChspsResource::NewL(); + CleanupStack::PushL( clone ); + clone->SetLockingPolicy( iLockingPolicy ); clone->SetResourceType( iResourceType ); - clone->SetLanguage( iLanguage ); - clone->SetResourceIdL( *iResourceID ); - clone->SetFileNameL( *iFileName ); + clone->SetLanguage( iLanguage ); + clone->SetResourceIdL( ResourceId() ); + clone->SetFileNameL( FileName() ); clone->SetMimeTypeL( iMimeType ); clone->SetConfigurationUid( iConfigurationUid ); + clone->SetTagsL( Tags() ); CleanupStack::Pop( clone ); + return clone; } @@ -95,37 +99,30 @@ aStream.WriteUint32L( iLockingPolicy ); aStream.WriteUint32L( iResourceType ); aStream.WriteUint32L( iLanguage ); - - if ( iResourceID ) + + const TDesC& resourceId = ResourceId(); + aStream.WriteInt32L( resourceId.Length() ); + if ( resourceId.Length() > 0 ) { - aStream << *iResourceID; - } - else - { - aStream << KNullDesC; + aStream << resourceId; } - if ( iFileName ) + const TDesC& fileName = FileName(); + aStream.WriteInt32L( fileName.Length() ); + if ( fileName.Length() > 0 ) { - aStream << *iFileName; - } - else - { - aStream << KNullDesC; - } - + aStream << fileName; + } iMimeType.ExternalizeL(aStream); aStream.WriteUint32L( iConfigurationUid ); - if ( iTags ) + const TDesC& tags = Tags(); + aStream.WriteInt32L( tags.Length() ); + if ( tags.Length() > 0 ) { - aStream << *iTags; - } - else - { - aStream << KNullDesC; + aStream << tags; } } @@ -141,12 +138,20 @@ iLanguage = (TLanguage)aStream.ReadUint32L(); delete iResourceID; - iResourceID = NULL; - iResourceID = HBufC::NewL(aStream, KMaxFileName ); + iResourceID = NULL; + TInt len = aStream.ReadInt32L(); + if( len > 0 ) + { + iResourceID = HBufC::NewL( aStream, len ); + } delete iFileName; iFileName = NULL; - iFileName = HBufC::NewL(aStream, KMaxFileName ); + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iFileName = HBufC::NewL( aStream, len ); + } iMimeType.InternalizeL(aStream); @@ -154,7 +159,11 @@ delete iTags; iTags = NULL; - iTags = HBufC::NewL(aStream, KMaxTagsLength ); + len = aStream.ReadInt32L(); + if( len > 0 ) + { + iTags = HBufC::NewL( aStream, len ); + } } // ----------------------------------------------------------------------------- @@ -205,9 +214,16 @@ // EXPORT_C void ChspsResource::SetResourceIdL( const TDesC& aResourceId ) { - delete iResourceID; - iResourceID = NULL; - iResourceID = aResourceId.AllocL(); + if( iResourceID ) + { + delete iResourceID; + iResourceID = NULL; + } + + if( aResourceId.Length() > 0 ) + { + iResourceID = aResourceId.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -234,9 +250,16 @@ // EXPORT_C void ChspsResource::SetFileNameL( const TDesC& aFileName ) { - delete iFileName; - iFileName = NULL; - iFileName = aFileName.AllocL(); + if( iFileName ) + { + delete iFileName; + iFileName = NULL; + } + + if( aFileName.Length() > 0 ) + { + iFileName = aFileName.AllocL(); + } } // ----------------------------------------------------------------------------- @@ -254,8 +277,7 @@ { return KNullDesC; } - } - + } // ----------------------------------------------------------------------------- // ChspsResource::SetMimeTypeL(). @@ -322,9 +344,16 @@ // EXPORT_C void ChspsResource::SetTagsL( const TDesC& aTag ) { - delete iTags; - iTags = NULL; - iTags = aTag.AllocL(); + if( iTags ) + { + delete iTags; + iTags = NULL; + } + + if( aTag.Length() > 0 ) + { + iTags = aTag.AllocL(); + } } // ----------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspsresult/src/hspspluginidlist.cpp --- a/homescreenpluginsrv/hspsresult/src/hspspluginidlist.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspsresult/src/hspspluginidlist.cpp Wed May 12 13:36:47 2010 +0300 @@ -10,6 +10,7 @@ * Nokia Corporation - initial contribution. * * Contributors: +* Leo Zheng - GCC-E compilation error fix (2098) * * Description: Class ChspsPluginIdList is a HSPS utility class for passing * plugin ids from a client process to the server process. @@ -30,7 +31,7 @@ // might leave. // ----------------------------------------------------------------------------- // -EXPORT_C ChspsPluginIdList::ChspsPluginIdList( TInt aGranularity ) : CArrayFixFlat( aGranularity ) +EXPORT_C ChspsPluginIdList::ChspsPluginIdList( TInt aGranularity ) : CArrayFixFlat( aGranularity ) { } diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspstools/group/hspstools.mmp --- a/homescreenpluginsrv/hspstools/group/hspstools.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspstools/group/hspstools.mmp Wed May 12 13:36:47 2010 +0300 @@ -57,7 +57,7 @@ nostrictdef -LIBRARY euser.lib flogger.lib hspsdomdocument.lib liwservicehandler.lib estor.lib efsrv.lib hspsodt.lib charconv.lib hspsresource.lib +LIBRARY euser.lib flogger.lib hspsdomdocument.lib liwservicehandler.lib estor.lib efsrv.lib hspsodt.lib charconv.lib hspsresource.lib #ifdef ENABLE_ABIV2_MODE DEBUGGABLE diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp --- a/homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,7 +18,7 @@ #include "hspslogbusfile.h" #include "e32debug.h" - +#include "f32file.h" // Constants #ifdef HSPS_BUILD_LOG_IMPLEMENTATION @@ -86,6 +86,13 @@ #ifdef HSPS_BUILD_LOG_IMPLEMENTATION EXPORT_C TFileName ChspsLogBusFile::CreateLogFilename( const TDesC& aBaseline ) { + RFs fs; + if ( KErrNone == fs.Connect() ) + { + fs.MkDirAll(_L("c:\\logs\\hsps\\")); + fs.Close(); + } + TFileName fileName; // Append baseline and trailing '_'. diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsclient.h --- a/homescreenpluginsrv/inc/hspsclient.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsclient.h Wed May 12 13:36:47 2010 +0300 @@ -267,8 +267,10 @@ /** * From MhspsMaintenanceService. */ - IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask, - CArrayPtrFlat& aHeaderList); + IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders( + const ChspsODT& aSearchMask, + const TBool aCopyLogos, + CArrayPtrFlat& aHeaderList ); /** * From MhspsMaintenanceService. @@ -324,11 +326,14 @@ * @param aSearchMask is ChspsODT-object which attributes are filled to present search * parameters for theme set queried by client. This parametrisation follows * the high-level schema. + * @param aCopyLogos is set if client wants to view logos * @param aHeaderList is an list object able to carry ChspsODT-objects. * @return Error code */ - IMPORT_C TInt hspsGetHeaders(const ChspsODT& aSearchMask, - CArrayPtrFlat& aHeaderList); + IMPORT_C TInt hspsGetHeaders( + const ChspsODT& aSearchMask, + const TBool aCopyLogos, + CArrayPtrFlat& aHeaderList); /** * From MhspsMaintenanceService diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsclientsession.h --- a/homescreenpluginsrv/inc/hspsclientsession.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsclientsession.h Wed May 12 13:36:47 2010 +0300 @@ -85,11 +85,12 @@ * @since S60 5.0 * @param aResultData Result data. * @param aSearchMaskData Search mask data. + * @param aCopyLogos Set if logo resources should be copied to client * @param aHeaderData Header data. * @return Symbian error code. */ IMPORT_C TInt GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData, - TDes8& aHeaderData); + const TBool aCopyLogos,TDes8& aHeaderData); /** * SetActiveTheme. diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsdefinitionrepository.h --- a/homescreenpluginsrv/inc/hspsdefinitionrepository.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsdefinitionrepository.h Wed May 12 13:36:47 2010 +0300 @@ -491,7 +491,10 @@ #ifdef HSPS_LOG_ACTIVE // Log bus. Not owned. ChspsLogBus* iLogBus; -#endif +#endif + + // Cached copy of last retrieved ODT. + ChspsODT* iCacheLastODT; }; #endif // C_hspsDEFINITIONREPOSITORY_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsdomattribute.h --- a/homescreenpluginsrv/inc/hspsdomattribute.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsdomattribute.h Wed May 12 13:36:47 2010 +0300 @@ -52,6 +52,17 @@ IMPORT_C static ChspsDomAttribute* NewL( const TDesC8& aName, ChspsDomStringPool& aStringPool ); + + /** + * Two-phased constructor 8 bit. + * + * @since S60 5.0 + * @param aName Name of attribute (String pool index). + * @param aStringPool Attached string pool. + */ + IMPORT_C static ChspsDomAttribute* NewL( + const TInt aName, + ChspsDomStringPool& aStringPool ); /** * Two-phased stream constructor. @@ -83,9 +94,11 @@ * * @since S60 5.0 * @param aStringPool Original string pool clone. + * @param aFastClone If ETrue, then fast mode cloning is used. * @return Pointer to an attribute. Ownership is transferred to a caller. */ - ChspsDomAttribute* CloneL( ChspsDomStringPool& aStringPool ); + ChspsDomAttribute* CloneL( ChspsDomStringPool& aStringPool, + const TBool aFastClone = EFalse ); /** * Get the attribute value. @@ -104,6 +117,14 @@ IMPORT_C void SetValueL( const TDesC8& aValue ); /** + * Set attribute value. + * + * @since S60 5.0 + * @param aValue Attribute ref value. + */ + IMPORT_C void SetValueL( const TInt aValue ); + + /** * Get the attributes name string pool index. * * @since S60 5.0 @@ -127,8 +148,7 @@ * @since S60 5.0 * @return Name. */ - IMPORT_C const TDesC8& Name(); - + IMPORT_C const TDesC8& Name(); /** * Documented in ChspsDomListItem::Size. @@ -159,6 +179,10 @@ */ void ConstructL( const TDesC8& aName ); + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TInt aName ); private: // Data //String pool to get string for references, not owned. diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsdomnode.h --- a/homescreenpluginsrv/inc/hspsdomnode.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsdomnode.h Wed May 12 13:36:47 2010 +0300 @@ -63,7 +63,20 @@ const TDesC8& aName, const TDesC8& aNS, ChspsDomStringPool& aStringPool ); - + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aName Name of node (string pool index). + * @param aNS Namespace (string pool index). + * @param aStringPool Attached string pool. + */ + static ChspsDomNode* NewL( + const TInt aName, + const TInt aNS, + ChspsDomStringPool& aStringPool ); + /** * Two-phased stream constructor. * @@ -83,10 +96,13 @@ * Makes a clone from this node and it's child nodes. * * @since S60 5.0 - * @param aStringPool A new string pool. + * @param aStringPool A new string pool. + * @param aFastClone If ETrue, then fast mode cloning is used. + * * @return Pointer to a clone node. Caller has the ownership. */ - IMPORT_C ChspsDomNode* CloneL( ChspsDomStringPool& aStringPool ); + IMPORT_C ChspsDomNode* CloneL( ChspsDomStringPool& aStringPool, + const TBool aFastClone = EFalse ); /** * Makes a clone only from this node. @@ -299,8 +315,7 @@ IMPORT_C const TDesC8& AttributeValue(const TDesC8& aAttribute) const; public: //From MhspsDomListItem - - + /** * Documented in ChspsDomListItem::Size */ @@ -321,8 +336,7 @@ * Documented in ChspsDomListItem::Name */ IMPORT_C const TDesC8& Name(); - - + public: /** @@ -350,6 +364,16 @@ * By default Symbian 2nd phase constructor is private. */ void ConstructL( const TDesC8& aName, const TDesC8& aNS ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TInt aName, const TInt aNS ); + + /** + * Construct members + */ + void Construct2L(); private: // Data diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsdomstringpool.h --- a/homescreenpluginsrv/inc/hspsdomstringpool.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsdomstringpool.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005,2006 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,25 +15,24 @@ * */ - - -#ifndef hsps_DOM_STRING_POOL_H -#define hsps_DOM_STRING_POOL_H +#ifndef HSPS_DOM_STRING_POOL_H +#define HSPS_DOM_STRING_POOL_H // INCLUDES #include #include +#include "hspsdomstringpooloptimizer.h" // CLASS DECLARATION /** - * Class utilize flyweight pattern. Dom strings are stored once - * and referred with index. Class can be serialized. - * - * @lib hspsdomdocument.lib - * @since S60 5.0 - * @ingroup group_hspsdom - */ +* @ingroup group_hspsdom +* Class utilize flyweight pattern. Dom strings are stored once +* and referred with index. Class can be serialized. +* +* @lib xndomdocument.lib +* @since Series 60 3.1 +*/ class ChspsDomStringPool : public CBase { public: // Constructors and destructor @@ -41,23 +40,26 @@ /** * Two-phased constructor. * - * @since S60 5.0 + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. */ - static ChspsDomStringPool* NewL(); - + static ChspsDomStringPool* NewL( const TBool aAllowDuplicates = EFalse ); + /** * Two-phased stream constructor. * - * @since S60 5.0 - * @param aStream Source stream. - */ - static ChspsDomStringPool* NewL( RReadStream& aStream ); + * @param aStream Stream where string pool is internalized. + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. + */ + static ChspsDomStringPool* NewL( RReadStream& aStream, + const TBool aAllowDuplicates = EFalse ); /** * Destructor. */ virtual ~ChspsDomStringPool(); - + public: /** * Make a copy from original StringPool. @@ -65,39 +67,70 @@ * @return Pointer to a string pool. Ownership is transferred to a caller. */ ChspsDomStringPool* CloneL(); + + /** + * Reset string pool to be reused. + * + * @since Series 60 5.2 + */ + void Reset(); + public: //Adding /** * Set dom string into string pool. * - * @since S60 5.0 * @param aString String to add to string pool * @return Index (reference) to string pool */ IMPORT_C TInt AddStringL( const TDesC8& aString ); - + + /** + * Set dom string into string pool. + * + * @param aString String to add to string pool. OWNERSHIP TRANSFERRED! + * @return Index (reference) to string pool + */ + TInt AddStringL( HBufC8* aString ); + + /** + * Add all string from another string pool. + * + * @param aStringPool Source string pool. + */ + void AddAllL( ChspsDomStringPool& aStringPool ); + public: //Accessing /** - * Get pointer to the node element name. - * @param aStringRef StringRef. + * Get reference to string. + * + * @param aMap Map object which has index to name string * @return Pointer to the name */ const TDesC8& String( const TInt aStringRef ); /** * Get object's data size in bytes. + * * @return Data size in bytes */ TInt Size() const; + + /** + * Get amount of strings. + */ + TInt Count() const; /** - * Externalize object + * Externalize object. + * * @param aStream Output stream */ void ExternalizeL( RWriteStream& aStream ) const; /** - * Internalize object + * Internalize object. + * * @param aStream Input stream */ void InternalizeL( RReadStream& aStream ); @@ -106,21 +139,41 @@ /** * C++ default constructor. + * + * @param aAllowDuplicates ETrue if duplicates are to be allowed. + * Supported for legacy reasons. */ - ChspsDomStringPool(); + ChspsDomStringPool( const TBool aAllowDuplicates ); /** - * By default Symbian 2nd phase constructor is private. + * By default Symbian 2nd phase constructor is private. */ - void ConstructL(); - - private: + void ConstructL(); + + /** + * Add string to string pool and to optimizer also. + * + * @param aNewString String to be added. OWNERSHIP TRANSFERRED. + * @param TInt Index to added string. + */ + TInt DoAddStringL( HBufC8* aNewString ) ; + + private: //String pool RPointerArray iStringPool; - + + /** + * String pool optimizer. + */ + ThspsDomStringPoolOptimizer iStringPoolOptimizer; + /** + * ETrue if string pool can contain duplicate entries. Must + * be supported for legacy reasons while loading xuikon odts. + */ + TBool iAllowDuplicates; }; -#endif // hsps_DOM_STRING_POOL_H +#endif // HSPS_DOM_STRING_POOL_H // End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsdomstringpooloptimizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomstringpooloptimizer.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2005,2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Optimizer module for ChspsDomStringPool. +* +*/ + +#ifndef HSPS_DOM_STRING_POOL_OPTIMIZER_H +#define HSPS_DOM_STRING_POOL_OPTIMIZER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* @ingroup group_hspsdom +* Optimizer module entry for ChspsDomStringPool. +* +* @lib hspsdomdocument.lib +* @since Series 60 5.2 +*/ +class ThspsDomStringPoolOptimizerEntry + { + public: // Construction. + /** + * Constructor. + * + * @param aIndex Index. + * @param aString String. + */ + ThspsDomStringPoolOptimizerEntry( TInt aIndex, const TDesC8& aString ); + + public: // Data. + /** + * Index of string in actual string pool. + */ + TInt iIndex; + + /** + * Reference to string in string pool. + */ + const TDesC8& iString; + }; + +/** +* @ingroup group_hspsdom +* Optimizer module for ChspsDomStringPool. +* +* @lib hspsdomdocument.lib +* @since Series 60 5.2 +*/ +class ThspsDomStringPoolOptimizer + { + public: + /** + * Add entry to optimizer list. + * + * @param aEntry Entry to be added. + */ + void AddEntryL( ThspsDomStringPoolOptimizerEntry& aEntry ); + + /** + * Get index for string. + * + * @param aString Reference to given string. + * @return TInt Index to actual string pool for string if found. + * If string is not found will return KErrNotFound. + */ + TInt GetIndex( const TDesC8& aString ); + + /** + * Reset. + */ + void Reset(); + + /** + * Close allocated resources. + */ + void Close(); + + /** + * Get item count. + */ + TInt Count(); + + /** + * Get entry. + * + * @param aIndex Index to Entry. + */ + ThspsDomStringPoolOptimizerEntry& Entry( const TInt aIndex ); + + private: + /** + * Find entry from alphabetic list. + * Uses binary search. + * + * @param aString Reference to string to be searched for. + * @param aLeft Left limit for binary search + * @param aRight Right limit for binary search. + * + * @return Index to OPTIMIZER ARRAY. KErrNotFound if + * given string is not found. + */ + TInt FindEntry( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ); + + /** + * Find a position clue for given string. + * + * Will return index that can be used to initiate linear + * search. Uses binary search to limit required comparisons + * when string pools starts to fill. + * + * Note: Returned index is not absolute! it must be + * only used as a start index for linear searching. + * + * Returned index will be quite close to actual insertion position. + * it will be 0 - 2 steps backward from actual position. + * + * @param aString Reference to string. + * @param aLeft Left limit for binary search + * @param aRight Right limit for binary search. + * + * @return Index to start searching for position + * for given string. + */ + TInt FindInsertionIndexEstimate( const TDesC8& aString, + const TInt aLeft, + const TInt aRight ); + + private: // Data. + /** + * Array of optimizer entries. + */ + RArray iEntries; + }; + +#endif // HSPS_DOM_STRING_POOL_OPTIMIZER_H + +// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsodt.h --- a/homescreenpluginsrv/inc/hspsodt.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsodt.h Wed May 12 13:36:47 2010 +0300 @@ -151,6 +151,13 @@ * @param aIndex Index of the resource to be deleted. */ IMPORT_C void DeleteResourceL( TInt aIndex ); + + /** + * Deletes all resources from the ODT. + * + * @since S60 5.0 + */ + IMPORT_C void DeleteAllResources(); /** * Gets a resource. @@ -344,8 +351,15 @@ * @since S60 5.0 * @return ChspsODT* pointer to the cloned ODT. */ - IMPORT_C ChspsODT* CloneL(); - + IMPORT_C ChspsODT* CloneL() const; + + /** + * Clones given ODT to this ODT. + * + * @since S60 5.0 + * @param aODT Source ODT. + */ + IMPORT_C void CloneL( ChspsODT& aODT ); /** * Clones the aDom and sets it as this ChspsODT's DomDocument. @@ -370,22 +384,6 @@ * @return TUint configuration type. */ IMPORT_C TUint ConfigurationType() const; - - /** - * Set package version. - * - * @since S60 5.0 - * @param aVersion Version. - */ - IMPORT_C void SetPackageVersionL( const TDesC& aVersion ); - - /** - * Get configuration type. - * - * @since S60 5.0 - * @return TDesC package version - */ - IMPORT_C const TDesC& PackageVersion() const; /** * Set family. @@ -475,20 +473,23 @@ */ void ConstructL(); - private: // Data - - // Family mask (bits for e.g. vga, qhd_tch etc resolutions) - TUint32 iFamilyMask; + private: + /** + * Helper to ODT cloning. Prevents duplicate code in two clone methods. + * + * @param aSource Source ODT + * @param aTarget Target ODT + */ + static void CopyODTDataL( const ChspsODT& aSource, ChspsODT& aTarget ); - // Configuration type - TUint iConfigurationType; - - // Application or interface uid - TUint iRootUid; + /** + * Calculate header size in bytes. + * + * @return TInt Header size. + */ + TInt HeaderSize() const; - // The publisher - TUint iProviderUid; - + private: // Data // Identifies specific configuration TUint iThemeUid; HBufC* iProviderName; @@ -496,17 +497,8 @@ HBufC* iThemeShortName; // Revision number - HBufC* iThemeVersion; - - // Indicates whether we are able to internalize the instance - HBufC* iPackageVersion; - - // Language of the ODT instance - TInt iLanguage; - - // Multiple instances allowed/not - TInt iMultiInstance; - + HBufC* iThemeVersion; + // Description of the widget HBufC* iDescription; @@ -515,10 +507,28 @@ // Path to the preview file HBufC* iPreviewFile; + + // Family mask (bits for e.g. vga, qhd_tch etc resolutions) + TUint32 iFamilyMask; + // Configuration type + TUint iConfigurationType; + + // Application or interface uid + TUint iRootUid; + + // The publisher + TUint iProviderUid; + // ThspsThemeStatus - TUint iFlags; - + TUint iFlags; + + // Language of the ODT instance + TInt iLanguage; + + // Multiple instances allowed/not + TInt iMultiInstance; + // Pointer to list of unlocalized resources CArrayPtrSeg* iResourceList; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsresource.h --- a/homescreenpluginsrv/inc/hspsresource.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsresource.h Wed May 12 13:36:47 2010 +0300 @@ -289,15 +289,15 @@ TInt iConfigurationUid; // Filename without the extension - TDesC* iResourceID; + HBufC* iResourceID; // Full path and name - TDesC* iFileName; + HBufC* iFileName; TDataType iMimeType; // Tags seperated with a colon - TDesC* iTags; + HBufC* iTags; // Reserved pointer for future extension TAny* iReserved; diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/inc/hspsthememanagement.h --- a/homescreenpluginsrv/inc/hspsthememanagement.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/inc/hspsthememanagement.h Wed May 12 13:36:47 2010 +0300 @@ -1294,11 +1294,14 @@ * @param aSearchMask is ChspsODT-object which attributes are filled to present search * parameters for theme set queried by client. This parametrisation follows the * high-level schema. + * @param aCopyLogos indicates that logo resources should be copied to a private directory * @param aHeaderList is an list object able to carry ChspsODT-objects. * @return ThspsServiceCompletedMessage expressing the result of the call. */ - virtual ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask, - CArrayPtrFlat& aHeaderList) = 0; + virtual ThspsServiceCompletedMessage hspsGetListHeaders( + const ChspsODT& aSearchMask, + const TBool aCopyLogos, + CArrayPtrFlat& aHeaderList) = 0; /** hspsGetListHeaders * diff -r 2f40063dfb5c -r dbbebe55c824 homescreenpluginsrv/rom/hsps.iby --- a/homescreenpluginsrv/rom/hsps.iby Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreenpluginsrv/rom/hsps.iby Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,6 @@ * * Contributors: * NTT DOCOMO, INC - Fixing Bug 399 - hsps.iby includes 200159C9.txt which is already included by s60cenrep_variant.iby -* * Description: IBY file for ROM image creation * */ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/group/bld.inf --- a/homescreensrv_plat/ai_content_model_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -26,8 +26,5 @@ ../inc/aicontentobserver.inl MW_LAYER_PLATFORM_EXPORT_PATH(aicontentobserver.inl) ../inc/aicontentobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentobserver.h) -../inc/aipropertyextension.h MW_LAYER_PLATFORM_EXPORT_PATH(aipropertyextension.h) -../inc/aieventhandlerextension.h MW_LAYER_PLATFORM_EXPORT_PATH(aieventhandlerextension.h) -../inc/aipropertyextension.inl MW_LAYER_PLATFORM_EXPORT_PATH(aipropertyextension.inl) ../inc/aicontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentmodel.h) ../inc/aicontentrequest.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentrequest.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aicontentmodel.h --- a/homescreensrv_plat/ai_content_model_api/inc/aicontentmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentmodel.h Wed May 12 13:36:47 2010 +0300 @@ -123,6 +123,12 @@ const char KAiContentTypeText[] = "text/plain"; +/** MIME type for passing raw data. + * + * @see MAiContentObserver::PublishPtr + */ +const char KAiContentTypeData[] = "data/stream"; + /** * Abstract interface which provides services to iterate content items * supported by the plug-in. Only used by the Active Idle Framework. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h --- a/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h Wed May 12 13:36:47 2010 +0300 @@ -19,13 +19,15 @@ #ifndef M_AICONTENTOBSERVER_H #define M_AICONTENTOBSERVER_H +// System includes #include -class MAiPropertyExtension; +// User includes + +// Forward declarations +class CHsContentPublisher; +class THsPublisherInfo; class RFile; -class TDesC8; -class TDesC16; -struct TAiPublisherInfo; /** * Used by AI Plug-in to give notification about modifications in @@ -35,9 +37,13 @@ */ class MAiContentObserver { -public: // New Enumeration +public: + // data types + /** - * CSS Primitive value type + * Value type for SetProperty + * + * @since S60 5.2 */ enum TValueType { @@ -57,7 +63,8 @@ EValueUnitValue }; -public: // New functions +public: + // new functions /** * Invoked by the plug-in to inform that it initiates content publishing @@ -107,21 +114,21 @@ /** * Invoked by plug-in to test if the specified content can be published. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. * @param aIndex - index of the content item. * @return ETrue - if content could be published; EFalse otherwise. */ - virtual TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; + virtual TBool CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) = 0; /** * Invoked by the plug-in to inform that content identified by reference * aResource must be published to UI control\element identified by selector * aContent. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -137,14 +144,14 @@ * - KErrNotFound - if content reference is not found in current * UI definition. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) = 0; + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) = 0; /** * Invoked by the plug-in to inform that textual content provided within * parameter aText must be published to UI control\element identified by * selector aContent. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -159,14 +166,14 @@ * - KErrArgument - if content cannot be published to UI element, * e.g. MIME type mismatch. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) = 0; + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) = 0; /** * Invoked by the plug-in to inform that content provided within buffer * aBuf must be published to UI control\element identified by selector * aContent. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -181,7 +188,7 @@ * - KErrArgument - if content cannot be published to UI element, * e.g. MIME type mismatch. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) = 0; + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) = 0; /** * Invoked by the plug-in to inform that an object provided by pointer aPtr @@ -189,7 +196,7 @@ * The implementation packages the pointer to a buffer and delegates to * buffer publishing method Publish(MAiPropertyExtension&, TInt, const TDesC8&, TInt). * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -207,7 +214,7 @@ * e.g. MIME type mismatch. * @see KAiContentTypeBitmap */ - inline TInt PublishPtr( MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex ); + inline TInt PublishPtr( CHsContentPublisher& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex ); /** * Helper function for unpacking a pointer that has been published with @@ -221,7 +228,7 @@ * Invoked by the plug-in to inform that content from file handle aFile * must be published to UI control\element identified by selector aContent. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -237,13 +244,13 @@ * - KErrArgument - if content cannot be published to UI element, * e.g. MIME type mismatch. */ - virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) = 0; + virtual TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) = 0; /** * Invoked by the plug-in to inform that content must be cleaned in UI * control\element identified by selector aContent. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aContent - identification of content selector, MUST correspond * single content selector supported by plug-in. The framework * utilizes the selector id to match for cid and MIME type. @@ -255,7 +262,7 @@ * - KErrNotFound - if content reference is not found in current * UI definition. */ - virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; + virtual TInt Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) = 0; /** * Returns interface extension. Not used in S60 3.2 release. @@ -267,17 +274,17 @@ virtual TAny* Extension( TUid aUid ) = 0; /** - * Invoked by the plugin factory - * - * @param aPublsiherInfo Publisher which requires subscription - * @return ETrue if subsription is needed, EFalse otherwise - */ - virtual TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const = 0; + * Invoked by the plugin factory + * + * @param aPublsiherInfo Publisher which requires subscription + * @return ETrue if subsription is needed, EFalse otherwise + */ + virtual TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const = 0; /** * Invoked by the plug-in to change the property value of a specific content. * value type must be string. - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aElementId - id of content selector, MUST correspond * single content supported by plug-in. The framework * utilizes the id to find in the plugin xml defintion. @@ -290,7 +297,7 @@ * - KErrNotSupported - if content selector is not supported by * current plugin definition. */ - virtual TInt SetProperty( MAiPropertyExtension& aPlugin, + virtual TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue ) = 0; @@ -298,7 +305,7 @@ /** * Invoked by the plug-in to change the property value of a specific content. * - * @param aPlugin - Plug-in property extension interface implementation. + * @param aPlugin - Plug-in interface implementation. * @param aElementId - id of content selector, MUST correspond * single content supported by plug-in. The framework * utilizes the id to find in the plugin xml defintion. @@ -312,7 +319,7 @@ * - KErrNotSupported - if content selector is not supported by * current plugin definition. */ - virtual TInt SetProperty( MAiPropertyExtension& aPlugin, + virtual TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue, diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl --- a/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl Wed May 12 13:36:47 2010 +0300 @@ -15,23 +15,40 @@ * */ +#ifndef _AICONTENTOBSERVER_INL +#define _AICONTENTOBSERVER_INL -inline TInt MAiContentObserver::PublishPtr - (MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex) +// --------------------------------------------------------------------------- +// MAiContentObserver::PublishPtr +// +// --------------------------------------------------------------------------- +// +inline TInt MAiContentObserver::PublishPtr( CHsContentPublisher& aPlugin, + TInt aContent, TAny* aPtr, TInt aIndex ) { // Package the pointer to a buffer and delegate to buffer publish method - return this->Publish(aPlugin, aContent, TPckgC(aPtr), aIndex); + return this->Publish( aPlugin, aContent, TPckgC( aPtr ), aIndex ); } -template inline -PtrT* MAiContentObserver::UnpackPtr(const TDesC8& aBuf) +// --------------------------------------------------------------------------- +// MAiContentObserver::UnpackPtr +// +// --------------------------------------------------------------------------- +// +template< class PtrT > inline PtrT* MAiContentObserver::UnpackPtr( + const TDesC8& aBuf ) { - TAny* result = NULL; + TAny* result( NULL ); + if ( aBuf.Size() == sizeof( TAny* ) ) { - TPckg(result).Copy(aBuf); // Effectively writes aBuf contents to result + // Effectively writes aBuf contents to result + TPckg< TAny* >( result ).Copy( aBuf ); } - return static_cast(result); + + return static_cast< PtrT* >( result ); } -// End of file \ No newline at end of file +#endif // _AICONTENTOBSERVER_INL + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aicontentrequest.h --- a/homescreensrv_plat/ai_content_model_api/inc/aicontentrequest.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentrequest.h Wed May 12 13:36:47 2010 +0300 @@ -37,6 +37,15 @@ * content observer, EFalse otherwise. */ virtual TBool RefreshContent( TInt aContentId ) = 0; + + /** + * Requests AI content publisher to suspend specific content item. + * + * @param aContentId content identifier in target plug-ins content model. + * @return ETrue if the plugin will suspend the content by calling its + * content observer, EFalse otherwise. + */ + virtual TBool SuspendContent( TInt aContentId ) = 0; protected: /** diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aieventhandlerextension.h --- a/homescreensrv_plat/ai_content_model_api/inc/aieventhandlerextension.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Event handling extension for the CAiContentPublisher interface. -* -*/ - - -#ifndef M_AIEVENTHANDLEREXTENSION_H -#define M_AIEVENTHANDLEREXTENSION_H - -#include - -/** - * Extension of the CAiContentPublisher interface, which allows Active Idle - * Framework to notify their plug-ins that they must to handle event. - * Plug-ins must provide implementation of interface only if they are - * supporting event model (e.g. provides possibility to manipulate engine - * properties via UI). - * - * @since S60 3.2 - */ -class MAiEventHandlerExtension - { -public: - /** - * Invoked by the framework when plug-in must handle an event. - * - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - */ - virtual void HandleEvent(TInt aEvent, const TDesC& aParam) = 0; - - /** - * Invoked by the framework when plug-in must handle an event. - * - * @param aEventName - name of the event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where mapping to unique identifier supplied by event - * is failed by the frame work then the and - * are provied to plug-in as-is in the descriptor. - */ - virtual void HandleEvent(const TDesC& /*aEventName*/, const TDesC& /*aParam*/) { }; - - /** - * Invoked by the framework for querying if plugin has menu item - * - * @param aMenuItem menu item name - * @return ETrue if plugin has specific menu item, EFalse otherwise - */ - virtual TBool HasMenuItem(const TDesC& /*aMenuItem*/) { return EFalse; } - -protected: - /** - * Protected destructor prevents deletion through this interface. - */ - ~MAiEventHandlerExtension() { } - }; - -#endif // M_AIEVENTHANDLEREXTENSION_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.h --- a/homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef M_AIPROPERTYEXTENSION_H -#define M_AIPROPERTYEXTENSION_H - -#include - -/** - * Maximum length for Content publisher name - */ -const TInt KAiPublisherNameMaxLength = 128; - -/** - * Maximum length for Content publisher namespace - */ -const TInt KAiPublisherNamespaceMaxLength = 32; - -/** - * Content publisher name buffer - */ -typedef TBuf TAiPublisherName; - -/** - * Content publisher namespace buffer - */ -typedef TBuf8 TAiPublisherNamespace; - -/** - * Contains information about Content publisher plug-in. - */ -struct TAiPublisherInfo - { - TAiPublisherInfo() - : iUid( TUid::Null() ), - iName( KNullDesC ), - iNamespace( KNullDesC8 ) - { - } - - inline TAiPublisherInfo& operator= (const TAiPublisherInfo& aInfo) - { - iUid = TUid::Uid( aInfo.iUid.iUid ); - iName.Copy( aInfo.iName ); - iNamespace.Copy( aInfo.iNamespace ); - return *this; - } - - inline TBool operator== (const TAiPublisherInfo& aInfo) const - { - if( iUid == aInfo.iUid && - iName == aInfo.iName && - iNamespace == aInfo.iNamespace ) - { - return ETrue; - } - - return EFalse; - } - - TUid iUid; - TAiPublisherName iName; - TAiPublisherNamespace iNamespace; - }; - -/** - * Defines set of properties supported by plug-in. - * - * Example how to provide and set the properties. - * @code - * void CMyAiPlugin::ConstructL() - * { - * iInfo = new (ELeave) TAiPublisherInfo; - * iContent = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginContent ); - * iResources = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginResources ); - * iEvents = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginEvents ); - * } - * - * void CMyAiPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - * { - * if( !aValue ) return; - * - * switch( aProperty ) - * { - * case EAiPublisherInfo: - * { - * const TAiPublisherInfo* info = - * static_cast(aValue); - * iInfo->iUid.iUid = info->iUid.iUid; - * iInfo->iName.Copy( info->iName ); - * break; - * } - * } - * } - * - * TAny* CMyAiPlugin::GetPropertyL( TInt aProperty ) - * { - * switch( aProperty ) - * { - * case EAiPublisherInfo: - * return iInfo; - * - * case EAiPublisherContent: - * return iContent; - * - * case EAiPublisherResources: - * return iResources; - * - * case EAiPublisherEvents: - * return iEvents; - * } - * return NULL; - * } - * @endcode - */ -enum TAiPublisherProperty - { - /** - * Enables read-only access to Plug-in information. GetProperty MUST return - * instance of struct TAiPublisherInfo via TAny* . - */ - EAiPublisherInfo = 0x0001, - - /** - * Enables read-only access to iterator of content selectors. GetProperty - * MUST return instance of MAiContentItemIterator for content selectors. - */ - EAiPublisherContent, - - /** - * Enables read-only access to iterator of content references. GetProperty - * MUST return instance of MAiContentItemIterator for content references. - */ - EAiPublisherResources, - - /** - * Enables read-only access to iterator of events supported by plug-in. - * GetProperty MUST return instance of MAiContentItemIterator for events. - */ - EAiPublisherEvents, - - /** - * Provides access to MAiContentRequest interface for refreshing a content - * item. - * @see EAiPublisherContent - */ - EAiContentRequest, - - /** - * Provides access to MAiContentRequest interface for refreshing a resource - * item. - * @see EAiPublisherResources - */ - EAiResourceRequest, - - /** - * Provides access to localized plugin name if supported. HBufC* - * @see EAiPublisherResources - */ - EAiPluginName - }; - - -/** - * Property extension interface for CAiContentPublisher. - * - * @see CAiContentPublisher::Extension - * @since S60 3.2 - */ -class MAiPropertyExtension - { -public: // New functions - - /** - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return Pointer to property value. - */ - virtual TAny* GetPropertyL(TInt aProperty) = 0; - - /** - * Helper function for accessing the Publisher Info Property. - */ - inline const TAiPublisherInfo* PublisherInfoL(); - - /** - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - virtual void SetPropertyL(TInt aProperty, TAny* aValue) = 0; - -protected: - /** - * Protected destructor prevents deletion through this interface. - */ - ~MAiPropertyExtension() { } - }; - -#include - -#endif // M_AIPROPERTYEXTENSION_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.inl --- a/homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.inl Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Inline function implementations for MAiPropertyExtension -* -*/ - - -inline const TAiPublisherInfo* MAiPropertyExtension::PublisherInfoL() - { - return static_cast(this->GetPropertyL(EAiPublisherInfo)); - } diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_information_api/group/bld.inf --- a/homescreensrv_plat/ai_plugin_information_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_plugin_information_api/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -25,4 +25,3 @@ PRJ_EXPORTS ../inc/activeidle2domainpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(activeidle2domainpskeys.h) -../inc/activeidle2internalpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(activeidle2internalpskeys.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_information_api/inc/activeidle2domainpskeys.h --- a/homescreensrv_plat/ai_plugin_information_api/inc/activeidle2domainpskeys.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_plugin_information_api/inc/activeidle2domainpskeys.h Wed May 12 13:36:47 2010 +0300 @@ -68,10 +68,6 @@ const TUint KActiveIdleActOnSendKey = 0x00000004; // Contains 0 if we are to ignore the send or > 0 if we need to react to it -const TUint KActiveIdleTouchToolbarWidth = 0x00000005; - -const TUint KActiveIdleTouchToolbarHeight = 0x00000006; - const TUint KActiveIdleSimRegFailedReceived = 0x00000007; // Contains 1 if we have received sim reg failed message, 0 if not. enum EPSActiveIdleSimRegReceiveStatus @@ -85,33 +81,6 @@ EPSSimRegFailedMessageReceived }; -const TUint KActiveIdleThemeSupportsXsp = 0x00000008; // Contains one value from following enumeration - -enum EPSActiveIdleThemeSupportsXsp -{ - // Value indicates that xSP feature is not supported in currently active theme - EPSAiXspNotSupported, - - // Value indicates that the current theme supports the xSP feature - EPSAiXspIsSupported -}; - -const TUint KActiveIdleLaunch = 0x00000009; // Contains information if shortcut launching is ongoing or not - -enum EPSActiveIdleIdleLaunch -{ - - // Value indicates that no shortcut is in launching state and new launch tapping can be handled - EPSAiLaunchNotActive = 0, - - // Value indicates that active idle shortcut is launching - EPSAiLaunchIsActive -}; - - -// Indicates that Active Idle 2 should be restarted. -const TUint KActiveIdleRestartAI2 = 0x0000000B; - // Indicates that all the CPS Harvester plugins have been updated const TUint KActiveIdleCpsPluginsUpdated = 0x0000000C; @@ -150,21 +119,6 @@ */ const TUid KPSUidActiveIdle2 = {0x102750F0}; // ActiveIdle2 SID -/** -* -* First iterate Active plugin UID range to find all -* active plugin UID's. Use that UID as a key to find the plugins name -* from the name range. -* -*/ - -/** -* Active plugin count -* -* Possible integer values: -* 0x000000000 - 0xFFFFFFFF : Active plugin count -*/ -const TUint KAIActivePluginCount = 0x00000000; /** * Active plugin UID range @@ -175,13 +129,4 @@ const TUint KAIActivePluginRangeStart = 0x00000001; const TUint KAIActivePluginRangeEnd = 0x0FFFFFFF; -/** -* Active plugin name range -* -* Possible string values: -* Plugin name -*/ -const TUint KAIPluginNameRangeStart = 0x10000000; -const TUint KAIPluginNameRangeEnd = 0xFFFFFFFF; - #endif // ACTIVEIDLE2_DOMAIN_PS_KEYS_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_information_api/inc/activeidle2internalpskeys.h --- a/homescreensrv_plat/ai_plugin_information_api/inc/activeidle2internalpskeys.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Internal Publish & Subscribe keys for Active Idle 2 -* -*/ - - -#ifndef __ACTIVEIDLE2INTERNALPSKEYS_H__ -#define __ACTIVEIDLE2INTERNALPSKEYS_H__ - -/** - * Gives possibility to execute shortcuts defined by localapp URL. - * This UID is used as a key id under KUidSystemCategory. - * Clients must supply string in localapp URL format defined by RFC 2396. - * - * @type RProperty::EText - */ -const TUint32 KPSUidShortcutCmd = 0x102750FF; - -/** - * Shortcut Plug-in command for enabling keylock. - */ -_LIT( KAiPSEnableKeyLock, "localapp:keylock?on"); - -/** - * Shortcut Plug-in command for canceling keylock. - */ -_LIT( KAiPSSkipKeyLock, "localapp:keylock?skip"); - -/** - * Shortcut Plug-in command for timeoutting keylock. - */ -_LIT( KAiPSKeyLockTimeout, "localapp:keylock?timeout"); - -/** - * Shortcut Plug-in command for launching Logs to dialed calls view. - */ -_LIT( KAiPSLaunchLogs, "localapp:logs?view=dialled"); - -/** - * Shortcut Plug-in command for launching Voice Dial UI. - */ -_LIT( KAiPSLaunchNameDialer, "localapp:voicedial"); - -/** - * Shortcut Plug-in command for canceling voice dial ui. - */ -_LIT( KAiPSSkipNameDialer, "localapp:voicedial?skip"); - - -// Restart code for category KPSUidAiInformation = 0x101FD657 key KActiveIdleRestartAI2 0xA -const TInt KActiveIdleRestartCode = 0xFA93BAD2; - - - -/** - * Publish and Subscribe key for data plugin states in KPSUidActiveIdle2 category (AI plug-in registry API) - */ -const TUint KPSAiDataPluginState = 0x0000000F; // Contains one value from following emuneration - -/** - * States for the KPSAiDataPluginState key - */ -enum EPSAiDataPluginState -{ - EPSAiDataPluginsNotLoaded, - EPSAiDataPluginsLoaded -}; - - -#endif // __ACTIVEIDLE2INTERNALPSKEYS_H__ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/group/bld.inf --- a/homescreensrv_plat/ai_plugin_management_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_plugin_management_api/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -24,12 +24,12 @@ PRJ_EXPORTS -../inc/aicontentpublisheruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aicontentpublisheruid.hrh) ../inc/aiprofilepluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiprofilepluginuids.hrh) -../inc/aiscutuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiscutuids.hrh) -../inc/aicontentpublisher.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentpublisher.h) ../inc/aidevicestatuscontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aidevicestatuscontentmodel.h) -../inc/aiscutcontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutcontentmodel.h) -../inc/aiscutdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutdefs.h) ../inc/aiprofileplugincontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aiprofileplugincontentmodel.h) -../inc/aiscutappuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiscutappuids.hrh) + +../inc/hscontentpublisheruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(hscontentpublisheruid.hrh) +../inc/hscontentpublisher.h MW_LAYER_PLATFORM_EXPORT_PATH(hscontentpublisher.h) +../inc/hscontentpublisher.inl MW_LAYER_PLATFORM_EXPORT_PATH(hscontentpublisher.inl) +../inc/hspublisherinfo.h MW_LAYER_PLATFORM_EXPORT_PATH(hspublisherinfo.h) +../inc/hspublisherinfo.inl MW_LAYER_PLATFORM_EXPORT_PATH(hspublisherinfo.inl) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisher.h --- a/homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,398 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface for Active Idle content publisher plug-ins. -* -*/ - - -#ifndef C_AICONTENTPUBLISHER_H -#define C_AICONTENTPUBLISHER_H - -#include -#include - -/** - * ECom plugin interface UID - */ -const TUid KInterfaceUidContentPlugin = { AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER }; - -/** - * API Extension UID for MAiPropertyExtension. - * - * @see CAiContentPublisher::Extension - * @see MAiPropertyExtension - */ -const TUid KExtensionUidProperty = { 0x1 }; - -/** - * API Extension UID for MAiEventExtension. - * - * @see CAiContentPublisher::Extension - * @see MAiEventExtension - */ -const TUid KExtensionUidEventHandler = { 0x2 }; - -/** - * Defines set of reasons for plug-in state change. - */ -enum TAiTransitionReason - { - - /** - * Unknown transition reason. - */ - EAiUnknownTransitionReason = 0, - - /** - * System has started up. - */ - EAiSystemStartup, - - /** - * System is shutting down. - */ - EAiSystemShutdown, - - /** - * Backlight on. - */ - EAiBacklightOn, - - /** - * Backlight off. - */ - EAiBacklightOff, - - /** - * Backup or restore has been initiated. - */ - EAiBackupRestoreStarted, - - /** - * Backup or restore has ended. - */ - EAiBackupRestoreEnded, - - /** - * Call started. - */ - EAiPhoneCallStarted, - - /** - * Call ended. - */ - EAiPhoneCallEnded, - - /** - * Active Idle UI Definition change has started. - */ - EAiUiDefinitionChangeStarted, - - /** - * Active Idle UI Definition change has ended. - */ - EAiUiDefinitionChangeEnded, - - /** - * Phone general theme has changed. - */ - EAiGeneralThemeChanged, - - /** - * Screen layout has changed. - */ - EAiScreenLayoutChanged, - - /** - * System clock crossed midnight. - */ - EAiMidnightPassed, - - /** - * Language has been changed. - */ - EAiLanguageChanged, - - /** - * System time has been changed by user. - */ - EAiTimeChanged, - - /** - * Idle changes to background. - */ - EAiIdleBackground, - - /** - * Idle changes to foreground. - */ - EAiIdleForeground, - - /** - * Suspending plugins. - */ - EAiSuspendPlugins, - - /** - * Keylock enabled. - */ - EAiKeylockEnabled, - - /** - * Keylock disabled. - */ - EAiKeylockDisabled, - - /** - * Plugins can go online - */ - EAiIdleOnLine, - - /** - * Plugins must go offline - */ - EAiIdleOffLine, - - /** - * Page changed - */ - EAiIdlePageSwitch - }; - -class MAiContentObserver; -class MAiPluginSettings; -typedef RPointerArray< MAiPluginSettings > RAiSettingsItemArray; - -/** - * ECom plug-in interface that Active Idle plug-ins must implement. - * It is used to control plug-in life cycle: load/destroy plug-ins; - * suspend/resume plug-in execution. - * - * @since S60 3.2 - */ -class CAiContentPublisher : public CBase - { -public: // Constructors and destructor - - /** - * Creates a new plug-in instance based on implementation UID. - * - * @param aImpUid implementation UID of plug-in to instantiate. - * @return pointer to the instantiated interface implementation. - * @pre Interface implementation exists by uid aImpUid. - */ - inline static CAiContentPublisher* NewL(TUid aImpUid); - - /** - * Creates a new plug-in instance based on mime type. - * - * @param aMime MIME type of plug-in to instantiate. - * @return pointer to the instantiated interface implementation. - */ - inline static CAiContentPublisher* NewL(const TDesC8& aMime); - - /** - * Destroys instance of the plug-in. Called by the framework during plug-in - * unloading phase. - */ - inline virtual ~CAiContentPublisher(); - -public: // New functions - /** - * This method transit the plugin to "Alive" state. - * The method is called by the framework to instruct plug-in that it is - * allowed to actively publish its data to its observers. This means the plugin - * is allowed to consume memory and CPU resources, e.g plug-in is able load - * engines, run timers, perform asynchronous operations, etc. The method - * transits the plug-in to "Alive" state. There can be many concurrent - * calls to resume, with different or the same reason code, this allows - * the plugin to properly respond to enviroment change that raise the - * need to re-publish content (changes like date/time change etc). - * - * @param aReason reason for state change, see TAiTransitionChange. - * @pre None - * @post Plugin is in resumed state and actively publishes its data. - * - * Short example what a typical resume implementation does. - * @code - * if( !MyEngineCreated() ) - * { - * CreateEngine(); - * } - * StartEngine(); - * @endcode - */ - virtual void Resume(TAiTransitionReason aReason) = 0; - - /** - * This method transits the plug-in to "Suspendend" state. - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timer, cancel outstanding asynchronous operations, etc. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @pre None - * @post Plugin suspends publishing data and free resources (timers etc). - * - * Short example what a typical suspend implementation does. - * @code - * DisableEngine(); - * @endcode - */ - virtual void Suspend(TAiTransitionReason aReason) = 0; - - /** - * This method transits the plug-in to "Idle" state. - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, the plug-in - * should unload its engines during backup operation. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @pre None - * @post Plugin stops publishing data and frees all possible resources. - * - * Short example what a typical stop implementation does. - * @code - * DestroyEngine(); - * @endcode - */ - virtual void Stop(TAiTransitionReason aReason) = 0; - - /** - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @pre None - * @post Plugin publishes its data to the subscribed observer. - * - * Short example what a typical subscribe implementation does and - * one alternative how observers are used. - * @code - * if( !ObserverAlreadyAdded( aObserver ) ) - * { - * iMyContentObservers.AppendL( aObserver ); - * } - * - * ... - * - * // Engine reports data changed - * - * const TDesC& data = iEngine->LatestData(); - * for( TInt i = 0; i < iMyContentObservers.Count(); ++i ) - * { - * iMyContentObservers[i].Publish( data ); - * } - * @endcode - */ - virtual void SubscribeL(MAiContentObserver& aObserver) = 0; - - /** - * Configures the plug-in. - * - * @param aSettings setting items defined in the UI definition. - * This plugin takes ownership of the - * MAiPluginSettings objects in the array. - * If this method leaves the caller will handle the cleanup. - * @pre None - * @post Plugin has set its state according to relevant settings. - * - * Short example how to read plugin settings. - * @code - * for( TInt i = 0; i < aSettings.Count(); ++i ) - * { - * MAiPluginSettingsItem& item = (aSettings[i])->AiPluginSettingsItem(); - * TInt32 value = 0; - * if( ParseInt( value, item.Value() ) != KErrNone ) - * { - * continue; - * } - * if( value < 0 ) - * { - * continue; // All our settings are counts, skip bad settings - * } - * if( item.Key() == EMySettingMaxUsers ) - * { - * iEngine->SetMaxUsers( value ); - * continue; - * } - * else if( item.Key() == EMySettingNumItems ) - * { - * iNumItems = value; - * continue; - * } - * } - * // We own the array so destroy it - * aSettings.ResetAndDestroy(); - * @endcode - */ - virtual void ConfigureL( RAiSettingsItemArray& aSettings) = 0; - - /** - * Returns interface extension. In S60 3.2 only event & property - * extensions are supported. See MAiEventHandlerExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @see MAiEventExtension - * @see MAiPropertyExtension - * @return the extension interface. Actual type depends on the passed aUid - * argument. - * - * Example on how to properly return an extension. - * @code - * if (aUid == KExtensionUidProperty) - * { - * return static_cast(this); - * } - * else if (aUid == KExtensionUidEventHandler) - * { - * return static_cast(this); - * } - * return NULL; // Requested extension not supported - * @endcode - */ - virtual TAny* Extension(TUid aUid) = 0; - -private: // data - /** An identifier used during destruction. */ - TUid iDestructKey; - }; - -inline CAiContentPublisher* CAiContentPublisher::NewL(TUid aImplUid) - { - TAny* ptr = REComSession::CreateImplementationL(aImplUid, - _FOFF(CAiContentPublisher, iDestructKey)); - - return reinterpret_cast (ptr); - } - -inline CAiContentPublisher* CAiContentPublisher::NewL(const TDesC8& aMime) - { - TEComResolverParams params; - params.SetDataType(aMime); - - TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidContentPlugin, - _FOFF(CAiContentPublisher, iDestructKey), params); - - return reinterpret_cast (ptr); - } - -inline CAiContentPublisher::~CAiContentPublisher() - { - REComSession::DestroyedImplementation(iDestructKey); - } - -#endif // C_AICONTENTPUBLISHER_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisheruid.hrh --- a/homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisheruid.hrh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for aicontentpublisher -* -*/ - - -#ifndef AICONTENTPUBLISHERUID_HRH -#define AICONTENTPUBLISHERUID_HRH - -/** - * Ecom interface uid for CAiContentPublisher. - * - * Example resource of a plugin that implements content publisher interface. - * @code - * #include - * #include - * - * #define MY_DLL_UID 0xFFEEDDCC - * #define MY_PLUGIN_IMPLEMENTATION_UID 0xBBAA9988 - * - * RESOURCE REGISTRY_INFO registry_info - * { - * resource_format_version = RESOURCE_FORMAT_VERSION_2; - * dll_uid = MY_DLL_UID; - * - * // Interface info array - * interfaces = - * { - * INTERFACE_INFO - * { - * // UID of the implemented interface - * interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; - * - * implementations = - * { - * IMPLEMENTATION_INFO - * { - * implementation_uid = MY_PLUGIN_IMPLEMENTATION_UID; - * version_no = 1; - * display_name = "My plugin"; - * } - * }; - * } - * }; - * } - * @endcode - */ -#define AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER 0x102750ED - -#endif // AICONTENTPUBLISHERUID_HRH diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aidevicestatuscontentmodel.h --- a/homescreensrv_plat/ai_plugin_management_api/inc/aidevicestatuscontentmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aidevicestatuscontentmodel.h Wed May 12 13:36:47 2010 +0300 @@ -46,6 +46,7 @@ EAiDeviceStatusContentGeneralIndicator, EAiDeviceStatusContentVHZText, EAiDeviceStatusContentCUGMCNIndicator + ,EAiDeviceStatusContentNetRegStatus }; @@ -64,7 +65,7 @@ const wchar_t KAiDeviceStatusContentGeneralIndicator_Cid[] = L"GeneralIndicator"; const wchar_t KAiDeviceStatusContentVHZText_Cid[] = L"VHZText"; const wchar_t KAiDeviceStatusContentCUGMCNIndicator_Cid[] = L"CUGMCNIndicator"; - +const wchar_t KAiDeviceStatusContentNetRegStatus_Cid[] = L"NetRegStatus"; const char KAiDeviceStatusMimeTypeTextPlain[] = "text/plain"; @@ -130,6 +131,11 @@ //Published data is localized text, for example "Group 1" or MCN message { EAiDeviceStatusContentCUGMCNIndicator, KAiDeviceStatusContentCUGMCNIndicator_Cid, KAiDeviceStatusMimeTypeTextPlain } + + //Published data is network registration status + , { EAiDeviceStatusContentNetRegStatus, KAiDeviceStatusContentNetRegStatus_Cid, + KAiDeviceStatusMimeTypeTextPlain } + }; const TInt KAiDeviceStatusContentCount = sizeof( KAiDeviceStatusContent ) / @@ -142,11 +148,13 @@ { EAiDeviceStatusResourceSIMRegFail, EAiDeviceStatusResourceNWOk, - EAiDeviceStatusResourceNWLost + EAiDeviceStatusResourceNWLost + ,EAiDeviceStatusResourceNetRegFail }; const wchar_t KAiDeviceStatusResourceSIMRegFail_Cid[] = L"SIMRegFail"; -const wchar_t KAiDeviceStatusResourceShowNWLost_Cid[] = L"NWLost"; +const wchar_t KAiDeviceStatusResourceShowNWLost_Cid[] = L"NWLost"; +const wchar_t KAiDeviceStatusResourceNetRegFail_Cid[] = L"NetRegFail"; const TAiContentItem KAiDeviceStatusResources[] = @@ -155,7 +163,10 @@ { EAiDeviceStatusResourceSIMRegFail, KAiDeviceStatusResourceSIMRegFail_Cid, KAiDeviceStatusMimeTypeTextPlain }, { EAiDeviceStatusResourceNWLost, KAiDeviceStatusResourceShowNWLost_Cid, - KAiDeviceStatusMimeTypeTextPlain }, + KAiDeviceStatusMimeTypeTextPlain }, + { EAiDeviceStatusResourceNetRegFail, KAiDeviceStatusResourceNetRegFail_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + }; const TInt KAiDeviceStatusResourceCount = sizeof( KAiDeviceStatusResources ) / diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aiprofilepluginuids.hrh --- a/homescreensrv_plat/ai_plugin_management_api/inc/aiprofilepluginuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiprofilepluginuids.hrh Wed May 12 13:36:47 2010 +0300 @@ -19,8 +19,6 @@ #ifndef AIPROFILEPLUGINUIDS_HRH #define AIPROFILEPLUGINUIDS_HRH -#include - /** * Ecom dll uid for AI Profile plug-in. */ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aiscutappuids.hrh --- a/homescreensrv_plat/ai_plugin_management_api/inc/aiscutappuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: App uids for shortcut plug-in -* -*/ - - -#ifndef AISCUTAPPUIDS_HRH -#define AISCUTAPPUIDS_HRH - -#define KScutExchangeMailUidValue 0x10282480 // -#define KScutFlashPlayerUidValue 0x101fd693 // -#define KScutOperatorMenuUidValue 0x10008D5E // !! -#define KScutVideoServicesUidValue 0x10281893 // !! -#define KScutVoiceDialUidValue 0x101F8543 // aivoicedialui - -#define KScutAmsEditorUidValue 0x1020745A // -#define KScutEmailEditorUidValue 0x101F4CD6 // -#define KScutMmsEditorUidValue 0x100058DE // -#define KScutPostcardEditorUidValue 0x10207247 // -#define KScutUnifiedEditorUidValue 0x102072D8 // -#define KScutSyncMlEmailUidValue 0x101F7C5C // - -#define KScutAboutUidValue 0x10005A22 // -#define KScutApplicationManagerUidValue 0x101F8512 // -#define KScutApplicationShellUidValue 0x101F4CD2 // -#define KScutBluetoothUidValue 0x10005951 // -#define KScutBrowserUidValue 0x10008D39 // -#define KScutCalculatorUidValue 0x10005902 // -#define KScutCalendarUidValue 0x10005901 // -#define KScutCamcorderUidValue 0x101F857A // -#define KScutChineseDictionaryUidValue 0x101F9CFE // -#define KScutClockUidValue 0x10005903 // -#define KScutConnectionManagerUidValue 0x101F84D0 // -#define KScutConverterUidValue 0x101F4668 // -#define KScutDiallerUidValue 0x100058B3 // -#define KScutDRMRightsManagerUidValue 0x101F85C7 // -#define KScutDeviceManagerUidValue 0x101F6DE5 // -#define KScutFMRadioUidValue 0x10207A89 // -#define KScutFMTXRadioUidValue 0x10282BEF // -#define KScutFaxModemUidValue 0x1000594E // -#define KScutFileManagerUidValue 0x101F84EB // -#define KScutGeneralSettingsUidValue 0x100058EC // -#define KScutControlPanelUidValue 0 // not yet! -#define KScutHelpUidValue 0x10005234 // -#define KScutIRUidValue 0x1000594D // -#define KScutInstantMessagingUidValue 0x101F4673 // -#define KScutLandmarksUidValue 0x101F85A2 // -#define KScutLogsUidValue 0x101F4CD5 // -#define KScutMediaGallery2UidValue 0x101F8599 // -#define KScutMediaPlayerUidValue 0x200159B2 // -#define KScutMemoryCardUidValue 0x101F4666 // -#define KScutMessagingCenterUidValue 0x100058C5 // -#define KScutMusicPlayerUidValue 0x102072C3 // -#define KScutNavigatorUidValue 0x101F85A0 // -#define KScutNotepadUidValue 0x10005907 // -#define KScutPersonalisationUidValue 0x10005A32 // -#define KScutPhoneUidValue 0x100058B3 // -#define KScutPhonebookUidValue 0x101F4CCE // -#define KScutPocUidValue 0x101FD63D // -#define KScutProfilesUidValue 0x100058F8 // -#define KScutSatUiUidValue 0x101F4CE0 // -#define KScutSearchUidValue 0x10282411 // -#define KScutSmlSyncUidValue 0x101F6DE4 // -#define KScutSpeedDialUidValue 0x1000590A // -#define KScutUSBUidValue 0x102068E2 // -#define KScutUserDictionaryUidValue 0x101F8645 // -#define KScutVoIPUidValue 0x10202871 // -#define KScutVoiceCommandsUidValue 0x101F8555 // -#define KScutVoiceMailboxUidValue 0x100058F5 // -#define KScutVoiceRecorderUidValue 0x100058CA // - -#define KScutInstallationViewIdValue 0x10283321 -#define KScutChangeThemeViewIdValue 0x102750A7 -#define KScutDiallerViewIdValue 0x10282D81 -#define KScutRemoteMailboxViewIdValue 0x2 -#define KScutConnectivityStatusViewIdValue 0x10207250 - -#endif // AISCUTAPPUIDS_HRH - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aiscutcontentmodel.h --- a/homescreensrv_plat/ai_plugin_management_api/inc/aiscutcontentmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Content model for shortcut plug-in. -* -*/ - - -#ifndef AISCUTCONTENTMODEL_H -#define AISCUTCONTENTMODEL_H - -#include - -#include - -// AI Shortcut Plug-in ECOM implementation UID. -const TInt KImplUidScutPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; -const TUid KUidScutPlugin = { KImplUidScutPlugin }; - -// ================================= CONTENT =================================== - -/** - * Content Ids. - */ -enum TAiScutContentIds -{ - EAiScutContentShortcutIcon, - EAiScutContentShortcutCaption, - EAiScutContentShortcutShortCaption, - EAiScutContentShortcutMskCaption, - EAiScutContentShortcutSkCaption, - EAiScutContentShortcutSkIcon, - EAiScutContentShortcutToolbarCaption, - EAiScutContentShortcutToolbarIcon, - EAiScutContentPopupTextCaptionLine, - EAiScutContentPopupTextFirstLine, - EAiScutContentPopupTextSecondLine, - EAiScutContentPopupTextThirdLine -}; - -/** - * Content that the plug-in will publish. - */ -const TAiContentItem KAiScutContent[] = -{ - // Shortcut icon as CFbsBitmap. - { EAiScutContentShortcutIcon, L"ShortcutIcon", KAiContentTypeBitmap } - , - // Shortcut caption as plain text (used for long application titles). - { EAiScutContentShortcutCaption, L"ShortcutCaption", "text/plain" } - , - // Shortcut short caption as plain text (used for short application titles in softkeys). - { EAiScutContentShortcutShortCaption, L"ShortcutShortCaption", "text/plain" } - , - // Shortcut msk caption as plain text (used for short application titles in MSK). - { EAiScutContentShortcutMskCaption, L"ShortcutMskCaption", "text/plain" } - , - // Shortcut sk caption as plain text (used for short application titles in SK). - { EAiScutContentShortcutSkCaption, L"ShortcutSkCaption", "text/plain" } - , - // Shortcut sk icon as bitmap (used for application icons in SK). - { EAiScutContentShortcutSkIcon, L"ShortcutSkIcon", KAiContentTypeBitmap } - , - // Shortcut sk caption as plain text (used for short application titles in SK). - { EAiScutContentShortcutToolbarCaption, L"ShortcutToolbarCaption", "text/plain" } - , - // Shortcut toolbar icon as bitmap (used for application icons in toolbar). - { EAiScutContentShortcutToolbarIcon, L"ShortcutToolbarIcon", KAiContentTypeBitmap } - , - // Caption line of Popup as plain text. - { EAiScutContentPopupTextCaptionLine, L"ShortcutPopupCaptionLine", "text/plain" } - , - // 1st actual line of Popup as plain text. - { EAiScutContentPopupTextFirstLine, L"ShortcutPopup1stLine", "text/plain" } - , - // 2nd actual line of Popupn as plain text. - { EAiScutContentPopupTextSecondLine, L"ShortcutPopup2ndLine", "text/plain" } - , - // 3rd actual line of Popup as plain text. - { EAiScutContentPopupTextThirdLine, L"ShortcutPopup3rdLine", "text/plain" } -}; - -const TInt KAiScutContentCount = sizeof( KAiScutContent ) / - sizeof( KAiScutContent[0] ); - - -// ================================ RESOURCES ================================== - -/** - * Resource Ids. - */ -enum TAiScutPluginResourceIds -{ - EAiScutResourceDefaultIcon, - EAiScutResourceEmptyIcon, - EAiScutResourceBackCaption, - EAiScutResourceEmptyCaption, - EAiScutResourceNewMsgCaption, - EAiScutResourceNewEmailCaption, - EAiScutResourceNewSyncMLMailCaption, - EAiScutResourceNewPostcardCaption, - EAiScutResourceNewAudioMsgCaption, - EAiScutResourceSelectMsgTypeCaption, - EAiScutResourceChangeThemeCaption, - EAiScutResourceNewMsgShortCaption, - EAiScutResourceNewEmailShortCaption, - EAiScutResourceNewSyncMLMailShortCaption, - EAiScutResourceNewPostcardShortCaption, - EAiScutResourceNewAudioMsgShortCaption, - EAiScutResourceSelectMsgTypeShortCaption, - EAiScutResourceChangeThemeShortCaption -}; - -/** - * Resources that the plug-in will publish. - */ -const TAiContentItem KAiScutResources[] = -{ - // Default shortcut icon. - { EAiScutResourceDefaultIcon, L"DefaultIcon", "image/*" } - , - // Empty shortcut icon, used when shortcut target is unknown. - { EAiScutResourceEmptyIcon, L"EmptyIcon", "image/*" } - , - // Localizable caption for the back shortcut - { EAiScutResourceBackCaption, L"BackCaption", "text/plain" } - , - // Localizable caption for the empty shortcut. - { EAiScutResourceEmptyCaption, L"EmptyCaption", "text/plain" } - , - // Localizable caption for the "new message" shortcut. - { EAiScutResourceNewMsgCaption, L"NewMessageCaption", "text/plain" } - , - // Localizable caption for the "new email" shortcut. - { EAiScutResourceNewEmailCaption, L"NewEmailCaption", "text/plain" } - , - // Localizable caption for the "new syncml mail" shortcut. - { EAiScutResourceNewSyncMLMailCaption, L"NewSyncMLMailCaption", "text/plain" } - , - // Localizable caption for the "new postcard" shortcut. - { EAiScutResourceNewPostcardCaption, L"NewPostcardCaption", "text/plain" } - , - // Localizable caption for the "new audio message" shortcut. - { EAiScutResourceNewAudioMsgCaption, L"NewAudioMsgCaption", "text/plain" } - , - // Localizable caption for the "select message type" shortcut. - { EAiScutResourceSelectMsgTypeCaption, L"SelectMsgTypeCaption", "text/plain" } - , - // Localizable caption for the "change theme" shortcut. - { EAiScutResourceChangeThemeCaption, L"ChangeThemeCaption", "text/plain" } - , - // Localizable short caption for the "new message" shortcut. - { EAiScutResourceNewMsgShortCaption, L"NewMessageShortCaption", "text/plain" } - , - // Localizable short caption for the "new email" shortcut. - { EAiScutResourceNewEmailShortCaption, L"NewEmailShortCaption", "text/plain" } - , - // Localizable short caption for the "new syncml mail" shortcut. - { EAiScutResourceNewSyncMLMailShortCaption, L"NewSyncMLMailShortCaption", "text/plain" } - , - // Localizable short caption for the "new postcard" shortcut. - { EAiScutResourceNewPostcardShortCaption, L"NewPostcardShortCaption", "text/plain" } - , - // Localizable short caption for the "new audio message" shortcut. - { EAiScutResourceNewAudioMsgShortCaption, L"NewAudioMsgShortCaption", "text/plain" } - , - // Localizable short caption for the "new message" shortcut. - { EAiScutResourceSelectMsgTypeShortCaption, L"SelectMsgTypeShortCaption", "text/plain" } - , - // Localizable short caption for the "change theme" shortcut. - { EAiScutResourceChangeThemeShortCaption, L"ChangeThemeShortCaption", "text/plain" } - -}; - -const TInt KAiScutResourceCount = sizeof( KAiScutResources ) / - sizeof( KAiScutResources[0] ); - - -// ============================ SERVICES (Events) ============================== - -/** - * Event Ids. - */ -enum TAiScutEventIds -{ - EAiScutEventLaunchByIndex, - EAiScutEventLaunchByValue, - EAiScutEventShowSettings, - EAiScutEventShowSetting, - EAiScutEventLaunchFastswap, - EAiScutEventLaunchByIndexAlternate, - EAiScutEventLoseFocus, - EAiScutEventGainFocus -}; - -/** - * Services that the plug-in can perform. - */ -const TAiContentItem KAiScutEvents[] = -{ - // Launches a shortcut by its index that is delivered as an integer. - { EAiScutEventLaunchByIndex, L"LaunchByIndex", "int" } - , - // Launches a shortcut by its value that is delivered in a descriptor. - { EAiScutEventLaunchByValue, L"LaunchByValue", "str" } - , - // Shows the shortcut plug-in settings dialog. - { EAiScutEventShowSettings, L"ShowSettings", "" } - , - // Shows the shortcut plug-in setting. - { EAiScutEventShowSetting, L"ShowSetting", "" } - , - // Opens the fast swap window - { EAiScutEventLaunchFastswap, L"LaunchFastSwap", "" } - , - // Special launching. If the index points to appshell - // fastswap is opened. Other special cases can be added to the engine - { EAiScutEventLaunchByIndexAlternate, L"LaunchByIndexAlternate", "int" } - , - // Used when we move out of a SC button (Needed for Popup-functionality). - // index of shortcut is delivered as an integer - { EAiScutEventLoseFocus, L"LoseFocus", "int" } - , - // Used when we move into a SC button (Needed for Popup-functionality). - // index of shortcut is delivered as an integer. - { EAiScutEventGainFocus, L"GainFocus", "int" } - -}; - -#endif // AISCUTCONTENTMODEL_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aiscutdefs.h --- a/homescreensrv_plat/ai_plugin_management_api/inc/aiscutdefs.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in definitions. -* -*/ - - -#ifndef AISCUTDEFS_H -#define AISCUTDEFS_H - -#include -#include -#include "aiscutappuids.hrh" - -// ============================================================================= -// =============== UIDs and view ids to external applications ================== -// ============================================================================= - -// Active Idle UID. -const TUid KScutActiveIdleUid = { 0x102750F0 }; - -// Shortcut Settings DLL UID. -const TUid KScutSettingsDllUid = { AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN }; - -// Keypad lock UID -const TUid KScutKeyLockUid = { 0x10000000 }; - -// Web Browser application UID. -const TUid KScutBrowserUid = { KScutBrowserUidValue }; - -// General Settings application UID. -const TUid KScutGeneralSettingsUid = { KScutGeneralSettingsUidValue }; - -// Message Centre application UID. -const TUid KScutMessagingUid = { KScutMessagingCenterUidValue }; - -// Remote mailbox view id. Message list view id (0x2) defined in MceIds.hrh. -const TUid KScutRemoteMailboxViewId = { KScutRemoteMailboxViewIdValue }; - -// Personalisation application UID. -const TUid KScutPersonalisationUid = { KScutPersonalisationUidValue }; - -// Change-Theme view id in the Personalisation application. -const TUid KScutChangeThemeViewId = { KScutChangeThemeViewIdValue }; - -// Installation view id in the Control Panel. -const TUid KScutInstallationViewId = { KScutInstallationViewIdValue }; - -// Connectivity view id in the Control Panel. -const TUid KScutConnectivityViewId = { KScutConnectivityStatusViewIdValue }; -// Voice dialer UID -const TUid KScutVoiceDialUid = { KScutVoiceDialUidValue }; - -// Logs UID -const TUid KScutLogsUid = { KScutLogsUidValue }; - -// AppShell UID -const TUid KScutAppShellUid = { KScutApplicationShellUidValue }; - -// Telephony UID -const TUid KScutDiallerUid = { KScutDiallerUidValue }; - -// Postcard editor UID -const TUid KScutPostcardEditorUid = { KScutPostcardEditorUidValue }; - -// On-Screen Dialler view id in the Telephony application. -const TUid KScutDiallerViewId = { KScutDiallerViewIdValue }; - -// On-Screen Dialler view command -const TUid KScutDiallerViewCommand = { 0x1 }; -// AppMngr -const TUid KScutAppMngrUid = { 0x101F8512 }; - -// EasyVoip Application UID -const TUid KScutEasyVoIPApplicationUid = { 0x1020E566 }; - -// VoIP launcher UID -const TUid KScutVoIPLauncherUid = { 0x10275424 }; - -// EasyVoip Central Repository UID -const TUid KUidEasyVoIPRepository = { 0x1020E593 }; - -// EasyVoIP shortcut startup flag -const TUint32 KEasyVoIPShortcutStartup = 0x00000004; - -// Logs views -_LIT8( KLogsMissedCallsView , "missed" ); -_LIT8( KLogsDialledCallsView , "dialled" ); -_LIT8( KLogsReceivedCallsView , "received" ); -_LIT8( KLogsMainView , "counters" ); - -// Softkeys -_LIT( KLeftSoftkey , "0x01000100" ); -_LIT( KRightSoftkey , "0x01000101" ); - -const TUint32 KLeftSoftkeyId = { 0x01000100 }; -const TUint32 KRightSoftkeyId = { 0x01000101 }; - -/** - * Bit fields for content items that the observers support. - */ -enum TSupportedContentItems -{ - ESupportIcon = 0x1, - ESupportCaption = 0x2, - ESupportShortCaption = 0x4 -}; - -class CAiScutShortcut; -class CAiScutShortcutInfo; -typedef RPointerArray RAiShortcutArray; -typedef RPointerArray RAiShortcutInfoArray; - -/** - * Definitions for application titles. - */ -enum TAiScutAppTitleType -{ - EAiScutLongTitle, - EAiScutShortTitle, - EAiScutSkeyTitle, - EAiScutMskTitle -}; - -class TAiScutAppTitleEntry -{ -public: - TUid iAppUid; - TUid iViewId; - HBufC* iLongTitle; - HBufC* iShortTitle; - HBufC* iSkeyTitle; - HBufC* iMskTitle; -}; - -/** - * Localized send ui resource for error note. - */ -_LIT( KSendNormResource, "sendnorm.rsc" ); - -/** - * Shortcut menu strings - */ -_LIT( KSettings, "widgetsettings" ); -#endif // AISCUTDEFS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/aiscutuids.hrh --- a/homescreensrv_plat/ai_plugin_management_api/inc/aiscutuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Uids for shortcut plug-in -* -*/ - - -#ifndef AISCUTUIDS_HRH -#define AISCUTUIDS_HRH - -#include - -/** - * Ecom dll uid for AI Shortcut plug-in. - */ -#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN 0x102750F9 - -/** - * Ecom implementation uid for AI Shortcut plug-in. - */ -#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN 0x102750FA - -/** - * Ecom dll uid for AI Shortcut Settings plug-in. - */ -#define AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN 0x102750FB - -/** - * Ecom implementation uid for AI Shortcut Settings plug-in. - */ -#define AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN 0x102750FC - -#endif // AISCUTUIDS_HRH - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,491 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for Homescreen content publisher plug-ins. +* +*/ + +#ifndef _HSCONTENTPUBLISHER_H +#define _HSCONTENTPUBLISHER_H + +// System includes +#include +#include + +// User includes +#include +#include + +// Constants +/** + * ECom plugin interface UID + * + * @since S60 5.2 + */ +const TUid KInterfaceUidHsContentPlugin = { HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER }; + +// Forward declarations +class MAiContentObserver; +class MAiPluginSettings; + +// Type definitions +typedef RPointerArray< MAiPluginSettings > RAiSettingsItemArray; + +/** + * ECom plug-in interface that Homescreen plug-ins must implement. + * It is used to control plug-in life cycle: load/destroy plug-ins; + * suspend/resume plug-in execution. + * + * @since S60 5.2 + */ +class CHsContentPublisher : public CBase + { +public: + // Data types + + /** + * CHsContentPublisher start-up reason. + * + * @since S60 5.2 + * @see CHsContentPublisher::Start() + */ + enum TStartReason + { + ESystemStartup = 1, + EPageStartup, + EPluginStartup + }; + + /** + * CHsContentPublisher shutdown reason. + * + * @since S60 5.2 + * @see CHsContentPublisher::Stop() + */ + enum TStopReason + { + ESystemShutdown = 1, + EPageShutdown, + EPluginShutdown + }; + + /** + * CHsContentPublisher resume reason. + * + * @since S60 5.2 + * @see CHsContentPublisher::Resume() + */ + enum TResumeReason + { + /** + * Homescreen is visible. + */ + EForeground = 1 + }; + + /** + * CHsContentPublisher suspend reason. + * + * @since S60 5.2 + * @see CHsContentPublisher::Suspend() + */ + enum TSuspendReason + { + /** + * Homescreen is invisible. + */ + EBackground = 1, + /** + * Backup/Restore is ongoing. + * + * The plug-in must realease all its resources + * which affects to backup/restore operation. + */ + EBackupRestore, + /** + * General Theme is changed. + * + * The plug-in must re-create any data which is themeable. + */ + EGeneralThemeChange + }; + + /** + * CHsContentPublisher properties. + * + * @since S60 5.2 + * @see CHsContentPublisher::SetProperty() + * @see CHsContentPublisher::GetProperty() + */ + enum TProperty + { + /** + * Enables read-only access to iterator of content selectors. GetProperty + * must return instance of MAiContentItemIterator for content selectors. + */ + EPublisherContent = 1, + + /** + * Enables read-only access to iterator of content references. GetProperty + * must return instance of MAiContentItemIterator for content references. + */ + EPublisherResources, + + /** + * Enables read-only access to iterator of events supported by plug-in. + * GetProperty must return instance of MAiContentItemIterator for events. + */ + EPublisherEvents, + + /** + * Provides access to MAiContentRequest interface for refreshing a content + * item. + * @see EPublisherContent + */ + EContentRequest, + + /** + * Provides access to MAiContentRequest interface for refreshing a resource + * item. + * @see EPublisherResources + */ + EResourceRequest, + + /** + * Provides access to localized plugin name if supported. HBufC* + * @see EPublisherResources + */ + EPluginName, + + /** + * Provides access to CPS command buffer. + */ + ECpsCmdBuffer + }; + +public: + // Constructor and destructor + + /** + * Creates a new plug-in instance based on implementation UID. + * + * @param aPublisherInfo This plug-in's publisher info. + * @return pointer to the instantiated interface implementation. + * @pre Interface implementation exists by uid aImpUid. + */ + inline static CHsContentPublisher* NewL( + const THsPublisherInfo& aPublisherInfo ); + + /** + * Destroys instance of the plug-in. Called by the framework during plug-in + * destruction phase. + */ + inline ~CHsContentPublisher(); + +public: + // new functions + + /** + * This method transits the plug-in into "Idle" state. + * Parameter aReason explains the plug-in's startup reason. + * Based on THsStartReason plug-in may decide its startup behavior. + * + * This method is called by the framework after plugin is constructed and configured. + * + * @since S60 5.2 + * @param aReason startup reason, see TStartReason. + * @pre None + * @post Plugin is in Idle state. + */ + virtual void Start( TStartReason aReason ) = 0; + + /** + * This method transits the plug-in into its final state. + * Parameter aReason explains the plug-in's shutdwon reason. + * Based on THsStopReason plug-in may prepare itself for next startup. + * + * This method is called by the framework before plugin is destroyed. + * + * @since S60 5.2 + * @param aReason reason for state change, see TStopReason. + * @pre None + * @post Plugin is ready to be destroyed. + */ + virtual void Stop( TStopReason aReason ) = 0; + + /** + * This method transits the plug-in into "Alive" state. + * + * In this state the plug-in is allowed to actively publish data + * to its observers, and it can consume memory and CPU resources. + * + * @since S60 5.2 + * @param aReason reason for state change, see TResumeReason. + * @pre None + * @post Plugin is in "Alive" state and actively publishes its data. + * + * Short example what a typical resume implementation does. + * @code + * if( !MyEngineCreated() ) + * { + * CreateEngine(); + * StartEngine(); + * } + * else + * { + * // Publish only changed data! + * RefreshData(); + * } + * @endcode + */ + virtual void Resume( TResumeReason aReason ) = 0; + + /** + * This method transits the plug-in into "Suspended" state. + * + * In this state the plug-in is not allowed to publish data + * to its observers. CPU resource usage must be minimal, e.g. + * timers must be stopped, outstanding asynchronous operations must + * be canceled, etc. + * + * @since S60 5.2 + * @param aReason reason for state change, see TSuspendReason. + * @pre None + * @post Plugin suspends publishing data and free resources (timers etc). + * + * Short example what a typical suspend implementation does. + * @code + * SuspendEngine(); + * @endcode + */ + virtual void Suspend( TSuspendReason aReason ) = 0; + + /** + * This method transits the plug-in into "Online" sub-state. + * In this state plugin is allowed to use network connections. + * + * @since S60 5.2 + */ + inline virtual void SetOnline(); + + /** + * This method transits the plug-in into "Offline" sub-state. + * In this state plugin is not allowed to use network connections. + * + * @since S60 5.2 + */ + inline virtual void SetOffline(); + + /** + * Adds the content observer / subscriber to the plug-in. The plug-in must + * maintain a registry of subscribers and publish data to all of them + * when new content is available in "Alive" state. + * + * @since S60 5.2 + * @param aObserver content observer to register. + * @pre None + * @post Plugin publishes its data to the subscribed observer. + * + * Short example what a typical subscribe implementation does and + * one alternative how observers are used. + * @code + * if( !ObserverAlreadyAdded( aObserver ) ) + * { + * iMyContentObservers.AppendL( aObserver ); + * } + * + * ... + * + * // Engine reports data changed in "Alive" state + * + * const TDesC& data = iEngine->LatestData(); + * for( TInt i = 0; i < iMyContentObservers.Count(); ++i ) + * { + * iMyContentObservers[i].Publish( data ); + * } + * @endcode + */ + virtual void SubscribeL( MAiContentObserver& aObserver ) = 0; + + /** + * Configures the plug-in. + * + * @since S60 5.2 + * @param aSettings setting items defined in the UI definition. + * This plugin takes ownership of the + * MAiPluginSettings objects in the array. + * If this method leaves the caller will handle the cleanup. + * @pre None + * @post Plugin has set its state according to relevant settings. + * + * Short example how to read plugin settings. + * @code + * for( TInt i = 0; i < aSettings.Count(); ++i ) + * { + * MAiPluginSettingsItem& item = (aSettings[i])->AiPluginSettingsItem(); + * TInt32 value = 0; + * if( ParseInt( value, item.Value() ) != KErrNone ) + * { + * continue; + * } + * if( value < 0 ) + * { + * continue; // All our settings are counts, skip bad settings + * } + * if( item.Key() == EMySettingMaxUsers ) + * { + * iEngine->SetMaxUsers( value ); + * continue; + * } + * else if( item.Key() == EMySettingNumItems ) + * { + * iNumItems = value; + * continue; + * } + * } + * // aSettings ownership is passed to the plug-in, destroy array. + * aSettings.ResetAndDestroy(); + * @endcode + */ + virtual void ConfigureL( RAiSettingsItemArray& aSettings ) = 0; + + /** + * Sets property value. + * + * @since S60 5.2 + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + * @see TProperty. + * + * An example of setting a property + * @code + * void CMyPlugin::SetPropertyL( TInt TProperty, TAny* aValue ) + * { + * if( !aValue ) + * { + * return; + * } + * + * // Save the property here to a member variable + * } + * @endcode + */ + inline virtual void SetProperty( TProperty aProperty, TAny* aAny ); + + /** + * Gets property value. + * + * @since S60 5.2 + * @param aProperty - identification of property. + * @return Pointer to property value. + * @see TProperty. + * + * An example of getting a property + * @code + * void CMyPlugin::ConstructL() + * { + * iContent = AiUtility::CreateContentItemArrayIteratorL( KMyPluginContent ); + * iResources = AiUtility::CreateContentItemArrayIteratorL( KMyPluginResources ); + * iEvents = AiUtility::CreateContentItemArrayIteratorL( KMyPluginEvents ); + * } + * + * TAny* CMyPlugin::GetPropertyL( TProperty aProperty ) + * { + * switch( aProperty ) + * { + * case EPublisherContent: + * return iContent; + * + * case EPublisherResources: + * return iResources; + * + * case EPublisherEvents: + * return iEvents; + * } + * return NULL; + * } + * @endcode + */ + inline virtual TAny* GetProperty( TProperty aProperty ); + + /** + * Invoked by the framework when the plug-in must handle an event. + * + * @since S60 5.2 + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + */ + inline virtual void HandleEvent( TInt aEvent, const TDesC& aParam ); + + /** + * Invoked by the framework when the plug-in must handle an event. + * + * @since S60 5.2 + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provied to plug-in as-is in the descriptor. + */ + inline virtual void HandleEvent( const TDesC& aEventName, const TDesC& aParam ); + + /** + * Invoked by the framework to query whether the plug-in has a menu item. + * + * @since S60 5.2 + * @param aMenuItem menu item name + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + inline virtual TBool HasMenuItem( const TDesC& aMenuItem ); + + /** + * Returns interface extension. In S60 5.2 extensions are not provided. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + * + * Example on how to properly return an extension. + * @code + * return NULL; // Requested extension not supported + * @endcode + */ + inline virtual TAny* Extension( TUid aUid ); + + /** + * Gets plug-in's publisher info. + * + * @since S60 5.2 + * @return PublisherInfo + */ + inline const THsPublisherInfo& PublisherInfo() const; + +private: + // data + + /** An identifier used during destruction. */ + TUid iDestructKey; + /** Publisher info. */ + mutable THsPublisherInfo iPublisherInfo; + }; + +#include + +#endif // _HSCONTENTPUBLISHER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisher.inl Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline function implementations for hscontentpublisher.h +* +*/ + + +#ifndef _HSCONTENTPUBLISHER_INL +#define _HSCONTENTPUBLISHER_INL + +// --------------------------------------------------------------------------- +// CHsContentPublisher::NewL +// +// --------------------------------------------------------------------------- +// +inline CHsContentPublisher* CHsContentPublisher::NewL( + const THsPublisherInfo& aPublisherInfo ) + { + TAny* ptr = REComSession::CreateImplementationL( aPublisherInfo.Uid(), + _FOFF( CHsContentPublisher, iDestructKey ) ); + + CHsContentPublisher* self = + reinterpret_cast< CHsContentPublisher*>( ptr ); + + self->iPublisherInfo = aPublisherInfo; + + return self; + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::~CHsContentPublisher +// +// ---------------------------------------------------------------------------- +// +inline CHsContentPublisher::~CHsContentPublisher() + { + REComSession::DestroyedImplementation( iDestructKey ); + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::SetOnline +// +// ---------------------------------------------------------------------------- +// +inline void CHsContentPublisher::SetOnline() + { + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::SetOffline +// +// ---------------------------------------------------------------------------- +// +inline void CHsContentPublisher::SetOffline() + { + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::SetProperty +// +// ---------------------------------------------------------------------------- +// +inline void CHsContentPublisher::SetProperty( TProperty /*aProperty*/, + TAny* /*aAny*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::GetProperty +// +// ---------------------------------------------------------------------------- +// +inline TAny* CHsContentPublisher::GetProperty( + TProperty /*aProperty*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::HandleEvent +// +// ---------------------------------------------------------------------------- +// +inline void CHsContentPublisher::HandleEvent( TInt /*aEvent*/, + const TDesC& /*aParam*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::HandleEvent +// +// ---------------------------------------------------------------------------- +// +inline void CHsContentPublisher::HandleEvent( const TDesC& /*aEventName*/, + const TDesC& /*aParam*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::HasMenuItem +// +// ---------------------------------------------------------------------------- +// +inline TBool CHsContentPublisher::HasMenuItem( const TDesC& /*aMenuItem*/ ) + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::Extension +// +// ---------------------------------------------------------------------------- +// +inline TAny* CHsContentPublisher::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CHsContentPublisher::PublisherInfo +// +// ---------------------------------------------------------------------------- +// +inline const THsPublisherInfo& CHsContentPublisher::PublisherInfo() const + { + return iPublisherInfo; + } + +#endif // _HSCONTENTPUBLISHER_INL + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisheruid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/hscontentpublisheruid.hrh Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource headers for HS Content Publisher +* +*/ + + +#ifndef _HSCONTENTPUBLISHERUID_HRH +#define _HSCONTENTPUBLISHERUID_HRH + +/** + * Ecom interface uid for CHsContentPublisher. + * + * Example resource of a plugin that implements HS content publisher interface. + * @code + * #include + * #include + * + * #define MY_DLL_UID 0xFFEEDDCC + * #define MY_PLUGIN_IMPLEMENTATION_UID 0xBBAA9988 + * + * RESOURCE REGISTRY_INFO registry_info + * { + * resource_format_version = RESOURCE_FORMAT_VERSION_2; + * dll_uid = MY_DLL_UID; + * + * // Interface info array + * interfaces = + * { + * INTERFACE_INFO + * { + * // UID of the implemented interface + * interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + * + * implementations = + * { + * IMPLEMENTATION_INFO + * { + * implementation_uid = MY_PLUGIN_IMPLEMENTATION_UID; + * version_no = 1; + * display_name = "My plugin"; + * } + * }; + * } + * }; + * } + * @endcode + */ +#define HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER 0x200286E1 + +#endif // _HSCONTENTPUBLISHERUID_HRH diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/hspublisherinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/hspublisherinfo.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: HS Publisher info +* +*/ + + +#ifndef _HSPUBLISHERINFO_H +#define _HSPUBLISHERINFO_H + +// System includes +#include + +// User includes + +// Forward declarations + +// Constants + +/** + * Maximum length for Content publisher name. + * + * @since S60 5.2 + */ +const TInt KHsPublisherNameMaxLength( 128 ); + +/** + * Maximum length for Content publisher namespace. + * + * @since S60 5.2 + */ +const TInt KHsPublisherNamespaceMaxLength( 32 ); + +// Types + +/** + * Content publisher name buffer. + * + * @since S60 5.2 + */ +typedef TBuf< KHsPublisherNameMaxLength > THsPublisherName; + +/** + * Content publisher namespace buffer. + * + * @since S60 5.2 + */ +typedef TBuf8< KHsPublisherNamespaceMaxLength > THsPublisherNamespace; + +/** + * Content publisher information + * + * @since S60 5.2 + */ + +/** + * Holds content publisher plug-in information. + * + * @since S60 5.2 + */ +class THsPublisherInfo + { +public: + // Constructors + + /** + * C++ default contrutor + */ + inline THsPublisherInfo(); + + /** + * C++ contrutor + */ + inline THsPublisherInfo( const TUid& aUid, + const TDesC& aName, const TDesC8& aNamespace ); + +public: + // new functions + + /** + * Assigment operator + * + * @since S60 5.2 + * @param aInfo Publisher info to assign. + */ + inline THsPublisherInfo& operator= ( const THsPublisherInfo& aInfo ); + + /** + * Equals operator + * + * @since S60 5.2 + * @param aInfo Publisher info to compare + * @return ETrue if this and aInfo equals, EFalse otherwise. + */ + inline TBool operator== ( const THsPublisherInfo& aInfo ) const; + + /** + * Gets Uid + * + * @since S60 5.2 + * @return Uid + */ + inline TUid Uid() const; + + /** + * Gets Name + * + * @since S60 5.2 + * @return Name + */ + inline const TDesC& Name() const; + + /** + * Gets Namespace + * + * @since S60 5.2 + * @return Namespace + */ + inline const TDesC8& Namespace() const; + +private: + // data + + /** Publisher implementation UID */ + TUid iUid; + /** Publisher name */ + THsPublisherName iName; + /** Publisher namespace */ + THsPublisherNamespace iNamespace; + +private: + // friend classes + + friend class CAiPluginFactory; + +#ifdef _AIFW_UNIT_TEST + friend class UT_HsPublisherInfo; +#endif + }; + +#include + +#endif // _HSPUBLISHERINFO_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_plugin_management_api/inc/hspublisherinfo.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/hspublisherinfo.inl Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline function implementations for hspublisherinfo.h +* +*/ + + +#ifndef _HSPUBLISHERINFO_INL +#define _HSPUBLISHERINFO_INL + +// --------------------------------------------------------------------------- +// THsPublisherInfo::THsPublisherInfo +// +// --------------------------------------------------------------------------- +// +inline THsPublisherInfo::THsPublisherInfo() + : iUid( TUid::Null() ), iName( KNullDesC ), iNamespace( KNullDesC8 ) + { + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::THsPublisherInfo +// +// --------------------------------------------------------------------------- +// +inline THsPublisherInfo::THsPublisherInfo( const TUid& aUid, + const TDesC& aName, const TDesC8& aNamespace ) + { + iUid = TUid::Uid( aUid.iUid ); + iName.Copy( aName ); + iNamespace.Copy( aNamespace ); + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::operator= +// +// --------------------------------------------------------------------------- +// +inline THsPublisherInfo& THsPublisherInfo::operator= ( + const THsPublisherInfo& aInfo ) + { + iUid = TUid::Uid( aInfo.iUid.iUid ); + iName.Copy( aInfo.iName ); + iNamespace.Copy( aInfo.iNamespace ); + + return *this; + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::operator== +// +// --------------------------------------------------------------------------- +// +inline TBool THsPublisherInfo::operator== ( + const THsPublisherInfo& aInfo ) const + { + if( iUid == aInfo.iUid && + iName == aInfo.iName && + iNamespace == aInfo.iNamespace ) + { + return ETrue; + } + + return EFalse; + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::Uid +// +// --------------------------------------------------------------------------- +// +inline TUid THsPublisherInfo::Uid() const + { + return iUid; + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::Name +// +// --------------------------------------------------------------------------- +// +inline const TDesC& THsPublisherInfo::Name() const + { + return iName; + } + +// --------------------------------------------------------------------------- +// THsPublisherInfo::Namespace +// +// --------------------------------------------------------------------------- +// +inline const TDesC8& THsPublisherInfo::Namespace() const + { + return iNamespace; + } + +#endif // _HSPUBLISHERINFO_INL + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_shortcut_command_api/ai_shortcut_command_api.metaxml --- a/homescreensrv_plat/ai_shortcut_command_api/ai_shortcut_command_api.metaxml Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - AI Shortcut Command API - Gives possibility to execute shortcuts defined by localapp URL - c++ - activeidle - - - - - - - - yes - no - - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_shortcut_command_api/group/bld.inf --- a/homescreensrv_plat/ai_shortcut_command_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: File that exports the files belonging to -: AI Shortcut Command API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/aiscutplugindomaincrkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutplugindomaincrkeys.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_shortcut_command_api/inc/aiscutplugindomaincrkeys.h --- a/homescreensrv_plat/ai_shortcut_command_api/inc/aiscutplugindomaincrkeys.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut Plug-in CenRep keys. -* -*/ - - -#ifndef AISCUTPLUGINDOMAINCRKEYS_H -#define AISCUTPLUGINDOMAINCRKEYS_H - -/** - * Uid for central repository file that holds shortcut plug-in settings. - */ -const TUid KCRUidShortcutItems = { 0x10275104 }; - -/** - * Flag bit 31 - * Theme-default shortcuts. 1000 0000 0000 0000 0000 0000 0000 0000 - */ -const TUint32 KScutFlagBitThemeDefault = 0x80000000; - -/** - * Mask to unset the theme-default flag. 0111 1111 1111 1111 1111 1111 1111 1111 - */ -const TUint32 KScutBitMaskThemeDefault = 0x7FFFFFFF; - -/** - * Flag bit 30 - * Locked shortcuts. 0100 0000 0000 0000 0000 0000 0000 0000 - */ -const TUint32 KScutFlagBitLocked = 0x40000000; - -/** - * Mask to unset the locked flag. 1011 1111 1111 1111 1111 1111 1111 1111 - */ -const TUint32 KScutBitMaskLocked = 0xBFFFFFFF; - -/** - * Flag bit 24 - * Optionally visible shortcut (softkeys). 0000 0001 0000 0000 0000 0000 0000 0000 - */ -const TUint32 KScutFlagBitOptionallyVisible = 0x01000000; - -/** - * Flag bit 25 - * Non-visible shortcut (key press). 0000 0010 0000 0000 0000 0000 0000 0000 - */ -const TUint32 KScutFlagBitNonVisible = 0x02000000; - -/** -* Flag bits 26-31 //0000 0001 0000 0000 0000 0001 0000 0000 -* Icon ovverides 0010 0000 0000 0000 0000 0000 0000 0000 -*/ -const TUint32 KScutFlagBitIconOverride = 0x20000000; - -/** - * Flag bit for toolbar shortcuts - */ -const TUint32 KScutFlagBitToolbarShortcut = 0x10000000; - -/** - * Mask for additional settings. - */ -const TUint32 KScutMaskAdditionalSetting = 0xFFFFFFFF ^ (KScutFlagBitIconOverride + KScutFlagBitToolbarShortcut); - -/** - * Partial key for theme-default shortcut ids. - */ -const TUint32 KScutCenRepKeyThemeDefault = KScutFlagBitThemeDefault; - -/** - * Partial key for user defined shortcut ids. - */ -const TUint32 KScutCenRepKeyUserDefined = 0x0; - -/** - * Mask used to separate theme-default ids from user defined ids. - */ -const TUint32 KScutCenRepKeyMask = KScutFlagBitThemeDefault; - -/** - * Shortcut count for the active theme - */ -const TUint32 KScutCenRepShorcutCount = 0xFFFFFFF0; - -/** - * A key which contains a space-separated list of application UIDs - * identifying the applications that should not show the xSP tip message. - */ -const TUint32 KAIxSPNoTipAppsList = 0x0001FFFF; - -/** - * Shortcut plug-in keycodes for optionally visible shortcuts. - */ -enum TAiScutKeyCodes -{ - // Navigation keys. - EAiScutScrollKeyLeft = 0x0000, - EAiScutScrollKeyRight = 0x0001, - EAiScutScrollKeyUp = 0x0002, - EAiScutScrollKeyDown = 0x0003, - EAiScutSelectionKey = 0x0004, - - // Soft keys. - EAiScutSoftKeyLeft = 0x0100, - EAiScutSoftKeyRight = 0x0101, - - // Touch toolbar - EAiScutToolbarFirst = 0x1000, - EAiScutToolbarSecond = 0x1001, - EAiScutToolbarThird = 0x1002 -}; - -#endif // AISCUTPLUGINDOMAINCRKEYS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_utilities_api/group/bld.inf --- a/homescreensrv_plat/ai_utilities_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_utilities_api/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -31,7 +31,4 @@ ../inc/aipluginsettings.h MW_LAYER_PLATFORM_EXPORT_PATH(aipluginsettings.h) ../inc/aistrcnv.h MW_LAYER_PLATFORM_EXPORT_PATH(aistrcnv.h) ../inc/contentprioritymap.h MW_LAYER_PLATFORM_EXPORT_PATH(contentprioritymap.h) - -#ifdef __COVER_DISPLAY -../inc/aisecondarydisplayapi.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/aisecondarydisplayapi.h) -#endif +../inc/aicpscommandbuffer.h MW_LAYER_PLATFORM_EXPORT_PATH(aicpscommandbuffer.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_utilities_api/inc/aicpscommandbuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aicpscommandbuffer.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cps command buffer interface +* +*/ + + +#ifndef M_CAICPSCOMMANDBUFFER_H +#define M_CAICPSCOMMANDBUFFER_H + +// System includes +#include + +// User includes + +// Forward declarations +class MLiwInterface; +class CLiwDefaultMap; +class CLiwServiceHandler; + +/** + * AI Cps command buffer interface + * + * @lib aifw + * @since S60 v5.2 + */ +class MAiCpsCommandBuffer + { +public: + // new functions + + /** + * Adds command to command buffer queue + * + * @since S60 5.2 + * @param aPluginId plugin id. + * @param aType type of the cps registry. + * @param aFilter filter values. + * @param aAction action trigger. + */ + virtual void AddCommand( const TDesC& aPluginId, + const TDesC& aType, CLiwDefaultMap* aFilter, + const TDesC8& aAction ) = 0; + + /** + * Gets Service Handler + * + * @since S60 5.2 + * @return Service handler + */ + virtual CLiwServiceHandler* ServiceHandler() const = 0; + + /** + * Gets IContentPublishing Interface + * + * @since S60 5.2 + * @return Interface + */ + virtual MLiwInterface* CpsInterface() const = 0; + +protected: + // destructor + + ~MAiCpsCommandBuffer() { } + }; + +#endif // M_CAICPSCOMMANDBUFFER_H + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_utilities_api/inc/aiplugintool.h --- a/homescreensrv_plat/ai_utilities_api/inc/aiplugintool.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_utilities_api/inc/aiplugintool.h Wed May 12 13:36:47 2010 +0300 @@ -19,14 +19,15 @@ #ifndef M_AIPLUGINTOOL_H #define M_AIPLUGINTOOL_H +// System includes #include -#include -class TAiPublisherInfo; -class CAiContentPublisher; +// User incldues +#include + +// Forward declarations +class THsPublisherInfo; class MAiContentItemIterator; -class MAiPropertyExtension; -class MAiEventHandlerExtension; /** * Plugin tool. @@ -39,44 +40,15 @@ public: /** - * Get the publisher info of the passed publisher. - * - * @since S60 3.2 - * @param reference to content publisher - * @return pointer to publisher info - */ - virtual const TAiPublisherInfo* PublisherInfoL( - CAiContentPublisher& aContentPublisher ) = 0; - - /** * Get the content item iterator for the passed publisher. * * @param reference to content publisher * @param content type indication * @return pointer to content iterator */ - virtual MAiContentItemIterator* ContentItemIteratorL( - CAiContentPublisher& aContentPublisher, - TInt aContentType = EAiPublisherContent ) = 0; - - - /** - * Get the property extension for passed publisher. - * - * @param reference to content publisher - * @return property extension pointer - */ - virtual MAiPropertyExtension* PropertyExt( - CAiContentPublisher& aContentPublisher ) = 0; - - /** - * Get the event handler extension for passed publisher. - * - * @param reference to content publisher - * @return event handler extension pointer - */ - virtual MAiEventHandlerExtension* EventHandlerExt( - CAiContentPublisher& aContentPublisher ) = 0; + virtual MAiContentItemIterator* ContentItemIterator( + CHsContentPublisher& aContentPublisher, + CHsContentPublisher::TProperty aType = CHsContentPublisher::EPublisherContent ) = 0; /** * Release the tool. @@ -85,8 +57,7 @@ protected: - MAiPluginTool() { } - + MAiPluginTool() { } }; inline void Release( MAiPluginTool* aSelf ) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_utilities_api/inc/aisecondarydisplayapi.h --- a/homescreensrv_plat/ai_utilities_api/inc/aisecondarydisplayapi.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file contains note definitions for Cover UI sync -* -*/ - - -#ifndef AISECONDARYDISPLAYAPI_HRH -#define AISECONDARYDISPLAYAPI_HRH - -// CONSTANTS -const TUid KAICategory = { 0x102750F3 }; - -// DATA TYPES - -// Enumerates dialogs -enum TAiDialogIndex - { - EAiNoNote = 0, - EAiSimRegistrationFailed - }; - -#endif // AISECONDARYDISPLAYAPI_HRH - -// End of File - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h --- a/homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h Wed May 12 13:36:47 2010 +0300 @@ -123,4 +123,9 @@ */ const TUint32 KAIWallpaperPath = 0x00000851; +/** + * Key id to store plugin id of active view + */ +const TUint32 KAIActiveViewPluginId = 0x00000852; + #endif // __AI2INTERNALCRKEYS_H__ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/group/bld.inf --- a/homescreensrv_plat/context_utility_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: File that exports the files belonging to context utility api -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../inc/hgcontextutilitybase.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutilitybase.h) -../inc/hgcontextutility.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutility.h) -../inc/hgcontextdef.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextdef.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/inc/hgcontextdef.h --- a/homescreensrv_plat/context_utility_api/inc/hgcontextdef.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context types -* -*/ - - -#ifndef HGCONTEXTDEF_H -#define HGCONTEXTDEF_H - -#include - -// context source -_LIT( KHgCFSource, "Hg" ); - -// context types -_LIT( KHgCFTypeContact, "Contact" ); -_LIT( KHgCFTypePbkContact, "PbkContact" ); -_LIT( KHgCFTypePbkContactMulti, "PbkContactMulti" ); -_LIT( KHgCFTypeText, "Text" ); -_LIT( KHgCFTypePhoto, "Photo" ); -_LIT( KHgCFTypeActiveDate, "ActiveDate" ); -_LIT( KHgCFTypeUrl, "Url" ); -_LIT( KHgCFTypeDate, "Date" ); - -_LIT( KHgCFTypeMusicState, "MusicState" ); -_LIT( KHgCFTypeMusicArtist, "MusicArtist" ); -_LIT( KHgCFTypeMusicTitle, "MusicTitle" ); -_LIT( KHgCFTypeMusicAlbum, "MusicAlbum" ); -_LIT( KHgCFTypeMusicAlbumArt, "MusicAlbumArt" ); -_LIT( KHgCFTypeMusicUri, "MusicUri" ); -_LIT( KHgCFTypeMusicGenre, "MusicGenre" ); -_LIT( KHgCFTypeMusicType, "MusicType" ); - -_LIT( KHgCFTypeMusicRadioName, "MusicRadioName" ); -_LIT( KHgCFTypeMusicRadioUrl, "MusicRadioUrl" ); -_LIT( KHgCFTypeMusicRadioFrequency, "MusicRadioFrequency" ); -_LIT( KHgCFTypeMusicRadioRDSPI, "MusicRadioRDSPI" ); - -_LIT( KHgCFTypeVideoState, "VideoState" ); -_LIT( KHgCFTypeVideoTitle, "VideoTitle" ); -_LIT( KHgCFTypeVideoUri, "VideoUri" ); -_LIT( KHgCFTypeVideoType, "VideoType" ); - -_LIT( KHgCFTypeTvChannelName, "TvChannelName" ); -_LIT( KHgCFTypeTvProgramName, "TvProgramName" ); -_LIT( KHgCFTypeTvProgramDesc, "TvProgramDesc" ); -_LIT( KHgCFTypeTvProgramGenre, "TvProgramGenre" ); - -_LIT( KHgCFTypeGpsLatitude, "GpsLatitude" ); -_LIT( KHgCFTypeGpsLongitude, "GpsLongitude" ); - -_LIT( KHgCFTypeOviId, "OviId" ); - -// some pre-defined values -_LIT( KHgCFValueUnknownContact, "" ); // special value for PbkContact -_LIT( KHgCFValueUnknownInfo, "" ); // e.g. for TV contexts, when information is not available -_LIT( KHgCFValueMusicTypePlayer, "MusicPlayer" ); -_LIT( KHgCFValueMusicTypeRadio, "Radio" ); -_LIT( KHgCFValueVideoTypeLocal, "VideoLocal" ); -_LIT( KHgCFValueVideoTypeStream, "VideoStream" ); - -_LIT( KHgCFServiceIdPrefixOvi, "Ovi" ); // for CHgContextUtility::PublishServiceIdL - -#endif // HGCONTEXTDEF_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/inc/hgcontextutility.h --- a/homescreensrv_plat/context_utility_api/inc/hgcontextutility.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll - * -*/ - - -#ifndef HGCONTEXTUTILITY_H -#define HGCONTEXTUTILITY_H - -#include -#include -#include -#include -#include -#include - -class MVPbkStoreContact; -class MVPbkContactLink; -class CVPbkContactLinkArray; -class CMdESession; - -/** - * Utility class to publish and access context through the Context Framework. - * @lib hgcontextutility.lib - * - * Typical usage in applications that are publishing context: - * During construction: - * \code - * iContextUtility = CHgContextUtility::NewL(); - * iContextUtility->RePublishWhenFgL( ETrue ); - * \endcode - * Publishing is accomplished with one single call, for example: - * \code - * void ContactChanged( MVPbkStoreContact* aNewContact ) { - * ... - * iContextUtility->PublishContactContextL( *aNewContact ); - * ... - * \endcode - * - * By default publishing requests are ignored if the application is - * not in foreground (does not apply to apps that do not have the - * ui environment). If there is still a good reason to allow this - * then call AllowPublishFromBackground( ETrue ). - */ -NONSHARABLE_CLASS( CHgContextUtility ) : public CHgContextUtilityBase - { -public: - /** - * 2-phased constructor. - */ - IMPORT_C static CHgContextUtility* NewL(); - - /** - * 2-phased constructor. - */ - IMPORT_C static CHgContextUtility* NewLC(); - - /* - * Destructor. - */ - IMPORT_C ~CHgContextUtility(); - - /** - * Publishes contact context. - * @param aContact contact - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes contact context. - * @param aContactLink contact link - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes contact context. - * Attempts to publish an empty value will be ignored. - * - * Prefer using the overloads taking vpbk contact or link, whenever possible. - * Use this in case of unknown contacts only, that is, a name, phone number, - * or email address that does not belong to a phonebook contact. - * - * @param aContactName formatted name, phone number, or email address, - * or a combination of them, e.g. "firstname lastname", "+12345678", - * "lastname firstname ", "firstname, lastname <0501234567>". - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( const TDesC& aContactName, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Overload for publishing multiple contacts. - * Ownership of passed pointers is not taken. - * @param aContacts contact array - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( - const RPointerArray& aContacts, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Overload for publishing multiple contacts. - * @param aContactLinks contact link array - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( - const CVPbkContactLinkArray& aContactLinks, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Overload for publishing multiple contacts. - * @param aContactNames string array, for element format - * see PublishContactContextL(const TDesC&) - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes freetext context. - * Not to be used for bulk text (e.g. full content of some text viewer component). - * @param aText some text, typically the highlighted substring - * from a viewer or editor control - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishTextContextL( const TDesC& aText, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes URL context. - * @param aUrl URL - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishUrlContextL( const TDesC& aUrl, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes date/time context. - * @param aTime time - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishTimeContextL( const TTime& aTime, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes photo context. - * @param aFilename name of image file, with full path - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishPhotoContextL( const TDesC& aFilename, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes photo context. - * @param aMdeItemId item id for the Image object in MDS - * @param aMdeSession opened metadata engine session - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId, - CMdESession& aMdeSession, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes TV context. - * Pass KNullDesC if some of the needed data is not available. - * @param aChannelName channel name - * @param aProgramName program name - * @param aProgramDescription program description - * @param aGenre genre - */ - IMPORT_C void PublishTvContextL( - const TDesC& aChannelName, - const TDesC& aProgramName, - const TDesC& aProgramDescription, - const TDesC& aGenre ); - - /** - * Publishes an account id as contact context. - * - * @param aServiceId the service prefix, e.g. "Ovi" - * @param aAccountId the account id - * @param aDelay if non-zero then context is published only after - * a short delay. If a new publish call is made before the timer fires the - * pending value will not be published. - */ - IMPORT_C void PublishServiceIdL( const TDesC& aServiceId, - const TDesC& aAccountId, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Enables or disables automatic re-publishing of the latest - * context (published via this context utility instance) whenever - * the application comes to foreground. - * - * It is DISABLED by default. - * - * By enabling this the applications do not have to care about - * context publishing in HandleForegroundEventL etc. - * - * The feature needs CCoeEnv and calls will be ignored if the - * environment is not available. - * - * @param aEnable flag to turn the feature on/off - */ - IMPORT_C void RePublishWhenFgL( TBool aEnable ); - - /** - * Enables or disables context publishing when being in background. - * Applies to all PublishContextL variants. - * If disabled then no context will be published if it seems that the - * caller application is not in foreground. - * Has no effect if there is no CCoeEnv available, publishing is always - * allowed in that case. - * - * It is DISABLED by default, that is, publishing is not allowed - * from applications that are not in foreground. - * - * @param aAllow flag to turn the feature on/off - */ - IMPORT_C void AllowPublishFromBackground( TBool aAllow ); - - /** - * Adds new music context info to music context publishing parameters. - * This method is to be used in context with PublishMusicContextL. Fill in the - * parameters and then call PublishMusicContextL. - * This parameter list is cleared after publishing music context. - * - * @param aKey Name of the key to be published. - * @param aData Data for the key. - * @leave KErrNotFound, when key is empty. - * @leave KErrAlreadyExists, when key is already in the list. - * @see hgcontextdef.h for keys - * @see PublishMusicContextL - */ - IMPORT_C void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData ); - - /** - * Publishes music context from provided parameters as music context. - * Publishes all known (in hgcontextdef.h) music context fields as music - * context. All keys, which do not contain any data, are automatically - * filled with '' -string. - * Clears the parameter list after publishing the context. - * - * @leave KErrNotReady, when music context data parameter list is empty. - * * @see hgcontextdef.h for keys - * @see AddMusicContextInfoL - */ - IMPORT_C void PublishMusicContextL( - const TTimeIntervalMicroSeconds32& aDelay = 0 ); - - /** - * Publishes Radio context. - * Pass KNullDesC if some of the needed data is not available. - * @param aRadioName radio name - * @param aRadioUrl radio url - * @param aRadioFrequency radio frequency - * @param aRadioRDSPI radio identification code - */ - IMPORT_C void PublishRadioContextL( - const TDesC& aRadioName, - const TDesC& aRadioUrl, - const TDesC& aRadioFrequency, - const TDesC& aRadioRDSPI ); - - /** - * Creates a combined string from the elements of the given array. - * Returns NULL if the array has less than 2 elements. - * @param aArray string array - * @return combined string or NULL, ownership transferred to caller - */ - IMPORT_C static HBufC* BuildCombinedStringL( const MDesCArray& aArray ); - - /** - * Splits the given combined string and appends the components to - * the given array. The initial content of the array is not modified. - * If aString does not seem to be a string combined from multiple entries - * then aString is appended to aArray without any changes. - * @param aString combined string, input - * @param aArray array, output - */ - IMPORT_C static void SplitCombinedStringL( const TDesC& aString, - CDesCArray& aArray ); - -protected: - CHgContextUtility(); - void ConstructL(); - }; - -#endif /* HGCONTEXTUTILITY_H */ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/inc/hgcontextutilitybase.h --- a/homescreensrv_plat/context_utility_api/inc/hgcontextutilitybase.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Context publishing helper dll - * -*/ - - -#ifndef HGCONTEXTUTILITYBASE_H -#define HGCONTEXTUTILITYBASE_H - -#include -#include - -class CHgContextUtilityImpl; - -/** - * Utility base class to publish and access context through the Context Framework. - * @lib hgcontextutility.lib - */ -class CHgContextUtilityBase : public CBase - { -public: - /** - * Publishes context. - * Also defines the context if it has not been defined. - * Publishing empty value is not allowed, however such errors are ignored - * here so the function will not leave when CFW responds with KErrArgument. - * The security policy for the context will be set to require - * LocalServices capability. - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context - */ - IMPORT_C void PublishContextL( const TDesC& aContextType, - const TDesC& aContextData ); - - /** - * Publishes context, the value will contain all the strings - * from the given array, typically by using some separator character. - * @see PublishContextL - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context will be a combined - * version of all the strings from this array - */ - IMPORT_C void PublishContextL( const TDesC& aContextType, - const MDesCArray& aContextData ); - - /** - * Publishes context but only after a short interval, using a timer. - * If it is called again before the timer expires then the timer - * is restarted (and so the previous pending value is never published). - * @param aContextType context type, source is always KHgCFSource - * @param aContextData value for the context - * @param aDelay delay for the timer, in microseconds - */ - IMPORT_C void PublishContextDelayedL( const TDesC& aContextType, - const TDesC& aContextData, const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Overload for delayed publishing of a value combined from multiple strings. - * @param aContextType context type - * @param aContextData string array - * @param aDelay delay for the timer, in microseconds - */ - IMPORT_C void PublishContextDelayedL( const TDesC& aContextType, - const MDesCArray& aContextData, const TTimeIntervalMicroSeconds32& aDelay ); - - /** - * Requests the given context and returns the value for the - * first result. Returns NULL if not found. - * @param aContextType context type, the source is always KHgCFSource - */ - IMPORT_C HBufC* GetContextL( const TDesC& aContextType ); - - /** - * Requests the given context and returns the value for the - * first result. Returns NULL if not found. - * @param aContextSource context source - * @param aContextType context type - */ - IMPORT_C HBufC* GetContextL( const TDesC& aContextSource, - const TDesC& aContextType ); - -protected: - CHgContextUtilityBase(); - ~CHgContextUtilityBase(); - void BaseConstructL(); - CHgContextUtilityImpl* iImpl; - }; - -#endif /* HGCONTEXTUTILITYBASE_H */ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/bwins/t_ui_context_utility_apiu.def --- a/homescreensrv_plat/context_utility_api/tsrc/bwins/t_ui_context_utility_apiu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void) - ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &) - ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 4 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ??1CHgContextUtility@@UAE@XZ @ 5 NONAME ; CHgContextUtility::~CHgContextUtility(void) - ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 6 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void) - ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 7 NONAME ; void CHgContextUtility::RePublishWhenFgL(int) - ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 8 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 10 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 12 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) - ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 13 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &) - ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 14 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 15 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &) - ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 16 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &) - ?NewL@CHgContextUtility@@SAPAV1@XZ @ 17 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void) - ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 18 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?SplitCombinedStringL@CHgContextUtilityImpl@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 19 NONAME ABSENT ; void CHgContextUtilityImpl::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) - ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 20 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &) - ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 22 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &) - ?BuildCombinedStringL@CHgContextUtilityImpl@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 23 NONAME ABSENT ; class HBufC16 * CHgContextUtilityImpl::BuildCombinedStringL(class MDesC16Array const &) - ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 24 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 25 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) - ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &) - ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 30 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &) - ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 31 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &, class TRequestStatus &) - ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@AAVTRequestStatus@@@Z @ 32 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &, class TRequestStatus &) - ?SplitAndMatchL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 33 NONAME ; void CHgCtxContactMatcher::SplitAndMatchL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &) - ?GetFieldDataBinaryL@CHgCtxContactMatcher@@QBE?AVTPtrC8@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 34 NONAME ; class TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const - ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXXZ @ 35 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(void) - ?GetNameL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 36 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNameL(class MVPbkStoreContactFieldCollection &) - ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 37 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(class TRequestStatus &) - ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 38 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(class TRequestStatus &) - ?GetFieldDataDateTimeL@CHgCtxContactMatcher@@QBE?AVTTime@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 39 NONAME ; class TTime CHgCtxContactMatcher::GetFieldDataDateTimeL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const - ?SplitFindStringL@CHgCtxContactMatcher@@SAPAVCDesC16Array@@ABVTDesC16@@@Z @ 40 NONAME ; class CDesC16Array * CHgCtxContactMatcher::SplitFindStringL(class TDesC16 const &) - ?GetAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 41 NONAME ; void CHgCtxContactMatcher::GetAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) - ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 42 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(class TRequestStatus &) - ?GetCustomFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 43 NONAME ; void CHgCtxContactMatcher::GetCustomFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter) - ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 44 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &) - ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 45 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, class TRequestStatus &) - ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAH@Z @ 46 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, int &) - ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXXZ @ 47 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(void) - ?GetWebAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TWebAddressesType@1@@Z @ 48 NONAME ; void CHgCtxContactMatcher::GetWebAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum CHgCtxContactMatcher::TWebAddressesType) - ?FieldTypes@CHgCtxContactMatcher@@QBEABVMVPbkFieldTypeList@@XZ @ 49 NONAME ; class MVPbkFieldTypeList const & CHgCtxContactMatcher::FieldTypes(void) const - ?GetContactManager@CHgCtxContactMatcher@@QAEAAVCVPbkContactManager@@XZ @ 50 NONAME ; class CVPbkContactManager & CHgCtxContactMatcher::GetContactManager(void) - ?GetNamesForFindL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 51 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &) - ?GetNumbersL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 52 NONAME ; void CHgCtxContactMatcher::GetNumbersL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) - ?ContactNameFormatterL@CHgCtxContactMatcher@@QAEAAVMPbk2ContactNameFormatter@@XZ @ 53 NONAME ; class MPbk2ContactNameFormatter & CHgCtxContactMatcher::ContactNameFormatterL(void) - ?IsEmailAddressL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 54 NONAME ; int CHgCtxContactMatcher::IsEmailAddressL(class TDesC16 const &) - ?IsPhoneNumberL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 55 NONAME ; int CHgCtxContactMatcher::IsPhoneNumberL(class TDesC16 const &) - ?GetFieldDataTextL@CHgCtxContactMatcher@@QBE?AVTPtrC16@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 56 NONAME ; class TPtrC16 CHgCtxContactMatcher::GetFieldDataTextL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const - ?RegisterContactObserverL@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 57 NONAME ; void CHgCtxContactMatcher::RegisterContactObserverL(class MHgCtxContactObserver &) - ?GetContactStoresL@CHgCtxContactMatcher@@QAEAAVMVPbkContactStoreList@@XZ @ 58 NONAME ; class MVPbkContactStoreList & CHgCtxContactMatcher::GetContactStoresL(void) - ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@AAVTRequestStatus@@@Z @ 59 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *, class TRequestStatus &) - ?CancelOperation@CHgCtxContactMatcher@@QAEXXZ @ 60 NONAME ; void CHgCtxContactMatcher::CancelOperation(void) - ?NewLC@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 61 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewLC(class RFs *) - ?GetCustomFieldTypeLC@CHgCtxContactMatcher@@QAEPAVCVPbkFieldTypeRefsList@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 62 NONAME ; class CVPbkFieldTypeRefsList * CHgCtxContactMatcher::GetCustomFieldTypeLC(enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter) - ?CloseStoresL@CHgCtxContactMatcher@@QAEXXZ @ 63 NONAME ; void CHgCtxContactMatcher::CloseStoresL(void) - ?SplitMsgContactL@CHgCtxContactMatcher@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 64 NONAME ; void CHgCtxContactMatcher::SplitMsgContactL(class TDesC16 const &, class CDesC16Array &) - ?GetImppFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@PAVCDesC16Array@@11@Z @ 65 NONAME ; void CHgCtxContactMatcher::GetImppFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array *, class CDesC16Array *, class CDesC16Array *) - ?GetNamesForFindL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 66 NONAME ; void CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) - ?NewL@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 67 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewL(class RFs *) - ?MatchDataL@CHgCtxContactMatcher@@QAEXABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@ABVTCallBack@@@Z @ 68 NONAME ; void CHgCtxContactMatcher::MatchDataL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TCallBack const &) - ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@@Z @ 69 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &) - ?FindContactWithBirthdayL@CHgCtxContactMatcher@@QAEXABVTTime@@AAVCVPbkContactLinkArray@@@Z @ 70 NONAME ; void CHgCtxContactMatcher::FindContactWithBirthdayL(class TTime const &, class CVPbkContactLinkArray &) - ?LookupL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVCVPbkContactLinkArray@@@Z @ 71 NONAME ; void CHgCtxContactMatcher::LookupL(class TDesC16 const &, class CVPbkContactLinkArray &) - ?UnregisterContactObserver@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 72 NONAME ; void CHgCtxContactMatcher::UnregisterContactObserver(class MHgCtxContactObserver &) - ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@@Z @ 73 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &) - ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXXZ @ 74 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(void) - ??1CHgCtxContactMatcher@@UAE@XZ @ 75 NONAME ; CHgCtxContactMatcher::~CHgCtxContactMatcher(void) - ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@@Z @ 76 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *) - ?GetEmailAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 77 NONAME ; void CHgCtxContactMatcher::GetEmailAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) - ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 78 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TRequestStatus &) - ?GetThumbnailL@CHgCtxContactMatcher@@QAEPAVCFbsBitmap@@AAVMVPbkStoreContactFieldCollection@@@Z @ 79 NONAME ; class CFbsBitmap * CHgCtxContactMatcher::GetThumbnailL(class MVPbkStoreContactFieldCollection &) - ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 80 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) - ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 81 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &) - ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 82 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/eabi/t_ui_context_utility_apiu.def --- a/homescreensrv_plat/context_utility_api/tsrc/eabi/t_ui_context_utility_apiu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -EXPORTS - _Z9LibEntryLv @ 1 NONAME - _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME - _ZN17CHgContextUtility16RePublishWhenFgLEi @ 3 NONAME - _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 4 NONAME - _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME - _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 6 NONAME - _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 7 NONAME - _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 8 NONAME - _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 9 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 10 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 11 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 12 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 13 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME - _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 15 NONAME - _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 16 NONAME - _ZN17CHgContextUtility4NewLEv @ 17 NONAME - _ZN17CHgContextUtility5NewLCEv @ 18 NONAME - _ZN17CHgContextUtilityD0Ev @ 19 NONAME - _ZN17CHgContextUtilityD1Ev @ 20 NONAME - _ZN17CHgContextUtilityD2Ev @ 21 NONAME - _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 22 NONAME - _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 23 NONAME - _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 24 NONAME - _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 25 NONAME - _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 26 NONAME - _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 27 NONAME - _ZN21CHgContextUtilityImpl20BuildCombinedStringLERK12MDesC16Array @ 28 NONAME ABSENT - _ZN21CHgContextUtilityImpl20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 29 NONAME ABSENT - _ZTI11CHgTestBase @ 30 NONAME ; ## - _ZTI21CHgContextUtilityBase @ 31 NONAME ; ## - _ZTV11CHgTestBase @ 32 NONAME ; ## - _ZTV21CHgContextUtilityBase @ 33 NONAME ; ## - _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 34 NONAME - _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 35 NONAME - _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 36 NONAME - _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 37 NONAME - _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 38 NONAME - _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 39 NONAME - _ZN20CHgCtxContactMatcher10MatchDataLERK12MDesC16ArrayRK18MVPbkFieldTypeListR21CVPbkContactLinkArrayRK9TCallBack @ 40 NONAME - _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 41 NONAME - _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArrayR14TRequestStatus @ 42 NONAME - _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArray @ 43 NONAME - _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArrayR14TRequestStatus @ 44 NONAME - _ZN20CHgCtxContactMatcher11GetNumbersLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 45 NONAME - _ZN20CHgCtxContactMatcher12CloseStoresLEv @ 46 NONAME - _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16R14TRequestStatus @ 47 NONAME - _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16Ri @ 48 NONAME - _ZN20CHgCtxContactMatcher13GetAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 49 NONAME - _ZN20CHgCtxContactMatcher13GetImppFieldLER32MVPbkStoreContactFieldCollectionP12CDesC16ArrayS3_S3_ @ 50 NONAME - _ZN20CHgCtxContactMatcher13GetThumbnailLER32MVPbkStoreContactFieldCollection @ 51 NONAME - _ZN20CHgCtxContactMatcher14IsPhoneNumberLERK7TDesC16 @ 52 NONAME - _ZN20CHgCtxContactMatcher14OpenAllStoresLER14TRequestStatus @ 53 NONAME - _ZN20CHgCtxContactMatcher14OpenAllStoresLEv @ 54 NONAME - _ZN20CHgCtxContactMatcher14SplitAndMatchLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 55 NONAME - _ZN20CHgCtxContactMatcher15CancelOperationEv @ 56 NONAME - _ZN20CHgCtxContactMatcher15GetCustomFieldLER32MVPbkStoreContactFieldCollectionR12CDesC16Array18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 57 NONAME - _ZN20CHgCtxContactMatcher15IsEmailAddressLERK7TDesC16 @ 58 NONAME - _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollection @ 59 NONAME - _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 60 NONAME - _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContact @ 61 NONAME - _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContactR14TRequestStatus @ 62 NONAME - _ZN20CHgCtxContactMatcher16GetWebAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16ArrayNS_17TWebAddressesTypeE @ 63 NONAME - _ZN20CHgCtxContactMatcher16SplitFindStringLERK7TDesC16 @ 64 NONAME - _ZN20CHgCtxContactMatcher16SplitMsgContactLERK7TDesC16R12CDesC16Array @ 65 NONAME - _ZN20CHgCtxContactMatcher17GetContactManagerEv @ 66 NONAME - _ZN20CHgCtxContactMatcher17GetContactStoresLEv @ 67 NONAME - _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArray @ 68 NONAME - _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArrayR14TRequestStatus @ 69 NONAME - _ZN20CHgCtxContactMatcher18GetEmailAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 70 NONAME - _ZN20CHgCtxContactMatcher20GetCustomFieldTypeLCE18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 71 NONAME - _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLER14TRequestStatus @ 72 NONAME - _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLEv @ 73 NONAME - _ZN20CHgCtxContactMatcher21ContactNameFormatterLEv @ 74 NONAME - _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLER14TRequestStatus @ 75 NONAME - _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLEv @ 76 NONAME - _ZN20CHgCtxContactMatcher24FindContactWithBirthdayLERK5TTimeR21CVPbkContactLinkArray @ 77 NONAME - _ZN20CHgCtxContactMatcher24RegisterContactObserverLER21MHgCtxContactObserver @ 78 NONAME - _ZN20CHgCtxContactMatcher25UnregisterContactObserverER21MHgCtxContactObserver @ 79 NONAME - _ZN20CHgCtxContactMatcher4NewLEP3RFs @ 80 NONAME - _ZN20CHgCtxContactMatcher5NewLCEP3RFs @ 81 NONAME - _ZN20CHgCtxContactMatcher7LookupLERK7TDesC16R21CVPbkContactLinkArray @ 82 NONAME - _ZN20CHgCtxContactMatcher8GetNameLER32MVPbkStoreContactFieldCollection @ 83 NONAME - _ZN20CHgCtxContactMatcherD0Ev @ 84 NONAME - _ZN20CHgCtxContactMatcherD1Ev @ 85 NONAME - _ZN20CHgCtxContactMatcherD2Ev @ 86 NONAME - _ZNK20CHgCtxContactMatcher10FieldTypesEv @ 87 NONAME - _ZNK20CHgCtxContactMatcher17GetFieldDataTextLERK17MVPbkStoreContactRK14MVPbkFieldType @ 88 NONAME - _ZNK20CHgCtxContactMatcher19GetFieldDataBinaryLERK17MVPbkStoreContactRK14MVPbkFieldType @ 89 NONAME - _ZNK20CHgCtxContactMatcher21GetFieldDataDateTimeLERK17MVPbkStoreContactRK14MVPbkFieldType @ 90 NONAME - _ZThn12_N20CHgCtxContactMatcherD0Ev @ 91 NONAME - _ZThn12_N20CHgCtxContactMatcherD1Ev @ 92 NONAME - _ZThn16_N20CHgCtxContactMatcherD0Ev @ 93 NONAME - _ZThn16_N20CHgCtxContactMatcherD1Ev @ 94 NONAME - _ZThn20_N20CHgCtxContactMatcherD0Ev @ 95 NONAME - _ZThn20_N20CHgCtxContactMatcherD1Ev @ 96 NONAME - _ZThn4_N20CHgCtxContactMatcherD0Ev @ 97 NONAME - _ZThn4_N20CHgCtxContactMatcherD1Ev @ 98 NONAME - _ZThn8_N20CHgCtxContactMatcherD0Ev @ 99 NONAME - _ZThn8_N20CHgCtxContactMatcherD1Ev @ 100 NONAME - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/group/bld.inf --- a/homescreensrv_plat/context_utility_api/tsrc/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: T_ui_context_utility_api test module. -* -*/ - - - -PRJ_PLATFORMS -DEFAULT - -PRJ_TESTEXPORTS - -PRJ_EXPORTS - -PRJ_TESTMMPFILES -t_ui_context_utility_api.mmp - -PRJ_MMPFILES - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/group/context_utility_api.bat --- a/homescreensrv_plat/context_utility_api/tsrc/group/context_utility_api.bat Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -ATSInterface.exe -testmodule T_ui_context_utility_api \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.mmp --- a/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/*TYPE STIFUNIT*//* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: T_ui_context_utility_api test module. -* -*/ - - -#include - -TARGET T_ui_context_utility_api.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E7 - -CAPABILITY ALL -TCB - -DEFFILE T_ui_context_utility_api.def - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../../contextutility/inc - -// USERINCLUDE for base test class -USERINCLUDE ../testbase - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/internal - -SOURCEPATH ../src -SOURCE T_ui_context_utility_api.cpp -SOURCE T_ui_context_utility_api_cases.cpp -SOURCE wait.cpp -SOURCE hgctxcontactmatcher.cpp - -SOURCEPATH ../../../../contextutility/src -SOURCE hgcontextutilityimpl.cpp -SOURCE hgcontextutility.cpp -SOURCE hgcontextutilitybase.cpp - -// SOURCEPATH for base test class -SOURCEPATH ../testbase -SOURCE hgtestbase.cpp - -LIBRARY euser.lib -LIBRARY estor.lib -LIBRARY bafl.lib -LIBRARY stiftestinterface.lib -LIBRARY avkon.lib -LIBRARY aknnotify.lib -LIBRARY eikcore.lib -LIBRARY cfclient.lib -LIBRARY cfservices.lib -LIBRARY cone.lib -LIBRARY ws32.lib -LIBRARY mdeclient.lib -LIBRARY vpbkeng.lib -LIBRARY efsrv.lib -LIBRARY Pbk2Presentation.lib -LIBRARY fbscli.lib -LIBRARY imageconversion.lib -LIBRARY commonengine.lib - -DEBUGLIBRARY flogger.lib - -LANG SC - -EXPORTUNFROZEN - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.pkg --- a/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.pkg Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -; -; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: -; -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\T_ui_context_utility_api.dll" - "!:\Sys\Bin\T_ui_context_utility_api.dll" -"context_utility_api.bat" - "c:\context_utility_api.bat" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/inc/hgctxcontactmatcher.h --- a/homescreensrv_plat/context_utility_api/tsrc/inc/hgctxcontactmatcher.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,904 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contact metching class -* -*/ - - -#ifndef HGCONTACTMATCHER_H -#define HGCONTACTMATCHER_H - -// System includes -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -// Classes referenced -class RFs; -class CActiveSchedulerWait; -class CVPbkContactManager; -class MVPbkContactLink; -class CVPbkContactLinkArray; -class CVPbkContactStoreUriArray; -class MVPbkContactOperationBase; -class MVPbkFieldType; -class MVPbkFieldTypeList; -class MVPbkStoreContact; -class MVPbkStoreContactField; -class CVPbkFieldTypeRefsList; -class MVPbkStoreContactFieldCollection; -class MVPbkContactFieldSelector; - -class CPbk2SortOrderManager; -class MPbk2ContactNameFormatter; -class CFbsBitmap; - -/** - * Observer interface for contact added/changed/deleted notifications. - */ -class MHgCtxContactObserver - { -public: - /** - * Called when a contact is added, changed, or deleted. - */ - virtual void HandleContactEventL() = 0; - }; - -/** -* CHgCtxContactMatcher class is an API for contact matching. -* -* Before a method starts executing a Virtual Phonebook operation, -* it checks if there's an older asynchronous operation already in execution. -* If there is, synchronous methods leave with error code KErrInUse. -* Asynchronous methods complete the request with same error code. -* -* If phone backup/restore has been detected, using methods which -* require Virtual Phonebook is not possible normally. -* Instead those methods leave with error code KErrAccessDenied. -* Once EStoreBackupRestoreCompleted event has been received, -* methods can be called normally. -* -* @lib hgcontextservicesutils.lib -*/ - -NONSHARABLE_CLASS( CHgCtxContactMatcher ) : public CBase, - public MVPbkSingleContactOperationObserver, - public MVPbkContactStoreListObserver, - public MVPbkContactFindObserver, - public MVPbkContactFindFromStoresObserver, - public MVPbkContactViewObserver - { -public: // Construct & destruct - - /** - * Two-phase constructor for CHgCtxContactMatcher class. - * - * @param aFsSession File server session. - * - * @return CHgCtxContactMatcher* Pointer to newly created instance. - */ - IMPORT_C static CHgCtxContactMatcher* NewL( RFs* aFsSession = 0 ); - - /** - * Two-phase constructor for CHgCtxContactMatcher class. - * Like NewL(), but also places instance on cleanup stack. - * - * @return CHgCtxContactMatcher* Pointer to newly created instance. - */ - IMPORT_C static CHgCtxContactMatcher* NewLC( RFs* aFsSession = 0 ); - - /** - * C++ destructor. - */ - IMPORT_C ~CHgCtxContactMatcher(); - -private: // Internal construct - - /** - * C++ Constructor. - */ - CHgCtxContactMatcher( RFs* aFsSession ); - - /** - * Second phase constructor - */ - void ConstructL(); - -public: // API methods - - /** - * Opens one or more contact stores for future match operations. - * - * @param aUriArray Array of contact store URIs to be opened. - * - * @exception KErrNotSupported when none of the stores opens - * @exception KErrGeneral if some stores are already open - */ - IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray ); - - /** - * Opens one or more contact stores for future match operations. - * Asynchronous version. - * - * @param aUriArray Array of contact store URIs to be opened. - * @param aStatus Completion status of the request. - * KErrNone - at least one store opened successfully - * KErrNotSupported - all stores failed to open - * KErrGeneral - if some stores are already open - */ - IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray, - TRequestStatus& aStatus ); - - /** - * Opens all contact stores for future match operations. - * NOTE: does not open OwnNumber store. - * - * @exception KErrNotSupported when none of the stores opens - * @exception KErrGeneral if some stores are already open - */ - IMPORT_C void OpenAllStoresL(); - - /** - * Opens all contact stores for future match operations. - * Asynchronous version. - * NOTE: does not open OwnNumber store. - * - * @param aStatus Completion status of the request. - * KErrNone - at least one store opened successfully - * KErrNotSupported - all stores failed to open - * KErrGeneral - if some stores are already open - */ - IMPORT_C void OpenAllStoresL( TRequestStatus& aStatus ); - - /** - * Opens default contact stores for future match operations. - * Used to find local aliases to phone numbers and email addresses - * NOTE: does not open OwnNumber store or fixed dialing store - * Opens the stores in the default preference order - * - * @exception KErrNotSupported when none of the stores opens - * @exception KErrGeneral if some stores are already open - */ - IMPORT_C void OpenDefaultMatchStoresL(); - - /** - * Opens default contact stores for future match operations. - * Used to find local aliases to phone numbers and email addresses - * Asynchronous version. - * NOTE: does not open OwnNumber store or fixed dialing store - * Opens the stores in the default preference order - * - * @param aStatus Completion status of the request. - * KErrNone - at least one store opened successfully - * KErrNotSupported - all stores failed to open - * KErrGeneral - if some stores are already open - */ - IMPORT_C void OpenDefaultMatchStoresL( TRequestStatus& aStatus ); - - /** - * Opens all OwnNumber stores for future match operations. - * - * @exception KErrNotSupported when none of the stores opens - * @exception KErrGeneral if some stores are already open - */ - IMPORT_C void OpenOwnNumberStoresL(); - - /** - * Opens all OwnNumber stores for future match operations. - * - * @param aStatus Completion status of the request. - * KErrNone - at least one store opened successfully - * KErrNotSupported - all stores failed to open - * KErrGeneral - if some stores are already open - */ - IMPORT_C void OpenOwnNumberStoresL( TRequestStatus& aStatus ); - - /** - * Closes all currently open contact stores - * including OwnNumber stores. - * - * @return Leaves on error. - */ - IMPORT_C void CloseStoresL(); - - /** - * Determines whether a phone number is OwnNumber. Synchronous version. - * The method searches for the number from currently open stores. - * In order to use SIM's ISDN store, it should be the only open store. - * Can be opened with OpenOwnNumberStoresL(). - * - * @param aSearch Phone number to search for - * @param aResult Boolean result. - */ - IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TBool& aResult ); - - /** - * Determines whether a phone number is OwnNumber. Asynchronous version. - * The method searches for the number from currently open stores. - * In order to use SIM's ISDN store, it should be the only open store. - * Can be opened with OpenOwnNumberStoresL(). - * - * @param aSearch Phone number to search for - * @param aStatus Request status containing the result and - * possible error code. - * KErrNone = TRUE, - * KErrNotFound = FALSE, - * other value = system wide error code. - */ - IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TRequestStatus& aStatus ); - - /** - * Finds contacts with phone numbers that match the search string. - * Synchronous version. - * Contacts are searched from all currently open contact stores. - * Matching is done from the end of the phone number. - * Note: If the search string is shorter than 7 digits, matching from - * Phone memory contact store works ONLY if the phone number is - * exactly the same as the search string. - * Example: - * Search string "567" would find phone number "567", but not "1234567". - * From SIM stores both numbers would be found. - * - * @param aSearch Search string - * @param aDigits Number of digits to match from the end of phone number. - * @param aFlags Search all or stop at first match. - * See enum values from CVPbkPhoneNumberMatchStrategy.h - * @param aLinkArray Links to matching contacts are returned in this - * array that method caller provides. - * - * @return KErrNone = success, otherwise an error code. ,,list of codes - */ - IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, - CVPbkContactLinkArray& aLinkArray ); - - /** - * Finds contacts with phone numbers that match the search string. - * Asynchronous version. - * Searching is done according to parameters like in the synchronous version, - * but status code is returned in aStatus. - * - * @param aStatus Completion status of the request. - * Values: KErrNone = success, otherwise an error code. - */ - IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, - CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ); - - /** - * Returns the global list of possible field types. - * - * @return List of field types - */ - IMPORT_C const MVPbkFieldTypeList& FieldTypes() const; - - /** - * Gets a store contact from a contact link. - * @param aContactLink The link from which store contact should be returned. - * @param aStoreContact Pointer to store contact. - * Client must take the ownership immediately. - */ - IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink, - MVPbkStoreContact** aStoreContact ); - - /** - * Gets a store contact from a contact link. - * Asynchronous version. - * Parameters like in the synchronous version, - * but status code is returned in aStatus. - * - * @param aStatus Completion status of the request. - * Values: KErrNone = success, otherwise an error code. - */ - IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink, - MVPbkStoreContact** aStoreContact, TRequestStatus& aStatus ); - - /** - * Returns a pointer to contact's field data of given field type. - * If the field type isn't found from contact, return value is KNullDesC. - * NOTE: this works only for field types of storage type - * EVPbkFieldStorageTypeText. - * For other types, leaves with error code KErrArgument. - * - * @param aStoreContact The contact from which field data should be returned. - * @param aFieldType Field's type. - * @return TPtrC pointer to field's data. - */ - IMPORT_C TPtrC GetFieldDataTextL( const MVPbkStoreContact& aStoreContact, - const MVPbkFieldType& aFieldType ) const; - - /** - * Returns a pointer to contact's field data of given field type. - * If the field type isn't found from contact, return value is - * "1.1.1111". (d.m.yyyy). - * NOTE: this works only for field types of storage type - * EVPbkFieldStorageTypeDateTime. - * For other types, leaves with error code KErrArgument. - * - * @param aStoreContact The contact from which field data should be returned. - * @param aFieldType Field's type. - * @return TTime pointer to field's data. - */ - IMPORT_C TTime GetFieldDataDateTimeL( const MVPbkStoreContact& aStoreContact, - const MVPbkFieldType& aFieldType ) const; - - /** - * Returns a pointer to contact's field data of given field type. - * If the field type isn't found from contact, return value is KNullDesC8. - * NOTE: this works only for field types of storage type - * EVPbkFieldStorageTypeBinary. - * For other types, leaves with error code KErrArgument. - * - * @param aStoreContact The contact from which field data should be returned. - * @param aFieldType Field's type. - * @return TPtrC8 pointer to field's data. - */ - IMPORT_C TPtrC8 GetFieldDataBinaryL( const MVPbkStoreContact& aStoreContact, - const MVPbkFieldType& aFieldType ) const; - - /** - * Cancels asynchronous operation. - */ - IMPORT_C void CancelOperation(); - - /** - * Returns the used contact store list, needed for e.g. aiw fetch - * @return The used contact store list - */ - IMPORT_C MVPbkContactStoreList& GetContactStoresL(); - - /** - * Returns the name of the contact in the same format as MPbk2ContactNameFormatter - * @param aFieldCollection The fieldcollection of the contact - * @return HBufC* the name of the contact or null - */ - IMPORT_C HBufC* GetNameL( - MVPbkStoreContactFieldCollection& aFieldCollection ); - - /** - * Returns reference to the contactmanager - * @return reference to the contact manager - */ - IMPORT_C CVPbkContactManager& GetContactManager(); - - /** - * Finds contacts with field data that match the search string. - * Contacts are searched from all currently open contact stores. - * Matching is done from field types given by the method caller. - * The list of all possible field types can be fetched from the wrapper - * using FieldTypes(). - * - * @param aSearch Search string - * @param aFieldTypes List of field types included in matching. - * @param aLinkArray Links to matching contacts are returned - * in this array that method caller provides. - * - * @return KErrNone = success, otherwise an error code. ,,list of codes - */ - IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray); - - /** - * Finds contacts with field data that match the search string. - * Contacts are searched from all currently open contact stores. - * Matching is done from field types given by the method caller. - * The list of all possible field types can be fetched from the wrapper - * using FieldTypes(). - * - * @param aSearchStrings Search strings - * @param aFieldTypes List of field types included in matching. - * @param aLinkArray Links to matching contacts are returned - * in this array that method caller provides. - * @param aWordParserCallBack is the callback function to the parser - * - * @return KErrNone = success, otherwise an error code. - */ - IMPORT_C void MatchDataL( const MDesC16Array& aSearchStrings, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray, - const TCallBack& aWordParserCallBack ); - - /** - * Finds contacts with field data that match the search string. - * Asynchronous version. - * Searching is done according to parameters like in the synchronous version, - * but status code is returned in aStatus. - * - * @param aStatus Completion status of the request. - * Values: KErrNone = success, otherwise an error code. - */ - IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ); - - /** - * Returns reference to the contact name formatter. Object is created if not used earlier. - * @return reference to the contact name formatter - */ - IMPORT_C MPbk2ContactNameFormatter& ContactNameFormatterL(); - - /** - * Splits the input to words and then performs a MatchDataL using the same - * splitter callback function. - * - * LookupL and this are the preferred functions to do text-based lookups from Hg code. - * - * @see MatchDataL - * @see LookupL - */ - IMPORT_C void SplitAndMatchL( const TDesC& aData, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray ); - - /** - * Registers for getting notifications when a contact is added, changed, or deleted. - * Does nothing if already added. - * @param aObserver ref to observer - */ - IMPORT_C void RegisterContactObserverL( MHgCtxContactObserver& aObserver ); - - /** - * Unregisters the given observer. - * Does nothing if the given observer has not been registered before. - * @param aObserver ref to observer - */ - IMPORT_C void UnregisterContactObserver( MHgCtxContactObserver& aObserver ); - - /** - * Looks up a contact based on - * - name, or - * - phone number, or - * - email address, or - * - service id - * - * Also handles the "name " or "name " format. - * - * For service IDs the full uri must be given, e.g. if a contact - * has an Ovi ID in phonebook set to "somebody" then the search will - * only succeed if aData contains "Ovi:somebody" (unless of course - * the string "somebody" matches some name fields). - * - * @param aData name or phone number of email address - * @param aLinkArray array to which the result links are added, - * no items are appended if not found - */ - IMPORT_C void LookupL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray ); - - /** - * Returns the phone numbers of the contact. - * @param aFieldCollection The fieldcollection of the contact - * @param aArray Phone numbers are appended to this. (not resetted) - */ - IMPORT_C void GetNumbersL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ); - - /** - * Returns the email addresses of the contact. - * @param aFieldCollection The fieldcollection of the contact - * @param aArray Email addresses are appended to this. (not resetted) - */ - IMPORT_C void GetEmailAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ); - - /** - * Constructs the address (e.g. street, city, country) for the contact. - * The elements are combined into one string, using space as separator. - * aArray will have 0-3 items appended: nothing, or general and/or work and/or home address. - * @param aFieldCollection The fieldcollection of the contact - * @param aArray Addresses are appended to this. (not resetted) - */ - IMPORT_C void GetAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ); - - enum TWebAddressesType - { - EWebAddresses, //for general web adress - EWebAddressesHome, //for home web adress - EWebAddressesWork //for work web adress - }; - - /** - * Gets the prefered web address for the contact. - * - * aArray can have 0 or more items appended. - * - * @param aFieldCollection The fieldcollection of the contact - * @param aArray Web addresses are appended to this. (not resetted) - * @param aType Determinates which web adress return, @see TWebAddressesType - */ - IMPORT_C void GetWebAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray, - TWebAddressesType aType ); - - - /** - * Gets the thumbnail for a contact. - * @param aFieldCollection The fieldcollection of the contact - * @return bitmap or null (null if not found) - */ - IMPORT_C CFbsBitmap* GetThumbnailL( - MVPbkStoreContactFieldCollection& aFieldCollection ); - - /** - * Checks if the given string is a phone number. - */ - IMPORT_C static TBool IsPhoneNumberL( const TDesC& aData ); - - /** - * Checks if the given string is an email address. - */ - IMPORT_C static TBool IsEmailAddressL( const TDesC& aData ); - - /** - * Appends content of name fields to the given array. - * Uses less fields than LookupL, here only family and given name - * are taken and returned. - * - * @param aFieldCollection fields to check - * @param aArray array to which strings are appended - */ - IMPORT_C void GetNamesForFindL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ); - - /** - * Gets content of name fields. - * Overload for getting results in one string instead of an array. - * @param aFieldCollection fields to check - * @return content of name fields in no particular order separated by a space - */ - IMPORT_C HBufC* GetNamesForFindL( - MVPbkStoreContactFieldCollection& aFieldCollection ); - - /** - * Splits a string into parts. - * Space, comma, and semicolon are treated as separators. - */ - IMPORT_C static CDesCArray* SplitFindStringL(const TDesC& aFindString); - - /** - * Splits a "name1 name2 ... " into two parts: - * "name1 name2 ..." and "something". - * < and > characters are removed. - * The resulting strings are appended to the given arrray. - * Such format is used by messaging components and this function - * is useful if a search has to be made based on both the name and - * the phone number / email address. - * @param aString input string - * @param aArray array to append to - */ - IMPORT_C static void SplitMsgContactL( const TDesC& aString, CDesCArray& aArray ); - - /** - * Appends the values from all matching text fields to a given array. - * @param aFieldCollection fields to scan through - * @param aArray destination array - * @param aVersitName versit property name - * @param aVersitParam versit property parameter - */ - IMPORT_C void GetCustomFieldL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray, - TVPbkFieldTypeName aVersitName, - TVPbkFieldTypeParameter aVersitParam ); - - /** - * Returns a matching field type for the given versit name/parameter. - * The returned list is empty if no matching field types were found. - * @param aVersitName versit property name - * @param aVersitParam versit property parameter - * @return field type list, also on the cleanup stack - */ - IMPORT_C CVPbkFieldTypeRefsList* GetCustomFieldTypeLC( - TVPbkFieldTypeName aVersitName, - TVPbkFieldTypeParameter aVersitParam ); - - /** - * Finds impp field data. - * @param aFieldCollection fields to scan - * @param aSchemeOnlyAray if non-null then scheme parts are appended to here - * @param aUriOnlyArray if non-null then uri parts are appended to here - * @param aFullArray if non-null then full field contents are appended to here - */ - IMPORT_C void GetImppFieldL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray* aSchemeOnlyArray, - CDesCArray* aUriOnlyArray, - CDesCArray* aFullArray ); - - /** - * Finds all contacts that have a birthday on the given month/day. - * Other components from aDate - like year, hours, etc. - are ignored. - * @param aDate date to look for - * @param aLinkArray links are appended to this array - * If no matching contacts are found then aLinkArray is left untouched. - */ - IMPORT_C void FindContactWithBirthdayL( const TTime& aDate, - CVPbkContactLinkArray& aLinkArray ); - -private: // from MVPbkContactStoreListObserver, MVPbkContactStoreObserver - - /** - * Called when the opening process is complete, ie. all stores have - * been reported either failed or successfully opened. - */ - void OpenComplete(); - - /** - * Called when a contact store is ready for use. - */ - void StoreReady( MVPbkContactStore& aContactStore ); - - /** - * Called when a contact store becomes unavailable. - * Client may inspect the reason of the unavailability and decide whether or not - * it will keep the store opened (ie. listen to the store events). - * @param aContactStore The store that became unavailable. - * @param aReason The reason why the store is unavailable. - * This is one of the system wide error codes. - */ - void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason ); - - /** - * Called when changes occur in the contact store. - * @see TVPbkContactStoreEvent, MVPbkContactStoreObserver.h - * - * @param aContactStore - * @param aStoreEvent Event that has occured. - */ - void HandleStoreEventL( MVPbkContactStore& aContactStore, - TVPbkContactStoreEvent aStoreEvent ); - -private: // from MVPbkContactFindFromStoresObserver - /** - * Called when find is complete on a single store. Callee takes - * ownership of the results. In case of an error during find, - * the aResultsFromStore may contain only partial results of the find. - * - * @param aStore is the store from which the contacts were searched from - * - * @param aResultsFromStore Array of contact links that matched the find. - * Callee must take ownership of this object in - * the end of the function, ie. in case the function - * does not leave. - */ - void FindFromStoreSucceededL( MVPbkContactStore& aStore, - MVPbkContactLinkArray* aResultsFromStore ); - - /** - * This function is called if/when there were errors while searching - * from a store. - * @param aStore is the store from which the search was done. - * @param aError is the error code. - */ - void FindFromStoreFailed( MVPbkContactStore& aStore, TInt aError ); - - /** - * Called when find is complete. - */ - void FindFromStoresOperationComplete(); - -private: // from MVPbkContactFindObserver - - /** - * Called when find is complete. Callee takes ownership of the results. - * In case of an error during find, the aResults may contain only - * partial results of the find. - * - * @param aResults Array of contact links that matched the find. - * Callee must take ownership of this object in - * the end of the function, ie. in case the function - * does not leave. - */ - void FindCompleteL( MVPbkContactLinkArray* aResults ); - - /** - * Called in case the find fails for some reason. - * - * @param aError One of the system wide error codes. - */ - void FindFailed( TInt aError ); - -private: // from MVPbkSingleContactOperationObserver - - /** - * Called when operation is completed. - * - * @param aOperation the completed operation. - * @param aContact the contact returned by the operation. - * Client must take the ownership immediately. - */ - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, MVPbkStoreContact* aContact ); - - /** - * Called if the operation fails. - * - * @param aOperation the failed operation. - * @param aError error code of the failure. - */ - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, TInt aError ); - -private: // from MVPbkContactViewObserver - void ContactViewReady( - MVPbkContactViewBase& aView ); - void ContactViewUnavailable( - MVPbkContactViewBase& aView ); - void ContactAddedToView( - MVPbkContactViewBase& aView, - TInt aIndex, - const MVPbkContactLink& aContactLink ); - void ContactRemovedFromView( - MVPbkContactViewBase& aView, - TInt aIndex, - const MVPbkContactLink& aContactLink ); - void ContactViewError( - MVPbkContactViewBase& aView, - TInt aError, - TBool aErrorNotified ); - -private: // Constants - - // Wrapper method IDs for calls that have an asynchronous version - enum TMethodId - { - ENoMethod = 0, - EMatchPhoneNumber, - EMatchData, - EGetStoreContact, - EOpenStore, - ECloseStores - }; - - // Wrapper method processing status. - enum TMethodStatus - { - EIdle = 0, - EExecuting, - EFinished - }; - -private: // Methods - const MVPbkStoreContactField* FindField( const MVPbkStoreContact& aContact, - const MVPbkFieldType& aFType ) const; - static CVPbkContactStoreUriArray* GetStoreArrayLC( - const TDesC& (* const aFuncPtrs[])() ); - void OpenStoreL( const TDesC& (* const aFuncPtrs[])() ); - void OpenStoreL( const TDesC& (* const aFuncPtrs[])(), - TRequestStatus& aStatus ); - void FreeOldOperation(); - - // Copies the entries to the existing recipient array - void CopyFindResultsL( MVPbkContactLinkArray* aResults ); - - // Open store, code common to sync/async versions. - void OpenStoreCommonL( const CVPbkContactStoreUriArray& aUriArray ); - - // Match phonenumber, code common to sync/async versions. - void MatchPhoneNumberCommonL( const TDesC& aData, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags ); - - void InitOperationL( TMethodId aApiMethod ); - void InitOperationL( TMethodId aApiMethod, TRequestStatus* aStatus ); - void InitOperation( TRequestStatus* aStatus ); - void OperationComplete( TInt ErrorCode = KErrNone ); - void OperationFailed( TInt aError ); - void CleanupNumberMatch(); - void RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes ); - - void TryTextLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray ); - void TryNumberLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray ); - - void PreCreateNameFieldTypesL(); - void PreCreateEmailFieldTypesL(); - void PreCreateXspIdFieldTypesL(); - void PreCreateNumberFieldTypesL(); - void PreCreateAddressFieldTypesL(); - void PreCreateWebAddressFieldTypesL(); - void PreCreateWebAddressHomeFieldTypesL(); - void PreCreateWebAddressWorkFieldTypesL(); - void PreCreateWorkAddressFieldTypesL(); - void PreCreateHomeAddressFieldTypesL(); - - void GetTextFieldsL( const CVPbkFieldTypeRefsList& aList, - const MVPbkStoreContactFieldCollection& aFieldCollection, CDesCArray& aArray ); - -private: // Data - - // Used members - - RFs* iFsSession; - TBool iFsSessionOwned; - MVPbkStoreContact** iResultStoreContact; // result of GetStoreContact - CVPbkContactLinkArray* iResultContactLinkArray; // result of matching operations - TInt iResultContactLinkCnt; // number of links found in matching operations - TRequestStatus* iClientStatus; // request status used in asynch calls - - // Own members - CVPbkContactManager* iContactManager; - MVPbkContactOperationBase* iOperation; // CM operation being processed - CActiveSchedulerWait iASchedulerWait; // used in asynch calls - CVPbkContactStoreUriArray* iStoreUris; // used in matching - CVPbkPhoneNumberMatchStrategy* iMatchStrategy; // used in matching - CVPbkPhoneNumberMatchStrategy::TConfig* iStratConfig; // used in matching - TBool iSync; // is this wrapper call Synchronous (1) or Asynchronous (0) - TInt iError; // error code used while processing VPbk-operations - TBool iBackup;// contact store backup/restore in progress - // API method ID. Needed for cleanup after method finishes. - TMethodId iApiMethod; - // API method status. Needed to know processing has finished. - TMethodStatus iApiMethodStatus; - - CPbk2SortOrderManager* iSortOrderManager; - MPbk2ContactNameFormatter* iNameFormatter; - - RPointerArray iContactObservers; // ptrs not owned - CVPbkFieldTypeRefsList* iNameFieldTypes; - CVPbkFieldTypeRefsList* iEmailFieldTypes; - CVPbkFieldTypeRefsList* iXspIdFieldTypes; - CVPbkFieldTypeRefsList* iNumberFieldTypes; - CVPbkFieldTypeRefsList* iAddressFieldTypes; - CVPbkFieldTypeRefsList* iWebAddressFieldTypes; - CVPbkFieldTypeRefsList* iWebAddressHomeFieldTypes; - CVPbkFieldTypeRefsList* iWebAddressWorkFieldTypes; - CVPbkFieldTypeRefsList* iWorkAddressFieldTypes; - CVPbkFieldTypeRefsList* iHomeAddressFieldTypes; - }; - -/** -* Panic codes used in CHgCtxContactMatcher. -* -* @since 3.1u -*/ -class HgContactMatcherPanics - { -public: // API - - /** - * Panic codes - */ - enum TPanic - { - EPanNullPointer = 0, - EPanInvalidParam, - EPanInvalidOp - }; - -public: - - /** - * Panic - */ - static void Panic( TPanic aPanic ); - }; - -#endif - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/inc/t_ui_context_utility_api.h --- a/homescreensrv_plat/context_utility_api/tsrc/inc/t_ui_context_utility_api.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: T_ui_context_utility_api test module. -* -*/ - - - -#ifndef T_ui_context_utility_api_H -#define T_ui_context_utility_api_H - -// INCLUDES -#include "hgtestbase.h" -#include "hgctxcontactmatcher.h" - -// Logging path -_LIT( KT_ui_context_utility_apiLogPath, "\\logs\\testframework\\T_ui_context_utility_api\\" ); -// Log file -_LIT( KT_ui_context_utility_apiLogFile, "T_ui_context_utility_api.txt" ); - -// CLASS DECLARATION - -/** -* This a T_ui_context_utility_api class. -*/ -NONSHARABLE_CLASS(CT_ui_context_utility_api) : public CHgTestBase - { - public: - - CT_ui_context_utility_api(); - - void ConstructL(); - - static CT_ui_context_utility_api* NewL(); - - void CreateEnvL(); - void DestroyEnv(); - TInt LoadTestCasesL( - TInt& _test_case_no, - CT_ui_context_utility_api::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult); - - ~CT_ui_context_utility_api(); - - TInt RunTestL( - CT_ui_context_utility_api::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult); - - RPtrHashMap* GetImplHashTablePtr() - { - class CTestUtility : public CBase - { - public: - CHgContextUtilityImpl* iImpl; - }; - - class CTestImplementation : CTimer - { - public: - // number of pointers before iMusicContextInfo, calculate M-classes as pointers too - TInt unneeded[12]; - RPtrHashMap iMusicContextInfo; - }; - - // Fetch the pointer to hash table for testing purposes - return &((CTestImplementation*)((CTestUtility*)iContextUtility)->iImpl)->iMusicContextInfo; - } - #define TEST_VAR_DECLARATIONS - /** - * all testmodule-global variables declarations are inserted here - */ - #include "../src/T_ui_context_utility_api_cases.cpp" - #undef TEST_VAR_DECLARATIONS - - // for creating test env - CTrapCleanup* ENV_cleanup; - TInt ENV_err; - CEikonEnv* ENV_env; - CAknAppUi* ENV_aknAppUI; - }; - -#endif // T_ui_context_utility_api_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/src/hgctxcontactmatcher.cpp --- a/homescreensrv_plat/context_utility_api/tsrc/src/hgctxcontactmatcher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2539 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contact matching class -* -*/ - - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "hgctxcontactmatcher.h" - - -#include "hgctxutilslogging.h" - - -// ================= Static Constant Data =================== - -typedef const TDesC& (*UriFuncPtr)(); - -// Number match store URIs in priority order. -// When doing number matching, order of the stores in the uri array will -// determine which stores are searched first (sequential match). We stop -// the search when first match is found. -static const UriFuncPtr NumberMatchStoreUris[] = - { - VPbkContactStoreUris::DefaultCntDbUri, - // If we don't manage to open some store, we remove it from our array - VPbkContactStoreUris::SimGlobalAdnUri, - VPbkContactStoreUris::SimGlobalSdnUri, - NULL, // end marker - }; - -// All store URIs except own number store -static const UriFuncPtr AllStoreUris[] = - { - VPbkContactStoreUris::DefaultCntDbUri, - // If we don't manage to open some store, we remove it from our array - VPbkContactStoreUris::SimGlobalAdnUri, - VPbkContactStoreUris::SimGlobalSdnUri, - VPbkContactStoreUris::SimGlobalFdnUri, - NULL, // end marker - }; - -// Own number store URIs -static const UriFuncPtr OwnNumberStoreUris[] = - { - VPbkContactStoreUris::SimGlobalOwnNumberUri, - NULL, // end marker - }; - -// number of digits that must match from the right side of a phone number -const TInt KNumberMatchLenFromRight = 7; - -// granularity for CDesCArray -const TInt KArrayGranularity = 4; - -// YYYYMMDD:HHMMSS.MMMMMM -_LIT(KNullTime, "11110000:010101.00000"); - -// ================= STATIC FUNCTIONS ======================= - -// --------------------------------------------------------- -// FindWordSplitterL -// --------------------------------------------------------- -// -static TInt FindWordSplitterL( TAny* aParams ) - { - TVPbkWordParserCallbackParam* parser = - static_cast( aParams ); - - const TText* ptr = parser->iStringToParse->Ptr(); - const TText* end = ptr + parser->iStringToParse->Length(); - - const TText* startOfWord=NULL; - for ( ; ; ) - { - if ( ptr==end || TChar(*ptr).IsSpace() || *ptr == ',' || *ptr == ';' ) - { - if ( startOfWord ) - { - TPtrC addWord( startOfWord,ptr - startOfWord ); - parser->iWordArray->AppendL( addWord ); - startOfWord = NULL; - } - if ( ptr == end ) - { - break; - } - } - else if ( !startOfWord ) - { - startOfWord = ptr; - } - ptr++; - } - return( KErrNone ); - } - -static HBufC* CombineStringsLC( CDesCArray& aArray ) - { - TInt len = 0; - for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i ) - { - len += aArray[i].Length() + 1; - } - HBufC* result = HBufC::NewLC( len ); - TPtr p( result->Des() ); - for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i ) - { - if ( i ) - { - p.Append( ' ' ); - } - p.Append( aArray[i] ); - } - return result; - } - -// ================= MEMBER FUNCTIONS ======================= - -// ---------------------------------------------------------------------------- -// Two-phase constructor for CHgCtxContactMatcher class. -// ---------------------------------------------------------------------------- -EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewL( - RFs* aFsSession ) - { - CHgCtxContactMatcher* self = CHgCtxContactMatcher::NewLC( aFsSession ); - CleanupStack::Pop(self); - return self; - } - -// ---------------------------------------------------------------------------- -// Two-phase constructor for CHgCtxContactMatcher class. -// ---------------------------------------------------------------------------- -EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewLC( - RFs* aFsSession ) - { - CHgCtxContactMatcher* self = new ( ELeave ) CHgCtxContactMatcher( aFsSession ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// ---------------------------------------------------------------------------- -// C++ destructor. -// ---------------------------------------------------------------------------- -EXPORT_C CHgCtxContactMatcher::~CHgCtxContactMatcher() - { - delete iNameFieldTypes; - delete iNumberFieldTypes; - delete iEmailFieldTypes; - delete iXspIdFieldTypes; - delete iAddressFieldTypes; - delete iWebAddressFieldTypes; - delete iHomeAddressFieldTypes; - delete iWorkAddressFieldTypes; - - FreeOldOperation(); - CleanupNumberMatch(); - delete iStoreUris; - delete iContactManager; - delete iSortOrderManager; - delete iNameFormatter; - - if ( iClientStatus ) - { - User::RequestComplete( iClientStatus, KErrCancel ); - } - if ( iASchedulerWait.IsStarted() ) - { - iASchedulerWait.AsyncStop(); - } - - iContactObservers.Close(); - - if ( iFsSessionOwned && iFsSession ) - { - iFsSession->Close(); - delete iFsSession; - } - } - -// ---------------------------------------------------------------------------- -// C++ Constructor. -// ---------------------------------------------------------------------------- -CHgCtxContactMatcher::CHgCtxContactMatcher( RFs* aFsSession) : iFsSession( aFsSession ) - { - } - -// ---------------------------------------------------------------------------- -// Second phase constructor -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::ConstructL() - { - if ( !iFsSession ) - { - // The contact manager would be okay with NULL but some of our own functions - // need an RFs. - iFsSessionOwned = ETrue; - iFsSession = new ( ELeave ) RFs; - User::LeaveIfError( iFsSession->Connect() ); - } - - iContactManager = CVPbkContactManager::NewL( - *CVPbkContactStoreUriArray::NewLC(), iFsSession ); - CleanupStack::PopAndDestroy(); // CVPbkContactStoreUriArray - - // No stores open yet - iStoreUris = CVPbkContactStoreUriArray::NewL(); - } - -//******************* API-methods ********************************************* - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenStoreL( - const CVPbkContactStoreUriArray& aUriArray ) - { - InitOperationL( EOpenStore ); - OpenStoreCommonL( aUriArray ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - // Wait until stores are open - iASchedulerWait.Start(); - } - User::LeaveIfError( iError ); - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenStoreL( - const CVPbkContactStoreUriArray& aUriArray, TRequestStatus& aStatus ) - { - InitOperationL( EOpenStore ); - OpenStoreCommonL( aUriArray ); - InitOperation( &aStatus ); - - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - } - } - - -// ---------------------------------------------------------------------------- -// Common code to sync/async versions. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::OpenStoreCommonL( - const CVPbkContactStoreUriArray& aUriArray ) - { - if (iStoreUris->Count()) - { - // Opening more stores when some stores are already open is not - // supported. Support would require managing iStoreUris properly - // so that it contains all open stores. - User::Leave(KErrGeneral); - } - - const TInt count = aUriArray.Count(); - - for (TInt i = 0; i < count; ++i) - { - // Appended Uri:s to the array. If store fails to open it is removed - // from the array. This keeps Uri's in priority order in the array. - TVPbkContactStoreUriPtr uriPtr = aUriArray[i]; - iStoreUris->AppendL( uriPtr ); - - iContactManager->LoadContactStoreL( uriPtr ); - } - MVPbkContactStoreList& storeList = iContactManager->ContactStoresL(); - storeList.OpenAllL( *this ); - } - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL() - { - OpenStoreL(AllStoreUris); - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL( TRequestStatus& aStatus ) - { - OpenStoreL(AllStoreUris, aStatus); - } - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL() - { - OpenStoreL(NumberMatchStoreUris); - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL( TRequestStatus& aStatus ) - { - OpenStoreL(NumberMatchStoreUris, aStatus); - } - -// ---------------------------------------------------------------------------- -// Open OwnNumber stores. -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL() - { - OpenStoreL(OwnNumberStoreUris); - } - -// ---------------------------------------------------------------------------- -// Open OwnNumber stores. -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL( TRequestStatus& aStatus ) - { - OpenStoreL(OwnNumberStoreUris, aStatus); - } - -// ---------------------------------------------------------------------------- -// Close all open stores. -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::CloseStoresL() - { - // Closing stores does not work. MatchDataL() finds contacts from - // closed stores. - - InitOperationL( ECloseStores ); - - iApiMethodStatus = EExecuting; - TRAPD( err, iContactManager->ContactStoresL().CloseAll( *this ) ); - iApiMethodStatus = EFinished; - if ( err == KErrNone) - { - delete iStoreUris; iStoreUris = NULL; - iStoreUris = CVPbkContactStoreUriArray::NewL(); - } - else - { - User::Leave(err); - } - } - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL( - const TDesC& aData, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, - CVPbkContactLinkArray& aLinkArray ) - { - InitOperationL( EMatchPhoneNumber ); - iResultContactLinkArray = &aLinkArray; - - // Start asynchronous matching and wait until results are ready - MatchPhoneNumberCommonL( aData, aDigits, aFlags ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - iASchedulerWait.Start(); - } - User::LeaveIfError( iError ); - } - - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL( - const TDesC& aData, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, - CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ) - { - InitOperationL( EMatchPhoneNumber ); - iResultContactLinkArray = &aLinkArray; - // Start asynchronous matching - MatchPhoneNumberCommonL( aData, aDigits, aFlags ); - InitOperation( &aStatus ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - } - } - -// ---------------------------------------------------------------------------- -// Common code for sync and async versions -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::MatchPhoneNumberCommonL( - const TDesC& aData, TInt aDigits, - CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags ) - { - // Delete resources allocated for previous match - CleanupNumberMatch(); - - // iStoreUris is filled when stores are opened - - iStratConfig = new (ELeave) CVPbkPhoneNumberMatchStrategy::TConfig( - aDigits, - *iStoreUris, - CVPbkPhoneNumberMatchStrategy::EVPbkSequentialMatch, - aFlags); - iMatchStrategy = CVPbkPhoneNumberMatchStrategy::NewL( - *iStratConfig, - *iContactManager, - *this); - // Start asynchronous matching - iMatchStrategy->MatchL( aData ); - } - - -// ---------------------------------------------------------------------------- -// Find from a store succeeded -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FindFromStoreSucceededL( MVPbkContactStore& /*aStore*/, - MVPbkContactLinkArray* aResultsFromStore ) - { - __ASSERT_DEBUG( aResultsFromStore, HgContactMatcherPanics::Panic( - HgContactMatcherPanics::EPanNullPointer )); - - // Take the ownership of the result immediately - CleanupDeletePushL( aResultsFromStore ); - - CopyFindResultsL( aResultsFromStore ); - - CleanupStack::PopAndDestroy(); // aResultsFromStore - } - -// ---------------------------------------------------------------------------- -// Copy the found results for a store into array -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::CopyFindResultsL( MVPbkContactLinkArray* - aResults ) - { - const TInt count = aResults->Count(); - if ( iResultContactLinkArray ) - { - // Copy links to the member array - for ( TInt i = 0; i < count; ++i ) - { - iResultContactLinkArray->AppendL( aResults->At( i ).CloneLC() ); - CleanupStack::Pop(); // cloned link - } - } - else - { - iResultContactLinkCnt += count; - } - } - - -// ---------------------------------------------------------------------------- -// Find failed -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FindFromStoreFailed( MVPbkContactStore& /*aStore*/, TInt /*aError*/ ) - { - //no operation, search to continue from the other stores - } - - -// ---------------------------------------------------------------------------- -// Find complete -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FindFromStoresOperationComplete() - { - if (!iResultContactLinkArray) - { - // Links were not copied. Result is whether any links found or not. - OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound ); - } - else - { - OperationComplete(); - iResultContactLinkArray = NULL; - } - } - -// ---------------------------------------------------------------------------- -// Return global list of field types. -// ---------------------------------------------------------------------------- -EXPORT_C const MVPbkFieldTypeList& CHgCtxContactMatcher::FieldTypes() const - { - return iContactManager->FieldTypes(); - } - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetStoreContactL( - const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact ) - { - InitOperationL( EGetStoreContact ); - iResultStoreContact = aStoreContact; - - // Start asynchronous operation and wait until results are ready - FreeOldOperation(); - iOperation = iContactManager->RetrieveContactL( aLink, *this ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - iASchedulerWait.Start(); - } - User::LeaveIfError( iError ); - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetStoreContactL( - const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact, - TRequestStatus& aStatus ) - { - InitOperationL( EGetStoreContact ); - iResultStoreContact = aStoreContact; - // Start asynchronous operation - FreeOldOperation(); - iOperation = iContactManager->RetrieveContactL( aLink, *this ); - InitOperation( &aStatus ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - } - } - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber, TBool& aResult ) - { - InitOperationL( EMatchPhoneNumber ); - - // Not interested in links, only whether found or not - iResultContactLinkArray = NULL; - iResultContactLinkCnt = 0; - - // Start asynchronous matching and wait until results are ready - MatchPhoneNumberCommonL( aNumber, aNumber.Length(), - CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - iASchedulerWait.Start(); - } - User::LeaveIfError( iError ); - - aResult = iResultContactLinkCnt > 0; - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber, - TRequestStatus& aStatus ) - { - InitOperationL( EMatchPhoneNumber ); - - // Not interested in links, only whether found or not - iResultContactLinkArray = NULL; - iResultContactLinkCnt = 0; - - // Start asynchronous matching - MatchPhoneNumberCommonL( aNumber, aNumber.Length(), - CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag ); - InitOperation( &aStatus ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - } - } - -// ---------------------------------------------------------------------------- -// Cancel asynchronous operation -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::CancelOperation() - { - if (iApiMethodStatus != EExecuting) - { - return; - } - - __ASSERT_DEBUG(!iSync, HgContactMatcherPanics::Panic( - HgContactMatcherPanics::EPanInvalidOp)); - - switch(iApiMethod) - { - case EMatchData: - case EGetStoreContact: - FreeOldOperation(); // deleting the operation cancels it - break; - case EMatchPhoneNumber: - CleanupNumberMatch(); - break; - default: - ; - } - - User::RequestComplete( iClientStatus, KErrCancel ); - - iApiMethod = ENoMethod; - iApiMethodStatus = EFinished; - } - -// ---------------------------------------------------------------------------- -// GetFieldData, for EVPbkFieldStorageTypeText -// ---------------------------------------------------------------------------- -EXPORT_C TPtrC CHgCtxContactMatcher::GetFieldDataTextL( - const MVPbkStoreContact& aContact, - const MVPbkFieldType& aFType ) const - { - TPtrC ret(KNullDesC); - const MVPbkStoreContactField* field = FindField( aContact, aFType); - if (field) - { - const MVPbkContactFieldData& fdata = field->FieldData(); - if (fdata.DataType() == EVPbkFieldStorageTypeText) - { - const MVPbkContactFieldTextData& fdata2 = - MVPbkContactFieldTextData::Cast(fdata); - ret.Set( fdata2.Text() ); - } - else - { - User::Leave( KErrArgument ); - } - } - return ret; - } - -// ---------------------------------------------------------------------------- -// GetFieldData, for EVPbkFieldStorageTypeDateTime -// ---------------------------------------------------------------------------- -EXPORT_C TTime CHgCtxContactMatcher::GetFieldDataDateTimeL( - const MVPbkStoreContact& aContact, - const MVPbkFieldType& aFType ) const - { - TTime ret(KNullTime); - const MVPbkStoreContactField* field = FindField( aContact, aFType); - if (field) - { - const MVPbkContactFieldData& fdata = field->FieldData(); - if (fdata.DataType() == EVPbkFieldStorageTypeDateTime) - { - const MVPbkContactFieldDateTimeData& fdata2 = - MVPbkContactFieldDateTimeData::Cast( fdata ); - ret = fdata2.DateTime(); - } - else - { - User::Leave( KErrArgument ); - } - } - return ret; - } - -// ---------------------------------------------------------------------------- -// GetFieldData, for EVPbkFieldStorageTypeBinary -// ---------------------------------------------------------------------------- -EXPORT_C TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL( - const MVPbkStoreContact& aContact, - const MVPbkFieldType& aFType ) const - { - TPtrC8 ret(KNullDesC8); - const MVPbkStoreContactField* field = FindField( aContact, aFType); - if (field) - { - const MVPbkContactFieldData& fdata = field->FieldData(); - if (fdata.DataType() == EVPbkFieldStorageTypeBinary) - { - const MVPbkContactFieldBinaryData& fdata2 = - MVPbkContactFieldBinaryData::Cast( fdata ); - ret.Set( fdata2.BinaryData() ); - } - else - { - User::Leave( KErrArgument ); - } - } - return ret; - } - - -//******************************** Private Methods *************************** - -// ---------------------------------------------------------------------------- -// Finds a field of given type from contact. -// Returns pointer to field or NULL if not found. -// ---------------------------------------------------------------------------- - const MVPbkStoreContactField* CHgCtxContactMatcher::FindField( - const MVPbkStoreContact& aContact, - const MVPbkFieldType& aFType ) const - { - const MVPbkStoreContactFieldCollection& coll = aContact.Fields(); - TInt n = coll.FieldCount(); - - const MVPbkStoreContactField* field = NULL; - TBool bFound = EFalse; - for(TInt i=0; i < n && !bFound; ++i) - { - field = &coll.FieldAt( i ); - const MVPbkFieldType* ftype = field->MatchFieldType( 0 ); - if ( ftype ) - { - if ( ftype->IsSame( aFType )) - { - bFound = ETrue; - } - } - } - if ( !bFound ) - { - field = NULL; - } - return field; - } - -// ---------------------------------------------------------------------------- -// Get URI array with stores -// ---------------------------------------------------------------------------- -CVPbkContactStoreUriArray* CHgCtxContactMatcher::GetStoreArrayLC( - const TDesC& (* const aFuncPtrs[])() ) - { - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC(); - - // Add stores - for(TInt i = 0; aFuncPtrs[i]; i++) - { - TVPbkContactStoreUriPtr uriPtr(aFuncPtrs[i]()); - uriArray->AppendL(uriPtr); - } - return uriArray; - } - -// ---------------------------------------------------------------------------- -// Open stores. Synchronous version -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])()) - { - CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs); - - CHgCtxContactMatcher::OpenStoreL(*uriArray); - CleanupStack::PopAndDestroy(uriArray); - } - -// ---------------------------------------------------------------------------- -// Open stores. Asynchronous version -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])(), - TRequestStatus& aStatus) - { - CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs); - - CHgCtxContactMatcher::OpenStoreL(*uriArray, aStatus); - CleanupStack::PopAndDestroy(uriArray); - } - -// ---------------------------------------------------------------------------- -// Called when the opening process is complete, -// ie. all stores have been reported either failed or successfully opened. -// ---------------------------------------------------------------------------- -// -void CHgCtxContactMatcher::OpenComplete() - { - TInt error = KErrNone; - if ( iStoreUris->Count() == 0 ) - { - // unable to open any of the specified stores - error = KErrNotSupported; - } - OperationComplete( error ); - } - -// ---------------------------------------------------------------------------- -// Called when a contact store is ready to use. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::StoreReady( MVPbkContactStore& /*aContactStore*/ ) - { - } - -// ---------------------------------------------------------------------------- -// Called when a contact store becomes unavailable. -// Client may inspect the reason of the unavailability and decide whether or not -// it will keep the store opened (ie. listen to the store events). -// @param aContactStore The store that became unavailable. -// @param aReason The reason why the store is unavailable. -// This is one of the system wide error codes. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::StoreUnavailable( MVPbkContactStore& aContactStore, - TInt /*aReason*/ ) - { - // Remove contact store from uri list - iStoreUris->Remove( aContactStore.StoreProperties().Uri() ); - } - -// ---------------------------------------------------------------------------- -// Called when changes occur in the contact store. -// @see TVPbkContactStoreEvent -// -// @param aStoreEvent Event that has occured. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::HandleStoreEventL( - MVPbkContactStore& /*aContactStore*/, - TVPbkContactStoreEvent aStoreEvent) - { - // Contact and group events can be ignored, but we pass backup events for the observer. - switch ( aStoreEvent.iEventType ) - { - case TVPbkContactStoreEvent::EStoreBackupBeginning: - case TVPbkContactStoreEvent::EStoreRestoreBeginning: - { - iBackup = ETrue; - break; - } - case TVPbkContactStoreEvent::EStoreBackupRestoreCompleted: - { - iBackup = EFalse; - break; - } - case TVPbkContactStoreEvent::EContactAdded: - case TVPbkContactStoreEvent::EContactDeleted: - case TVPbkContactStoreEvent::EContactChanged: - { - for ( TInt i = 0, ie = iContactObservers.Count(); i != ie; ++i ) - { - iContactObservers[i]->HandleContactEventL(); - } - break; - } - default: - break; - } - } - - -// ---------------------------------------------------------------------------- -// Called when find is complete. Callee takes ownership of the results. -// In case of an error during find, the aResults may contain only -// partial results of the find. -// -// @param aResults Array of contact links that matched the find. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FindCompleteL( MVPbkContactLinkArray* aResults ) - { - __ASSERT_DEBUG( aResults, HgContactMatcherPanics::Panic( - HgContactMatcherPanics::EPanNullPointer )); - - // Take the ownership of the result immediately - CleanupDeletePushL( aResults ); - - CopyFindResultsL( aResults ); - - CleanupStack::PopAndDestroy(); // aResults - - if (!iResultContactLinkArray) - { - // No need to copy links. Only interested whether found or not - OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound ); - } - else - { - OperationComplete(); - iResultContactLinkArray = NULL; - } - } - -// ---------------------------------------------------------------------------- -// Called in case the find fails for some reason. -// -// @param aError One of the system wide error codes. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FindFailed( TInt aError ) - { - OperationFailed( aError ); - iResultContactLinkArray = NULL; - } - -// ---------------------------------------------------------------------------- -// Free old VPbk-operation. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::FreeOldOperation() - { - delete iOperation; - iOperation = NULL; - } - -// ---------------------------------------------------------------------------- -// Called when operation is completed. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& /*aOperation*/, MVPbkStoreContact* aContact) - { - *iResultStoreContact = aContact; - iResultStoreContact = NULL; - OperationComplete(); - } - -// ---------------------------------------------------------------------------- -// Called if the operation fails. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& /*aOperation*/, TInt aError) - { - OperationFailed( aError ); - } - -// ---------------------------------------------------------------------------- -// Set member variables for sync operation -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod ) - { - if ( iBackup ) - { - User::Leave( KErrAccessDenied ); - } - - // Check whether operation is in progress - if ( iApiMethodStatus == EExecuting ) - { - User::Leave( KErrInUse ); - } - - iSync = ETrue; - iError = KErrNone; - iApiMethod = aMethod; - iApiMethodStatus = EIdle; - } - -// ---------------------------------------------------------------------------- -// Set member variables for async operation -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod, TRequestStatus* aStatus ) - { - InitOperationL( aMethod ); - - iSync = EFalse; - iClientStatus = aStatus; - *iClientStatus = KRequestPending; - } - -// ---------------------------------------------------------------------------- -// Set member variables for async operation -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::InitOperation( TRequestStatus* aStatus ) - { - iSync = EFalse; - iClientStatus = aStatus; - *iClientStatus = KRequestPending; - } - -// ---------------------------------------------------------------------------- -// Sync/async operation finished succesfully, return results to method caller. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::OperationComplete( TInt aErrorCode ) - { - if (iSync) - { - if ( iASchedulerWait.IsStarted() ) - { - iASchedulerWait.AsyncStop(); - } - } - else - { - if ( iClientStatus ) - { - User::RequestComplete( iClientStatus, aErrorCode ); - iClientStatus = NULL; - } - } - iApiMethodStatus = EFinished; - } - -// ---------------------------------------------------------------------------- -// Sync/async operation failed, return results to method caller. -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::OperationFailed( TInt aError ) - { - iError = aError; - OperationComplete( aError ); - } - -// ---------------------------------------------------------------------------- -// Free resources allocated for number matching -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::CleanupNumberMatch() -{ - delete iMatchStrategy; - iMatchStrategy = NULL; - - delete iStratConfig; - iStratConfig = NULL; - - // store uris are not deleted here - opened array remains valid - // until new set of stores is opened. -} - -// --------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetContactStoresL -// --------------------------------------------------------------------------- -EXPORT_C MVPbkContactStoreList& CHgCtxContactMatcher::GetContactStoresL() - { - return iContactManager->ContactStoresL(); - } - - -// ----------------------------------------------------------------------------- -// TInt CHgCtxContactMatcher::GetName -// -// Returns the formatted name fo the contact -// ----------------------------------------------------------------------------- -EXPORT_C HBufC* CHgCtxContactMatcher::GetNameL( MVPbkStoreContactFieldCollection& - aFieldCollection ) - { - MPbk2ContactNameFormatter& nameFormatter = ContactNameFormatterL(); - - HBufC* formattedName = nameFormatter.GetContactTitleOrNullL( aFieldCollection, - MPbk2ContactNameFormatter::EUseSeparator ); - return formattedName; - } - -// ----------------------------------------------------------------------------- -// CVPbkContactManager& CHgCtxContactMatcher::GetContactManager( ) -// ----------------------------------------------------------------------------- -EXPORT_C CVPbkContactManager& CHgCtxContactMatcher::GetContactManager() - { - return *iContactManager; - } - - -// ---------------------------------------------------------------------------- -// Synchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray) - { - InitOperationL( EMatchData ); - iResultContactLinkArray = &aLinkArray; - - // Start asynchronous matching and wait until results are ready - FreeOldOperation(); - iOperation = iContactManager->FindL(aData, aFieldTypes, *this); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - iASchedulerWait.Start(); - } - - User::LeaveIfError( iError ); - RemoveSimilarEmailAddressesL( aData, aLinkArray, aFieldTypes ); - } - -// ---------------------------------------------------------------------------- -// Remove contacts that do not have exactly the correct email address -// e.g. if cbd@test.com address is requested, the for example a contact with address abcd@test.com will be removed -// from the result. -// This filtering is done only in the syncronous version of MatchDataL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes ) - { - TVPbkFieldVersitProperty prop; - prop.SetName( EVPbkVersitNameEMAIL ); - // do extra checks for email addresses - - const MVPbkFieldType* foundType = NULL; - // Continue only if at least one type is EVPbkVersitNameEMAIL - TInt i; - for ( i = 0 ; i < aFieldTypes.FieldTypeCount() ; i++ ) - { - foundType = &(aFieldTypes.FieldTypeAt( i )); - if ( foundType->VersitProperties().Count() > 0 - && foundType->VersitProperties()[0].Name() == prop.Name() ) - { - break; - } - } - if ( i == aFieldTypes.FieldTypeCount() ) - { - // no email types - return; - } - - const MVPbkFieldTypeList& fieldTypeList = FieldTypes(); - - TInt index = 0; - TBool isExactMatch; - while( index < aLinkArray.Count() ) - { - MVPbkStoreContact* storeContact; - GetStoreContactL( aLinkArray.At( index ), &storeContact ); - storeContact->PushL(); - - isExactMatch = EFalse; - for ( TInt i = 0; i < fieldTypeList.FieldTypeCount(); i++ ) - { - // find the email property - foundType = &(fieldTypeList.FieldTypeAt( i )); - if ( foundType->VersitProperties().Count() > 0 - && foundType->VersitProperties()[0].Name() == prop.Name() ) - { - TPtrC src = GetFieldDataTextL(*storeContact, *foundType ); - if ( aData.CompareF( src ) == 0 ) - { - isExactMatch = ETrue; - } - } - } - if ( isExactMatch ) - { - // go for the next contact - index++; - } - else - { - // remove the contact, because the email address does not match the one queried. - // the next one will take plce of this contact in the list (=do not increase index) - aLinkArray.Delete( index ); - } - CleanupStack::PopAndDestroy( storeContact ); - } - } - -// ---------------------------------------------------------------------------- -// Asynchronous version -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray, - TRequestStatus& aStatus) - { - InitOperationL( EMatchData ); - iResultContactLinkArray = &aLinkArray; - - // Start asynchronous matching - FreeOldOperation(); - iOperation = iContactManager->FindL(aData, aFieldTypes, *this); - InitOperation( &aStatus ); - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - } - } -// ---------------------------------------------------------------------------- -// MatchData for searchstrings -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::MatchDataL( const MDesC16Array& aSearchStrings, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray, - const TCallBack& aWordParserCallBack ) - { - InitOperationL( EMatchData ); - iResultContactLinkArray = &aLinkArray; - - // Start asynchronous matching and wait here until results are ready - FreeOldOperation(); - iOperation = iContactManager->FindL( aSearchStrings, aFieldTypes, - *this, aWordParserCallBack ); - - if ( iApiMethodStatus != EFinished ) - { - iApiMethodStatus = EExecuting; - iASchedulerWait.Start(); - } - User::LeaveIfError( iError ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactNameFormatterL -// ---------------------------------------------------------------------------- -EXPORT_C MPbk2ContactNameFormatter& CHgCtxContactMatcher::ContactNameFormatterL() - { - //first initialise, if not already initialised - if ( !iSortOrderManager ) - { - iSortOrderManager = CPbk2SortOrderManager::NewL( FieldTypes() ); - } - - if ( !iNameFormatter ) - { - iNameFormatter = Pbk2ContactNameFormatterFactory::CreateL( FieldTypes(), - *iSortOrderManager ); - } - return *iNameFormatter; - } - - -// --------------------------------------------------------------------------- -// HgContactMatcherPanics::Panic -// -// Panic function -// --------------------------------------------------------------------------- -void HgContactMatcherPanics::Panic( TPanic aPanic ) - { - _LIT(KPanicCategory, "ContactMatcher"); - User::Panic( KPanicCategory, aPanic ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::SplitAndMatchL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::SplitAndMatchL( const TDesC& aData, - const MVPbkFieldTypeList& aFieldTypes, - CVPbkContactLinkArray& aLinkArray) - { - CDesCArray* wordArray = SplitFindStringL( aData ); - CleanupStack::PushL( wordArray ); - TCallBack findParser( FindWordSplitterL ); - MatchDataL( *wordArray, aFieldTypes, aLinkArray, findParser ); - CleanupStack::PopAndDestroy( wordArray ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::RegisterContactObserverL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::RegisterContactObserverL( - MHgCtxContactObserver& aObserver ) - { - if ( iContactObservers.Find( &aObserver ) == KErrNotFound ) - { - iContactObservers.AppendL( &aObserver ); - } - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::UnregisterContactObserver -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::UnregisterContactObserver( - MHgCtxContactObserver& aObserver ) - { - TInt pos = iContactObservers.Find( &aObserver ); - if ( pos >= 0 ) - { - iContactObservers.Remove( pos ); - } - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::LookupL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::LookupL( const TDesC& aData, - CVPbkContactLinkArray& aLinkArray ) - { - HGLOG_CONTEXT( LookupL, HGLOG_LOCAL ); - HGLOG1_IN( "'%S'", &aData ); - - // Take part_A from "part_A " - // or part_A from "part_A". - TPtrC input( aData ); - TInt ltPos = input.Locate( '<' ); - TInt gtPos = input.Locate( '>' ); - if ( ltPos != KErrNotFound && gtPos> ltPos ) - { - input.Set( aData.Mid( 0, ltPos ) ); - } - HBufC* trimmedInput = input.AllocLC(); - trimmedInput->Des().Trim(); - - TInt oldCount = aLinkArray.Count(); - if ( IsPhoneNumberL( *trimmedInput ) ) - { - TryNumberLookupL( *trimmedInput, aLinkArray ); - } - else - { - TryTextLookupL( *trimmedInput, aLinkArray ); - } - - CleanupStack::PopAndDestroy( trimmedInput ); - - if ( aLinkArray.Count() == oldCount && ltPos != KErrNotFound && gtPos > ltPos ) - { - // lookup for part_A was not successful so try part_B - trimmedInput = aData.Mid( ltPos + 1, gtPos - ltPos - 1 ).AllocLC(); - trimmedInput->Des().Trim(); - if ( IsPhoneNumberL( *trimmedInput ) ) - { - TryNumberLookupL( *trimmedInput, aLinkArray ); - } - else - { - TryTextLookupL( *trimmedInput, aLinkArray ); - } - CleanupStack::PopAndDestroy( trimmedInput ); - } - - HGLOG1_OUT( "got %d results", aLinkArray.Count() - oldCount ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateNameFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateNameFieldTypesL() - { - HGLOG_CONTEXT( PreCreateNameFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iNameFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameFN ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNameFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try FN" ); - } - - prop.SetName( EVPbkVersitNameN ); - prop.SetSubField( EVPbkVersitSubFieldGivenName ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNameFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try given name" ); - } - - prop.SetName( EVPbkVersitNameN ); - prop.SetSubField( EVPbkVersitSubFieldFamilyName ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNameFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try family name" ); - } - - prop.SetName( EVPbkVersitNameORG ); - prop.SetSubField( EVPbkVersitSubFieldOrgName ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNameFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try org name" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateEmailFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateEmailFieldTypesL() - { - HGLOG_CONTEXT( PreCreateEmailFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iEmailFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameEMAIL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamINTERNET ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iEmailFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general email" ); - } - - prop.SetName( EVPbkVersitNameEMAIL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamINTERNET ); - prop.Parameters().Add( EVPbkVersitParamWORK ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iEmailFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work email" ); - } - - prop.SetName( EVPbkVersitNameEMAIL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamINTERNET ); - prop.Parameters().Add( EVPbkVersitParamHOME ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iEmailFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home email" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateXspIdFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateXspIdFieldTypesL() - { - HGLOG_CONTEXT( PreCreateXspIdFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iXspIdFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameIMPP ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iXspIdFieldTypes->AppendL( *t ); - } - - HGLOG1_OUT( "found %d xsp id field types", - iXspIdFieldTypes->FieldTypeCount() ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateNumberFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateNumberFieldTypesL() - { - HGLOG_CONTEXT( PreCreateNumberFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iNumberFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamCELL ); - prop.Parameters().Add( EVPbkVersitParamHOME ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home mobile" ); - } - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamCELL ); - prop.Parameters().Add( EVPbkVersitParamWORK ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work mobile" ); - } - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamCELL ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general mobile" ); - } - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamHOME ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home landline" ); - } - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - prop.Parameters().Add( EVPbkVersitParamWORK ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work landline" ); - } - - prop.SetName( EVPbkVersitNameTEL ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - prop.Parameters().Reset(); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iNumberFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general landline" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateAddressFieldTypesL() - { - HGLOG_CONTEXT( PreCreateAddressFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldCountry ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general country" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldRegion ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general region" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldLocality ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general locality" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldStreet ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try general street" ); - } - - HGLOG_OUT(); - } - - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL() - { - HGLOG_CONTEXT( PreCreateWebAddressFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iWebAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.Parameters().Add( EVPbkVersitParamPREF ); - prop.SetName( EVPbkVersitNameURL ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWebAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try prefered url" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateWebAddressHomeFieldTypesL() - { - HGLOG_CONTEXT( PreCreateWebAddressHomeFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iWebAddressHomeFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.Parameters().Add( EVPbkVersitParamHOME ); - prop.SetName( EVPbkVersitNameURL ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWebAddressHomeFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home url" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateWebAddressWorkFieldTypesL() - { - HGLOG_CONTEXT( PreCreateWebAddressWorkFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iWebAddressWorkFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.Parameters().Add( EVPbkVersitParamWORK ); - prop.SetName( EVPbkVersitNameURL ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWebAddressWorkFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work url" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL() - { - HGLOG_CONTEXT( PreCreateHomeAddressFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iHomeAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - prop.Parameters().Add( EVPbkVersitParamHOME ); - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldCountry ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iHomeAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home country" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldRegion ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iHomeAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home region" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldLocality ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iHomeAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home locality" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldStreet ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iHomeAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try home street" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL() - { - HGLOG_CONTEXT( PreCreateWorkAddressFieldTypesL, HGLOG_LOCAL ); - HGLOG_IN(); - - iWorkAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - prop.Parameters().Add( EVPbkVersitParamWORK ); - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldCountry ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWorkAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work country" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldRegion ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWorkAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work region" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldLocality ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWorkAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work locality" ); - } - - prop.SetName( EVPbkVersitNameADR ); - prop.SetSubField( EVPbkVersitSubFieldStreet ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - iWorkAddressFieldTypes->AppendL( *t ); - HGLOG0( HGLOG_INFO, "will try work street" ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::TryTextLookupL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::TryTextLookupL( const TDesC& aName, - CVPbkContactLinkArray& aLinkArray ) - { - HGLOG_CONTEXT( TryTextLookupL, HGLOG_LOCAL ); - HGLOG_IN(); - - CVPbkFieldTypeRefsList* fieldTypes = CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( fieldTypes ); - - // try name and email and ovi id fields - if ( !iNameFieldTypes ) - { - PreCreateNameFieldTypesL(); - } - for ( TInt i = 0, ie = iNameFieldTypes->FieldTypeCount(); i != ie; ++i ) - { - fieldTypes->AppendL( iNameFieldTypes->FieldTypeAt( i ) ); - } - if ( !iEmailFieldTypes ) - { - PreCreateEmailFieldTypesL(); - } - for ( TInt i = 0, ie = iEmailFieldTypes->FieldTypeCount(); i != ie; ++i ) - { - fieldTypes->AppendL( iEmailFieldTypes->FieldTypeAt( i ) ); - } - if ( !iXspIdFieldTypes ) - { - PreCreateXspIdFieldTypesL(); - } - for ( TInt i = 0, ie = iXspIdFieldTypes->FieldTypeCount(); i != ie; ++i ) - { - fieldTypes->AppendL( iXspIdFieldTypes->FieldTypeAt( i ) ); - } - - SplitAndMatchL( aName, *fieldTypes, aLinkArray ); - - CleanupStack::PopAndDestroy( fieldTypes ); - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::TryNumberLookupL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::TryNumberLookupL( const TDesC& aNumber, - CVPbkContactLinkArray& aLinkArray ) - { - HGLOG_CONTEXT( TryNumberLookupL, HGLOG_LOCAL ); - HGLOG_IN(); - - MatchPhoneNumberL( aNumber, - KNumberMatchLenFromRight, - CVPbkPhoneNumberMatchStrategy::EVPbkMatchFlagsNone, - aLinkArray ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetTextFieldsL -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::GetTextFieldsL( - const CVPbkFieldTypeRefsList& aList, - const MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ) - { - HGLOG_CONTEXT( GetTextFieldsL, HGLOG_LOCAL ); - HGLOG_IN(); - - for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) - { - const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); - const MVPbkFieldType* type = field.BestMatchingFieldType(); - if ( type && aList.ContainsSame( *type ) ) - { - const MVPbkContactFieldData& fdata( field.FieldData() ); - if ( fdata.DataType() == EVPbkFieldStorageTypeText ) - { - const MVPbkContactFieldTextData& fdata2 = - MVPbkContactFieldTextData::Cast( fdata ); - const TDesC& text( fdata2.Text() ); - aArray.AppendL( text ); - HGLOG1( HGLOG_INFO, "found: '%S'", &text ); - } - } - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetNumbersL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetNumbersL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ) - { - HGLOG_CONTEXT( GetNumbersL, HGLOG_LOCAL ); - HGLOG_IN(); - - if ( !iNumberFieldTypes ) - { - PreCreateNumberFieldTypesL(); - } - GetTextFieldsL( *iNumberFieldTypes, aFieldCollection, aArray ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetEmailAddressesL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetEmailAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ) - { - HGLOG_CONTEXT( GetEmailAddressesL, HGLOG_LOCAL ); - HGLOG_IN(); - - if ( !iEmailFieldTypes ) - { - PreCreateEmailFieldTypesL(); - } - GetTextFieldsL( *iEmailFieldTypes, aFieldCollection, aArray ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetAddressesL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ) - { - HGLOG_CONTEXT( GetAddressesL, HGLOG_LOCAL ); - HGLOG_IN(); - - CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); - CleanupStack::PushL( arr ); - - if ( !iAddressFieldTypes ) - { - PreCreateAddressFieldTypesL(); - } - GetTextFieldsL( *iAddressFieldTypes, aFieldCollection, *arr ); - if ( arr->Count() ) - { - HBufC* combined = CombineStringsLC( *arr ); - aArray.AppendL( *combined ); - HGLOG1( HGLOG_INFO, "added '%S'", combined ); - CleanupStack::PopAndDestroy( combined ); - } - - arr->Reset(); - if ( !iHomeAddressFieldTypes ) - { - PreCreateHomeAddressFieldTypesL(); - } - GetTextFieldsL( *iHomeAddressFieldTypes, aFieldCollection, *arr ); - if ( arr->Count() ) - { - HBufC* combined = CombineStringsLC( *arr ); - aArray.AppendL( *combined ); - HGLOG1( HGLOG_INFO, "added '%S'", combined ); - CleanupStack::PopAndDestroy( combined ); - } - - arr->Reset(); - if ( !iWorkAddressFieldTypes ) - { - PreCreateWorkAddressFieldTypesL(); - } - GetTextFieldsL( *iWorkAddressFieldTypes, aFieldCollection, *arr ); - if ( arr->Count() ) - { - HBufC* combined = CombineStringsLC( *arr ); - aArray.AppendL( *combined ); - HGLOG1( HGLOG_INFO, "added '%S'", combined ); - CleanupStack::PopAndDestroy( combined ); - } - - CleanupStack::PopAndDestroy( arr ); - HGLOG_OUT(); - } - - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetWebAddressesL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetWebAddressesL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray, - TWebAddressesType aType ) - { - HGLOG_CONTEXT( GetWebAddressesL, HGLOG_LOCAL ); - HGLOG_IN(); - CVPbkFieldTypeRefsList* addressFieldTypes( NULL ); - - switch ( aType ) - { - case EWebAddresses: - { - if ( !iWebAddressFieldTypes ) - { - PreCreateWebAddressFieldTypesL(); - } - addressFieldTypes = iWebAddressFieldTypes; - } - break; - - case EWebAddressesHome: - { - if ( !iWebAddressHomeFieldTypes ) - { - PreCreateWebAddressHomeFieldTypesL(); - } - addressFieldTypes = iWebAddressHomeFieldTypes; - } - break; - - case EWebAddressesWork: - { - if ( !iWebAddressWorkFieldTypes ) - { - PreCreateWebAddressWorkFieldTypesL(); - } - addressFieldTypes = iWebAddressWorkFieldTypes; - } - break; - - default: - break; - } - - if( addressFieldTypes ) - { - GetTextFieldsL( *addressFieldTypes, aFieldCollection, aArray ); - } - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetThumbnailL -// ---------------------------------------------------------------------------- -EXPORT_C CFbsBitmap* CHgCtxContactMatcher::GetThumbnailL( - MVPbkStoreContactFieldCollection& aFieldCollection ) - { - HGLOG_CONTEXT( GetThumbnailL, HGLOG_LOCAL ); - HGLOG_IN(); - - CFbsBitmap* result = 0; - TVPbkFieldVersitProperty prop; - prop.SetName( EVPbkVersitNamePHOTO ); - const MVPbkFieldType* t = FieldTypes().FindMatch( prop, 0 ); - if ( t ) - { - HGLOG0( HGLOG_INFO, "photo field type found" ); - for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) - { - const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); - const MVPbkFieldType* type = field.BestMatchingFieldType(); - if ( type && type->IsSame( *t ) ) - { - const MVPbkContactFieldData& fdata( field.FieldData() ); - if ( fdata.DataType() == EVPbkFieldStorageTypeBinary ) - { - HGLOG0( HGLOG_INFO, "found thumbnail" ); - const MVPbkContactFieldBinaryData& fdata2 = - MVPbkContactFieldBinaryData::Cast( fdata ); - TPtrC8 data( fdata2.BinaryData() ); - CImageDecoder* decoder = 0; - // DataNewL does not seem to work properly with - // EOptionAlwaysThread, it will hang in WaitForRequest - // for ever, at least in the panel app. - // So write the image to a temporary file (duhhh...) - // and use FileNewL. - RFile f; - TFileName tempFileName; - iFsSession->CreatePrivatePath( EDriveC ); - iFsSession->PrivatePath( tempFileName ); - _LIT( KDriveC, "C:" ); - _LIT( KTempName, "hgctxthumb" ); - tempFileName.Insert( 0, KDriveC ); - tempFileName.Append( KTempName ); - HGLOG1( HGLOG_INFO, "tempfn='%S'", &tempFileName ); - User::LeaveIfError( f.Replace( *iFsSession, tempFileName, - EFileWrite ) ); - f.Write( data, data.Length() ); - f.Close(); - TRAPD( err, decoder = CImageDecoder::FileNewL( *iFsSession, - tempFileName, - CImageDecoder::EOptionAlwaysThread ) ); - HGLOG1( HGLOG_INFO, "decoder NewL result: %d", err ); - if ( err == KErrNone ) - { - CleanupStack::PushL( decoder ); - result = new ( ELeave ) CFbsBitmap; - CleanupStack::PushL( result ); - TSize sz( decoder->FrameInfo().iOverallSizeInPixels ); - TDisplayMode mode( decoder->FrameInfo().iFrameDisplayMode ); - HGLOG3( HGLOG_INFO, "size=%dx%d, mode=%d", sz.iWidth, - sz.iHeight, mode ); - User::LeaveIfError( result->Create( sz, mode ) ); - - TRequestStatus status; - HGLOG0( HGLOG_INFO, "starting to convert" ); - decoder->Convert( &status, *result ); - User::WaitForRequest( status ); - HGLOG1( HGLOG_INFO, "decoder Convert result: %d", - status.Int() ); - CleanupStack::Pop( result ); - CleanupStack::PopAndDestroy( decoder ); - - if ( status.Int() != KErrNone ) - { - delete result; - result = 0; - } - else - { - // stop and return the bitmap - break; - } - } - } - } - } - } - - HGLOG_OUT(); - return result; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::IsPhoneNumberL -// ---------------------------------------------------------------------------- -EXPORT_C TBool CHgCtxContactMatcher::IsPhoneNumberL( const TDesC& aData ) - { - TBool result = EFalse; - CFindItemEngine::SFoundItem item; - CFindItemEngine* search = CFindItemEngine::NewL( aData, - CFindItemEngine::EFindItemSearchPhoneNumberBin ); - if ( search->ItemCount() ) - { - search->Item( item ); - result = item.iStartPos == 0; - } - delete search; - return result; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::IsEmailAddressL -// ---------------------------------------------------------------------------- -EXPORT_C TBool CHgCtxContactMatcher::IsEmailAddressL( const TDesC& aData ) - { - TBool result = EFalse; - CFindItemEngine::SFoundItem item; - CFindItemEngine* search = CFindItemEngine::NewL( aData, - CFindItemEngine::EFindItemSearchMailAddressBin ); - if ( search->ItemCount() ) - { - search->Item( item ); - result = item.iStartPos == 0; - } - delete search; - return result; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetNamesForFindL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetNamesForFindL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray ) - { - CVPbkFieldTypeRefsList* nameTypes = CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( nameTypes ); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( EVPbkVersitNameN ); - prop.SetSubField( EVPbkVersitSubFieldGivenName ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - nameTypes->AppendL( *t ); - } - - prop.SetName( EVPbkVersitNameN ); - prop.SetSubField( EVPbkVersitSubFieldFamilyName ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - nameTypes->AppendL( *t ); - } - - for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) - { - const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); - t = field.MatchFieldType( 0 ); - if ( t && nameTypes->ContainsSame( *t ) ) - { - const MVPbkContactFieldData& fdata( field.FieldData() ); - if ( fdata.DataType() == EVPbkFieldStorageTypeText ) - { - const MVPbkContactFieldTextData& fdata2 = - MVPbkContactFieldTextData::Cast( fdata ); - aArray.AppendL( fdata2.Text() ); - } - } - } - - CleanupStack::PopAndDestroy( nameTypes ); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetNamesForFindL -// ---------------------------------------------------------------------------- -EXPORT_C HBufC* CHgCtxContactMatcher::GetNamesForFindL( - MVPbkStoreContactFieldCollection& aFieldCollection ) - { - CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); - CleanupStack::PushL( arr ); - GetNamesForFindL( aFieldCollection, *arr ); - HBufC* result = CombineStringsLC( *arr ); - CleanupStack::Pop( result ); - CleanupStack::PopAndDestroy( arr ); - return result; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::SplitFindStringL -// ---------------------------------------------------------------------------- -EXPORT_C CDesCArray* CHgCtxContactMatcher::SplitFindStringL(const TDesC& aFindString) - { - CDesCArray* wordArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( wordArray ); - - TVPbkWordParserCallbackParam parser( &aFindString, wordArray ); - FindWordSplitterL( &parser ); - - CleanupStack::Pop(); // wordArray - return parser.iWordArray; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::SplitMsgContactL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::SplitMsgContactL( const TDesC& aString, - CDesCArray& aArray ) - { - TInt pos = aString.Locate( '<' ); - if ( pos >= 0 ) - { - // skip spaces before '<' - TInt endPos = pos - 1; - while ( endPos > 0 && TChar( aString[endPos] ).IsSpace() ) - { - --endPos; - } - // take the text before '<' - aArray.AppendL( aString.Left( endPos + 1 ) ); - // take the text between '<' and '>' - TInt closePos = aString.Locate( '>' ); - if ( closePos > pos ) - { - aArray.AppendL( aString.Mid( pos + 1, closePos - pos - 1 ) ); - } - } - else - { - aArray.AppendL( aString ); - } - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetCustomFieldL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetCustomFieldL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray& aArray, - TVPbkFieldTypeName aVersitName, - TVPbkFieldTypeParameter aVersitParam ) - { - HGLOG_CONTEXT( GetCustomFieldL, HGLOG_LOCAL ); - HGLOG_IN(); - - CVPbkFieldTypeRefsList* typeList = GetCustomFieldTypeLC( - aVersitName, aVersitParam ); - - GetTextFieldsL( *typeList, aFieldCollection, aArray ); - - CleanupStack::PopAndDestroy( typeList ); - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetCustomFieldTypeLC -// ---------------------------------------------------------------------------- -EXPORT_C CVPbkFieldTypeRefsList* CHgCtxContactMatcher::GetCustomFieldTypeLC( - TVPbkFieldTypeName aVersitName, - TVPbkFieldTypeParameter aVersitParam ) - { - HGLOG_CONTEXT( GetCustomFieldTypeLC, HGLOG_LOCAL ); - HGLOG_IN(); - - CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( typeList ); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - - prop.SetName( aVersitName ); - prop.Parameters().Add( aVersitParam ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - typeList->AppendL( *t ); - HGLOG0( HGLOG_INFO, "field found" ); - } - - HGLOG_OUT(); - return typeList; - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::GetImppFieldL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::GetImppFieldL( - MVPbkStoreContactFieldCollection& aFieldCollection, - CDesCArray* aSchemeOnlyArray, - CDesCArray* aUriOnlyArray, - CDesCArray* aFullArray ) - { - HGLOG_CONTEXT( GetImppFieldL, HGLOG_LOCAL ); - HGLOG_IN(); - - // this function will not build on TUBE - CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( typeList ); - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* t; - prop.SetName( EVPbkVersitNameIMPP ); - t = types.FindMatch( prop, 0 ); - if ( t ) - { - typeList->AppendL( *t ); - HGLOG0( HGLOG_INFO, "type found" ); - } - for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) - { - const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); - const MVPbkFieldType* type = field.BestMatchingFieldType(); - if ( type && typeList->ContainsSame( *type ) ) - { - const MVPbkContactFieldData& fdata( field.FieldData() ); - HGLOG1( HGLOG_INFO, "field found %d", fdata.DataType() ); - if ( fdata.DataType() == EVPbkFieldStorageTypeUri ) - { - const MVPbkContactFieldUriData& fdata2 = - MVPbkContactFieldUriData::Cast( fdata ); - const TDesC& schemeOnly( fdata2.Scheme() ); - const TDesC& uriOnly( fdata2.Text() ); - const TDesC& fullText( fdata2.Uri() ); - HGLOG3( HGLOG_INFO, "'%S' + '%S' = '%S'", - &schemeOnly, &uriOnly, &fullText ); - if ( aSchemeOnlyArray ) - { - aSchemeOnlyArray->AppendL( schemeOnly ); - } - if ( aUriOnlyArray ) - { - aUriOnlyArray->AppendL( uriOnly ); - } - if ( aFullArray ) - { - aFullArray->AppendL( fullText ); - } - } - } - } - CleanupStack::PopAndDestroy( typeList ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::FindContactWithBirthdayL -// ---------------------------------------------------------------------------- -EXPORT_C void CHgCtxContactMatcher::FindContactWithBirthdayL( - const TTime& aDate, - CVPbkContactLinkArray& aLinkArray ) - { - HGLOG_CONTEXT( FindContactWithBirthdayL, HGLOG_LOCAL ); - HGLOG1_IN( "%Ld", aDate.Int64() ); - - // extract month and day - TDateTime dt = aDate.DateTime(); - TInt month = dt.Month(); - TInt day = dt.Day(); - HGLOG2( HGLOG_INFO, "wanted month = %d day = %d", month, day ); - - CVPbkFieldTypeRefsList* emptyList = CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( emptyList ); - - // create view with all contacts - CVPbkContactViewDefinition* def = CVPbkContactViewDefinition::NewLC(); - def->SetType( EVPbkContactsView ); - def->SetUriL( VPbkContactStoreUris::DefaultCntDbUri() ); - MVPbkContactViewBase* view = iContactManager->CreateContactViewLC( - *this, *def, *emptyList ); - - HGLOG0( HGLOG_INFO, "starting wait" ); - iASchedulerWait.Start(); - HGLOG0( HGLOG_INFO, "after wait" ); - - // view is ready - TInt ctCount = view->ContactCountL(); - HGLOG1( HGLOG_INFO, "contact count: %d", ctCount ); - - // find the birthday field type - const MVPbkFieldTypeList& types( FieldTypes() ); - TVPbkFieldVersitProperty prop; - const MVPbkFieldType* bdayFt; - prop.SetName( EVPbkVersitNameBDAY ); - prop.SetSubField( EVPbkVersitSubFieldNone ); - bdayFt = types.FindMatch( prop, 0 ); - - if ( bdayFt && ctCount ) - { - HGLOG0( HGLOG_INFO, "found bday field type" ); - TTime nullTime( KNullTime ); - // go through all contacts and check birthday field values - for ( TInt i = 0; i < ctCount; ++i ) - { - MVPbkContactLink* link( view->CreateLinkLC( i ) ); - MVPbkStoreContact* contact = 0; - GetStoreContactL( *link, &contact ); - if ( contact ) - { - HGLOG1( HGLOG_INFO, "got contact, idx %d", i ); - contact->PushL(); - TTime bday; - bday = GetFieldDataDateTimeL( *contact, *bdayFt ); - if ( bday != nullTime ) - { - HGLOG1( HGLOG_INFO, "found bday %Ld", bday.Int64() ); - dt = bday.DateTime(); - TInt thisMonth = dt.Month(); - TInt thisDay = dt.Day(); - HGLOG2( HGLOG_INFO, "for this contact month = %d day = %d", - thisMonth, thisDay ); - if ( thisMonth == month && thisDay == day ) - { - HGLOG0( HGLOG_INFO, "match" ); - aLinkArray.AppendL( link ); - link = 0; - } - } - CleanupStack::PopAndDestroy(); // contact - } - CleanupStack::Pop(); // if matched then no ownership and link is NULL by now - delete link; - } - } - - CleanupStack::PopAndDestroy(); // view - CleanupStack::PopAndDestroy( def ); - CleanupStack::PopAndDestroy( emptyList ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactViewReady -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::ContactViewReady( - MVPbkContactViewBase& aView ) - { - HGLOG_CONTEXT( ContactViewReady, HGLOG_LOCAL ); - HGLOG_IN(); - - if ( iASchedulerWait.IsStarted() ) - { - iASchedulerWait.AsyncStop(); - } - - aView.RemoveObserver( *this ); - - HGLOG_OUT(); - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactViewUnavailable -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::ContactViewUnavailable( - MVPbkContactViewBase& /*aView*/ ) - { - // means that view is unavailable for now - // but ContactViewReady will be called at some point - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactAddedToView -// ---------------------------------------------------------------------------- -void CHgCtxContactMatcher::ContactAddedToView( - MVPbkContactViewBase& /*aView*/, - TInt /*aIndex*/, - const MVPbkContactLink& /*aContactLink*/ ) - { - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactRemovedFromView -// ---------------------------------------------------------------------------- - void CHgCtxContactMatcher::ContactRemovedFromView( - MVPbkContactViewBase& /*aView*/, - TInt /*aIndex*/, - const MVPbkContactLink& /*aContactLink*/ ) - { - } - -// ---------------------------------------------------------------------------- -// CHgCtxContactMatcher::ContactViewError -// ---------------------------------------------------------------------------- - void CHgCtxContactMatcher::ContactViewError( - MVPbkContactViewBase& aView, - TInt aError, - TBool /*aErrorNotified*/ ) - { - HGLOG_CONTEXT( ContactViewError, HGLOG_LOCAL ); - HGLOG1_IN( "aError = %d", aError ); - - if ( iASchedulerWait.IsStarted() ) - { - iASchedulerWait.AsyncStop(); - } - - aView.RemoveObserver( *this ); - - HGLOG_OUT(); - } - - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api.cpp --- a/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: T_ui_context_utility_api class member functions -* -*/ - - - -// INCLUDE FILES -#include -#include -#include -#include "hgcontextutilityimpl.h" -#include "hgcontextutility.h" -#include "hgcontexttypes.h" -#include "hgtestbasemacros.h" -#include "T_ui_context_utility_api.h" -#include "wait.h" -#include "hgtestbasemacros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CT_ui_context_utility_api::CT_ui_context_utility_api -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CT_ui_context_utility_api::CT_ui_context_utility_api() - { - iTestDllName = _L("CT_ui_context_utility_api").AllocL(); - } - -// ----------------------------------------------------------------------------- -// CT_ui_context_utility_api::ConstructL -// Symbian 2nd phase constructor can leave. -// -// Note: If OOM test case uses STIF Logger, then STIF Logger must be created -// with static buffer size parameter (aStaticBufferSize). Otherwise Logger -// allocates memory from heap and therefore causes error situations with OOM -// testing. For more information about STIF Logger construction, see STIF Users -// Guide. -// ----------------------------------------------------------------------------- -// -void CT_ui_context_utility_api::ConstructL() - { - CHgTestBase::BaseConstructL( KT_ui_context_utility_apiLogPath, - KT_ui_context_utility_apiLogFile ); - } - -// ----------------------------------------------------------------------------- -// CT_ui_context_utility_api::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CT_ui_context_utility_api* CT_ui_context_utility_api::NewL() - { - CT_ui_context_utility_api* self = new (ELeave) CT_ui_context_utility_api; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CT_ui_context_utility_api::~CT_ui_context_utility_api() - { - - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point -// Returns: CTestModuleBase*: Pointer to Test Module object -// ----------------------------------------------------------------------------- -// -EXPORT_C CTestModuleBase* LibEntryL() - { - return CT_ui_context_utility_api::NewL(); - } - -// ----------------------------------------------------------------------------- -// SetRequirements handles test module parameters(implements evolution -// version 1 for test module's heap and stack sizes configuring). -// Returns: TInt: Symbian error code. -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, - TUint32& /*aParameterValid*/ ) - { - return KErrNone; - } - -//// ----------------------------------------------------------------------------- -//// CT_ui_context_utility_api::RunTestL -//// Method responsible for enumerating and running test cases (and also setup and teardown activities before -//// and after each test case). -//// ----------------------------------------------------------------------------- -TInt CT_ui_context_utility_api::RunTestL( - CT_ui_context_utility_api::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult ) - { - TInt _test_case_no = -1; - //test cases, setup and teardown include - - - if( aRunReason == CHgTestBase::ERunTestCase ) - { - LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult); - LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); - LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult); - CreateEnvL(); - _test_case_no = -1; - TRAPD( - errCode, - LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult); - LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); - LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult); - ) - DestroyEnv(); - User::LeaveIfError( errCode ); - } - else - { - LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); - } - - return _test_case_no; - } - -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -void CT_ui_context_utility_api::CreateEnvL() - { - CActiveScheduler::Install ( NULL ); - ENV_cleanup = CTrapCleanup::New(); - TInt ENV_err = KErrNone; - ENV_env = new CEikonEnv; - if ( ENV_env ) - { - TRAP( ENV_err, ENV_env->ConstructL() ); - if ( ENV_err ) - { - return; - } - ENV_aknAppUI = new CAknAppUi; - if (ENV_aknAppUI) - { - TRAP( ENV_err, ENV_aknAppUI->BaseConstructL( CEikAppUi::ENoAppResourceFile ) ); \ - if ( ENV_err ) - { - return; - } - } - } - } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -void CT_ui_context_utility_api::DestroyEnv() - { - TInt KWait( 500000 ); - CActiveSchedulerWait* wait = new (ELeave) CActiveSchedulerWait(); - CPeriodic* periodic = CPeriodic::NewL( CActive::EPriorityIdle ); - periodic->Start(KWait, KWait, TCallBack( CHgTestBase::CallStop, wait ) ); - wait->Start(); - delete periodic; - delete wait; - - if ( ENV_aknAppUI ) - { - ENV_aknAppUI->PrepareToExit(); - } - if ( ENV_env ) - { - ENV_env->DestroyEnvironment(); - } - if( ENV_cleanup ) - { - delete ENV_cleanup; - } - CActiveScheduler::Install ( iActiveScheduler ); - } -// ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- -TInt CT_ui_context_utility_api::LoadTestCasesL( - TInt& _test_case_no, - CT_ui_context_utility_api::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult) - { -#define TEST_CASES - #include "..\src\T_ui_context_utility_api_cases.cpp" -#undef TEST_CASES - return KErrNone; - } -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api_cases.cpp --- a/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api_cases.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1025 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: T_ui_context_utility_api test module. -* -*/ - - -// DEFINITION OF GLOBAL VARIABLES -#ifdef TEST_VAR_DECLARATIONS -// here You can define global objects used all over code -CHgContextUtility* iContextUtility; -#endif - -// testing code starts here -#ifdef TEST_CASES - -#ifndef KNAME -#define KNAME -_LIT(KName,"James Bond"); -#endif - -// STIF_SETUP defines activities needed before every test case. -STIF_SETUP - { - iContextUtility = CHgContextUtility::NewL(); - return KErrNone; - } - -// STIF_TEARDOWN defines activities needed after every test case -STIF_TEARDOWN - { - delete iContextUtility; - return KErrNone; - } - -// a Canary test to verify test environment. -STIF_TESTDEFINE( CanaryTest ) -{ - -} - -STIF_TESTDEFINE( T_MemoryOnlyTest ) -{ - /*private implementation IsForeground - cant be covered by tests because covered by previous condition*/ - iContextUtility->AllowPublishFromBackground( ETrue ); - iContextUtility->AllowPublishFromBackground( EFalse ); - return KErrNone; -} -//Test code for testing PublishContextL function call -STIF_TESTDEFINE( T_PublishContextL ) - { - // publish the Hg.Contact context to CF - iContextUtility->PublishContextL( KHgCFTypeContact, KName ); - //private implementation with dalay cant be covered by test because its never called - return KErrNone; - } - -//Test code for testing T_PublishContextDelayedL function call -STIF_TESTDEFINE( T_PublishContextDelayedL ) - { - // publish the Hg.Contact context to CF - iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,50000); - iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,0); - return KErrNone; - } - -//Test code for testing GetContextL function call -STIF_TESTDEFINE( T_GetContextL ) - { - HBufC* icontext = iContextUtility->GetContextL( _L( "NonExistContextType" )); - - STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) ); - delete icontext; - - // publish the Hg.Contact context to CF - iContextUtility->PublishContextL( KHgCFTypeContact, KName ); - - icontext = iContextUtility->GetContextL( KHgCFTypeContact); - - STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) ); - delete icontext; - - return KErrNone; - } - -//Test code for testing GetContextL function call -STIF_TESTDEFINE( T_GetContextLWithContextSource ) - { - HBufC* icontext = iContextUtility->GetContextL(KHgCFSource,_L( "NonExistContextType" )); - - STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) ); - delete icontext; - - // publish the Hg.Contact context to CF - iContextUtility->PublishContextL( KHgCFTypeContact, KName ); - - icontext = iContextUtility->GetContextL(KHgCFSource,KHgCFTypeContact); - - STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) ); - delete icontext; - - return KErrNone; - } - -//Test code for testing spliting combined context -STIF_TESTDEFINE( T_SplitCombinedStringL ) - { - HBufC* val( NULL ); - _LIT( KDummyContext, "CtxUtilApiTest" ); - const TInt KArrayGranularity( 3 ); - CDesCArray* sourceArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); - CDesCArray* resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); - CleanupStack::PushL( sourceArray ); - CleanupStack::PushL( resultArray ); - - iContextUtility->PublishContextL( KDummyContext, *sourceArray ); - //Can't be verified if current context is NULL, because could be already published - - sourceArray->AppendL( _L( "https://somedomain.com?param=parmaValue" ) ); - iContextUtility->PublishContextL( KDummyContext, *sourceArray );//there only one value. nothing to combine but returned value should be equal - val = iContextUtility->GetContextL( KDummyContext ); - CleanupStack::PushL( val ); - STIF_ASSERT_TRUE( val && val->Length() ); - CHgContextUtility::SplitCombinedStringL( *val, *resultArray ); - CleanupStack::PopAndDestroy(val); - STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() ); - for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter ) - { - STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) ); - } - CleanupStack::PopAndDestroy(resultArray); - - resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); - CleanupStack::PushL( resultArray ); - sourceArray->AppendL( _L( "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" )); - sourceArray->AppendL( _L( "!@#$%^&&*()/\<>[]|~,." ) ); - - iContextUtility->PublishContextL( KDummyContext, *sourceArray ); - - val = iContextUtility->GetContextL( KDummyContext ); - STIF_ASSERT_TRUE( val && val->Length() ); - CleanupStack::PushL(val); - CHgContextUtility::SplitCombinedStringL( *val, *resultArray ); - CleanupStack::PopAndDestroy( val ); - STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() ); - for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter ) - { - STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) ); - } - CleanupStack::PopAndDestroy(resultArray); - CleanupStack::PopAndDestroy(sourceArray); - return KErrNone; - } - -//Test code for testing PublishContextL with array argument -STIF_TESTDEFINE( T_PublishContextLWithArray ) - { - _LIT( KDummyContext, "CtxUtilApiTest" ); - CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); - CleanupStack::PushL( arr ); - - iContextUtility->PublishContextL( KDummyContext, *arr ); - - arr->AppendL( _L( "first item" ) ); - arr->AppendL( _L( "second item" ) ); - arr->AppendL( _L( "third item" ) ); - iContextUtility->PublishContextL( KDummyContext, *arr ); - HBufC* val = iContextUtility->GetContextL( KDummyContext ); - STIF_ASSERT_TRUE( val && val->Length() ); - delete val; - CleanupStack::PopAndDestroy( arr ); - return KErrNone; - } - -//Test code for testing PublishContextDelayedL with array argument -STIF_TESTDEFINE( T_PublishContextDelayedLWithArray ) - { - _LIT( KDummyContext, "CtxUtilApiTest2" ); - CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); - CleanupStack::PushL( arr ); - arr->AppendL( _L( "first item" ) ); - arr->AppendL( _L( "second item" ) ); - arr->AppendL( _L( "third item" ) ); - iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 ); - iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 0 ); - iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 ); - CWait* wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - HBufC* val = iContextUtility->GetContextL( KDummyContext ); - STIF_ASSERT_TRUE( val && val->Length() ); - delete val; - CleanupStack::PopAndDestroy( arr ); - return KErrNone; - } - -//Test code for testing RePublishWhenFgL with different arguments -//Most probably nothing will happen because there is no CCoeEnv but -//it should never crash. -STIF_TESTDEFINE( T_RePublishWhenFgL ) - { - iContextUtility->RePublishWhenFgL( ETrue ); - iContextUtility->RePublishWhenFgL( EFalse ); - iContextUtility->RePublishWhenFgL( ETrue ); - return KErrNone; - } - -/* IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL1 ) - { - CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); - m->OpenDefaultMatchStoresL(); - CVPbkContactManager& cm( m->GetContactManager() ); - MVPbkContactStoreList& sl( m->GetContactStoresL() ); - MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); - const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); - MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); - MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); - _LIT(KName, "ctxutiltester"); - textData->SetTextL( KName ); - newContact->AddFieldL(newField); - CleanupStack::Pop(newField); - CWait* wait = CWait::NewLC(); - struct TDummyObs : public MVPbkContactObserver - { - CWait* iWait; - TDummyObs( CWait* aWait ) : iWait( aWait ) { } - void ContactOperationCompleted(TContactOpResult /*aResult*/) - { - iWait->Stop(); - } - void ContactOperationFailed(TContactOp /*aOpCode*/, - TInt /*aErrorCode*/, - TBool /*aErrorNotified*/) { } - } dummyObs( wait ); - newContact->CommitL( dummyObs ); - wait->Start( 2000000 ); - CleanupStack::PopAndDestroy( wait ); - - iContextUtility->PublishContactContextL( *newContact, 0 ); - iContextUtility->PublishContactContextL( *newContact, 500000 ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); - ca->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - wait = CWait::NewL(); - struct TDummyObs2 : public MVPbkBatchOperationObserver - { - CWait* iWait; - TDummyObs2( CWait* aWait ) : iWait( aWait ) { } - void StepComplete( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/ ) { } - TBool StepFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/, TInt /*aError*/ ) - { - return EFalse; - } - void OperationComplete( - MVPbkContactOperationBase& /*aOperation*/ ) - { - iWait->Stop(); - } - } dummyObs2( wait ); - MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); - CleanupDeletePushL( op ); - wait->Start( 2000000 ); - delete wait; - CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m - - return KErrNone; - } - -/* IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL2 ) - { - CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); - m->OpenDefaultMatchStoresL(); - CVPbkContactManager& cm( m->GetContactManager() ); - MVPbkContactStoreList& sl( m->GetContactStoresL() ); - MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); - const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); - MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); - MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); - _LIT(KName, "ctxutiltester"); - textData->SetTextL( KName ); - newContact->AddFieldL(newField); - CleanupStack::Pop(newField); - CWait* wait = CWait::NewL(); - struct TDummyObs : public MVPbkContactObserver - { - CWait* iWait; - TDummyObs( CWait* aWait ) : iWait( aWait ) { } - void ContactOperationCompleted(TContactOpResult /*aResult*/) - { - iWait->Stop(); - } - void ContactOperationFailed(TContactOp /*aOpCode*/, - TInt /*aErrorCode*/, - TBool /*aErrorNotified*/){ } - } dummyObs( wait ); - newContact->CommitL( dummyObs ); - wait->Start( 2000000 ); - delete wait; - - CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); - ca->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - - iContextUtility->PublishContactContextL( ca->At( 0 ), 0 ); - iContextUtility->PublishContactContextL( ca->At( 0 ), 500000 ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - wait = CWait::NewL(); - struct TDummyObs2 : public MVPbkBatchOperationObserver - { - CWait* iWait; - TDummyObs2( CWait* aWait ) : iWait( aWait ) { } - void StepComplete( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/ ) { } - TBool StepFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/, TInt /*aError*/ ) - { - return EFalse; - } - void OperationComplete( - MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } - } dummyObs2( wait ); - MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); - CleanupDeletePushL( op ); - wait->Start( 2000000 ); - delete wait; - - // test with (surely) non-existing link - iContextUtility->PublishContactContextL( ca->At( 0 ) ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - - CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m - - return KErrNone; - } - -/* IMPORT_C void PublishContactContextL( const TDesC& aContactName, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL3 ) - { - iContextUtility->PublishContactContextL( KName ); - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - iContextUtility->PublishContactContextL( KName, 500000 ); - iContextUtility->PublishContactContextL( KName, 500000 ); - iContextUtility->PublishContactContextL( KName, 500000 ); - ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - return KErrNone; - } - -/* IMPORT_C void PublishContactContextL( - const RPointerArray& aContacts, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL4 ) - { - CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); - m->OpenDefaultMatchStoresL(); - CVPbkContactManager& cm( m->GetContactManager() ); - MVPbkContactStoreList& sl( m->GetContactStoresL() ); - MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); - const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); - MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); - MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); - _LIT(KName, "ctxutiltester"); - textData->SetTextL( KName ); - newContact->AddFieldL(newField); - CleanupStack::Pop(newField); - CWait* wait = CWait::NewL(); - struct TDummyObs : public MVPbkContactObserver - { - CWait* iWait; - TDummyObs( CWait* aWait ) : iWait( aWait ) { } - void ContactOperationCompleted(TContactOpResult /*aResult*/) { iWait->Stop(); } - void ContactOperationFailed(TContactOp /*aOpCode*/, TInt /*aErrorCode*/, TBool /*aErrorNotified*/) { } - } dummyObs( wait ); - newContact->CommitL( dummyObs ); - wait->Start( 2000000 ); - delete wait; - - RPointerArray pa; - CleanupClosePushL( pa ); - pa.AppendL( newContact ); - iContextUtility->PublishContactContextL( pa, 0 ); - iContextUtility->PublishContactContextL( pa, 500000 ); - CleanupStack::PopAndDestroy( &pa ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - RPointerArray pa2; - CleanupClosePushL( pa2 ); - pa2.AppendL( newContact ); - pa2.AppendL( newContact ); - pa2.AppendL( newContact ); - pa2.AppendL( newContact ); - iContextUtility->PublishContactContextL( pa2, 500000 ); - iContextUtility->PublishContactContextL( pa2, 0 ); - CleanupStack::PopAndDestroy( &pa2 ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); - ca->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - wait = CWait::NewL(); - struct TDummyObs2 : public MVPbkBatchOperationObserver - { - CWait* iWait; - TDummyObs2( CWait* aWait ) : iWait( aWait ) { } - void StepComplete( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/ ) { } - TBool StepFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/, TInt /*aError*/ ) - { - return EFalse; - } - void OperationComplete( - MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } - } dummyObs2( wait ); - MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); - CleanupDeletePushL( op ); - wait->Start( 2000000 ); - delete wait; - CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m - - return KErrNone; - } - -/* IMPORT_C void PublishContactContextL( - const RPointerArray& aContactLinks, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL5 ) - { - CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); - m->OpenDefaultMatchStoresL(); - CVPbkContactManager& cm( m->GetContactManager() ); - MVPbkContactStoreList& sl( m->GetContactStoresL() ); - MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); - const MVPbkFieldType* fieldType = - m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); - MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); - MVPbkContactFieldTextData* textData = - &(MVPbkContactFieldTextData::Cast(newField->FieldData())); - _LIT(KName, "ctxutiltester"); - textData->SetTextL( KName ); - newContact->AddFieldL(newField); - CleanupStack::Pop(newField); - CWait* wait = CWait::NewL(); - struct TDummyObs : public MVPbkContactObserver - { - CWait* iWait; - TDummyObs( CWait* aWait ) : iWait( aWait ) { } - void ContactOperationCompleted(TContactOpResult /*aResult*/) - { - iWait->Stop(); - } - void ContactOperationFailed(TContactOp /*aOpCode*/, - TInt /*aErrorCode*/, - TBool /*aErrorNotified*/) { } - } dummyObs( wait ); - newContact->CommitL( dummyObs ); - wait->Start( 2000000 ); - delete wait; - - CVPbkContactLinkArray* pa = CVPbkContactLinkArray::NewLC(); - pa->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - iContextUtility->PublishContactContextL( *pa, 0 ); - iContextUtility->PublishContactContextL( *pa, 500000 ); - CleanupStack::PopAndDestroy( pa ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - CVPbkContactLinkArray* pa2 = CVPbkContactLinkArray::NewLC(); - pa2->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - pa2->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - pa2->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - iContextUtility->PublishContactContextL( *pa2, 500000 ); - iContextUtility->PublishContactContextL( *pa2, 0 ); - CleanupStack::PopAndDestroy( pa2 ); - wait = CWait::NewL(); - wait->Start( 2000000 ); - delete wait; - ctx = iContextUtility->GetContextL( KHgCFTypeContact); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - - CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); - ca->AppendL( newContact->CreateLinkLC() ); - CleanupStack::Pop(); - wait = CWait::NewL(); - struct TDummyObs2 : public MVPbkBatchOperationObserver - { - CWait* iWait; - TDummyObs2( CWait* aWait ) : iWait( aWait ) { } - void StepComplete( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/ ) { } - TBool StepFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/, TInt /*aError*/ ) - { - return EFalse; - } - void OperationComplete( - MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } - } dummyObs2( wait ); - MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); - CleanupDeletePushL( op ); - wait->Start( 2000000 ); - delete wait; - CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m - - return KErrNone; - } - -/*IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishContactContextL6 ) - { - CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); - CleanupStack::PushL( arr ); - arr->AppendL( _L( "first item" ) ); - arr->AppendL( _L( "second item" ) ); - arr->AppendL( _L( "third item" ) ); - iContextUtility->PublishContactContextL( *arr ); - iContextUtility->PublishContactContextL( *arr, 500000 ); - iContextUtility->PublishContactContextL( *arr ); - CleanupStack::PopAndDestroy( arr ); - return KErrNone; - } - -/* IMPORT_C void PublishTextContextL( const TDesC& aText, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishTextContextL ) - { - iContextUtility->PublishTextContextL( KNullDesC, 100 ); - iContextUtility->PublishTextContextL( _L("fbngiuwetghorb rteogvhetui gherigth" ) ); - iContextUtility->PublishTextContextL( KNullDesC ); - iContextUtility->PublishTextContextL( _L("+35442754") ); - iContextUtility->PublishTextContextL( _L("35442754") ); - iContextUtility->PublishTextContextL( _L("abcdef@ghijk.com") ); - iContextUtility->PublishTextContextL( _L(" " ) ); - return KErrNone; - } - -/* IMPORT_C void PublishUrlContextL( const TDesC& aUrl, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishUrlContextL ) - { - _LIT( KNokiaDomain, "http://www.nokia.com" ); - _LIT( KSomeDomain, "http://www.somedomain.com" ); - iContextUtility->PublishUrlContextL( KNokiaDomain, 1000 ); - iContextUtility->PublishUrlContextL( KSomeDomain ); - iContextUtility->PublishUrlContextL( KNokiaDomain ); - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeUrl ); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - STIF_ASSERT_TRUE( 0 == ctx->Compare( KNokiaDomain ) ); - delete ctx; - return KErrNone; - } - -/* IMPORT_C void PublishTimeContextL( const TTime& aTime, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishTimeContextL ) - { - TTime t( 0 ); - iContextUtility->PublishTimeContextL( t, 100 ); - iContextUtility->PublishTimeContextL( t ); - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeActiveDate ); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - delete ctx; - return KErrNone; - } - -/* IMPORT_C void PublishPhotoContextL( const TDesC& aFilename, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishPhotoContextL ) - { - _LIT( KJpegPath, "c:\\image.jpg" ); - _LIT( KPngPath, "c:\\image.png" ); - iContextUtility->PublishPhotoContextL( KJpegPath, 100 ); - iContextUtility->PublishPhotoContextL( KPngPath, 0 ); - iContextUtility->PublishPhotoContextL( KJpegPath ); - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypePhoto ); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) ); - delete ctx; - - iContextUtility->PublishPhotoContextL( KPngPath, 100000 ); - ctx = iContextUtility->GetContextL( KHgCFTypePhoto ); - STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); - STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) ); - delete ctx; - return KErrNone; - } - -/* IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId, - CMdESession& aMdeSession, - const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ -STIF_TESTDEFINE( T_PublishPhotoContextL2 ) - { - CWait* wait = CWait::NewLC(); - struct TObs : public MMdESessionObserver { - CWait* iWait; - TObs( CWait* aWait ) : iWait( aWait ) { } - void HandleSessionOpened( CMdESession& /*aSession*/, TInt /*aError*/ ) { iWait->Stop(); } - void HandleSessionError( CMdESession& /*aSession*/, TInt /*aError*/ ) { } - } mdeobs( wait ); - CMdESession* s = CMdESession::NewLC( mdeobs ); - wait->Start( 5000000 ); - // invalid item id - TRAPD( err, iContextUtility->PublishPhotoContextL( 0, *s ) ); - STIF_ASSERT_TRUE( err != KErrNone ); // leave should have occured - for ( TInt i = 0; i < 100; ++i ) - { - TRAP_IGNORE( iContextUtility->PublishPhotoContextL( TItemId( i ), *s ) ); - } - CleanupStack::PopAndDestroy( 2 ); - return KErrNone; - } - -/* IMPORT_C void PublishTvContextL( const TDesC& aChannelName, - const TDesC& aProgramName, const TDesC& aProgramDescription, - const TDesC& aGenre ); */ -STIF_TESTDEFINE( T_PublishTvContextL ) - { - _LIT( K1, "channel A" ); - _LIT( K2, "program X" ); - _LIT( K3, "very interesting program" ); - iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC ); - iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC ); - iContextUtility->PublishTvContextL( K1, K2, KNullDesC, KNullDesC ); - HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeTvProgramName ); - STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( K2 ), - _L( "Context not found" ) ); - delete ctx; - - iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC ); - iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, KNullDesC ); - iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC ); - iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, _L("movie") ); - ctx = iContextUtility->GetContextL( KHgCFTypeTvChannelName ); - STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( KHgCFValueUnknownInfo ), - _L( "Context not found" ) ); - delete ctx; - return KErrNone; - } - -/* IMPORT_C void PublishServiceIdL( const TDesC& aServiceId, - const TDesC& aAccountId, - const TTimeIntervalMicroSeconds32& aDelay = 0 ); */ -STIF_TESTDEFINE( T_PublishServiceIdL ) - { - iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") ); - iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid"), 1000000 ); - iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") ); - } - -/* IMPORT_C void AddMusicContextInfoL( - const TDesC& aKey, - const TDesC& aData ); */ -STIF_TESTDEFINE( T_AddMusicContextInfoL ) - { - // Fetch the pointer to hash table for testing purposes - RPtrHashMap* hash = GetImplHashTablePtr(); - _LIT( KPlaying, "Playing" ); - _LIT( KArtist, "Hans Zimmer"); - _LIT( KTitle, "Why so serious" ); - _LIT( KAlbum, "Dark Knight" ); - _LIT( KGenre, "Soundtrack" ); - - STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L("There is stuff in the list!") ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicState ) == NULL, _L( "State in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicArtist ) == NULL, _L( "Artist in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicTitle ) == NULL, _L( "Title in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbum ) == NULL, _L( "Album in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbumArt ) == NULL, _L( "Art in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicUri ) == NULL, _L( "Uri in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicGenre ) == NULL, _L( "Genre in the list!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicType ) == NULL, _L( "Type in the list!" ) ); - - // No room for empty keys - TRAPD( err, iContextUtility->AddMusicContextInfoL( KNullDesC, KPlaying ) ); - STIF_ASSERT_TRUE_DESC( err == KErrNotFound, _L( "Empty key didn't cause leave!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); - - // Fill all values and test they will be there. - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicUri, KNullDesC ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicGenre, KGenre ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicType, KHgCFValueMusicTypePlayer ); - - STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items." ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicState )->CompareC( KPlaying ), - _L( "Wrong state in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicArtist )->CompareC( KArtist ), - _L( "Wrong artist in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicTitle )->CompareC( KTitle ), - _L( "Wrong title in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbum )->CompareC( KAlbum ), - _L( "Wrong album in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbumArt )->CompareC( KHgCFValueUnknownInfo ), - _L( "Wrong art in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicUri )->CompareC( KHgCFValueUnknownInfo ), - _L( "Wrong uri in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicGenre )->CompareC( KGenre ), - _L( "Wrong genre in the table!" ) ); - STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicType )->CompareC( KHgCFValueMusicTypePlayer ), - _L( "Wrong type in the table!" ) ); - - // An attempt to add same key twice, causes problems. - TRAP( err, iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ) ); - STIF_ASSERT_TRUE_DESC( err == KErrAlreadyExists, _L( "Adding same key should cause a leave!" ) ); - STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items!" ) ); - - return KErrNone; - } - -/** IMPORT_C void PublishMusicContextL( - const TTimeIntervalMicroSeconds32& aDelay = 0 ); */ -STIF_TESTDEFINE( T_PublishMusicContextL ) - { - RPtrHashMap* hash = GetImplHashTablePtr(); - _LIT( KPlaying, "Playing" ); - _LIT( KArtist, "John Williams"); - _LIT( KTitle, "Raiders March" ); - _LIT( KAlbum, "Raiders of the Lost Ark" ); - - STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); - TRAPD( err, iContextUtility->PublishMusicContextL() ); - STIF_ASSERT_TRUE_DESC( err == KErrNotReady, _L( "No point to publish anything, when list is empty!" ) ); - - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum ); - iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo ); - - iContextUtility->PublishMusicContextL(); - STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); - - HBufC* musicState = iContextUtility->GetContextL( KHgCFTypeMusicState ); - HBufC* musicArtist = iContextUtility->GetContextL( KHgCFTypeMusicArtist ); - HBufC* musicTitle = iContextUtility->GetContextL( KHgCFTypeMusicTitle ); - HBufC* musicAlbum = iContextUtility->GetContextL( KHgCFTypeMusicAlbum ); - HBufC* musicAlbumArt = iContextUtility->GetContextL( KHgCFTypeMusicAlbumArt ); - HBufC* musicGeneralUri = iContextUtility->GetContextL( KHgCFTypeMusicUri ); - HBufC* musicGenre = iContextUtility->GetContextL( KHgCFTypeMusicGenre ); - HBufC* musicType = iContextUtility->GetContextL( KHgCFTypeMusicType ); - - STIF_ASSERT_TRUE_DESC( musicState != NULL - && !musicState->Compare( KPlaying ), _L( "Music context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicArtist != NULL - && !musicArtist->Compare( KArtist ), _L( "Artist context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicTitle != NULL - && !musicTitle->Compare( KTitle ), _L( "Title context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicAlbum != NULL - && !musicAlbum->Compare( KAlbum ), _L( "Album context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicAlbumArt != NULL - && !musicAlbumArt->Compare( KHgCFValueUnknownInfo ), _L( "Art context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicGeneralUri != NULL - && !musicGeneralUri->Compare( KHgCFValueUnknownInfo ), _L( "Uri context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicGenre != NULL - && !musicGenre->Compare( KHgCFValueUnknownInfo ), _L( "Genre context not found" ) ); - STIF_ASSERT_TRUE_DESC( musicType != NULL - && !musicType->Compare( KHgCFValueUnknownInfo ), _L( "Type context not found" ) ); - - delete musicState; - delete musicArtist; - delete musicTitle; - delete musicAlbum; - delete musicAlbumArt; - delete musicGeneralUri; - delete musicGenre; - delete musicType; - - return KErrNone; - } - -STIF_TESTDEFINE( T_PublishRadioContextL ) - { - _LIT( KTestRadioName, "radio test name" ); - _LIT( KTestRadioUrl, "radio test url" ); - _LIT( KTestRadioFrequency, "radio test frequency" ); - _LIT( KTestRadioRDSPI, "radio test rdspi" ); - - HBufC* ctxRadioName = NULL; - HBufC* ctxRadioUrl = NULL; - HBufC* ctxRadioFrequency = NULL; - HBufC* ctxRadioRDSPI = NULL; - - RArray testData; - CleanupClosePushL(testData); - - // Empty Values - iContextUtility->PublishRadioContextL(KNullDesC, KNullDesC, KNullDesC, KNullDesC); - ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); - ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); - ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); - ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); - STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KHgCFValueUnknownInfo ), - _L( "Empty value: ctxRadioName error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KHgCFValueUnknownInfo ), - _L( "Empty value: ctxRadioUrl error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KHgCFValueUnknownInfo ), - _L( "Empty value: ctxRadioFrequency error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KHgCFValueUnknownInfo ), - _L( "Empty value: ctxRadioRDSPI error." ) ); - delete ctxRadioName; - delete ctxRadioUrl; - delete ctxRadioFrequency; - delete ctxRadioRDSPI; - - // One value - testData.Reset(); - testData.ReserveL(16); - for(TInt i = 0; i < 12; i++) - { - testData.AppendL(KNullDesC()); - } - testData.Insert(KTestRadioName(), 0); - testData.Insert(KTestRadioUrl(), 5); - testData.Insert(KTestRadioFrequency(), 10); - testData.Insert(KTestRadioRDSPI(), 15); - for(TInt i = 0; i < 16; i += 4) - { - iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); - ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); - ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); - ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); - ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); - STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && - !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), - _L( "One value: ctxRadioName error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && - !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), - _L( "One value: ctxRadioUrl error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && - !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), - _L( "One value: ctxRadioFrequency error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && - !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), - _L( "One value: ctxRadioRDSPI error." ) ); - delete ctxRadioName; - delete ctxRadioUrl; - delete ctxRadioFrequency; - delete ctxRadioRDSPI; - } - - // Two values - testData.Reset(); - testData.ReserveL(24); - for(TInt i = 0; i < 12; i++) - { - testData.AppendL(KNullDesC()); - } - testData.Insert(KTestRadioName(), 0); - testData.Insert(KTestRadioUrl(), 1); - testData.Insert(KTestRadioName(), 4); - testData.Insert(KTestRadioFrequency(), 6); - testData.Insert(KTestRadioName(), 8); - testData.Insert(KTestRadioRDSPI(), 11); - testData.Insert(KTestRadioUrl(), 13); - testData.Insert(KTestRadioFrequency(), 14); - testData.Insert(KTestRadioUrl(), 17); - testData.Insert(KTestRadioRDSPI(), 19); - testData.Insert(KTestRadioFrequency(), 22); - testData.Insert(KTestRadioRDSPI(), 23); - for(TInt i = 0; i < 24; i += 4) - { - iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); - ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); - ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); - ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); - ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); - STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && - !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), - _L( "Two values: ctxRadioName error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && - !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), - _L( "Two values: ctxRadioUrl error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && - !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), - _L( "Two values: ctxRadioFrequency error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && - !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), - _L( "Two values: ctxRadioRDSPI error." ) ); - delete ctxRadioName; - delete ctxRadioUrl; - delete ctxRadioFrequency; - delete ctxRadioRDSPI; - } - - // Three values - testData.Reset(); - testData.ReserveL(16); - for(TInt i = 0; i < 4; i++) - { - testData.AppendL(KTestRadioName()); - testData.AppendL(KTestRadioUrl()); - testData.AppendL(KTestRadioFrequency()); - testData.AppendL(KTestRadioRDSPI()); - } - testData.Remove(3); - testData.Insert(KNullDesC(), 3); - testData.Remove(6); - testData.Insert(KNullDesC(), 6); - testData.Remove(9); - testData.Insert(KNullDesC(), 9); - testData.Remove(12); - testData.Insert(KNullDesC(), 12); - for(TInt i = 0; i < 16; i += 4) - { - iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); - ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); - ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); - ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); - ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); - STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && - !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), - _L( "Three values: ctxRadioName error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && - !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), - _L( "Three values: ctxRadioUrl error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && - !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), - _L( "Three values: ctxRadioFrequency error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && - !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), - _L( "Three values: ctxRadioRDSPI error." ) ); - delete ctxRadioName; - delete ctxRadioUrl; - delete ctxRadioFrequency; - delete ctxRadioRDSPI; - } - - // Four values - iContextUtility->PublishRadioContextL(KTestRadioName, KTestRadioUrl, KTestRadioFrequency, KTestRadioRDSPI); - ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); - ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); - ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); - ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); - STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KTestRadioName ), - _L( "Four values: ctxRadioName error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KTestRadioUrl ), - _L( "Four values: ctxRadioUrl error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KTestRadioFrequency ), - _L( "Four values: ctxRadioFrequency error." ) ); - STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KTestRadioRDSPI ), - _L( "Four values: ctxRadioRDSPI error." ) ); - delete ctxRadioName; - delete ctxRadioUrl; - delete ctxRadioFrequency; - delete ctxRadioRDSPI; - - CleanupStack::PopAndDestroy(&testData); - - return KErrNone; - } - -#endif - -// end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/src/wait.cpp --- a/homescreensrv_plat/context_utility_api/tsrc/src/wait.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CWait class implementation -* -*/ - - -#include "wait.h" - -// CONSTANTS - -_LIT( KPanicCat, "ActTimSche" ); - -enum TPanicReason - { - EAlreadyStarted - }; - -LOCAL_C void Panic( TInt aCode ) - { - User::Panic( KPanicCat, aCode ); - } - -// MEMBER FUNCTIONS - -CWait* CWait::NewL() - { - - CWait* self = - CWait::NewLC(); - CleanupStack::Pop( self ); - - return self; - } - -CWait* CWait::NewLC() - { - - CWait* self = - new( ELeave ) CWait; - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - -CWait::CWait(): - CTimer( EPriorityStandard ) - { - - // Double check if base class adds active object into scheduler - if( !IsAdded() ) - { - CActiveScheduler::Add( this ); - } - } - -void CWait::ConstructL() - { - - // Do base constructions - CTimer::ConstructL(); - - // Initialize active scheduler wait - iWait = new( ELeave ) CActiveSchedulerWait; - } - -// Destructor -CWait::~CWait() - { - - Cancel(); - delete iWait; - } - -// METHODS - -//----------------------------------------------------------------------------- -// CWait::Start -//----------------------------------------------------------------------------- -// -void CWait::Start( - const TTimeIntervalMicroSeconds32& aInterval ) - { - - __ASSERT_ALWAYS( !IsActive(), Panic( EAlreadyStarted ) ); - - After( aInterval ); - iWait->Start(); - } - -//----------------------------------------------------------------------------- -// CWait::Stop -//----------------------------------------------------------------------------- -// -void CWait::Stop() - { - - Cancel(); - } - -//----------------------------------------------------------------------------- -// CWait::RunL -//----------------------------------------------------------------------------- -// -void CWait::RunL() - { - - // Double check that wait really started - if( iWait->IsStarted() ) - { - iWait->AsyncStop(); - } - } - -//----------------------------------------------------------------------------- -// CWait::DoCancel -//----------------------------------------------------------------------------- -// -void CWait::DoCancel() - { - - // Double check that wait really started - CTimer::DoCancel(); - if( iWait->IsStarted() ) - { - iWait->AsyncStop(); - } - } - - -// end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/src/wait.h --- a/homescreensrv_plat/context_utility_api/tsrc/src/wait.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CWait class declaration. -* -*/ - - - -#ifndef C_WAIT_H -#define C_WAIT_H - -#include - -/** -* Timed active scheduler wait. -* This class wraps inside a timer and scheduler wait. -* Wait will be automatically stopped after specified time. -*/ -NONSHARABLE_CLASS( CWait ): public CTimer - { - public: // Constructors and destructor - - // Two-phased constructor. - static CWait* NewL(); - static CWait* NewLC(); - - // Destructor. - virtual ~CWait(); - - public: // New methods - - /** - * Starts waiting in the scheduler. - * Wait will be automatically stopped after aInterval amount - * of time has passed. - * - * @param aInterval Interval after wait will be stopped. - * @return None - */ - void Start( const TTimeIntervalMicroSeconds32& aInterval ); - - /** - * Stops scheduler wait. - * - * @param None - * @return None - */ - void Stop(); - - private: // From base classes - - // @see CActive - void RunL(); - - // @see CActive - void DoCancel(); - - private: - - CWait(); - void ConstructL(); - - private: // Data - - // Own: Active scheduler wait - CActiveSchedulerWait* iWait; - }; - -#endif diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.cpp --- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: hgtestbase class member functions -* -*/ - - - -// INCLUDE FILES -#include -#include "hgtestbase.h" -#include -#include -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgTestBase::CHgTestBase -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CHgTestBase::CHgTestBase() - { - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::ConstructL -// Symbian 2nd phase constructor can leave. -// -// Note: If OOM test case uses STIF Logger, then STIF Logger must be created -// with static buffer size parameter (aStaticBufferSize). Otherwise Logger -// allocates memory from heap and therefore causes error situations with OOM -// testing. For more information about STIF Logger construction, see STIF Users -// Guide. -// ----------------------------------------------------------------------------- -// -void CHgTestBase::BaseConstructL( const TDesC& aTestPath, - const TDesC& aTestFile ) - { - iLog = CStifLogger::NewL( aTestPath, - aTestFile); - - // Sample how to use logging - _LIT( KLogStart, "Logging starts!" ); - iLog->Log( KLogStart ); - - iVersionLogged = EFalse; - iNumberOfTestCases = 0; - - // Construct active scheduler - iActiveScheduler = new ( ELeave ) CActiveScheduler; - - // Install active scheduler - // We don't need to check whether an active scheduler is already installed - // as this is a new thread, so there won't be one - CActiveScheduler::Install ( iActiveScheduler ); - } - -// Destructor -CHgTestBase::~CHgTestBase() - { - - delete iTestDllName; - delete iLog; - //delete ENV_cleanup; - delete iActiveScheduler; - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::InitL -// InitL is used to initialize the Test Module. -// ----------------------------------------------------------------------------- -// -TInt CHgTestBase::InitL( - TFileName& /*aIniFile*/, - TBool /*aFirstTime*/ ) - { - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::GetTestCasesL -// GetTestCases is used to inquire test cases from the Test Module. Test -// cases are stored to array of test cases. The Test Framework will be -// the owner of the data in the RPointerArray after GetTestCases return -// and it does the memory deallocation. -// ----------------------------------------------------------------------------- -// -TInt CHgTestBase::GetTestCasesL( - const TFileName& /*aConfig*/, - RPointerArray& aTestCases ) - { - TTestResult dummyResult; - return MainTestL(CHgTestBase::EEnumerateTestCases, -1, aTestCases, dummyResult); - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::OOMTestQueryL -// Used to check if a particular test case should be run in OOM conditions and -// which memory allocations should fail. -// ----------------------------------------------------------------------------- -// -TBool CHgTestBase::OOMTestQueryL( - const TFileName& /* aTestCaseFile */, - const TInt /*aCaseNumber*/, - TOOMFailureType& /* aFailureType */, - TInt& /*aFirstMemFailure*/, - TInt& /*aLastMemFailure*/ ) - { - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::OOMTestInitializeL -// Used to perform the test environment setup for a particular OOM test case. -// Test Modules may use the initialization file to read parameters for Test -// Module initialization but they can also have their own configure file or -// some other routine to initialize themselves. -// -// NOTE: User may add implementation for OOM test environment initialization. -// Usually no implementation is required. -// ----------------------------------------------------------------------------- -// -void CHgTestBase::OOMTestInitializeL( - const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */ ) - { - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::OOMHandleWarningL -// In some cases the heap memory allocation should be skipped, either due to -// problems in the OS code or components used by the code being tested, or even -// inside the tested components which are implemented this way on purpose (by -// design), so it is important to give the tester a way to bypass allocation -// failures. -// -// NOTE: User may add implementation for OOM test warning handling. Usually no -// implementation is required. -// ----------------------------------------------------------------------------- -// -void CHgTestBase::OOMHandleWarningL( - const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */, - TInt& /* aFailNextValue */ ) - { - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::OOMTestFinalizeL -// Used to perform the test environment cleanup for a particular OOM test case. -// -// NOTE: User may add implementation for OOM test environment finalization. -// Usually no implementation is required. -// ----------------------------------------------------------------------------- -// -void CHgTestBase::OOMTestFinalizeL( - const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */ ) - { - } - -void CHgTestBase::SendTestModuleVersion( const TDesC& aModuleName ) - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR; - moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR; - moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD; - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, aModuleName, newVersionOfMethod); - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::RunTestCaseL -// RunTestCaseL is used to run an individual test case specified -// by aTestCase. Test cases that can be run may be requested from -// Test Module by GetTestCases method before calling RunTestCase. -// ----------------------------------------------------------------------------- -// -TInt CHgTestBase::RunTestCaseL( - const TInt aCaseNumber, - const TFileName& /*aConfig*/, - TTestResult& aResult ) - { - if(!iVersionLogged) - { - CHgTestBase::SendTestModuleVersion( *iTestDllName ); - iVersionLogged = ETrue; - } - - RPointerArray aTestCases; //temporary - - /** - * SetupL is responsible for inicialization of all fields (etc.) common for all testcases - * MainTestL starts required testcase - * TeardownL destroys all data that was created by SetupL - */ - TInt errSetup = KErrNone; - TInt errTestcase = KErrNone; - - if(aCaseNumber > iNumberOfTestCases) - return KErrNotFound; - - __UHEAP_MARK; - - //TRAP(errSetup, MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_SETUP, aTestCases, aResult); - TRAP(errTestcase, MainTestL(CHgTestBase::ERunTestCase, aCaseNumber, aTestCases, aResult)); - // MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_TEARDOWN, aTestCases, aResult)); - - __UHEAP_MARKEND; - - if(errTestcase != KErrNone) - { - aResult.SetResult(errTestcase, _L("Testcase failed")); - } - if(errSetup != KErrNone) - { - aResult.SetResult(errSetup, _L("Setup or teardown failed")); - } - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CHgTestBase::MainTestL -// Method responsible for enumerating and running test cases (and also setup and teardown activities before -// and after each test case). -// ----------------------------------------------------------------------------- -// -TInt CHgTestBase::MainTestL(CHgTestBase::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult ) - { - if(aRunReason == CHgTestBase::ERunTestCase) - { - if(aTestToRun < 0) - { - iLog->Log(_L("Running setup or teardown")); - } - else - { - iLog->Log(_L("Running test case #%d"), aTestToRun); - } - } - else - { - iLog->Log(_L("Enumerating test cases.")); - } - - TInt result = -1; - - // this method must be implemented in the test case - result = RunTestL( aRunReason, aTestToRun, aTestCases, aResult ); - - if(aRunReason != CHgTestBase::ERunTestCase) - { - iNumberOfTestCases = result; - iLog->Log(_L("Enumeration completed.")); - } - - // Test case was executed - return KErrNone; - } - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.h --- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: hgtestbase module. -* -*/ - - -#include -#include "StifTestModule.h" -#include - -#include "hgtestbasemacros.h" - -// MACROS -#define TEST_MODULE_VERSION_MAJOR 0 -#define TEST_MODULE_VERSION_MINOR 0 -#define TEST_MODULE_VERSION_BUILD 0 - -// CLASS DECLARATION - -// FORWARD DECLARATIONS -class CHgTestClass; -class CEikonEnv; -class CAknAppUi; - -// DATA TYPES -typedef TInt (CHgTestClass::* TestFunction)(TTestResult&); - -/** -* An internal structure containing a test case name and -* the pointer to function doing the test -*/ -class TCaseInfoInternal -{ -public: - const TText* iCaseName; - TestFunction iMethod; - TBool iIsOOMTest; - TInt iFirstMemoryAllocation; - TInt iLastMemoryAllocation; -}; - -// CLASS DECLARATION - -/** -* A structure containing a test case name and -* the pointer to function doing the test -*/ -class TCaseInfo -{ -public: - TPtrC iCaseName; - TestFunction iMethod; - TBool iIsOOMTest; - TInt iFirstMemoryAllocation; - TInt iLastMemoryAllocation; - -TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) - { - }; - -}; - -class CHgTestBase : public CTestModuleBase -{ - -public: //Enums - // Reason for running test method - enum TCallReason - { - EEnumerateTestCases, - ERunTestCase, - }; - -public: // Constructors and destructor - /** - * Destructor. - */ - virtual ~CHgTestBase(); - -public: // New functions - static TInt CallStop( TAny* aWait ) - { - (static_cast(aWait))->AsyncStop(); - } -public: // Functions from base classes - - /** - * From CTestModuleBase InitL is used to initialize the - * test class object. It is called once for every instance of - * TestModule test class object after its creation. - * @param aIniFile Initialization file for the test module (optional) - * @param aFirstTime Flag is true when InitL is executed for first - * created instance of test class object - * @return Symbian OS error code - */ - TInt InitL( TFileName& aIniFile, TBool aFirstTime ); - - /** - * From CTestModuleBase GetTestCasesL is used to inquiry test cases - * from test class object. - * @param aTestCaseFile Test case file (optional) - * @param aTestCases Array of TestCases returned to test framework - * @return Symbian OS error code - */ - TInt GetTestCasesL( const TFileName& aTestCaseFile, - RPointerArray& aTestCases ); - - - /** - * From CTestModuleBase; OOMTestQueryL is used to specify is particular - * test case going to be executed using OOM conditions - * @param aTestCaseFile Test case file (optional) - * @param aCaseNumber Test case number (optional) - * @param aFailureType OOM failure type (optional) - * @param aFirstMemFailure The first heap memory allocation failure value (optional) - * @param aLastMemFailure The last heap memory allocation failure value (optional) - * @return TBool - */ - virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */, - TOOMFailureType& aFailureType, - TInt& /* aFirstMemFailure */, - TInt& /* aLastMemFailure */ ); - - /** - * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM - * test environment - * @param aTestCaseFile Test case file (optional) - * @param aCaseNumber Test case number (optional) - * @return None - */ - virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */ ); - - /** - * From CTestModuleBase; OOMHandleWarningL - * @param aTestCaseFile Test case file (optional) - * @param aCaseNumber Test case number (optional) - * @param aFailNextValue FailNextValue for OOM test execution (optional) - * @return None - * - * User may add implementation for OOM test warning handling. Usually no - * implementation is required. - */ - virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */, - TInt& /* aFailNextValue */); - - /** - * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM - * test environment - * @param aTestCaseFile Test case file (optional) - * @param aCaseNumber Test case number (optional) - * @return None - * - */ - virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, - const TInt /* aCaseNumber */ ); - - /** - * Method used to log version of test module - */ - void SendTestModuleVersion( const TDesC& aTestPath ); - -private: - /** - * From CTestModuleBase RunTestCaseL is used to run an individual - * test case. - * @param aCaseNumber Test case number - * @param aTestCaseFile Test case file (optional) - * @param aResult Test case result returned to test framework (PASS/FAIL) - * @return Symbian OS error code (test case execution error, which is - * not reported in aResult parameter as test case failure). - */ - TInt RunTestCaseL( const TInt aCaseNumber, - const TFileName& aTestCaseFile, - TTestResult& aResult ); - - /** - * Method containing all test cases, setup and teardown sections. - */ - TInt MainTestL(CHgTestBase::TCallReason aRunReason, TInt aTestToRun, RPointerArray& aTestCases, - TTestResult& aResult); - -protected: - - /** - * C++ default constructor. - */ - CHgTestBase(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void BaseConstructL( const TDesC& aTestPath, - const TDesC& aTestFile ); - - /** - * Put here the #include of the test cases cpp file - */ - virtual TInt RunTestL( - CHgTestBase::TCallReason aRunReason, - TInt aTestToRun, - RPointerArray& aTestCases, - TTestResult& aResult) = 0; - -protected: // Data - // Pointer to test (function) to be executed - TestFunction iMethod; - - // Pointer to logger - CStifLogger * iLog; - - // Flag saying if version of test module was already sent - TBool iVersionLogged; - // Total number of test cases - TInt iNumberOfTestCases; - HBufC16* iTestDllName; - // activescheduler for connecting - CActiveScheduler* iActiveScheduler; -}; diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbasemacros.h --- a/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbasemacros.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: hgtestbasemacros test module. -* -*/ - - - -#ifndef hgtestbasemacros_H -#define hgtestbasemacros_H - -_LIT( KAssertFailedEquals, "AssertEquals Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedNotEquals, "AssertNotEquals Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedNull, "AssertNull Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedNotNull, "AssertNotNull Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedSame, "AssertSame Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedNotSame, "AssertNotSame Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedTrue, "AssertTrue Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedFalse, "AssertFalse Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedNotLeaves, "AssertNotLeaves Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedLeaves, "AssertLeaves Failed [F:%s][L:%d]" ); -_LIT( KAssertFailedLeavesWith, "AssertLeavesWith Failed [F:%s][L:%d]" ); - - -#ifdef _UNICODE - #define __STIF_WIDEN2(x) L ## x - #define __STIF_WIDEN(x) __STIF_WIDEN2(x) - #define __STIF_DBG_FILE__ __STIF_WIDEN(__FILE__) -#else - #define __STIF_DBG_FILE__ __FILE__ -#endif - - -// Logs to the STIF log file AND to the RDebug -#define STIF_LOG( aMessage ) \ - iLog->Log( _L( aMessage ) ); RDebug::Print( _L( aMessage ) ); - - -// Defines a separate test case which consists of two blocks - one for enumeration of test cases -// second for running the testcase. -#define STIF_TESTDEFINE( aTestName ) \ -_test_case_no++; \ -if( aRunReason == CHgTestBase::EEnumerateTestCases ) \ - { \ - TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); \ - CleanupStack::PushL( newCase ); \ - newCase->iCaseNumber = _test_case_no; \ - newCase->iTitle.Copy( _L( #aTestName ) ); \ - User::LeaveIfError(aTestCases.Append ( newCase ) ); \ - CleanupStack::Pop( newCase ); \ - } \ -else if(aRunReason == CHgTestBase::ERunTestCase && _test_case_no == aTestToRun) - -#define STIF_RUN_SETUP -1 -#define STIF_RUN_TEARDOWN -2 - -// Defines a setup section of MainTestL method -#define STIF_SETUP \ - if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_SETUP ) - -// Defines a teardown section of MainTestL method -#define STIF_TEARDOWN \ - if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_TEARDOWN ) - -/********************************************************************************* - * Assert Macros - *********************************************************************************/ -#define __STIF_ASSERT_SHARED( aFunction, aMessage ) \ - if(!aFunction) \ - { \ - iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ - aResult.SetResult( KErrGeneral, _L("Testcase failed"));\ - User::Leave( KErrGeneral );\ - } - -#define __STIF_ASSERT_SHARED_DESC( aFunction, aMessage, aDesc ) \ - if(!aFunction) \ - { \ - iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ - aResult.SetResult( KErrGeneral, aDesc );\ - User::Leave( KErrGeneral );\ - } \ - else \ - { \ - aResult.SetResult( KErrNone, aDesc ); \ - } - - - -#define STIF_ASSERT_EQUALS( aExpected, aActual ) \ - __STIF_ASSERT_SHARED( AssertEquals( aExpected, aActual ) , KAssertFailedEquals ); - -#define STIF_ASSERT_EQUALS_DESC( aExpected, aActual, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( AssertEquals( aExpected, aActual ) , KAssertFailedEquals, aDescription ); - -#define STIF_ASSERT_NOT_EQUALS( aExpected, aActual ) \ - __STIF_ASSERT_SHARED( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals ); - -#define STIF_ASSERT_NOT_EQUALS_DESC( aExpected, aActual, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals, aDescription ); - -#define STIF_ASSERT_NULL( aPtr ) \ - __STIF_ASSERT_SHARED( AssertNull( aPtr ), KAssertFailedNull ); - -#define STIF_ASSERT_NULL_DESC( aPtr, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( AssertNull( aPtr ), KAssertFailedNull, aDescription ); - -#define STIF_ASSERT_NOT_NULL( aPtr ) \ - __STIF_ASSERT_SHARED( !AssertNull( aPtr ), KAssertFailedNotNull ); - -#define STIF_ASSERT_NOT_NULL_DESC( aPtr, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( !AssertNull( aPtr ), KAssertFailedNotNull, aDescription ); - -#define STIF_ASSERT_SAME( aExpectedPtr, aActualPtr ) \ - __STIF_ASSERT_SHARED( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame ); - -#define STIF_ASSERT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame, aDescription ); - -#define STIF_ASSERT_NOT_SAME( aExpectedPtr, aActualPtr) \ - __STIF_ASSERT_SHARED( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame ); - -#define STIF_ASSERT_NOT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame, aDescription ); - -#define STIF_ASSERT_TRUE( aCondition ) \ - __STIF_ASSERT_SHARED( AssertTrue( aCondition ), KAssertFailedTrue ); - -#define STIF_ASSERT_TRUE_DESC( aCondition, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( AssertTrue( aCondition ), KAssertFailedTrue, aDescription ); - -#define STIF_ASSERT_FALSE( aCondition ) \ - __STIF_ASSERT_SHARED( !AssertTrue( aCondition ), KAssertFailedFalse ); - -#define STIF_ASSERT_FALSE_DESC( aCondition, aDescription ) \ - __STIF_ASSERT_SHARED_DESC( !AssertTrue( aCondition), KAssertFailedFalse, aDescription ); - -// Eclosing block is used to create the scope for the __leaveValue -#define STIF_ASSERT_NOT_LEAVES( aStatement ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves ); \ - } - -#define STIF_ASSERT_NOT_LEAVES_DESC( aStatement, aDescription ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves, aDescription ); \ - } - -// Eclosing block is used to create the scope for the __leaveValue -#define STIF_ASSERT_LEAVES( aStatement ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves ); \ - } - -#define STIF_ASSERT_LEAVES_DESC( aStatement, aDescription ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED_DESC( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves, aDescription ); \ - } - -// Eclosing block is used to create the scope for the __leaveValue -#define STIF_ASSERT_LEAVES_WITH( aLeaveCode, aStatement ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves ); \ - } - -#define STIF_ASSERT_LEAVES_WITH_DESC( aLeaveCode, aStatement, aDescription ) \ - { \ - TRAPD( __leaveValue, aStatement ); \ - __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves, aDescription ); \ - } - -#define STIF_ASSERT_PANIC( aPanicCode, aStatement ) \ - { \ - TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \ - aStatement; \ - } - -#define STIF_ASSERT_PANIC_DESC( aPanicCode, aStatement, aDescription ) \ - { \ - TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \ - aResult.SetResult(KErrNone, aDescription); \ - aStatement; \ - } -#include "sitfunitutils.inl" - -#endif diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl --- a/homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: inline functions for the STIFUnit utils -* -*/ - - -template -inline TBool AssertEquals(const T& aExpected, const T& aActual) -/** - * AssertEquals - * - * @prototype - * @test - * - * @param aExpected - Expected result - * @param aActual - Actual result - * @return - True if equal - */ - { - if( aExpected==aActual ) - { - return ETrue; - } - return EFalse; - } - -template -inline TBool AssertNull(const T* aPtr) -/** - * AssertNull - * - * @prototype - * @test - * - * @param aPtr - Pointer - * @return - True if NULL - */ - { - if( aPtr==NULL ) - { - return ETrue; - } - return EFalse; - } - -template -inline TBool AssertSame(const T* aExpectedPtr, const T* aActualPtr) -/** - * AssertSame - * - * @prototype - * @test - * - * @param aExpectedPtr - Expected pointer - * @param aActualPtr - Actual pointer - * @return - True if equal - */ - { - if( aExpectedPtr==aActualPtr ) - { - return ETrue; - } - return EFalse; - } - -inline TBool AssertTrue(const TBool& aCondition) -/** - * AssertTrue - * - * @prototype - * @test - * - * @param aCondition - Condition - * @return - True if aCondition is true - */ - { - if( !aCondition ) - { - return EFalse; - } - return ETrue; - } - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/context_utility_api/ui_context_utility_api.metaxml --- a/homescreensrv_plat/context_utility_api/ui_context_utility_api.metaxml Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - UI Context Utility API - Utility API for publishing context to the Context Framework - c++ - contextengine - - - - - - - - - no - no - - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/group/bld.inf --- a/homescreensrv_plat/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -22,7 +22,6 @@ #include "../ai_utilities_api/group/bld.inf" #include "../ai_plugin_management_api/group/bld.inf" #include "../ai_plugin_information_api/group/bld.inf" -#include "../ai_shortcut_command_api/group/bld.inf" #include "../ai_variation_api/group/bld.inf" #include "../action_handler_plugin_api/group/bld.inf" #include "../content_harvester_plugin_api/group/bld.inf" @@ -35,10 +34,8 @@ #include "../sapi_actionhandler/group/bld.inf" #include "../sapi_homescreenplugin/group/bld.inf" #include "../sapi_menucontent/group/bld.inf" -#include "../shortcutplugin_extension_api/group/bld.inf" #include "../xcfw_api/group/bld.inf" #include "../idlefw_api/group/bld.inf" #include "../hs_widget_publisher_api/group/bld.inf" -#include "../context_utility_api/group/bld.inf" #include "../hs_settings_api/group/bld.inf" #include "../hs_content_control_api/group/bld.inf" diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_content_control_api/inc/hscontentcontroller.h --- a/homescreensrv_plat/hs_content_control_api/inc/hscontentcontroller.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentcontroller.h Wed May 12 13:36:47 2010 +0300 @@ -62,25 +62,48 @@ { public: /** - * Fills an array of CHsContentInfo. Both widget and template types are appended. - * @param aArray Array of CHsContentInfo + * Returns the list of available Home screen widgets + * @param aArray List of widgets + * @return KErrNone on success, any of system wide error codes */ virtual TInt WidgetListL( CHsContentInfoArray& aArray ) = 0; /** - * Fills an array of CHsContentInfo. View types are appended. - * @param aArray Array of CHsContentInfo + * Returns the list of Home screen widgets included in an application + * configuration or a view + * @param aInfo Content info defining the application configuration + * or the view which widget list is requested + * @param aArray List of widgets + * @return KErrNone on success, any of system wide error codes + */ + virtual TInt WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) = 0; + + /** + * Returns the list of available Home screen views + * @param aArray List of views + * @return KErrNone on success, any of system wide error codes */ virtual TInt ViewListL( CHsContentInfoArray& aArray ) = 0; /** - * + * Returns the list of available Home screen views included in an + * application configuration + * @param aInfo Content info defining the application configuration + * @param aArray List of views + * @return KErrNone on success, any of system wide error codes + */ + virtual TInt ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ) = 0; + + /** + * Returns the list of available Home screen application configurations + * @param aArray List of application configurations + * @return KErrNone on success, any of system wide error codes */ virtual TInt AppListL( CHsContentInfoArray& aArray ) = 0; /** - * Adds a widget to the active view. - * @param aInfo Content info object + * Adds a widget to the active Home screen view. + * @param aInfo Widget request to be added * @return KErrNone on success, any of system wide error codes, * KHsErrorViewFull, KHsErrorMaxInstanceCountExceeded or * KHsErrorDoesNotFit @@ -89,37 +112,50 @@ /** * Removes a widget from the configuration. - * @param aInfo Content info object + * @param aInfo Widget request to be removed + * @return KErrNone on success, any of system wide error codes */ virtual TInt RemoveWidgetL( CHsContentInfo& aInfo ) = 0; /** - * + * Adds a view to the active Home screen application configuration. + * @param aInfo View request to be added + * @return KErrNone on success, any of system wide error codes */ virtual TInt AddViewL( CHsContentInfo& aInfo ) = 0; /** - * + * Removes a view from the configuration. + * @param aInfo View request to be removed + * @return KErrNone on success, any of system wide error codes */ virtual TInt RemoveViewL( CHsContentInfo& aInfo ) = 0; /** - * + * Activates the Home screen view + * @param aInfo View request to be activated + * @return KErrNone on success, any of system wide error codes */ virtual TInt ActivateViewL( CHsContentInfo& aInfo ) = 0; /** - * + * Activates the Home screen application configuration + * @param aInfo Application configuration request to be activated + * @return KErrNone on success, any of system wide error codes */ virtual TInt ActivateAppL( CHsContentInfo& aInfo ) = 0; /** - * + * Returns the active Home screen view + * @param aInfo Active view + * @return KErrNone on success, any of system wide error codes */ virtual TInt ActiveViewL( CHsContentInfo& aInfo ) = 0; /** - * + * Returns the active Home screen application configuration + * @param aInfo Active application configuration + * @return KErrNone on success, any of system wide error codes */ virtual TInt ActiveAppL( CHsContentInfo& aInfo ) = 0; diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h --- a/homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h Wed May 12 13:36:47 2010 +0300 @@ -333,6 +333,23 @@ IMPORT_C TBool IsWrt() const; /** + * Sets whether an application confguration or a view is full + * + * @since S60 5.0 + * @param aIsFull, ETrue if application configuration or a view is full + */ + IMPORT_C void SetIsFull( TBool aIsFull ); + + /** + * Returns whether an application configuration or a view is full + * + * @since S60 5.0 + * @return ETrue if application configuration or view is full, + * EFalse otherwise + */ + IMPORT_C TBool IsFull() const; + + /** * Marshals Content Info data to a descriptor * * @since S60 5.0 @@ -407,6 +424,11 @@ * Flag to indicate whether this is a WRT widget */ TBool iIsWrt; + + /** + * Flag to indicate wheter an application configuration or a view is full + */ + TBool iIsFull; }; #endif // HSCONTENTINFO_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h --- a/homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h Wed May 12 13:36:47 2010 +0300 @@ -18,7 +18,7 @@ #define C_CHomeScreenSettingsIf_H #include -#include // for MLiwNotifyCallback +#include // for MLiwNotifyCallback #include #include @@ -52,39 +52,59 @@ * @lib HomeScreenSettingsIf.lib * @since S60 v5.0 */ -class CHomescreenSettings: +NONSHARABLE_CLASS( CHomescreenSettings ) : public CBase, public MLiwNotifyCallback, public MHomescreenSettingsIf { +public: // static methods + /** + * Get instance to settings API. + * + * InitializeL must be called before calling this method. + * Otherwise NULL is returned. InitializeL and Instance + * must be called within same thread since TLS is used + * to storage instance data. + * + * @return CHomescreenSettings* Pointer to settings api. + * Can return NULL in case of + * error. + */ + IMPORT_C static CHomescreenSettings* Instance(); + + /** + * Initialize settings api. + * + * There must be one UnInitialize call for each Initialize call + * in order to prevent memory leaking. + * (Implementation contains reference counting) + */ + IMPORT_C static void InitializeL( const TDesC8& aAppUid ); + + /** + * Uninitialize settings api. + * + * There must be one UnInitialize call for each Initialize call + * in order to prevent memory leaking. + * (Implementation contains reference counting) + */ + IMPORT_C static void UnInitialize(); + public: /** - * Two-phased constructor. + * Add observer * - * @param aAppUid Application uid in integer format - * @param aObserver Observer + * @param aObserver Observer to be added. */ - IMPORT_C static CHomescreenSettings* NewL( - const TDesC8& aAppUid, - const TDesC8& aPluginId, - MHomeScreenSettingsObserver* aObserver ); + IMPORT_C void AddObserverL( MHomeScreenSettingsObserver* aObserver ); /** - * Two-phased constructor. + * Remove observer * - * @param aAppUid Application uid in integer format - * @param aObserver Observer - */ - IMPORT_C static CHomescreenSettings* NewLC( - const TDesC8& aAppUid, - const TDesC8& aPluginId, - MHomeScreenSettingsObserver* aObserver ); + * @param aObserver Observer to be removed. + */ + IMPORT_C void RemoveObserver( MHomeScreenSettingsObserver* aObserver ); - /** - * Destructor. - */ - IMPORT_C virtual ~CHomescreenSettings(); - public: /** * From MHomescreenSettingsIf @@ -114,19 +134,33 @@ IMPORT_C TInt SetSettingsL( const TDesC8& aPluginId, const RPointerArray& aSettings, - const TBool aStoringParam ); - - + const TBool aStoringParam ); + protected: /** + * Two-phased constructor. + * + * @param aAppUid Application uid in integer format + */ + static CHomescreenSettings* NewL( const TDesC8& aAppUid ); + + /** + * Two-phased constructor. + * + * @param aAppUid Application uid in integer format + */ + static CHomescreenSettings* NewLC( + const TDesC8& aAppUid ); + + /** + * Destructor. + */ + virtual ~CHomescreenSettings(); + + /** * Constructor. - * - * @param aAppUid Application uid in integer format - * @param aObserver Observer */ - CHomescreenSettings( - MHomeScreenSettingsObserver* aObserver, - const TDesC8& aPluginId ); + CHomescreenSettings(); /** * Second phase constructor @@ -182,7 +216,6 @@ const RPointerArray& aSettings, const TDesC8& aStoringParam ); - protected: /** * From MLiwNotifyCallback @@ -210,18 +243,16 @@ * Owned. Provides hsps services. */ MLiwInterface* iHspsInterface; - /** - * Not owned. Wrapper observer - */ - MHomeScreenSettingsObserver* iObserver; + /* * Asynchronous service request tarnsaction id */ TInt iTransactionId; - /** - * Plugin id - */ - const TDesC8& iPluginId; + + /* + * List of observers. Items not owned! + */ + RPointerArray iObservers; }; } //namespace HSPluginSettingsIf diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsobserver.h --- a/homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsobserver.h Wed May 12 13:36:47 2010 +0300 @@ -42,7 +42,7 @@ * @param aPluginUid Plugin uid * @param aPluginId Plugin id */ - virtual TInt SettingsChangedL( + virtual void SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, const TDesC8& aPluginUid, diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -203,7 +203,8 @@ /** * Method publishes the provided widget. * Widget needs to be published in order for the content - * to be seen by the HS. + * to be seen by the HS. For correct behaviour during publishing, events received + * from HS must be handled appropriately. * * @code * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Wed May 12 13:36:47 2010 +0300 @@ -33,6 +33,7 @@ namespace Hs { class HsWidget; +class HsWidgetItem; typedef std::map WidgetContentIdMapType; @@ -168,7 +169,7 @@ /** */ void InsertWidgetDataIdentifiersL( HsWidget& aWidget, - CLiwDefaultMap* aDataMap ); + CLiwDefaultMap* aDataMap, const TDesC& aContentType ); /** */ @@ -177,7 +178,7 @@ /** */ - void InsertWidgetItemsL( HsWidget& aWidget, + void InsertWidgetItemL( HsWidgetItem& aWidgetItem, CLiwDefaultMap* aDataMap ); /** @@ -190,7 +191,7 @@ /** */ - void InsertItemsTriggersL( HsWidget& aWidget, + void InsertItemTriggerL( HsWidgetItem& aWidgetItem, CLiwDefaultMap* aTriggerMap ); /** diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Wed May 12 13:36:47 2010 +0300 @@ -198,7 +198,7 @@ { // remove widget data when widget removed from screen CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap, KAll ); // removal may fail if the client has already removed the data TRAP_IGNORE( RemoveFromCpsL( cpdatamap, KCpData ) ); mWidgetContentIds.erase( aWidget.getIdentifier() ); @@ -411,45 +411,55 @@ // --------------------------------------------------------------------------- // void HsWidgetPublisherImpl::PublishWidgetDataL( HsWidget& aWidget ) - { - CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); - CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); - - TLiwGenericParam type(KType, TLiwVariant(KCpData)); - inParam->AppendL(type); - - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); - - CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); - InsertWidgetItemsL( aWidget, datamap ); - cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); - InsertWidgetACLL( cpdatamap ); - - int count = aWidget.itemsCount(); - if( count > 0 ) - { - CLiwDefaultMap* triggermap = CLiwDefaultMap::NewLC(); - InsertItemsTriggersL( aWidget, triggermap ); - cpdatamap->InsertL( KActionMap, TLiwVariant( triggermap ) ); - CleanupStack::PopAndDestroy( triggermap ); - } + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + TLiwGenericParam type(KType, TLiwVariant(KCpData)); + + int count = aWidget.itemsCount(); + for( int i = 0; i < count; i++ ) + { + inParam->AppendL(type); + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); - inParam->AppendL( item ); - mServiceInterface->ExecuteCmdL( KAdd, - *inParam, *outParam); - TInt ret= ObtainErrorCode( *outParam ); + HsWidgetItem* const widgetItem = aWidget.getWidgetItem( i ); + + // insert widget data identifiers + HBufC* itemName = StdStringToUnicodeLC( widgetItem->getItemName()); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap, *itemName ); + CleanupStack::PopAndDestroy( itemName ); + + // insert widget item + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + InsertWidgetItemL( *widgetItem, datamap ); + cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); + + // insert widget access control list + InsertWidgetACLL( cpdatamap ); + + // insert item triggers + CLiwDefaultMap* triggermap = CLiwDefaultMap::NewLC(); + InsertItemTriggerL( *widgetItem, triggermap ); + cpdatamap->InsertL( KActionMap, TLiwVariant( triggermap ) ); + CleanupStack::PopAndDestroy( triggermap ); - CleanupStack::PopAndDestroy( datamap ); - CleanupStack::PopAndDestroy( cpdatamap ); - - item.Reset(); - type.Reset(); - outParam->Reset(); - inParam->Reset(); - User::LeaveIfError( ret ); - } + // add to CPS + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + inParam->AppendL( item ); + mServiceInterface->ExecuteCmdL( KAdd, + *inParam, *outParam); + TInt ret= ObtainErrorCode( *outParam ); + + CleanupStack::PopAndDestroy( datamap ); + CleanupStack::PopAndDestroy( cpdatamap ); + + item.Reset(); + outParam->Reset(); + inParam->Reset(); + User::LeaveIfError( ret ); + } + type.Reset(); + } // --------------------------------------------------------------------------- // @@ -562,7 +572,7 @@ CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); TRAPD( err, - InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap, KAll ); RemoveFromCpsL( cpdatamap, KCpData ) ); if ( err != KErrNotFound ) { @@ -773,7 +783,7 @@ // --------------------------------------------------------------------------- // void HsWidgetPublisherImpl::InsertWidgetDataIdentifiersL( HsWidget& aWidget, - CLiwDefaultMap* aDataMap ) + CLiwDefaultMap* aDataMap, const TDesC& aContentType ) { WidgetContentIdMapType::const_iterator contentIdIter = mWidgetContentIds.find( aWidget.getIdentifier() ); @@ -787,7 +797,7 @@ HBufC* publisherName = StdStringToUnicodeLC( GetPublisherNameL( aWidget ) ); aDataMap->InsertL( KPublisherId, TLiwVariant( *publisherName ) ); - aDataMap->InsertL( KContentType, TLiwVariant( KAll ) ); + aDataMap->InsertL( KContentType, TLiwVariant( aContentType ) ); aDataMap->InsertL( KContentId, TLiwVariant( contentId ) ); CleanupStack::PopAndDestroy( publisherName ); @@ -809,6 +819,9 @@ aDataMap->InsertL( KWidgetName, TLiwVariant( *widgetName ) ); aDataMap->InsertL( KWidgetMaxInstance, TLiwVariant( 1 ) ); + // this is needed by chswiplugin: + aDataMap->InsertL( KWidgetUid, TLiwVariant( iWidgetUid )); + const std::string& widgetDescriptionStd = aWidget.getDescription(); if ( widgetDescriptionStd.length() ) { @@ -832,31 +845,25 @@ // // --------------------------------------------------------------------------- // -void HsWidgetPublisherImpl::InsertWidgetItemsL ( HsWidget& aWidget, +void HsWidgetPublisherImpl::InsertWidgetItemL ( HsWidgetItem& aWidgetItem, CLiwDefaultMap* aDataMap ) { - int count = aWidget.itemsCount(); - for (int index = 0; index < count; index++) - { - HsWidgetItem* const item = aWidget.getWidgetItem( index ); - - TPtrC8 itemName = ((TUint8*)item->getItemName().c_str()); - if( item->isStringValue() ) - { - TPtrC8 itemValue = ((TUint8*)item->getItemValue().c_str()); - HBufC* value = HBufC::NewLC( KUnicodeSize * itemValue.Length() ); - TPtr dest( value->Des() ); - CnvUtfConverter::ConvertToUnicodeFromUtf8( dest, itemValue ); - - aDataMap->InsertL( itemName, TLiwVariant(*value )); - CleanupStack::PopAndDestroy(value); - } - else - { - int itemValue = item->getItemValueInt(); - aDataMap->InsertL( itemName, TLiwVariant( TInt32( itemValue ) )); - } - } + TPtrC8 itemName = ((TUint8*)aWidgetItem.getItemName().c_str()); + if( aWidgetItem.isStringValue() ) + { + TPtrC8 itemValue = ((TUint8*)aWidgetItem.getItemValue().c_str()); + HBufC* value = HBufC::NewLC( KUnicodeSize * itemValue.Length() ); + TPtr dest( value->Des() ); + CnvUtfConverter::ConvertToUnicodeFromUtf8( dest, itemValue ); + + aDataMap->InsertL( itemName, TLiwVariant(*value )); + CleanupStack::PopAndDestroy(value); + } + else + { + int itemValue = aWidgetItem.getItemValueInt(); + aDataMap->InsertL( itemName, TLiwVariant( TInt32( itemValue ) )); + } } // --------------------------------------------------------------------------- @@ -934,10 +941,9 @@ // // --------------------------------------------------------------------------- // -void HsWidgetPublisherImpl::InsertItemsTriggersL( HsWidget& aWidget, +void HsWidgetPublisherImpl::InsertItemTriggerL( HsWidgetItem& aWidgetItem, CLiwDefaultMap* aTriggerMap ) { - int count = aWidget.itemsCount(); CLiwDefaultMap* activateAction = CLiwDefaultMap::NewLC(); activateAction->InsertL( KPluginId, TLiwVariant( KCASpaAppLauncherPlugin ) ); @@ -948,13 +954,10 @@ activate->InsertL( KApaCommand, TLiwVariant( KApaCommandBackground ) ); activateAction->InsertL( KData, TLiwVariant( activate ) ); - - for (int index = 0; index < count; index++) - { - HsWidgetItem* const item = aWidget.getWidgetItem( index ); - TPtrC8 itemName = ((TUint8*)item->getItemName().c_str()); - aTriggerMap->InsertL( itemName, TLiwVariant( activateAction )); - } + + TPtrC8 itemName = ((TUint8*)aWidgetItem.getItemName().c_str()); + aTriggerMap->InsertL( itemName, TLiwVariant( activateAction )); + CleanupStack::PopAndDestroy( activate ); CleanupStack::PopAndDestroy( activateAction ); } diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/group/bld.inf --- a/homescreensrv_plat/idlefw_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/idlefw_api/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -25,8 +25,8 @@ ../inc/aiuicontrolleruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiuicontrolleruid.hrh) ../inc/aiconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(aiconsts.h) ../inc/aifweventhandler.h MW_LAYER_PLATFORM_EXPORT_PATH(aifweventhandler.h) +../inc/aifwstatehandler.h MW_LAYER_PLATFORM_EXPORT_PATH(aifwstatehandler.h) ../inc/aiuicontroller.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuicontroller.h) -../inc/aiuiframeworkobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuiframeworkobserver.h) ../inc/aiuiidleintegration.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuiidleintegration.h) ../inc/debug.h MW_LAYER_PLATFORM_EXPORT_PATH(debug.h) // needed? ../inc/aifwdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aifwdefs.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/inc/aifwdefs.h --- a/homescreensrv_plat/idlefw_api/inc/aifwdefs.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/idlefw_api/inc/aifwdefs.h Wed May 12 13:36:47 2010 +0300 @@ -16,25 +16,59 @@ */ -#ifndef AIFWDEFS_H -#define AIFWDEFS_H +#ifndef _AIFWDEFS_H +#define _AIFWDEFS_H +// System inclides -#include -#include +// User includes + +// Type definitions /** - * Array of publisher Content publisher info records. + * AiFw State definitions. + * + * @since S60 5.2 */ -typedef RArray RAiPublisherInfoArray; - -_LIT(KOnline_Offline, "online_offline"); +enum TAiFwState + { + EAiFwBacklightOn = 1, + EAiFwBacklightOff, + EAiFwForeground, + EAiFwBackground, + EAiFwBackupRestoreStart, + EAiFwBackupRestoreEnd, + EAiFwGeneralThemeChange, + EAiFwUiStartup, + EAiFwUiShutdown, + EAiFwOnline, + EAiFwOffline + }; -enum TAifwStates - { - EAifwOffline, - EAifwOnline, - EAifwPageSwitch - }; +/** + * AiFw data plugin load reasons. + * + * @since S60 5.2 + */ +enum TAiFwLoadReason + { + EAiFwSystemStartup = 1, + EAiFwPageStartup, + EAiFwPluginStartup + }; -#endif // AIFWDEFS_H +/** + * AiFw data plugin destroy reasons. + * + * @since S60 5.2 + */ +enum TAiFwDestroyReason + { + EAiFwSystemShutdown = 1, + EAiFwPageShutdown, + EAiFwPluginShutdown + }; + +#endif // _AIFWDEFS_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/inc/aifweventhandler.h --- a/homescreensrv_plat/idlefw_api/inc/aifweventhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/idlefw_api/inc/aifweventhandler.h Wed May 12 13:36:47 2010 +0300 @@ -19,11 +19,15 @@ #ifndef M_AIFWEVENTHANDLER_H #define M_AIFWEVENTHANDLER_H +// System includes #include -#include + +// User includes +// Forward declarations class CAiUiController; -class CAiContentPublisher; +class CHsContentPublisher; +class THsPublisherInfo; /** * Active Idle Framework internal event handling interface. @@ -33,56 +37,50 @@ * @since S60 3.2 */ class MAiFwEventHandler -{ + { public: + // new functions + /** * Application environment ready callback. Main UI controller calls this * method when application framework is initialized. + * + * @since S60 3.2 */ virtual void AppEnvReadyL() = 0; /** * UI ready event handler. * + * @since S60 3.2 * @param aUiController Active Idle UI Controller which manages the UI - * that is ready. + * that is ready. */ virtual void HandleUiReadyEventL( CAiUiController& aUiController ) = 0; /** * UI activation event handler. - * + * + * @since S60 3.2 */ virtual void HandleActivateUI() = 0; /** * UI shutdown event handler. * + * @since S60 3.2 * @param aUiController Active Idle UI Controller which manages the UI - * that was shut down. + * that was shut down. */ virtual void HandleUiShutdown( CAiUiController& aUiController ) = 0; /** - * UI has changed, load data plugin. - * - * @param aPublisherInfo Publisher info describing plugin to load. - */ - virtual void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ) = 0; - - /** - * UI has changed, destroy data plugin. - * - * @param aPublisherInfo Publisher info describing plugin to destroy. - */ - virtual void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ) = 0; - - /** * Active Idle Framework Plug-in event handler. UI controllers forward * events that are targeted to Active Idle Content Publisher Plug-ins * to this method. * - * @param aParam event parameters from the UI model. + * @since S60 3.2 + * @param aParam event parameters from the UI model. */ virtual void HandlePluginEvent( const TDesC& aParam ) = 0; @@ -91,50 +89,77 @@ * events that are targeted to Active Idle Content Publisher Plug-ins * to this method. * + * @since S60 5.2 * @param aPublisherInfo publisher info. * @param aParam event parameters from the UI model. */ - virtual void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ) = 0; + virtual void HandlePluginEventL( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aParam ) = 0; /** * Queries if a Content Publiseher Plug-in has settings * + * @since S60 5.2 * @param aPublisherInfo publisher info. * @param aMenuItem menuitem type. */ - virtual TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ) = 0; + virtual TBool HasMenuItemL( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aMenuItem ) = 0; + + /** + * Refresh content request. UI controller can use this interface to request + * a content publisher plug-in to refresh (re-publish) a specific content + * item. + * + * @since S60 3.2 + * @param aContentCid Textual identifier of the content to refresh. + * @return True if the content publisher plug-in is found and the plugin + * will refresh the content by calling its content observer. + * False otherwise. + */ + virtual TBool RefreshContent( const TDesC& aContentCid ) = 0; /** * Refresh content request. UI controller can use this interface to request * a content publisher plug-in to refresh (re-publish) a specific content * item. * + * @since S60 5.2 + * @param aPublisherInfo publisher info. * @param aContentCid Textual identifier of the content to refresh. * @return True if the content publisher plug-in is found and the plugin * will refresh the content by calling its content observer. * False otherwise. */ - virtual TBool RefreshContent( const TDesC& aContentCid ) = 0; + virtual TBool RefreshContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) = 0; /** + * Suspend content request. UI controller can use this interface to request + * a content publisher plug-in to suspend a specific content + * item. + * + * @since S60 5.2 + * @param aPublisherInfo publisher info. + * @param aContentCid Textual identifier of the content to refresh. + * @return True if the content publisher plug-in is found and the plugin + * will refresh the content by calling its content observer. + * False otherwise. + */ + virtual TBool SuspendContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) = 0; + + /** * Service to check if menu is open. * + * @since S60 3.2 * @return ETrue if menu is open, EFalse otherwise */ - virtual TBool QueryIsMenuOpen() = 0; - - /** - * Service to process the state changes - * - * @param aState changed state - */ - virtual void ProcessStateChange( TAifwStates aState ) = 0; - -protected: - /** - * Protected destructor prevents deletion through this interface. - */ - ~MAiFwEventHandler() { } + virtual TBool QueryIsMenuOpen() = 0; }; #endif // M_AIEVENTHANDLEREXTENSION_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/inc/aifwstatehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aifwstatehandler.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Idle Framework internal state handling interface. +* +*/ + + +#ifndef M_AIFWSTATEHANDLER_H +#define M_AIFWSTATEHANDLER_H + +// System includes + +// User includes +#include + +// Forward declarations +class THsPublisherInfo; + +/** + * Active Idle Framework internal state handling interface. + * Events from UI controllers are forwarded to this interface for processing + * on the Active Idle Framework side. + * + * @since S60 5.2 + */ +class MAiFwStateHandler + { +public: + // new functions + + /** + * Instructs to load plugin + * + * @since S60 5.2 + * @param aPublisherInfo plugin to load + * @param aReason startup reason + * @return Error code, KErrNone if loaded succesfully. + */ + virtual TInt LoadPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwLoadReason aReason ) = 0; + + /** + * Instructs to destroy plugin + * + * @since S60 5.2 + * @param aPublisherInfo plugin to destroy + * @param aReason shutdown reason + */ + virtual void DestroyPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwDestroyReason aReason ) = 0; + + /** + * Instructs to change all plugins' state + * + * @since S60 5.2 + * @param aState State to change + */ + virtual void ChangePluginState( TAiFwState aState ) = 0; + + }; + +#endif // M_AIFWSTATEHANDLER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/inc/aiuicontroller.h --- a/homescreensrv_plat/idlefw_api/inc/aiuicontroller.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/idlefw_api/inc/aiuicontroller.h Wed May 12 13:36:47 2010 +0300 @@ -16,22 +16,25 @@ */ -#ifndef C_AIUICONTROLLER_H -#define C_AIUICONTROLLER_H +#ifndef _AIUICONTROLLER_H +#define _AIUICONTROLLER_H +// System includes #include + +// User includes #include "aicontentmodel.h" -#include "aifwdefs.h" #include "aiuicontrolleruid.hrh" #include "aipluginsettings.h" +// Forward declarations class MAiContentObserver; class MAiFwEventHandler; -class MAiUiFrameworkObserver; -class CCoeEnv; -class CAiContentPublisher; +class MAiFwStateHandler; class MAiMainUiController; class MAiSecondaryUiController; +class THsPublisherInfo; +class CCoeEnv; /** * ECom interface UID for CAiUiContoller @@ -46,8 +49,7 @@ class CAiUiController : public CBase { public: - -// Constructors and destructor + // Constructors and destructor /** * Static factory method. @@ -56,7 +58,7 @@ * @param ECom implementatoin uid * @return class instance */ - inline static CAiUiController* NewL(TUid aImpUid); + inline static CAiUiController* NewL( TUid aImpUid ); /** * Static factory method. @@ -65,14 +67,15 @@ * @param mimetype * @return class instance */ - inline static CAiUiController* NewL(const TDesC8& aMime); + inline static CAiUiController* NewL( const TDesC8& aMime ); /** * Destructor. */ - inline virtual ~CAiUiController(); + inline ~CAiUiController(); -// New functions +public: + // New functions /** * Instructs this UI controller to load its UI definition. @@ -82,22 +85,15 @@ virtual void LoadUIDefinitionL() = 0; /** - * Retrieves the Content Publisher Plug-in list defined in this UI - * controller's UI model. - * - * @since Series 60 3.2 - */ - virtual void GetPluginsL(RAiPublisherInfoArray& aPlugins) = 0; - - /** * Retrieves plug-in settings specified in this UI controller's UI definition. * - * @param aPubInfo Publisher info of the plug-in for which to - * retrieve settings for. + * @param aPublisherInfo Publisher info of the plug-in for which to + * retrieve settings for. * @param aSettings array to get settings items to. */ - virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, - RAiSettingsItemArray& aSettings) = 0; + virtual void GetSettingsL( + const THsPublisherInfo& aPublisherInfo, + RAiSettingsItemArray& aSettings ) = 0; /** * Activate UI managed by this UI controller. @@ -122,15 +118,16 @@ * Set to NULL to disable event callbacks from this * UI Controller. */ - virtual void SetEventHandler(MAiFwEventHandler& aEventHandler) = 0; + virtual void SetEventHandler( MAiFwEventHandler& aEventHandler ) = 0; /** - * Remove specified plugin from the UI. - * - * @param aPlugin plugin that is removed. - */ - virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) = 0; - + * Sets plugin state handler + * + * @since S60 5.2 + * @param aHandler Plugin State Handler + */ + virtual void SetStateHandler( MAiFwStateHandler& aStateHandler ) = 0; + /** * Returns the main UI Controller interface, or NULL if this is not the * main UI controller. @@ -143,32 +140,49 @@ */ virtual MAiSecondaryUiController* SecondaryInterface() = 0; -private: // Data +private: + // data - TUid iDestructKey; // An identifier used during destruction - + /** An identifier used during destruction */ + TUid iDestructKey; }; -inline CAiUiController* CAiUiController::NewL(TUid aImplUid) +// ---------------------------------------------------------------------------- +// CAiUiController::NewL +// +// ---------------------------------------------------------------------------- +// +inline CAiUiController* CAiUiController::NewL( TUid aImplUid ) { - TAny* ptr = REComSession::CreateImplementationL(aImplUid, - _FOFF(CAiUiController, iDestructKey)); + TAny* ptr = REComSession::CreateImplementationL( aImplUid, + _FOFF( CAiUiController, iDestructKey ) ); - return reinterpret_cast (ptr); + return reinterpret_cast< CAiUiController* >( ptr ); } -inline CAiUiController* CAiUiController::NewL(const TDesC8& aMime) +// ---------------------------------------------------------------------------- +// CAiUiController::NewL +// +// ---------------------------------------------------------------------------- +// +inline CAiUiController* CAiUiController::NewL( const TDesC8& aMime ) { TEComResolverParams params; - params.SetDataType(aMime); - TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidUiController, - _FOFF(CAiUiController, iDestructKey), params); - return reinterpret_cast (ptr); + params.SetDataType( aMime ); + TAny* ptr = REComSession::CreateImplementationL( KInterfaceUidUiController, + _FOFF( CAiUiController, iDestructKey ), params ); + + return reinterpret_cast< CAiUiController* >( ptr ); } +// ---------------------------------------------------------------------------- +// CAiUiController::~CAiUiController +// +// ---------------------------------------------------------------------------- +// inline CAiUiController::~CAiUiController() { - REComSession::DestroyedImplementation(iDestructKey); + REComSession::DestroyedImplementation( iDestructKey ); } @@ -181,6 +195,8 @@ class MAiMainUiController { public: + // new functions + /** * Starts application framework and application event loop. * This function returns only when the application is shut down. @@ -194,12 +210,7 @@ * Returns the CONE environment object this main UI controller uses. */ virtual CCoeEnv& CoeEnv() = 0; - - /** - * Sets UI framework observer for this main UI controller. - */ - virtual void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ) = 0; - + /** * Exits the main ui controller **/ @@ -220,21 +231,16 @@ class MAiSecondaryUiController { public: + // new functions + /** * Sets the CONE environment object for this secondary UI controller to use. * * @param aCoeEnv the CONE environment object to use. */ - virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0; - - /** - * Returns the UI framework observer of this secondary UI controller. - * - * @return The UI framework observer, or NULL if observer is not supported. - */ - virtual MAiUiFrameworkObserver* UiFrameworkObserver() = 0; + virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0; }; -#endif // C_AIUICONTROLLER_H +#endif // _AIUICONTROLLER_H // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/idlefw_api/inc/aiuiframeworkobserver.h --- a/homescreensrv_plat/idlefw_api/inc/aiuiframeworkobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Observer interface for UI framework events -* -*/ - - -#ifndef M_AIUIFRAMEWORKOBSERVER_H -#define M_AIUIFRAMEWORKOBSERVER_H - -#include - -/** - * MAiUiFrameworkObserver observes UI framework events. - * - * @since S60 v3.2 - */ -class MAiUiFrameworkObserver - { - -public: - - /** - * Event handler for resource change in UI framework. - * - * @param aType resource change type. - */ - virtual void HandleResourceChange( TInt aType ) = 0; - - /** - * Event handler for focus change event. - * - * @param aForeground ETrue if UI is foreground. - */ - virtual void HandleForegroundEvent( TBool aForeground ) = 0; - -protected: - - virtual ~MAiUiFrameworkObserver() {}; - - }; - - -#endif // M_AIUIFRAMEWORKOBSERVER_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp --- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp Wed May 12 13:36:47 2010 +0300 @@ -56,7 +56,6 @@ LIBRARY apparc.lib LIBRARY sendui.lib LIBRARY hlplch.lib -LIBRARY ws32.lib - +LIBRARY ws32.lib // End of File diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp --- a/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Wed May 12 13:36:47 2010 +0300 @@ -106,6 +106,7 @@ if ( !ExtractUidL( aMap, appUid, KApplicationUid ) ) { + // app not yet running RApaLsSession appSession; CleanupClosePushL( appSession ); User::LeaveIfError( appSession.Connect( ) ); @@ -127,6 +128,7 @@ CleanupStack::PopAndDestroy( cmd ); CleanupStack::PopAndDestroy( &appSession ); } + return errCode; } diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h --- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Wed May 12 13:36:47 2010 +0300 @@ -114,11 +114,21 @@ * * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier * @param aInParamList input parameter list (filter) - * @param aOutParamList output action_map + * @param aCmdOptions options for the command */ - void ExecuteActionL( const CLiwGenericParamList& aInParamList ); + void ExecuteActionL( const CLiwGenericParamList& aInParamList, + TUint aCmdOptions ); /** + * Send command to server to ExecuteMultipleActions + * + * @param aInParamList input parameter list (filter) + * @param aCmdOptions options for the command + */ + void ExecuteMultipleActionsL( + const CLiwGenericParamList& aInParamList, TUint aCmdOptions); + + /** * Check second param from IDataSource interface * * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier @@ -127,7 +137,15 @@ */ void CheckMapL( const CLiwGenericParamList& aInParamList, const TDesC8& aKey ); - + + /** + * Check proper data is passed as parameter to ExecuteMultipleActions + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aList generic list containing input parameters + */ + void CheckMultiExecuteInputParamsL(const CLiwGenericParamList& aList); + private: /** diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h --- a/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Wed May 12 13:36:47 2010 +0300 @@ -113,10 +113,21 @@ * * @since S60 v 5.0 * @param aInParamList const reference to the input list + * @param aOptions Command options. */ - void ExecuteActionL( const CCPLiwMap& aMap ); + void ExecuteActionL( const CCPLiwMap& aMap, TUint aOptions = 0 ); /** + * Pass ExecuteMultipleActionsL request to the server + * + * @since S60 v 5.0 + * @param aList const reference to the input list + * @param aOptions Command options. + */ + void ExecuteMultipleActionsL( const CLiwGenericParamList& aList, + TUint aOptions = 0 ); + + /** * Pass GetChangeInfoData request to server * @param aBuf reference to the input list * @return error code diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp --- a/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Wed May 12 13:36:47 2010 +0300 @@ -90,12 +90,16 @@ CP_DEBUG( _L8("CContentPublishingInterface::ProcessCommandL") ); if ( aCmdName.CompareF( KExecuteAction ) == 0 ) - { - iCPClient->ExecuteActionL( aInParamList ); - } - else - { - CDataSourceInterface::ProcessCommandL(aCmdName, - aInParamList, aOutParamList, aCmdOptions, aCallback); - } + { + iCPClient->ExecuteActionL( aInParamList, aCmdOptions ); + } + else if ( aCmdName.CompareF( KExecuteMultipleActions ) == 0 ) + { + iCPClient->ExecuteMultipleActionsL( aInParamList, aCmdOptions ); + } + else + { + CDataSourceInterface::ProcessCommandL(aCmdName, + aInParamList, aOutParamList, aCmdOptions, aCallback); + } } diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp --- a/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Wed May 12 13:36:47 2010 +0300 @@ -96,6 +96,7 @@ CLiwGenericParamList& aOutParamList ) { CP_DEBUG( _L8("CCPClient::GetListL()") ); + CP_EXTENDED_DEBUG( "GetListL()" , aInParamList ); CheckMapL( aInParamList, KFilter ); CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); inMapForServer->PushL( ); @@ -113,6 +114,7 @@ TUint aCmdOptions ) { CP_DEBUG( _L8("CCPClient::AddL()") ); + CP_EXTENDED_DEBUG( "Add()" , aInParamList ); CheckMapL( aInParamList, KItem ); CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ; inMapForServer->PushL( ); @@ -128,6 +130,7 @@ void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList ) { CP_DEBUG( _L8("CCPClient::DeleteL()") ); + CP_EXTENDED_DEBUG( "Delete()" , aInParamList ); CheckMapL( aInParamList, KData ); CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); inMapForServer->PushL( ); @@ -144,6 +147,7 @@ const CLiwGenericParamList& aInParamList, TInt32 aTransactionId ) { CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); + CP_EXTENDED_DEBUG( "RegisterObserver()" , aInParamList ); CheckMapL( aInParamList, KFilter ); CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); inMapForServer->PushL( ); @@ -163,6 +167,7 @@ void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList ) { CP_DEBUG( _L8("CCPClient::UnregisterObservers()") ); + CP_EXTENDED_DEBUG( "UnregisterObservers()" , aInParamList ); if ( !iActiveNotifier ) { User::Leave( KErrNotFound ); @@ -195,14 +200,16 @@ // // ----------------------------------------------------------------------------- // -void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList ) +void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList, + TUint aCmdOptions) { - CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); + CP_DEBUG( _L8("CCPClient::ExecuteActionL()") ); + CP_EXTENDED_DEBUG( "ExecuteAction()" , aInParamList ); CheckMapL( aInParamList, KFilter ); CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); inMapForServer->PushL( ); inMapForServer->IsValidForActionL( ); - iServerClient.ExecuteActionL( *inMapForServer ); + iServerClient.ExecuteActionL( *inMapForServer, aCmdOptions ); CleanupStack::PopAndDestroy( inMapForServer ); } @@ -210,6 +217,19 @@ // // ----------------------------------------------------------------------------- // +void CCPClient::ExecuteMultipleActionsL( + const CLiwGenericParamList& aInParamList, TUint aCmdOptions) + { + CP_DEBUG( _L8("CCPClient::ExecuteMultipleActionsL()") ); + CP_EXTENDED_DEBUG( "ExecuteMultipleActionsL()" , aInParamList ); + CheckMultiExecuteInputParamsL(aInParamList); + iServerClient.ExecuteMultipleActionsL( aInParamList, aCmdOptions ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void CCPClient::CheckMapL( const CLiwGenericParamList& aInParamList, const TDesC8& aKey ) { @@ -224,3 +244,20 @@ } } } + +// ----------------------------------------------------------------------------- +// +// --------------- -------------------------------------------------------------- +// +void CCPClient::CheckMultiExecuteInputParamsL( + const CLiwGenericParamList& aList) + { + const TLiwGenericParam* param = NULL; + TInt pos(0); + param = aList.FindFirst(pos, KFilters); + User::LeaveIfError(pos); //leaves if not found + if (param->Value().TypeId() != LIW::EVariantTypeList) + { + User::Leave(KErrBadName); + } + } diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp --- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp Wed May 12 13:36:47 2010 +0300 @@ -204,8 +204,10 @@ iSizeDes = NULL; CleanupStack::PopAndDestroy(&outbuf); } - RegisterAgainL(); - + if (KErrNoMemory!=iStatus.Int()) + { + RegisterAgainL(); + } NotifyObserversL(error, eventParamList); CleanupStack::PopAndDestroy(eventParamList); } @@ -292,9 +294,12 @@ // // ---------------------------------------------------------------------------- // -TInt CCPActiveNotifier::RunError( TInt /*aError*/) +TInt CCPActiveNotifier::RunError( TInt aError ) { - TRAP_IGNORE( RegisterAgainL( ) ); + if (KErrNoMemory!=aError) + { + TRAP_IGNORE( RegisterAgainL( ) ); + } return KErrNone; } // ---------------------------------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp --- a/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Wed May 12 13:36:47 2010 +0300 @@ -146,12 +146,13 @@ // // ----------------------------------------------------------------------------- // -void RCPServerClient::ExecuteActionL( const CCPLiwMap& aMap ) +void RCPServerClient::ExecuteActionL( const CCPLiwMap& aMap, TUint aOptions ) { CP_DEBUG( _L8("RCPServerClient::ExecuteActionL()") ); HBufC8 *inbuf = aMap.PackForServerLC( ); TIpcArgs args; args.Set( KDescriptorPosition, &*inbuf ); + args.Set( KOptionsPosition, static_cast( aOptions ) ); User::LeaveIfError( SendReceive( ECpServerExecuteAction, args ) ); CleanupStack::PopAndDestroy( inbuf ); } @@ -160,6 +161,29 @@ // // ----------------------------------------------------------------------------- // +void RCPServerClient::ExecuteMultipleActionsL( + const CLiwGenericParamList& aList, TUint aOptions) + { + CP_DEBUG( _L8("RCPServerClient::ExecuteMultipleActionsL()") ); + TIpcArgs args; + TInt size = aList.Size(); + HBufC8* datadesc = HBufC8::NewLC( size ); + TPtr8 ptr = datadesc->Des(); + RDesWriteStream datastrm( ptr ); + CleanupClosePushL(datastrm); + aList.ExternalizeL(datastrm); + datastrm.CommitL(); + args.Set( KDescriptorPosition, &*datadesc ); + args.Set( KOptionsPosition, static_cast( aOptions ) ); + User::LeaveIfError(SendReceive(ECpServerExecuteMultipleActions, args)); + CleanupStack::PopAndDestroy(&datastrm); + CleanupStack::PopAndDestroy(datadesc); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void RCPServerClient::DeleteL( const CCPLiwMap& aMap ) { CP_DEBUG( _L8("RCPServerClient::DeleteL()") ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Wed May 12 13:36:47 2010 +0300 @@ -1,25 +1,25 @@ EXPORTS - ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 1 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, class CArrayPtrFlat &) + ?RestoreConfigurationsL@CHspsPersonalisationService@@QAEXHH@Z @ 1 NONAME ; void CHspsPersonalisationService::RestoreConfigurationsL(int, int) ?GetODTL@CHspsConfigurationService@@QAEXH@Z @ 2 NONAME ; void CHspsConfigurationService::GetODTL(int) ?GetAppConfListL@CHspsPersonalisationService@@QAEXHKAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 3 NONAME ; void CHspsPersonalisationService::GetAppConfListL(int, unsigned long, class CArrayPtrFlat &) ?SetConfStateL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00@Z @ 4 NONAME ; void CHspsPersonalisationService::SetConfStateL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &) ?InvalidateODT@CHspsConfigurationService@@QAEXXZ @ 5 NONAME ; void CHspsConfigurationService::InvalidateODT(void) ?RemovePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 6 NONAME ; void CHspsPersonalisationService::RemovePluginL(int, class TDesC8 &) ?SetActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 7 NONAME ; void CHspsPersonalisationService::SetActiveAppConfL(int, class TDesC8 &) - ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 8 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &) - ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 9 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &) - ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 10 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *) - ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 11 NONAME ; void CHspsConfigurationService::GetAppUidL(int &) - ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 12 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat &) - ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 13 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *) - ?GetDOML@CHspsConfigurationService@@QAEAAVChspsDomDocument@@XZ @ 14 NONAME ; class ChspsDomDocument & CHspsConfigurationService::GetDOML(void) - ?NewL@CHspsConfigurationService@@SAPAV1@XZ @ 15 NONAME ; class CHspsConfigurationService * CHspsConfigurationService::NewL(void) - ?NewL@CHspsPersonalisationService@@SAPAV1@XZ @ 16 NONAME ; class CHspsPersonalisationService * CHspsPersonalisationService::NewL(void) - ?SetPluginSettingsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAVChspsDomDocument@@H@Z @ 17 NONAME ; void CHspsPersonalisationService::SetPluginSettingsL(int, class TDesC8 &, class ChspsDomDocument &, int) - ?GetFamilyL@CHspsConfigurationService@@QAEXAAK@Z @ 18 NONAME ; void CHspsConfigurationService::GetFamilyL(unsigned long &) - ?ReplacePluginL@CHspsPersonalisationService@@QAEXHABVTDesC8@@0@Z @ 19 NONAME ; void CHspsPersonalisationService::ReplacePluginL(int, class TDesC8 const &, class TDesC8 const &) - ?GetPluginOdtL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@PAVChspsODT@@@Z @ 20 NONAME ; void CHspsPersonalisationService::GetPluginOdtL(int, class TDesC8 &, class ChspsODT *) - ?SetActivePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 21 NONAME ; void CHspsPersonalisationService::SetActivePluginL(int, class TDesC8 &) - ?UnRegisterObserverL@CHspsConfigurationService@@QAEXXZ @ 22 NONAME ; void CHspsConfigurationService::UnRegisterObserverL(void) - ?RestoreConfigurationsL@CHspsPersonalisationService@@QAEXHH@Z @ 23 NONAME ; void CHspsPersonalisationService::RestoreConfigurationsL(int, int) + ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KHAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 8 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, int, class CArrayPtrFlat &) + ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 9 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &) + ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 10 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &) + ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 11 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *) + ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 12 NONAME ; void CHspsConfigurationService::GetAppUidL(int &) + ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 13 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat &) + ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 14 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *) + ?GetDOML@CHspsConfigurationService@@QAEAAVChspsDomDocument@@XZ @ 15 NONAME ; class ChspsDomDocument & CHspsConfigurationService::GetDOML(void) + ?NewL@CHspsConfigurationService@@SAPAV1@XZ @ 16 NONAME ; class CHspsConfigurationService * CHspsConfigurationService::NewL(void) + ?NewL@CHspsPersonalisationService@@SAPAV1@XZ @ 17 NONAME ; class CHspsPersonalisationService * CHspsPersonalisationService::NewL(void) + ?SetPluginSettingsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAVChspsDomDocument@@H@Z @ 18 NONAME ; void CHspsPersonalisationService::SetPluginSettingsL(int, class TDesC8 &, class ChspsDomDocument &, int) + ?GetFamilyL@CHspsConfigurationService@@QAEXAAK@Z @ 19 NONAME ; void CHspsConfigurationService::GetFamilyL(unsigned long &) + ?ReplacePluginL@CHspsPersonalisationService@@QAEXHABVTDesC8@@0@Z @ 20 NONAME ; void CHspsPersonalisationService::ReplacePluginL(int, class TDesC8 const &, class TDesC8 const &) + ?GetPluginOdtL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@PAVChspsODT@@@Z @ 21 NONAME ; void CHspsPersonalisationService::GetPluginOdtL(int, class TDesC8 &, class ChspsODT *) + ?SetActivePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 22 NONAME ; void CHspsPersonalisationService::SetActivePluginL(int, class TDesC8 &) + ?UnRegisterObserverL@CHspsConfigurationService@@QAEXXZ @ 23 NONAME ; void CHspsConfigurationService::UnRegisterObserverL(void) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Wed May 12 13:36:47 2010 +0300 @@ -13,17 +13,17 @@ _ZN27CHspsPersonalisationService13GetPluginOdtLEiR6TDesC8P8ChspsODT @ 12 NONAME _ZN27CHspsPersonalisationService13RemovePluginLEiR6TDesC8 @ 13 NONAME _ZN27CHspsPersonalisationService13SetConfStateLEiR6TDesC8S1_S1_ @ 14 NONAME - _ZN27CHspsPersonalisationService14GetPluginListLER6TDesC8S1_mR13CArrayPtrFlatI8ChspsODTE @ 15 NONAME + _ZN27CHspsPersonalisationService14GetPluginListLER6TDesC8S1_miR13CArrayPtrFlatI8ChspsODTE @ 15 NONAME _ZN27CHspsPersonalisationService14ReplacePluginLEiRK6TDesC8S2_ @ 16 NONAME _ZN27CHspsPersonalisationService15GetAppConfListLEimR13CArrayPtrFlatI8ChspsODTE @ 17 NONAME _ZN27CHspsPersonalisationService16SetActivePluginLEiR6TDesC8 @ 18 NONAME _ZN27CHspsPersonalisationService17SetActiveAppConfLEiR6TDesC8 @ 19 NONAME _ZN27CHspsPersonalisationService18SetPluginSettingsLEiR6TDesC8R16ChspsDomDocumenti @ 20 NONAME _ZN27CHspsPersonalisationService21RestoreActiveAppConfLEiR6TDesC8 @ 21 NONAME - _ZN27CHspsPersonalisationService4NewLEv @ 22 NONAME - _ZTI25CHspsConfigurationService @ 23 NONAME - _ZTI27CHspsPersonalisationService @ 24 NONAME - _ZTV25CHspsConfigurationService @ 25 NONAME - _ZTV27CHspsPersonalisationService @ 26 NONAME - _ZN27CHspsPersonalisationService22RestoreConfigurationsLEii @ 27 NONAME + _ZN27CHspsPersonalisationService22RestoreConfigurationsLEii @ 22 NONAME + _ZN27CHspsPersonalisationService4NewLEv @ 23 NONAME + _ZTI25CHspsConfigurationService @ 24 NONAME + _ZTI27CHspsPersonalisationService @ 25 NONAME + _ZTV25CHspsConfigurationService @ 26 NONAME + _ZTV27CHspsPersonalisationService @ 27 NONAME diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Wed May 12 13:36:47 2010 +0300 @@ -87,12 +87,14 @@ * @param aInterface Interface of the requested plugins. * @param aType Type of the requested plugins. * @param aFamily Requested plugin configuration family + * @param aCopyLogos Controls whether to copy logos to client's private folder * @param aList List of plugins ODT headers. */ IMPORT_C void GetPluginListL( TDesC8& aInterface, TDesC8& aType, TUint32 aFamily, + const TBool aCopyLogos, CArrayPtrFlat& aList ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Wed May 12 13:36:47 2010 +0300 @@ -76,6 +76,7 @@ TDesC8& aInterface, TDesC8& aType, TUint32 aFamily, + const TBool aCopyLogos, CArrayPtrFlat& aList ) { // Setup a mask for finding plugins with defined interface @@ -96,6 +97,7 @@ TInt err = iHspsClient->hspsGetHeaders( *searchMask, + aCopyLogos, aList ); CleanupStack::PopAndDestroy( searchMask ); @@ -270,6 +272,7 @@ // Get application configurations User::LeaveIfError( iHspsClient->hspsGetHeaders( *searchMask, + EFalse, aList ) ); CleanupStack::PopAndDestroy( searchMask ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh --- a/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Wed May 12 13:36:47 2010 +0300 @@ -87,6 +87,7 @@ _LIT8( KHspsLiwNotification, "notification" ); _LIT8( KHspsLiwId, "id" ); _LIT8( KHspsLiwType, "type" ); +_LIT8( KHspsLiwCopyLogos, "copylogos" ); _LIT8( KHspsLiwInterface, "interface" ); _LIT8( KHspsLiwUid, "uid" ); _LIT8( KHspsLiwName, "name" ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Wed May 12 13:36:47 2010 +0300 @@ -424,8 +424,9 @@ TInt pos; TPtrC8 interface; TPtrC8 type; + TBool copyLogos = EFalse; const TLiwGenericParam* inParam; - TLiwVariant inParamVariant; + TLiwVariant inParamVariant; // Get interface parameter (mandatory) pos = 0; @@ -433,43 +434,58 @@ pos, KHspsLiwInterface ); - if( inParam ) - { - inParamVariant = inParam->Value(); - interface.Set( inParamVariant.AsData() ); - - // Get type parameter (optional) - pos = 0; - inParam = aInParamList.FindFirst( - pos, - KHspsLiwType ); - if ( inParam ) - { - inParamVariant = inParam->Value(); - type.Set( inParamVariant.AsData() ); - } - - // Get headers list of defined interface - TUint32 family; - iHspsConfigurationService->GetFamilyL( family ); - CArrayPtrFlat* list = - new ( ELeave )CArrayPtrFlat( KHeaderListGranularity ); - CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) ); - iHspsPersonalisationService->GetPluginListL( - interface, - type, - family, - *list ); - - // Create GetPlugins output parameters - CHspsLiwUtilities::GetPluginsOutputL( *list, aOutParamList ); - CleanupStack::PopAndDestroy( list ); - } - else + if( !inParam ) { // Invalid method call User::Leave( KErrArgument ); } + + inParamVariant = inParam->Value(); + interface.Set( inParamVariant.AsData() ); + + // Get type parameter (optional) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwType ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + type.Set( inParamVariant.AsData() ); + } + + // Get copylogos parameter (optional) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwCopyLogos ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + copyLogos = inParamVariant.AsTBool(); + } + + // Get headers list of defined interface + TUint32 family; + iHspsConfigurationService->GetFamilyL( family ); + + CArrayPtrFlat* list = + new ( ELeave )CArrayPtrFlat( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) ); + + // Get headers list of defined interface + iHspsPersonalisationService->GetPluginListL( + interface, + type, + family, + copyLogos, + *list ); + + // Create GetPlugins output parameters + CHspsLiwUtilities::GetPluginsOutputL( *list, aOutParamList ); + + CleanupStack::PopAndDestroy( list ); + } // ----------------------------------------------------------------------------- @@ -1131,15 +1147,6 @@ { inParamVariant = inParam->Value(); pluginId.Set( inParamVariant.AsData() ); - // Check that plugin node exists - ChspsDomNode* node = &( CHspsLiwUtilities::FindRootNodeByIdentifierL( - KPluginElement, - pluginId, - *( iHspsConfigurationService->GetDOML().RootNode() ) ) ); - if ( !node ) - { - User::Leave( KErrNotFound ); - } } else { diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Wed May 12 13:36:47 2010 +0300 @@ -36,7 +36,7 @@ _LIT8( KHspsAppUid, "appUid" ); // Heap size for test step thread -const TUint KDefaultHeapSize = 0x10000; +const TUint KDefaultHeapSize = 0x100000; // Test step data typedef struct @@ -555,9 +555,9 @@ TInt err = testThread.Create( _L( "TestStep" ), HSPSTestStepThread, - 0x5000, // 20kB - KDefaultHeapSize, - KDefaultHeapSize, + 0xA000, // 40kB + KDefaultHeapSize * 2, // 2 times of base size + KDefaultHeapSize * 8, // 8 times of base size - needed by Eunit ( TAny* )&data, EOwnerProcess ); @@ -595,11 +595,12 @@ User::WaitForRequest( status ); err = status.Int(); - testThread.Close(); - // Give test thread some time to close User::After( 2000000 ); - + + // Terminate thread. + testThread.Kill( KErrNone ); + testThread.Close(); } User::LeaveIfError( err ); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp Wed May 12 13:36:47 2010 +0300 @@ -30,7 +30,7 @@ // ======== LOCAL CONSTANTS ==================================================== // Test step timeout -const TInt KTestStepTimeout = 5000000; +const TInt KTestStepTimeout = 15000000; // Max input const TInt KTestStepInputSizeMax = 1000; @@ -327,6 +327,21 @@ exitNow = ETrue; } } + + if( exitNow ) + { + logBus->LogText( _L("------------------------------------------") ); + logBus->LogText( _L("Differences found. Dumping output in full:") ); + for ( TInt i = 0; + i < iOutParams->Length(); + i++ ) + { + logBus->LogText( _L("[%5d], %3d, '%c'"), + i, // index + ( TUint16 )aOutPtr[i], + ( TUint16 )aOutPtr[i] ); + } + } CleanupStack::PopAndDestroy( logBus ); } @@ -386,6 +401,8 @@ RDesReadStream inParamStream; inParamStream.Open( inParamBufPtr ); + + // If this fails, field sizes are invalid in the "LIW" input CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL( inParamStream ); inParamStream.Release(); diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Wed May 12 13:36:47 2010 +0300 @@ -108,6 +108,7 @@ "../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" "../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" "../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" "../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" "../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" "../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" @@ -117,6 +118,7 @@ "../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" "../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" "../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" "../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" "../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" "../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Wed May 12 13:36:47 2010 +0300 @@ -108,6 +108,7 @@ "../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" "../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" "../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../testthemes/finnish_widget/dummy.mif"-"c:/data/mt_hsps/finnish_widget/dummy.mif" "../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" "../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" "../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" @@ -117,6 +118,7 @@ "../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" "../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" "../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../testthemes/installed_widget/widgetconfiguration_customized.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration_customized.xml" "../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" "../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" "../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd Wed May 12 13:36:47 2010 +0300 @@ -20,4 +20,5 @@ if exist \epoc32\winscw\c\sys\bin\mt_*.dll del \epoc32\winscw\c\sys\bin\mt_*.dll if exist \epoc32\winscw\c\sys\hash\mt_*.dll del \epoc32\winscw\c\sys\hash\mt_*.dll -copy \epoc32\release\winscw\udeb\mt_*.dll \epoc32\release\winscw\udeb\z\sys\bin \ No newline at end of file +md \epoc32\winscw\c\sys\bin\ +copy \epoc32\release\winscw\udeb\mt_*.dll \epoc32\winscw\c\sys\bin\ \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h Wed May 12 13:36:47 2010 +0300 @@ -510,7 +510,117 @@ // - Version 1.0 // - Item count (LE) 10, -2,0,0,0, +3,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'d','u','m','m','y','.','m','i','f', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'l','o','g','o', // - pluginConf::resources // - Version 1.0 // - List item starts diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_customization_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_customization_1.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test case Customizations(1) test data +* +*/ + +#ifndef MT_HSPS_CUSTOMIZATION_1_H_ +#define MT_HSPS_CUSTOMIZATION_1_H_ + +/* +Customizations(1) +---------------- + +Test purpose + +Verify that customized configurations are shadowing similar files +in ROM drive. Customized content can written to similar folder +structure, to any internal drive which users cannot hack (too easily). +HSPS's ROM installer should then utilize ecplised files from the +customization folders instead. +This test utilizes a copy of the orginal xml file, with an +exception that all the default settings have been removed. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Minimal configuration must be set as active. Installed_widget with + an 2000B133 UID must be available. Customized configuration file is + written to the C's install folder for shadowing purposes. + +Test steps + +Test step 1: +• Input: + InstallConfigurationL( KHSPSInstallInstalledWidgetConf ); +• Expected output: + "Installed_widget" is installed successfully. + +Test step 2: +• Input: + GetPluginSettings(“plugin uid”) +• Expected output: + All settings, which were there by default, are now gone. + +*/ + +// Test step 2 method: +const TUint8 customization_1_ts_2_method[] = "GetPluginSettings"; + +// Test step 2 input: +const TUint8 customization_1_ts_2_input[] = { +// GetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - GetPluginSettings(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','3' +}; + +// Test step 2 output: +const TUint8 customization_1_ts_2_output[] = { +// GetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - GetPluginSettings::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - GetPluginSettings::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +}; + + + +#endif /*MT_HSPS_CUSTOMIZATION_1_H_*/ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h Wed May 12 13:36:47 2010 +0300 @@ -128,7 +128,7 @@ // - Version 1.0 // - Item count (LE) 10, -6,0,0,0, +7,0,0,0, // - plugins[0]::uid // - Variant name // - Version 1.0 @@ -272,6 +272,30 @@ 5, 0,0,0,0, 2, +// - plugins[0]::logo +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'l','o','g','o', +// - plugins[0]::logo +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +55,0,0,0, +222, +'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', // GetPlugins(Output)::plugins // - Version 1.0 // - List item starts @@ -452,10 +476,9 @@ // - Variant value 10, 5, -75,0,0,0, -93, -2, -'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', +55,0,0,0, +222, +'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', // GetPlugins(Output)::plugins // - Version 1.0 // - List item starts diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h Wed May 12 13:36:47 2010 +0300 @@ -321,10 +321,9 @@ // - Variant value 10, 5, -75,0,0,0, -93, -2, -'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', +55,0,0,0, +222, +'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', // GetPlugins(Output)::plugins // - Version 1.0 // - List item starts diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h Wed May 12 13:36:47 2010 +0300 @@ -150,7 +150,7 @@ // - Version 1.0 // - Item count (LE) 10, -6,0,0,0, +7,0,0,0, // - plugins[0]::uid // - Variant name // - Version 1.0 @@ -294,6 +294,30 @@ 5, 0,0,0,0, 2, +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'l','o','g','o', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +55,0,0,0, +222, +'m','i','f','(','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', // GetPlugins(Output)::plugins // - Version 1.0 // - List item starts diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_8.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,658 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test case GetPlugins(8) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_8_H +#define C_MT_HSPS_GETPLUGINS_8_H + +/* +GetPlugins(8) +---------------- + +Test purpose +Verify that logo files are copied to client’s private folder. + +Pre-conditions +There must be installed test themes for Active Idle application and Operator configuration must be set as active + +Test steps +Test step 1: +• Input: + GetPlugins(“0x0998”, “widget”,“True” ) +• Expected output + Plugin list holding the widget configurations, logo files should exist in the target directory +*/ + +// Test step 1 method: + +const TUint8 getplugins_8_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_8_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - GetPlugins(Input)::copylogos +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'c','o','p','y','l','o','g','o','s', +// - GetPlugins(Input)::copylogos +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTBool +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +11, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 getplugins_8_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +7,0,0,0, +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','2', +// - plugins[0]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[0]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'F','i','n','n','i','s','h',' ','-',' ','W','i','d','g','e','t', +// - plugins[0]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[0]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[0]::logo +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'l','o','g','o', +// - plugins[0]::logo +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +75,0,0,0, +93, +2, +'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - plugins[1]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[1]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[1]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[1]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','2', +// - plugins[2]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[2]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - plugins[2]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[2]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_GETPLUGINS_8_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h Wed May 12 13:36:47 2010 +0300 @@ -339,9 +339,9 @@ // - Variant value 10, 5, -13,0,0,0, -54, -'P','l','u','g','i','n','U','p','d','a','t','e','d', +15,0,0,0, +62, +'P','l','u','g','i','n','I','n','s','t','a','l','l','e','d', // - Notification(Output)::appConfUid // - Variant name // - Version 1.0 @@ -800,8 +800,9 @@ // - Variant value 10, 5, -0,0,0,0, -2, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', // - Notification(Output)::origUid // - Variant name // - Version 1.0 @@ -846,9 +847,8 @@ // - Variant value 10, 5, -21,0,0,0, -86, -'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t',' ','V','2', +0,0,0,0, +2, // - Notification(Output)::pluginUid // - Variant name // - Version 1.0 @@ -912,7 +912,7 @@ 5, 1,0,0,0, 6, -'0' +'9' }; const TInt requestnotify_6_ts_5_trigger = EHspsTriggerRunUninstallationCase; diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreactiveappconf_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreactiveappconf_1.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,580 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test case RestoreActiveAppConf(2) test data +* +*/ + +#ifndef MT_HSPS_RESTOREACTIVEAPPCONF_1_H_ +#define MT_HSPS_RESTOREACTIVEAPPCONF_1_H_ + +/* +RestoreActiveAppConf(1) +------------------- + +Test purpose: + +Verify that Operator configuration gets activated if the active +application configuration is in error state prior to the GetActiveAppConf request. + +Pre-conditions: + +• There must be installed test themes for ActiveIdle application and Minimal + configuration must be set as active. + +Test steps: + +Test step 1: +• Input: + SetConfState +• Expected output: + Active application configuration was successfully set to error state + +Test step 2: +• Input: + GetActiveAppConf +• Expected output: + Operator configuration in “Confirmed” state + +*/ + + +// Test step 1 method: +const TUint8 restoreactiveappconf_1_ts_1_method[] = "SetConfState"; + +// Test step 1 input: +const TUint8 restoreactiveappconf_1_ts_1_input[] = { +// SetConfState(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'e','r','r','o','r' +}; + +// Test step 1 expected output: +const TUint8 restoreactiveappconf_1_ts_1_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + + + +// Test step 2 method: +const TUint8 restoreactiveappconf_1_ts_2_method[] = "GetActiveAppConf"; + + +// Test step 2 input: +const TUint8 restoreactiveappconf_1_ts_2_input = 0; + + +// Test step 2 expected output: +const TUint8 restoreactiveappconf_1_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','r','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +#endif /* MT_HSPS_RESTOREACTIVEAPPCONF_1_H_ */ diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreactiveappconf_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreactiveappconf_2.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Test case RestoreActiveAppConf(2) test data +* +*/ + +#ifndef C_MT_HSPS_RESTOREACTIVEAPPCONF_2_H +#define C_MT_HSPS_RESTOREACTIVEAPPCONF_2_H + +/* +RestoreActiveAppConf(2) +------------------- + +Test purpose: + +Verify that Minimal configuration gets re-installed from ROM +(due to the statuslicenceerestorable status) if the active application +configuration is in error state prior to the GetActiveAppConf request. + +Pre-conditions: + +• There must be installed test themes for ActiveIdle application and Minimal + configuration must be set as active. + +Test steps: + +Test step 1: +• Input: + SetConfState +• Expected output: + Active application configuration was successfully set to error state + +Test step 2: +• Input: + GetActiveAppConf +• Expected output: + Minimal configuration with configuration state “Confirmed” + +*/ + + +// Test step 1 method: +const TUint8 restoreactiveappconf_2_ts_1_method[] = "SetConfState"; + +// Test step 1 input: +const TUint8 restoreactiveappconf_2_ts_1_input[] = { +// SetConfState(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'e','r','r','o','r' +}; + +// Test step 1 expected output: +const TUint8 restoreactiveappconf_2_ts_1_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + + + +// Test step 2 method: +const TUint8 restoreactiveappconf_2_ts_2_method[] = "GetActiveAppConf"; + + +// Test step 2 input: +const TUint8 restoreactiveappconf_2_ts_2_input = 0; + + +// Test step 2 expected output: +const TUint8 restoreactiveappconf_2_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetActiveAppConf(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - GetActiveAppConf(Input)::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 +}; + +#endif // C_MT_HSPS_RESTOREACTIVEAPPCONF_2_H diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_restoreconfigurations_1.h Wed May 12 13:36:47 2010 +0300 @@ -25,10 +25,7 @@ Test purpose -Verify that HSPS removes all plugin configurations from the active view -or that all but one view are removed from the application configuration. -Activity should be maintained. First locked view should remain or if not found, -first unlocked view. +Verify that "restore active" and "restore all" functionality works as specified. Pre-conditions • There must be installed test themes for Active Idle application and Typical @@ -46,14 +43,13 @@ • Input: GetActiveAppConf • Expected output: - There are still two views of which the first view remains active + ROM configuration is restored and returned. Test step 3: • Input: GetPluginConf(“Typical - View1”) • Expected output: - There are no plugins (widgets) in the first view - + ROM view configuration is returned. Test step 4: • Input: @@ -71,8 +67,7 @@ • Input: GetPluginConf(“Typical - View1”) • Expected output: - There are no plugins (widgets) in the remaining view - + There are no plugins (widgets) in the remaining view */ // Test step 1 method: @@ -1104,7 +1099,340 @@ // - Version 1.0 // - Item count (LE) 10, +3,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, 0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', // - pluginConf::settings // - Variant name // - Version 1.0 @@ -1133,7 +1461,6 @@ // - List item starts 10, 0,0,0,0, - // - items[0] // - Version 1.0 // - Variant value type, EVariantTypeMap diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Wed May 12 13:36:47 2010 +0300 @@ -154,6 +154,11 @@ */ void GetPlugins_7_L(); /** + * Test case function for test case GetPlugins(8) + * See HSPS module test specification + */ + void GetPlugins_8_L(); + /** * Test case function for test case GetPluginList(1) * See HSPS module test specification */ @@ -448,6 +453,21 @@ * See HSPS module test specification */ void RestoreConfigurations_1_L(); + /** + * Test case function for test case Customization(1) + * See HSPS module test specification + */ + void Customization_1_L(); + /** + * Test case function for test case RestoreActiveAppConf(1) + * See HSPS module test specification + */ + void RestoreActiveAppConf_1_L(); + /** + * Test case function for test case RestoreActiveAppConf(2) + * See HSPS module test specification + */ + void RestoreActiveAppConf_2_L(); private: // Data diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Wed May 12 13:36:47 2010 +0300 @@ -47,6 +47,7 @@ #include "mt_hsps_getplugins_5.h" #include "mt_hsps_getplugins_6.h" #include "mt_hsps_getplugins_7.h" +#include "mt_hsps_getplugins_8.h" // get plugin list #include "mt_hsps_getpluginlist_1.h" #include "mt_hsps_getpluginlist_2.h" @@ -116,6 +117,11 @@ #include "mt_hsps_setactiveplugin_6.h" // restore configurations #include "mt_hsps_restoreconfigurations_1.h" +// customizations +#include "mt_hsps_customization_1.h" +// restoractiveeappconf +#include "mt_hsps_restoreactiveappconf_1.h" +#include "mt_hsps_restoreactiveappconf_2.h" // ======== LOCAL CONSTANTS ==================================================== @@ -124,6 +130,7 @@ _LIT( KMinimalResourceFile2, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml" ); _LIT( KMinimalResourceFile3, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file" ); _LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg" ); +_LIT( KFinnishMifLogo, "c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\dummy.mif" ); // ======== LOCAL FUNCTIONS ==================================================== @@ -222,11 +229,12 @@ installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSFinnishWidgetConf ); installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSInstalledWidgetConf ); - // Remove test configurations from import folder + // Remove test configurations from import & install folder at C drive CFileMan* fileManager = CFileMan::NewL( iFileserver ); CleanupStack::PushL( fileManager ); fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ) ); fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ); + fileManager->RmDir( _L( "d:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ) ); CleanupStack::PopAndDestroy( fileManager ); // Install test configurations @@ -810,8 +818,38 @@ ( TUint8* )getplugins_7_ts_1_input, ( TUint8* )getplugins_7_ts_1_output ); EUNIT_PRINT( _L8( "Test step passed" ) ); - } - + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(8) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_8_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: fetch widget plugins and copy logos files + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_8_ts_1_method, + ( TUint8* )getplugins_8_ts_1_input, + ( TUint8* )getplugins_8_ts_1_output ); + + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + ResetResources(); + // Check that the logo file was copied + AddResourceL( KFinnishMifLogo, 4608 ); + CheckResourcesL(); + EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + //------------------------------------------------------------------------------ // Test case: GetPluginList(1) //------------------------------------------------------------------------------ @@ -2645,11 +2683,20 @@ CFileMan::EOverWrite ) ); // Wait until configuration is installed - User::After( 5000000 ); + User::After( 8000000 ); // Make sure "InstalledWidget" is installed if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) { + // Installation failed - remove imports to be able to re-run the test again + // The ChspsThemeServer::HandleConfigurationImportsL does handle newly + // added files only + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + + // Leave - the test was not successfull User::Leave( KErrGeneral ); } @@ -2667,7 +2714,7 @@ User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); // Removing of *.dat file causes configuration uninstallation // Wait until configuration is uninstalled - User::After( 5000000 ); + User::After( 8000000 ); // Make sure "InstalledWidget" is uninstalled if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) @@ -2944,6 +2991,113 @@ } //------------------------------------------------------------------------------ +// Test case: Customization(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::Customization_1_L() + { + // Pre conditions + + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Simulate customization by copying configuration files to D drive ("ROM" stuff is on C) + CFileMan* fileManager = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileManager ); + User::LeaveIfError( + fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration_customized.xml" ), + _L( "d:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ), + CFileMan::ERecurse|CFileMan::EOverWrite + ) + ); + CleanupStack::PopAndDestroy( fileManager ); + + MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( installationService ); + + // Test step 1: install installed_widget which has customized content in D drive + EUNIT_PRINT( _L8( "Test step 1" ) ); + installationService->InstallConfigurationL( KHSPSInstallInstalledWidgetConf ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: check settings from the installed_widget, it should hold + // settings from the widgetconfiguration_customized.xml file + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )customization_1_ts_2_method, + ( TUint8* )customization_1_ts_2_input, + ( TUint8* )customization_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + CleanupStack::PopAndDestroy( installationService ); + } + +//------------------------------------------------------------------------------ +// Test case: RestoreActiveAppConf(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RestoreActiveAppConf_1_L() + { + // Pre conditions: activate configuration which hasn't got statuslicenceerestorable status + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Get ODT and fill in the plugin DOMs + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: invalidate state of the active application configuration + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )restoreactiveappconf_1_ts_1_method, + ( TUint8* )restoreactiveappconf_1_ts_1_input, + ( TUint8* )restoreactiveappconf_1_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: retrieve the app conf, Operator configuration should be now active + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )restoreactiveappconf_1_ts_2_method, + ( TUint8* )restoreactiveappconf_1_ts_2_input, + ( TUint8* )restoreactiveappconf_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + + +//------------------------------------------------------------------------------ +// Test case: RestoreActiveAppConfL(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RestoreActiveAppConf_2_L() + { + // Pre conditions: activate configuration with a statuslicenceerestorable status + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator ); + + // Get ODT and fill in the plugin DOMs + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: invalidate state of the active application configuration + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )restoreactiveappconf_2_ts_1_method, + ( TUint8* )restoreactiveappconf_2_ts_1_input, + ( TUint8* )restoreactiveappconf_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: retrieve the app conf, we should fail installing the Operator + // configuration as it is not in ROM + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )restoreactiveappconf_2_ts_2_method, + ( TUint8* )restoreactiveappconf_2_ts_2_input, + ( TUint8* )restoreactiveappconf_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ // Test case table //------------------------------------------------------------------------------ EUNIT_BEGIN_TEST_TABLE( @@ -3059,6 +3213,13 @@ SetupL, GetPlugins_7_L, Teardown ) EUNIT_TEST( + "GetPlugins(8)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_8_L, Teardown ) + + EUNIT_TEST( "GetPluginList(1)", "IConfiguration", "GetPluginList", @@ -3470,7 +3631,27 @@ "SetActivePlugin", "FUNCTIONALITY", SetupL, RestoreConfigurations_1_L, Teardown ) - + + EUNIT_TEST( + "Customization(1)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, Customization_1_L, Teardown ) + + EUNIT_TEST( + "RestoreActiveAppConfL(1)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, RestoreActiveAppConf_1_L, Teardown ) + + EUNIT_TEST( + "RestoreActiveAppConfL(2)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, RestoreActiveAppConf_2_L, Teardown ) EUNIT_END_TEST_TABLE diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/dummy.mif Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/dummy.mif has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch widget @@ -20,6 +24,8 @@ FinnishWidget 1.0 + mif(dummy.mif 1 2) + widgetconfiguration.xml @@ -34,4 +40,4 @@ localizedbg.jpg - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,6 +1,10 @@ - + + + qhd_tch + vga_tch + widget @@ -32,4 +36,4 @@ widget.bmp - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/widgetconfiguration_customized.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/widgetconfiguration_customized.xml Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/hs_logo.jpg has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/locale.dtd Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/0/widget.bmp has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/hs_logo.jpg has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/locale.dtd Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/1/widget.bmp has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/hs_logo.jpg has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/locale.dtd Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/9/widget.bmp has changed diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,39 @@ + + + + + qhd_tch + vga_tch + + + widget + + + 0998 + + + 101FB657 + + + 2000B133 + + + + + &qtn_2000B133_configuration_name; + InstallWidgetConf + 2.0 + + + widgetconfiguration.xml + + + locale.dtd + + + + hs_logo.jpg + widget.bmp + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget_v2/widgetconfiguration.xml Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch application @@ -31,4 +35,4 @@ - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,6 +1,10 @@ - + + + qhd_tch + vga_tch + view @@ -31,4 +35,4 @@ resource.file picture.jpeg - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch widget @@ -27,4 +31,4 @@ - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch application @@ -32,4 +36,4 @@ - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch view @@ -27,4 +31,4 @@ locale.dtd - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch application @@ -33,4 +37,4 @@ - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch view @@ -34,4 +38,4 @@ hs_logoz.jpg - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch view @@ -30,4 +34,4 @@ view2.bmp - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,9 @@ - + + + + qhd_tch + vga_tch widget @@ -32,4 +36,4 @@ - \ No newline at end of file + diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsiconutility.cpp --- a/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsiconutility.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsiconutility.cpp Wed May 12 13:36:47 2010 +0300 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/shortcutplugin_extension_api/group/bld.inf --- a/homescreensrv_plat/shortcutplugin_extension_api/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: File that exports the files belonging to -: AI Shortcut xSP Extension API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/aiscutextserv.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutextserv.h) -../inc/aiscutextdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutextdefs.h) diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextdefs.h --- a/homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextdefs.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Common client/server definitions for Shortcut plug-in -* -*/ - - -#ifndef AISCUTEXTDEFS_H -#define AISCUTEXTDEFS_H - -_LIT( KAiScutExtServerName, "AiScutExtServer" ); - -const TUint KAiScutExtServMajorVersionNumber = 1; -const TUint KAiScutExtServMinorVersionNumber = 0; -const TUint KAiScutExtServBuildVersionNumber = 0; - -const TUint KMaxPopupTextLines = 3; - -/** - * xSP extension server requests - */ -enum TAiScutExtServRequest - { - EAiScutExtServSetTargetDefinition = 1, - EAiScutExtServSetPopupText, - EAiScutExtServResetPopupText, - EAiScutExtServSetIcon, - EAiScutExtServResetIcon, - EAiScutExtServIsInShortcuts, - EAiScutExtServIssuePutInShortcuts - }; - -/** - * AiScutExtServer client panic codes - */ -enum TAiScutExtServerPanic - { - EBadRequest = 1 - }; - -#endif // AISCUTEXTDEFS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextserv.h --- a/homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextserv.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: AI Shortcut xSP Extension API -* -*/ - - -#ifndef RAISCUTEXTSERV_H -#define RAISCUTEXTSERV_H - -#include -#include - -class CGulIcon; - -/** - * Active Idle Shortcut Plugin extension client side API. - * @since S60 v3.2 - */ -class RAiScutExtServ : public RSessionBase -{ - public: - /** - * Connects a client to the AiScut extension server. - * Target definition is generated automatically from process' uid 3. - * @return KErrNone, if successful, otherwise one of the other - * system-wide error codes. - */ - IMPORT_C TInt Connect(); - - /** - * Connects a client to the AiScut extension server. - * @param aTargetDefinition Target definition string. - * @return KErrNone, if successful, otherwise one of the other - * system-wide error codes. - */ - IMPORT_C TInt Connect( const TDesC& aTargetDefinition ); - - /** - * @return The client side version number. - */ - IMPORT_C TVersion Version() const; - - /** - * Updates a pop-up text box. - * @param aPopupTextLines Array of lines displayed in pop-up text box. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt UpdatePopupTextL( const MDesCArray& aPopupTextLines ); - - /** - * Resets a pop-up text box. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt ResetPopupText(); - - /** - * Updates a shortcut icon. - * @param aIcon Icon to be shown in shortcut. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt UpdateIconL( const CGulIcon& aIcon ); - - /** - * Resets a shortcut icon. Default icon will be shown. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt ResetIcon(); - - /** - * @return ETrue if the shortcut is in shortcuts bar. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt IsInShortcuts( TBool& aIsInShortcuts ) const; - - /** - * Launches AiScutPlugin General Settings view. - * @return KErrNone, if successful, otherwise one of the other system-wide error codes. - */ - IMPORT_C TInt IssuePutInShortcuts(); -}; - -#endif // RAISCUTEXTSERV_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/shortcutplugin_extension_api/shortcutplugin_extension_api.metaxml --- a/homescreensrv_plat/shortcutplugin_extension_api/shortcutplugin_extension_api.metaxml Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - AI Shortcut xSP Extension API - Enables client applications to publish dynamic shortcut graphics and tooltips - c++ - activeidle - - - - - - - - - no - no - - diff -r 2f40063dfb5c -r dbbebe55c824 homescreensrv_plat/xcfw_api/inc/xcfwengine.h --- a/homescreensrv_plat/xcfw_api/inc/xcfwengine.h Wed Mar 03 15:38:34 2010 +0200 +++ b/homescreensrv_plat/xcfw_api/inc/xcfwengine.h Wed May 12 13:36:47 2010 +0300 @@ -22,7 +22,7 @@ // INCLUDES #include -#include +#include #include #include "gecodefaultobjectfactory.h" diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/conf/activeidle2.confml Binary file idlefw/conf/activeidle2.confml has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/conf/activeidle2_10275102.crml Binary file idlefw/conf/activeidle2_10275102.crml has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/group/aifw.mmp --- a/idlefw/group/aifw.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/group/aifw.mmp Wed May 12 13:36:47 2010 +0300 @@ -28,23 +28,14 @@ // Framework sources SOURCEPATH ../src/framework SOURCE aifw.cpp -SOURCE aicontentpluginmanager.cpp +SOURCE aieventhandler.cpp +SOURCE aipluginfactory.cpp SOURCE aiuicontrollermanager.cpp -SOURCE aicallstatusobserver.cpp -SOURCE ailightstatusobserver.cpp -SOURCE aibackuprestorestatusobserver.cpp -SOURCE aienvironmentchangeobserver.cpp -SOURCE aifocusobserver.cpp -SOURCE aikeylockobserver.cpp -SOURCE aipsstatusobserver.cpp -SOURCE aipluginstatemanager.cpp -SOURCE aipluginstatemachineimpl.cpp -SOURCE aistatealive.cpp -SOURCE aistatesuspended.cpp -SOURCE aistateidle.cpp -SOURCE aipluginfactory.cpp -SOURCE aiuiframeworkobserverimpl.cpp -SOURCE ainetworklistener.cpp +SOURCE aistatemanager.cpp +SOURCE aistateprovider.cpp +SOURCE aiecomobserver.cpp +SOURCE aicpscommandbuffer.cpp +SOURCE aicpsexecuteparam.cpp // Active Idle Framework shared sources SOURCEPATH ../src/common @@ -64,6 +55,8 @@ LIBRARY apparc.lib apgrfx.lib LIBRARY ws32.lib cone.lib commonengine.lib LIBRARY cenrepnotifhandler.lib +LIBRARY liwServiceHandler.lib +LIBRARY swiutils.lib // S60 Dependencies LIBRARY avkon.lib @@ -71,17 +64,14 @@ LIBRARY featmgr.lib LIBRARY eikcore.lib LIBRARY hwrmlightclient.lib -LIBRARY networkhandling.lib +LIBRARY aknskinsrv.lib // Active Idle internal dependencies -LIBRARY aiutils.lib aiidleint.lib +LIBRARY aiutils.lib +LIBRARY aiidleint.lib // Debugging dependencies -LIBRARY flogger.lib - -//++HV -LIBRARY akntransitionutils.lib -//--HV +LIBRARY flogger.lib DEFFILE aifwu.def diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/group/aiutils.mmp --- a/idlefw/group/aiutils.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/group/aiutils.mmp Wed May 12 13:36:47 2010 +0300 @@ -17,7 +17,6 @@ #include #include -//#include TARGET aiutils.dll TARGETTYPE dll @@ -26,11 +25,11 @@ CAPABILITY CAP_GENERAL_DLL SOURCEPATH ../src/utility -SOURCE aiutility.cpp -SOURCE caipspropertyobserver.cpp -SOURCE caistrparser.cpp -SOURCE caiplugintool.cpp -SOURCE caicontentitemarrayiterator.cpp +SOURCE aiutility.cpp +SOURCE caipspropertyobserver.cpp +SOURCE caistrparser.cpp +SOURCE caiplugintool.cpp +SOURCE caicontentitemarrayiterator.cpp SOURCE contentprioritymap.cpp SOURCE aipluginsettingsimpl.cpp @@ -40,5 +39,5 @@ MW_LAYER_SYSTEMINCLUDE LIBRARY euser.lib -LIBRARY charconv.lib +LIBRARY charconv.lib diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/group/bld.inf --- a/idlefw/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -25,15 +25,14 @@ PRJ_EXPORTS -../plugins/devicestatus/loc/aidevstaplgres.loc MW_LAYER_LOC_EXPORT_PATH(aidevstaplgres.loc) -../loc/aifw.loc MW_LAYER_LOC_EXPORT_PATH(aifw.loc) +../loc/aifw.loc MW_LAYER_LOC_EXPORT_PATH(aifw.loc) // Generic configuration interface for component cenrep settings ../conf/activeidle2.confml APP_LAYER_CONFML(activeidle2.confml) ../conf/activeidle2_10275102.crml APP_LAYER_CRML(activeidle2_10275102.crml) -../rom/idlefw.iby CORE_MW_LAYER_IBY_EXPORT_PATH(idlefw.iby) -../rom/idlefw_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(idlefw_resources.iby) +../rom/idlefw.iby CORE_MW_LAYER_IBY_EXPORT_PATH(idlefw.iby) +../rom/idlefw_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(idlefw_resources.iby) PRJ_MMPFILES aiutils.mmp diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/hslaunch/src/hslaunch.cpp --- a/idlefw/hslaunch/src/hslaunch.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/hslaunch/src/hslaunch.cpp Wed May 12 13:36:47 2010 +0300 @@ -16,6 +16,7 @@ */ #include +#include #include "hslaunch.h" // ========================= DECLARATIONS ================================== @@ -260,36 +261,36 @@ // ----------------------------------------------------------------------------- // void CHsLaunch::ProcessEnded( const TExitType& aExitType, - const TInt /*aExitReason*/, + const TInt aExitReason, const TExitCategoryName& /*aExitCategory*/ ) { - // Only respond to panic. EExitTerminate and EExitKill are ignored. - if( aExitType != EExitPanic ) - { - return; - } - TInt crashCount = 0; TInt error = RProperty::Get( KPSCategoryUid, KPSCrashCountKey, crashCount ); - if( error == KErrNone ) + // increment crash count in cenrep if the process has panic'd or killed with + // an error code + if( aExitType == EExitPanic || + ( aExitType == EExitKill && aExitReason != KErrNone ) ) { - crashCount++; - error = RProperty::Set( KPSCategoryUid, - KPSCrashCountKey, - crashCount ); - } - - if( error == KErrNone ) - { - User::After( KSleepOnRetry ); - Activate(); - } - else - { - ShutdownApp( error ); + if( error == KErrNone ) + { + crashCount++; + error = RProperty::Set( KPSCategoryUid, + KPSCrashCountKey, + crashCount ); + } + + if( error == KErrNone ) + { + User::After( KSleepOnRetry ); + Activate(); + } + else + { + ShutdownApp( error ); + } } } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aibackuprestorestatusobserver.h --- a/idlefw/inc/framework/aibackuprestorestatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Backup / Restore status observer -* -*/ - - -#ifndef C_AIBACKUPRESTORESTATUSOBSERVER_H -#define C_AIBACKUPRESTORESTATUSOBSERVER_H - -#include -#include -#include "aipsstatusobserver.h" - -class MAiPSPropertyObserver; - -/** - * @ingroup group_aifw - * - * Publish and subscribe key observer - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiBackupRestoreStatusObserver ) : public CAiPSStatusObserver - { -public: - -// Construction - - static CAiBackupRestoreStatusObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiBackupRestoreStatusObserver(); - -// functions from base class CAiPSStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiBackupRestoreStatusObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// new functions - - static TInt HandleBackupOperationEvent( TAny* aPtr ); - - }; - -#endif // C_AIBACKUPRESTORESTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aicallstatusobserver.h --- a/idlefw/inc/framework/aicallstatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Call status observer -* -*/ - - -#ifndef C_AICALLSTATUSOBSERVER_H -#define C_AICALLSTATUSOBSERVER_H - -#include -#include -#include "aipsstatusobserver.h" - -class MAiPSPropertyObserver; - -/** - * @ingroup group_aifw - * - * Publish and subscribe key observer - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiCallStatusObserver ) : public CAiPSStatusObserver - { -public: - -// Construction - - static CAiCallStatusObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiCallStatusObserver(); - -// functions from base class CAiPSStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiCallStatusObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// new functions - - static TInt HandleCallStateChange( TAny* aPtr ); - - }; - -#endif // C_AICALLSTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aicontentpluginmanager.h --- a/idlefw/inc/framework/aicontentpluginmanager.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Content plugin manager class for Active idle framework. -* -*/ - - - -#ifndef C_AICONTENTPLUGINMANAGER_H -#define C_AICONTENTPLUGINMANAGER_H - -#include -#include "aicontentmodel.h" -#include "aicontentpublisher.h" -#include "aifwdefs.h" -#include "aipluginsettings.h" -#include "aipluginfactory.h" - -class MAiContentObserver; -class MAiEventHandlerExtension; -class MAiPluginTool; -class CAiContentPublisher; -class CAiPluginStateManager; -class CAiUiController; -class CImplementationInformation; - -/** - * @ingroup group_aifw - * - * Content plugin manager class for Active idle framework. - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CAiContentPluginManager ) : public CBase - - { -public: // Constructor and destructor - - static CAiContentPluginManager* NewL(); - - virtual ~CAiContentPluginManager(); - -public: // New functions - - /** - * Forward plugin event to plugins. - * - * @since S60 3.2 - * @param aParam event string. - */ - void HandlePluginEvent( const TDesC& aParam ); - - /** - * Forward plugin event to plugins. - * - * @since S60 5.0 - * @param aPublisherInfo publisher info. - * @param aParam event string. - */ - void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); - - /** - * Queries wheter a plugin has settigns or not. - */ - TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); - - /** - * Requests a Content publisher plug-in to refresh a content item. - */ - TBool RefreshContent( const TDesC& aContentCid ); - - /** - * Sets plugins to online/offline - * - * @since S60 5.0 - * @param aOnline ETrue to set plugins online, EFalse to offline - * @paran aPublishers List of publishers - */ - void ProcessOnlineState( TBool aOnline ); - - /** - * Gets plugin state manager. - * - * @since S60 5.0 - * @return plugin state manager. - */ - CAiPluginStateManager& StateManager() const; - - /** - * Gets plugin factory. - * - * @since S60 5.0 - * @return plugin factory. - */ - CAiPluginFactory& PluginFactory() const; - - -private: // Constructors - - CAiContentPluginManager(); - - void ConstructL(); - -private: // New functions - - void GetIdL( CAiContentPublisher& aContentPublisher, - TAiPublisherProperty aProperty, - const TDesC& aName, TInt& aId ); - - TInt RefreshContentL( const TDesC& aContentCid ); - -private: // Data - - /** - * Plugins array. - * Owned. - */ - RPointerArray< CAiContentPublisher > iPlugins; - - /** - * Plugin factory. - * Owned. - */ - CAiPluginFactory* iPluginFactory; - - /** - * System state observer. - * Owned. - */ - CAiPluginStateManager* iStateManager; - - /** - * Plugin tool from utility lib. - * Owned. - */ - MAiPluginTool* iPluginTool; - }; - -#endif // C_AICONTENTPLUGINMANAGER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aicpsexecuteparam.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aicpsexecuteparam.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CPS Execute parameter + * +*/ + + +#ifndef AICPSEXECUTEPARAM_H +#define AICPSEXECUTEPARAM_H + +// System includes +#include + +// User includes + +// Forward declarations +class CLiwGenericParamList; +// Constants + +/** + * CPS Execute Command Parameter + * + * @since S60 5.2 + */ + +/** + * Holds parameters to execute the CPS excute command + * + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiCpsExecuteParam ) : public CBase + { +public: + // constructors and destructor + + /** + * Two-phased constructors. + */ + static CAiCpsExecuteParam* NewL( ); + static CAiCpsExecuteParam* NewLC(); + + /** + * Destructor. + */ + ~CAiCpsExecuteParam(); + +private: + // constructors + + /** + * C++ default constructor + */ + CAiCpsExecuteParam(); + + /** + * 2nd phase constructor + */ + void ConstructL( ); + +public: + // new functions + + /** + * Gets plugin id + * + * @since S60 5.2 + * @return plugin id + */ + const TDesC& PluginId() const; + + /** + * Returns the input parameter map for Execute command + * it will leave the CLiwDefaultMap object in the stack + * + * @since S60 5.2 + * @return in param map + */ + CLiwDefaultMap* InParamMapLC(); + + /** + * Adds a actions to the action list + * + * @since S60 5.2 + * @param aAction actions to add + */ + void AddActionL(const TDesC8& aAction); + + /** + * Sets the filter values + * This method always over write the previous filters vlaues. + * + * @since S60 5.2 + * @param aMap filter map + */ + void SetFilterL(CLiwDefaultMap* aMap); + + /** + * Sets Registry type + * This method always over write the previous retgistry type. + * + * @since S60 5.2 + * @param aRegistryType type of cps registry + */ + void SetRegistryTypeL(const TDesC& aRegistryType); + + /** + * Sets the plugin id + * This method always over write the previous plugin id. + * + * @since S60 5.2 + * @param aPluginId actions to add + */ + void SetPluginIdL(const TDesC& aPluginId); + +private: + // data + /** Plugin Id, owned.*/ + HBufC* iPluginId; + /** Registry type, owned. */ + HBufC* iRegistryType; + /** Filters, owned.*/ + HBufC* iPublisher; + HBufC* iContentType; + HBufC* iContentId; + + /** action trigger list, owned. */ + RPointerArray iActions; + }; + +#endif /* AICPSEXECUTEPARAM_H */ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aidevicestatusobserver.h --- a/idlefw/inc/framework/aidevicestatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Device status observer -* -*/ - - -#ifndef M_AIDEVICESTATUSOBSERVER_H -#define M_AIDEVICESTATUSOBSERVER_H - -#include "aipluginstatemachine.h" - -/** - * description - * - * @lib aifw - * @since S60 3.2 - */ -class MAiDeviceStatusObserver - { - -public: - - virtual ~MAiDeviceStatusObserver(){} - - virtual TAiStateChanges Status() = 0; - - }; - -#endif // M_AIDEVICESTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aiecomobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aiecomobserver.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CAiEcomObserver class implementation. + * +*/ + + +#ifndef AIECOMOBSERVER_H +#define AIECOMOBSERVER_H + +// System includes +#include +#include +#include + +// User includes + + +// Class declaration +/** + * + * Active Idle ECom observer + * + * @ingroup group_aifw + * @lib aifw.lib + * @since S60 5.2 + */ +class MAiEcomObserver + { +public: + + /** + * This is called when the IdleFw detects a change in ECom + * plugin registrations (adding, removing or upgrading ECOM-plugins). + * + * @since S60 5.2 + */ + virtual void NotifyEcomRegistryChanged() = 0; + }; + + +// Class declaration +/** + * + * Active Idle ECom observer + * + * @ingroup group_aifw + * @lib aifw.lib + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiEcomObserver ) : public CActive + { +public: + // constructors and destructor + + // Two-phased constructor. + static CAiEcomObserver* NewL(); + + // Two-phased constructor. + static CAiEcomObserver* NewLC(); + + // Cancel and destroy + ~CAiEcomObserver(); + +public: + // New functions + + /** + * Adds a new observer for plugin notifications. + * @param aObserver Observer pointer. + */ + void AddObserverL( MAiEcomObserver* aObserver ); + +private: + // new functions + + // Start observing ecom notification + void StartObserving(); + + // Notifies observers + void NotifyObservers(); + +private: + // constructors + + /** + * C++ default constructor + */ + CAiEcomObserver(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: + // from CActive + + /** + * @see CActive + */ + void RunL(); + + /** + * @see CActive + */ + void DoCancel(); + +private: + // data + + /** ECom session handle (must be closed, not deleted), Own */ + REComSession iEComSession; + + /** Own: Array of Observers - pointer not owned */ + RPointerArray< MAiEcomObserver > iObservers; + +private: + // friend classes + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiEcomObserver; +#endif + }; + +#endif // AIECOMOBSERVER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aienvironmentchangeobserver.h --- a/idlefw/inc/framework/aienvironmentchangeobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Environment observer -* -*/ - - -#ifndef C_AIENVIROMENTCHANGEOBSERVER_H -#define C_AIENVIROMENTCHANGEOBSERVER_H - -#include -#include "aidevicestatusobserver.h" -#include "aiuiframeworkobserver.h" - -class MAiStateManager; -class CEnvironmentChangeNotifier; - -/** - * @ingroup group_aifw - * - * System enviroment change observer. - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CAiEnvironmentChangeObserver ) : public CBase, - public MAiDeviceStatusObserver - { -public: - -// Construction - - static CAiEnvironmentChangeObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiEnvironmentChangeObserver(); - -// functions from base class CAiEnvironmentChangeObserver - - TAiStateChanges Status(); - -// new functions - - static TInt EnvironmentChangeCallBack(TAny* aPtr); - -private: - -// Construction - - CAiEnvironmentChangeObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -protected: // Data - - /** - * State manager. - * Not own. - */ - MAiStateManager* iStateManager; - - /** - * Enviroment change notifier: time, locale and midnight crossover - * Own. - */ - CEnvironmentChangeNotifier* iEnvironmentChangeNotifier; - }; - -#endif // C_AIENVIROMENTCHANGEOBSERVER_H - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aieventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aieventhandler.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content plugin event handler class for Active idle framework. +* +*/ + + + +#ifndef _AIEVENTHANDLER_H +#define _AIEVENTHANDLER_H + +// System includes +#include + +// User includes +#include + +// Forward declarations +class MAiPluginTool; +class CAiPluginFactory; +class CHsContentPublisher; +class THsPublisherInfo; + +// Class declaration +/** + * @ingroup group_aifw + * + * Content plugin eventhandler class for Active idle framework. + * + * @lib aifw + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiEventHandler ) : public CBase + { +public: // Constructor and destructor + + static CAiEventHandler* NewL( CAiPluginFactory& aFactory ); + + ~CAiEventHandler(); + +public: // New functions + + /** + * Forward plugin event to plugins. + * + * @since S60 5.2 + * @param aParam event string. + */ + void HandlePluginEvent( const TDesC& aParam ); + + /** + * Forward plugin event to plugins. + * + * @since S60 5.2 + * @param aPublisherInfo publisher info. + * @param aParam event string. + */ + void HandlePluginEventL( + const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ); + + /** + * Queries wheter a plugin has a menuitem or not. + * + * @since S60 5.2 + * @param aPublisherInfo publisher info. + * @param aMenuItem menuitem to query. + * @return ETrue if exists, EFalse otherwise + */ + TBool HasMenuItemL( + const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + + /** + * Requests a Content publisher plug-in to refresh a content item. + * + * @since S60 5.2 + * @param aContentCid Content id to refresh + * @return ETrue if succesful, EFalse otherwise + */ + TBool RefreshContent( const TDesC& aContentCid ); + + /** + * Requests a Content publisher plug-in to refresh a content item. + * + * @since S60 5.2 + * @param aPublisherInfo publisher info. + * @param aContentCid Content id to refresh + * @return ETrue if succesful, EFalse otherwise + */ + TBool RefreshContent( + const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); + + /** + * Requests a Content publisher plug-in to suspend a content item. + * + * @since S60 5.2 + * @param aPublisherInfo publisher info. + * @param aContentCid Content id to suspend + * @return ETrue if succesful, EFalse otherwise + */ + TBool SuspendContent( + const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); + +private: + // Constructors + + /** + * C++ default contructor + */ + CAiEventHandler( CAiPluginFactory& aFactory ); + + /** + * 2nd phase contructor + */ + void ConstructL(); + +private: + // new functions + + void GetIdL( CHsContentPublisher& aContentPublisher, + CHsContentPublisher::TProperty aProperty, const TDesC& aName, TInt& aId ); + + TInt RefreshContentL( const TDesC& aContentCid ); + +private: + // data + + /** Plugin factory, Not owned */ + CAiPluginFactory& iFactory; + /** Plugin tool from utility lib, Owned */ + MAiPluginTool* iPluginTool; + +private: + // friend classes + +#ifdef _AIFW_UNIT_TEST + class UT_AiEventHandler; +#endif + }; + +#endif // _AIEVENTHANDLER_H + +// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aifocusobserver.h --- a/idlefw/inc/framework/aifocusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: AI2 focus observer. -* -*/ - - -#ifndef C_AIFOCUSOBSERVER_H -#define C_AIFOCUSOBSERVER_H - -#include -#include -//++HV -#include -//--HV -#include "aipsstatusobserver.h" - -class MAiPSPropertyObserver; - -/** - * @ingroup group_aifw - * - * Focus change observer. Using telephony idle visiblity PS. - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiFocusObserver ) : public CAiPSStatusObserver - //++HV - ,public MAknTransitionUtilsObserver - //--HV - { -public: - -// Construction - - static CAiFocusObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiFocusObserver(); - -// functions from base class CAiPSStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiFocusObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// new functions - - //++HV - - static TInt StaticHandleFocusChangeEvent( TAny* aPtr ); - TInt HandleFocusChangeEvent(); - - - // From MAknTransitionUtilsObserver - TInt AknTransitionCallback(TInt aEvent, TInt aState = 0, const TDesC8* aParams = NULL); - - -private: - TBool iTfxEffectActive; - - - //--HV - }; - -#endif // C_AIFOCUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aifw.h --- a/idlefw/inc/framework/aifw.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/inc/framework/aifw.h Wed May 12 13:36:47 2010 +0300 @@ -16,38 +16,36 @@ */ -#ifndef C_AIFW_H -#define C_AIFW_H +#ifndef _AIFW_H +#define _AIFW_H +// System includes #include -#include -#include #include -#include "aifwdefs.h" -#include "aicontentmodel.h" -#include "aifweventhandler.h" +// User includes +#include +// Forward declarations class CAiUiControllerManager; -class CAiContentPluginManager; +class CAiStateManager; +class CAiStateProvider; +class CAiPluginFactory; +class CAiEventHandler; class CAiWsPluginManager; -class CAiPluginStateManager; -class RConeResourceLoader; -class CAiContentPublisher; -class MAiPSPropertyObserver; -class CAiNetworkListener; +class THsPublisherInfo; +// Class declaration /** * @ingroup group_aifw * * Active Idle Framework main class. */ -NONSHARABLE_CLASS( CAiFw ) : - public CBase, - public MAiFwEventHandler, - public MCenRepNotifyHandlerCallback +NONSHARABLE_CLASS( CAiFw ) : public CBase, public MAiFwEventHandler, + public MCenRepNotifyHandlerCallback { -public: // Constructors and destructors +public: + // constructors and destructor /** * Creates and returns a new Active Idle Framework object. @@ -59,6 +57,9 @@ */ IMPORT_C static CAiFw* NewLC(); + /** + * Destructor + */ ~CAiFw(); public: // New functions @@ -72,11 +73,21 @@ */ IMPORT_C void RunL(); -private: // Constructors +private: + // constructors + + /** + * Default C++ constructor + */ CAiFw(); + + /** + * 2nd phase constructor + */ void ConstructL(); -private: // From MAiFwEventHandler +private: + // from MAiFwEventHandler /** * @see MAiFwEventHandler @@ -97,17 +108,7 @@ * @see MAiFwEventHandler */ void HandleUiShutdown( CAiUiController& aUiController ); - - /** - * @see MAiFwEventHandler - */ - void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ); - - /** - * @see MAiFwEventHandler - */ - void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ); - + /** * @see MAiFwEventHandler */ @@ -116,77 +117,86 @@ /** * @see MAiFwEventHandler */ - void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); + void HandlePluginEventL( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aParam ); /** * @see MAiFwEventHandler */ - TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + TBool HasMenuItemL( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aMenuItem ); /** * @see MAiFwEventHandler */ TBool RefreshContent( const TDesC& aContentCid ); + + /** + * @see MAiFwEventHandler + */ + TBool RefreshContent( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ); + + /** + * @see MAiFwEventHandler + */ + TBool SuspendContent( + const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ); /** * @see MAiFwEventHandler */ TBool QueryIsMenuOpen(); - - /** - * @see MAiFwEventHandler - */ - void ProcessStateChange( TAifwStates aState ); -private: // From MCenRepNotifyHandlerCallback +private: + // from MCenRepNotifyHandlerCallback /** * @see MCenRepNotifyHandlerCallback */ void HandleNotifyInt( TUint32 aId, TInt aNewValue ); -private: // New functions - - static TInt HandleFocusChangeEvent( TAny* aSelf ); - static TInt HandleRestartEvent( TAny* aSelf ); - void SwapUiControllerL( TBool aToExtHS ); - -private: // Data +public: + // new functions /** - * UI Controller manager, Owned. - */ - CAiUiControllerManager* iUiControllerManager; - - /** - * Content plugin manager, Owned. - */ - CAiContentPluginManager* iPluginManager; - - /** - * Window server plug-in manager, Owned. - */ - CAiWsPluginManager* iWsPluginManager; - - /** - * Notify handler for cenrep, Owned. + * Get repository + * + * @since S60 5.2 + * @return Repositury */ - CCenRepNotifyHandler* iNotifyHandler; + CRepository& Repository() const; - /** - * Notify handler for cenrep, Owned. - */ - CCenRepNotifyHandler* iNotifyHandlerESS; +private: + // new functions + + void SwapUiControllerL( TBool aToExtHS ); - /** - * Idle repository, Owned. - */ - CRepository* iAIRepository; +private: + // data - /** - * Idle restart PS observer, Owned. - */ - MAiPSPropertyObserver* iIdleRestartObserver; + /** UI Controller manager, Owned. */ + CAiUiControllerManager* iUiControllerManager; + /** Plugin factory, Owned */ + CAiPluginFactory* iFactory; + /** State manager, Owned */ + CAiStateManager* iStateManager; + /** State provider, Owned */ + CAiStateProvider* iStateProvider; + /** Plugin event handler, Owned. */ + CAiEventHandler* iEventHandler; + /** Window server plug-in manager, Owned. */ + CAiWsPluginManager* iWsPluginManager; + /** Notify handler for cenrep, Owned. */ + CCenRepNotifyHandler* iNotifyHandler; + /** Notify handler for cenrep, Owned. */ + CCenRepNotifyHandler* iNotifyHandlerESS; + /** Idle repository, Owned. */ + CRepository* iRepository; TBool iLibrariesLoaded; @@ -195,5 +205,5 @@ RLibrary iLibrary3; }; -#endif // C_AIFW_H +#endif // _AIFW_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aifwstartupscheduler.h --- a/idlefw/inc/framework/aifwstartupscheduler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Custom active scheduler for Active Idle Framework startup. -* -*/ - - -#ifndef C_AIFWSTARTUPSCHEDULER_H -#define C_AIFWSTARTUPSCHEDULER_H - - -#include - -/** - * Custom active scheduler for Active Idle Framework startup. - */ -NONSHARABLE_CLASS( CAiFwStartupScheduler ) : public CActiveScheduler - { -public: - static CAiFwStartupScheduler* NewLC(); - - ~CAiFwStartupScheduler(); - - /** - * Returns result code from this scheduler's execution. - * - * @return - KErrNone if the scheduler loop executed succesfully - * - Any of the system-wide error codes in case of an error. - */ - TInt Result(); - -private: -// from base class CActiveScheduler - void Error(TInt aError) const; - -// Construction - CAiFwStartupScheduler(); -private: // data - - /** - * Result code returned by Result(). - */ - mutable TInt iResult; - }; - - -#endif // ? C_AIFWSTARTUPSCHEDULER_H - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aikeylockobserver.h --- a/idlefw/inc/framework/aikeylockobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: AI2 keylock status observer. -* -*/ - - -#ifndef C_AIKEYLOCKOBSERVER_H -#define C_AIKEYLOCKOBSERVER_H - -#include -#include -#include "aipsstatusobserver.h" - -class MAiPSPropertyObserver; - -/** - * @ingroup group_aifw - * - * Keylock status change observer. - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiKeylockObserver ) : public CAiPSStatusObserver - { -public: - -// Construction - - static CAiKeylockObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiKeylockObserver(); - -// functions from base class CAiPSStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiKeylockObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// new functions - - static TInt HandleKeylockStatusEvent( TAny* aPtr ); - - }; - -#endif // C_AIKEYLOCKOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/ailightstatusobserver.h --- a/idlefw/inc/framework/ailightstatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Light status observer -* -*/ - - -#ifndef C_AILIGHTSTATUSOBSERVER_H -#define C_AILIGHTSTATUSOBSERVER_H - -#include -#include -#include -#include "aidevicestatusobserver.h" - -class MAiStateManager; - -/** - * @ingroup group_aifw - * - * Publish and subscribe key observer - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiLightStatusObserver ) : public CBase, - public MHWRMLightObserver, - public MAiDeviceStatusObserver - { -public: - -// Construction - - static CAiLightStatusObserver* NewL( MAiStateManager* aStateManager ); - - ~CAiLightStatusObserver(); - -// functions from base class MAiDeviceStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiLightStatusObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// from MHWRMLightObserver - - void LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus ); - -protected: // Data - - /** - * Light client. - * Own. - */ - CHWRMLight* iLight; - - /** - * State manager. - * Not own. - */ - MAiStateManager* iStateManager; - - }; - -#endif // C_AILIGHTSTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/ainetworklistener.h --- a/idlefw/inc/framework/ainetworklistener.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Network info listener -* -*/ - -#ifndef C_NETWORKLISTENER_H -#define C_NETWORKLISTENER_H - -#include -#include -#include "ainetworkobserver.h" - -class MAiNetworkObserver; -class CNWSession; - -/** - * @ingroup group_xmluicontroller - * - * Network info listener. - * - * Client can use this object to listen network state changes. Client must implement - * MAiNetworkObserver interface to retrieve network state changes - * - * @since S60 5.0 - */ -NONSHARABLE_CLASS(CAiNetworkListener) : public CBase, - public MNWMessageObserver - { -public: - - static CAiNetworkListener* CAiNetworkListener::NewL(MAiNetworkObserver& aNetworkObserver); - - virtual ~CAiNetworkListener(); - - /** - * Get current network status - * @return TNetworkState - */ - MAiNetworkObserver::TNetworkState NetworkState(); - -// from base class MNWMessageObserver - - /** - * From MNWMessageObserver. - * Called by network handling engine when network info changes. - * - * @since S60 5.0 - * @param aMessage is type of the change. - */ - void HandleNetworkMessage( const TNWMessages aMessage ); - - /** - * From MNWMessageObserver. - * Called if network handling engine fails. - * - * @since S60 5.0 - * @param aOperation is failed operation. - * @param aErrorCode is fail reason. - */ - void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); - -private: - TBool HasNetworkInfoChanged( const TNWMessages aMessage ); - - MAiNetworkObserver::TNetworkState InterpretNWMessage(const TNWMessages aMessage, const TNWInfo); - - CAiNetworkListener(MAiNetworkObserver& aNetworkObserver); - - void ConstructL(); - - -private: // data - - /** - * Session to network handling engine. - * Own. - */ - CNWSession* iSession; - - /** - * Cached network info structure. - */ - TNWInfo iInfo; - - /** - * Previous network information. - */ - TNWInfo iOldInfo; - - /** - * Reference to client observing - */ - MAiNetworkObserver& iObserver; - - - /** - * Network related message flags - */ - - enum TNetInfoFlags - { - ENetworkProviderNameReceived = 0x00000001, - ENetworkProviderNameOk = 0x00000002, - EServiceProviderNameReceived = 0x00000004, - EServiceProviderNameOk = 0x00000008, - ERegistrationStatusReceived = 0x00000010, - ENetworkInfoChangeReceived = 0x00000020, - EProgrammableOperatorInfoReceived = 0x00000040, - EProgrammableOperatorInfoReceivedOk = 0x00000080 - }; - - /** - * Subset of sum of TNetInfoFlags. - */ - TUint iReceivedMessageFlags; - - /** - * Subset of sum of old TNetInfoFlags. - */ - TUint iOldReceivedMessageFlags; - - /** - * current state of network - */ - MAiNetworkObserver::TNetworkState iCurrentNwState; - }; -//} - -#endif // C_AINETWORKINFOLISTENER_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/ainetworkobserver.h --- a/idlefw/inc/framework/ainetworkobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Network info observer -* -*/ - -#ifndef M_NETWORKOBSERVER_H -#define M_NETWORKOBSERVER_H - -#include -#include - -/** - * @ingroup group_xmluicontroller - * - * Network info observer. - * - * Client gets network state changes through this interface. - * - * @since S60 5.0 - */ -class MAiNetworkObserver - { - -public: - enum TNetworkState - { - ENone = 0, - EHomeNetwork, - ERoaming - }; - -protected: - - /** - * Virtual destructor. - * Cannot be used to destruct the object. - */ - virtual ~MAiNetworkObserver() {}; - -public: - - /** - * Called when network info changes. - * - * @since S60 5.0 - * @param aNewState new network state - */ - virtual void HandleNetworkStateChange( TNetworkState aNewState ) = 0; - - }; - -#endif // M_AINETWORKINFOOBSERVER_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/ainwsdlgcontroller.h --- a/idlefw/inc/framework/ainwsdlgcontroller.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Network selection dialog controller -* -*/ - - -#ifndef C_AINWSDLGCONTROLLER_H -#define C_AINWSDLGCONTROLLER_H - -#include -#include -#include - -class CNWSession; - -/** - * Network Selection Dialog controller. - */ -NONSHARABLE_CLASS( CAiNwSDlgController ) : - public CBase, - public MNWMessageObserver - { -public: - -// Constructors and destructors - - /** - * Creates a new instance of the class. - * - * @return A new instance of the class. - * @exception Any of the system-wide error codes if instance creation - * fails due to an unrecoverable error. - */ - static CAiNwSDlgController* NewL(); - - ~CAiNwSDlgController(); - -// from MNWMessageObserver - - void HandleNetworkMessage( const TNWMessages aMessage ); - void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); - -private: - -// Constructors - - CAiNwSDlgController(); - - void ConstructL(); - -private: - -// New functions - - /** - * Take action according to current state change. - */ - void HandleStateChange(); - - /** - * - */ - void HandleNetworkFound(); - - /** - * - */ - void HandleNetworkLost(); - - /** - * Opens the network selection dialog. - */ - void LaunchDialog(); - - /** - * Cancels the network selection dialog. - */ - void CancelDialog(); - - /** - * Tests if offline mode is engaged. - * - * @return ETrue if offline mode is currently active - */ - TBool IsOffLineMode() const; - - /** - * Tests if Bluetooth SAP is in connected mode. - * - * @return ETrue if Bluetooth SAP is active. - */ - TBool IsBluetoothSAPConnected() const; - - static TInt DelayCallBack(TAny* aParam); - -private: - -// Data - - /** - * Notifier service - * Own - */ - CAknSoftNotifier* iSoftNotifier; - - /** - * Session to network handling engine. - * Own. - */ - CNWSession* iSession; - - /** - * Cached network info structure. - */ - TNWInfo iInfo; - - /** - * A true value if registered to network. - */ - TBool iRegistered; - - /** - * Profile API. - */ - CRepository* iProfileApi; - - /** - * Timer object for 1-minute delay - */ - CPeriodic* iPeriodic; - }; - -#endif // C_AINWSDLGCONTROLLER_H - -// End of file. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginactivitypstool.h --- a/idlefw/inc/framework/aipluginactivitypstool.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin activity PS tool -* -*/ - - -#ifndef AIPLUGINACTIVITYPSTOOL_H -#define AIPLUGINACTIVITYPSTOOL_H - -#include // TUid -#include // RProperty - -struct TAiPublisherInfo; - -NONSHARABLE_CLASS(CAiPluginActivityRegistry) : public CBase - { - public: - - static CAiPluginActivityRegistry* NewL(); - - TInt SetPluginActive( const TAiPublisherInfo& aPubInfo ); - - void CleanRegistry(); - - ~CAiPluginActivityRegistry(); - - private: - - // construction - - void ConstructL(); - - CAiPluginActivityRegistry(); - - // new methods - - /** - * Update PS registry count register. - */ - TInt UpdateCountRegister(); - - /** - * Update PS registry ordinal register. - */ - TInt UpdateOrdinalRegister( TInt aPluginUid ); - - /** - * Update plugins name register. - */ - TInt UpdateNameRegister( TInt aPluginUid, - const TDesC& aName ); - - /** - * Clean last added entry. In case of failure. - */ - void CleanLastEntry( TInt aPluginUid, - TInt aOrdinal, - TInt aLastCount ); - - private: // Members - - /** - * Ordinal in registry. Ascending. - */ - TInt iRegistryOrdinal; - - /** - * Plugin count in registry. - */ - TInt iPluginCount; - - /** - * PS property that is updated. - */ - RProperty iProperty; - - }; - -#endif // AIPLUGINACTIVITYPSTOOL_H - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginfactory.h --- a/idlefw/inc/framework/aipluginfactory.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/inc/framework/aipluginfactory.h Wed May 12 13:36:47 2010 +0300 @@ -11,134 +11,169 @@ * * Contributors: * -* Description: Content plugin manager class for Active idle framework. +* Description: Plugin factory class for Active idle framework. * */ -#ifndef C_AIPLUGINASYNCFACTORY_H -#define C_AIPLUGINASYNCFACTORY_H +#ifndef _AIPLUGINCFACTORY_H +#define _AIPLUGINCFACTORY_H -#include "aicontentpublisher.h" -#include "aipropertyextension.h" -#include "aifwdefs.h" +// System includes #include +#include + +// User includes -class MAiContentObserver; -class MAiEventHandlerExtension; -class MAiContentItemIterator; -class CAiContentPublisher; -class CAiUiController; -class CAiPluginActivityRegistry; -class CImplementationInformation; -class CAiContentPluginManager; -class MAiPluginTool; -class MAiPluginLifecycleObserver; +// Forward declarations +class CAiUiControllerManager; +class CAiStateManager; +class CAiCpsCommandBuffer; +class CHsContentPublisher; +class THsPublisherInfo; +// Class declaration /** * @ingroup group_aifw * - * Content plugin factory class for Active idle framework. + * Plugin factory class for Active idle framework. * * @lib aifw - * @since S60 3.2 + * @since S60 5.2 */ NONSHARABLE_CLASS( CAiPluginFactory ) : public CBase { - public: +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiPluginFactory* NewL( CAiUiControllerManager& aManager ); -// Constructor and destructor - - static CAiPluginFactory* NewL( RPointerArray& aPlugins, - CAiContentPluginManager& aManager ); - - virtual ~CAiPluginFactory(); + /** + * Destructor + */ + ~CAiPluginFactory(); -// New functions +public: + // new functions - /** - * Create plugin - * - * @since S60 5.0 - * @param aPublisherInfo plugin to load. - * @param aControllerArray array of active UI controllers. - */ - void CreatePluginL( const TAiPublisherInfo& aPublisherInfo, - RPointerArray& aControllerArray ); + /** + * Create plugin + * + * @since S60 5.2 + * @param aPublisherInfo plugin to create. Factory keeps plugin's ownership. + * @return KErrNone if plugin is created succesfully, otherwise system wide error code. + */ + TInt CreatePlugin( + const THsPublisherInfo& aPublisherInfo ); + + /** + * Destroy plugin + * + * @since S60 5.2 + * @param aPublisherInfo plugin to destroy. + */ + void DestroyPlugin( + const THsPublisherInfo& aPublisherInfo ); - /** - * Destroy plugin - * - * @since S60 5.0 - * @param aPublisherInfo plugin to destroy. - * @param aControllerArray array of active UI controllers. - */ - void DestroyPluginL( const TAiPublisherInfo& aPublisherInfo, - RPointerArray& aControllerArray ); + /** + * Destroy plugin + * + * @since S60 5.2 + * @param aUid Implementation UID of a plugin to destroy. + */ + void DestroyPlugin( + const TUid& aUid ); - /** - * Destroys all plugins - * - * @since S60 5.0 - */ - void DestroyPlugins(); - - - void AddLifecycleObserverL( MAiPluginLifecycleObserver& aObserver ); + /** + * Finds plugin by publisher info. + * + * @since S60 5.2 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByInfo( + const THsPublisherInfo& aPublisherInfo ) const; - /** - * Finds plugin by publisher info. - * - * @since S60 5.0 - * @param aInfo publisher info. - * @return Pointer to plugin, NULL if not found. - */ - CAiContentPublisher* PluginByInfoL( const TAiPublisherInfo& aInfo ) const; + /** + * Finds plugin by uid. + * + * @since S60 5.2 + * @param aInfo publisher uid. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByUid( const TUid& aUid ) const; + + /** + * Finds plugin by name. + * + * @since S60 5.2 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. Factory keeps plugin's ownership. + */ + CHsContentPublisher* PluginByName( const TDesC& aName ) const; + + /** + * Sets cps command buffer + * + * @since S60 5.2 + * @param aCommanddBuffer Command buffer + */ + void SetCommandBuffer( CAiCpsCommandBuffer* aCommanddBuffer ); + +private: + // private constructors - /** - * Finds plugin by name. - * - * @since S60 5.0 - * @param aInfo publisher info. - * @return Pointer to plugin, NULL if not found. - */ - CAiContentPublisher* PluginByNameL( const TDesC& aName ) const; - - private: - -// Constructors - - CAiPluginFactory( RPointerArray& aPlugins, - CAiContentPluginManager& aManager ); + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CAiPluginFactory( CAiUiControllerManager& aManager ); - void ConstructL(); - -// New functions - - CAiContentPublisher* CreatePluginLC( const TAiPublisherInfo& aPluginInfo ); - - void SubscribeContentObserversL( CAiContentPublisher& aContentPublisher, - const TAiPublisherInfo& aPublisherInfo, - RPointerArray& aControllerArray ); - - void ConfigurePluginL( RPointerArray& aControllerArray, - CAiContentPublisher& aContentPublisher, - const TAiPublisherInfo& aPubInfo ); +private: + // new functions + + void CreatePluginL( + const THsPublisherInfo& aPublisherInfo ); + + void SubscribeContentObserversL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ); + + void ConfigurePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ); + + RPointerArray< CHsContentPublisher >& Publishers() const; - private: // Data - // Array of loaded data plugins, Not owned - RPointerArray& iPlugins; - // Content plugin manager, Not owned - CAiContentPluginManager& iManager; - // Ecom implementation info, Owned - RImplInfoPtrArray iEComPlugins; - // Plugin tool from utility lib, Owned - MAiPluginTool* iPluginTool; - // Life cycle observers, Owned - RPointerArray iLifecycleObservers; +private: + // data + + /** UI Controller Manager, Not owned */ + CAiUiControllerManager& iUiControllerManager; + /** Cps command buffer, Not owned */ + CAiCpsCommandBuffer* iCommandBuffer; + /** Array of loaded data plugins, Owned */ + mutable RPointerArray< CHsContentPublisher > iPublishers; + /** Ecom implementation info, Owned */ + RImplInfoPtrArray iEComPlugins; + +private: + // friend classes + friend class CAiStateManager; + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiPluginFactory; +#endif }; -#endif // C_AIPLUGINASYNCFACTORY_H +#endif // _AIPLUGINCFACTORY_H // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginlifecycleobserver.h --- a/idlefw/inc/framework/aipluginlifecycleobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin lifecycle observer -* -*/ - - - -#ifndef M_AIPLUGINLIFECYCLEOBSERVER_H -#define M_AIPLUGINLIFECYCLEOBSERVER_H - -#include "aipropertyextension.h" -#include - -class CAiContentPublisher; - -// Unnamed namespace for local definitions -namespace - { - const TInt KAIUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; - - const TInt KAIUidShortCutPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN; - - const TInt KAIUidProfilePlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; - - const TInt KAIUidSATPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SATPLUGIN; - } - -/** - * Plugin lifecycle observer base class. - * - * @lib aifw - * @since S60 3.2 - */ -class MAiPluginLifecycleObserver - { -public: - - /** - * Report plugin created. - * @param aPlugin reference to the created plugin. - */ - virtual void PluginCreatedL( CAiContentPublisher& aPlugin ) = 0; - - /** - * Report plugin destroyed. - * @param aPlugin reference to the dtored plugin. - */ - virtual void PluginDestroyed( CAiContentPublisher& aPlugin ) = 0; - - /** - * Report all plugins created. - */ - virtual void AllPluginsCreated() = 0; - - /** - * Report all plugins destroyed. - */ - virtual void AllPluginsDestroyed() = 0; - -protected: - - /** - * Protected destructor prevents deletion through this interface. - */ - ~MAiPluginLifecycleObserver() { }; - }; - -#endif // M_AIPLUGINSTATEMANAGER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginstate.h --- a/idlefw/inc/framework/aipluginstate.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin state main class -* -*/ - - -#ifndef M_AIPLUGINSTATE_H -#define M_AIPLUGINSTATE_H - -#include "aipluginstatemachine.h" - -/** - * Plugin state interface. - * - * @lib aifw - * @since S60 3.2 - */ -class MAiPluginState - { -public: - - /** - * This method is called when state is entered. - * - * @param aStateMachine reference to the owning state machine. - * @param aStateChange the system state variable change that caused this - * state change. - */ - virtual void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) = 0; - - /** - * This method handles system state variable state changes - * handles events in the current state. - * - * @param aStateMachine reference to the owning state machine. - * @param aStateChange the system state variable change that is the cause - * of this event. - * @return TBool did the state handle the event. - */ - virtual TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) = 0; - - /** - * This method is called when state is exited. - * - * @param aStateMachine reference to the owning state machine. - * @param aStateChange the system state variable change that caused this - * state change. - */ - virtual void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) = 0; - -protected: - - ~MAiPluginState() - { - }; - - }; - -#endif // M_AIPLUGINSTATE_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginstatemachine.h --- a/idlefw/inc/framework/aipluginstatemachine.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin state mmchine base class -* -*/ - - -#ifndef M_AIPLUGINSTATEMACHINE_H -#define M_AIPLUGINSTATEMACHINE_H - -#include - -class MAiPluginState; - -/** - * TAiStateChanges state change enumeration for each separate monitored state. - */ -enum TAiStateChanges - { - ESMAIInCall, - ESMAINoCall, - ESMAIBacklightOn, - ESMAIBacklightOff, - ESMAIBackupOn, - ESMAIBackupOff, - ESMAIIdleForeground, - ESMAIIdleBackground, - ESMAISystemBoot, - ESMAISystemShutdown, - ESMAILocaleChanged, - ESMAITimeChanged, - ESMAIMidnightCrossover, - ESMAIReportThemeChangeStarted, - ESMAIReportThemeChangeReady, - ESMAIRelayoutScreen, - ESMAIGeneralThemeChanged, - ESMAIT1Timeout, - ESMAIKeylockEnabled, - ESMAIKeylockDisabled, - ESMAIUnknownState, - ESMAIEnterEditMode, - ESMAIExitEditMode, - ESMAIOffLine, - ESMAIOnLine, - ESMAIPageSwitch - }; - -/** - * Sate variable enumeration for querying the status of the monitored item. - */ -enum TAiStateVariable - { - ESMAICallStatus, - ESMAILightStatus, - ESMAIBackupRestoreStatus, - ESMAIIdleFocusStatus - }; - -/** - * Possible states of the state machine (and plugin). - */ -enum TAiState - { - EAiIdle = 1, - EAiSuspended, - EAiAlive, - EAiAliveActive, - EAiAliveIncall, - EAiAliveInactive - }; - -/** - * Sub states of idle state. - */ -enum TAiIdleSubState - { - EAiIdleCreatingPlugins = EAiAliveInactive + 1, - EAiIdleBackupRestore - }; - -/** - * @ingroup group_aifw - * - * Plugin state resource interface. - * - * @lib aifw - * @since S60 3.2 - */ -class MAiPluginStateResources - { -public: - - /* - * Check whether the specified state variable is active or not. - * - * @param aStateVariable system variable state change that is to be checked. - */ - virtual TBool StateVariable( TAiStateVariable aStateVariable ) = 0; - - /** - * Translates system state change reason to plugin state state reason. - * - * @param aStateChange the system state variable change to be translated. - * @return TAiTransitionReason plugin state transition reason. - */ - virtual TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ) = 0; - - /** - * Restart plugin suspend timer. - */ - virtual void RestartSuspendTimer() = 0; - -protected: - ~MAiPluginStateResources() {} - }; - -/** - * Plugin state machine interface. - * - * @lib aifw - * @since S60 3.2 - */ -class MAiPluginStateMachine : public MAiPluginStateResources - { -public: - - /* - * Method that changes this state machine to a state. - * - * @param aState state to change to. - * @param aStateChange system variable state change that is the cause for this call. - */ - virtual void SwitchToState( TAiState aState, - TAiStateChanges aStateChange ) = 0; - - /* - * Reference to the plugin that is managed by this state machine. - * - * @return CAiContentPublisher reference to the plugin. - */ - virtual CAiContentPublisher& Plugin() const = 0; - - /** - * Change plugin states. - * - * @param aReason for transition - * @param aStateChangeMethod state change method to call - * @param aLogOpCode operation code for logging - */ - virtual void ChangePluginState( - TAiTransitionReason aReason, - void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ) = 0; - -protected: - ~MAiPluginStateMachine() {} - }; - -#endif // M_AIPLUGINSTATEMACHINE_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginstatemachineimpl.h --- a/idlefw/inc/framework/aipluginstatemachineimpl.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin state machine implementation -* -*/ - - -#ifndef C_AIPLUGINSTATEMACHINEIMPL_H -#define C_AIPLUGINSTATEMACHINEIMPL_H - -#include -#include -#include "aipluginstatemachine.h" -#include "aistatealive.h" -#include "aistatesuspended.h" -#include "aistateidle.h" - -class MAiPluginStateControl; -class MAiPluginState; - -/** - * Plugin state machine implementation. - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CAiPluginStateMachine ) : public CBase, - public MAiPluginStateMachine - { -public: // Constructor - - CAiPluginStateMachine( MAiPluginStateResources& aPluginStateResource, - CAiContentPublisher& aPlugin ); - -public: // from MAiPluginStateMachine - - TBool StateVariable( TAiStateVariable aStateVariable ); - - TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); - - void RestartSuspendTimer(); - - void SwitchToState( TAiState aState, TAiStateChanges aStateChange ); - - CAiContentPublisher& Plugin() const; - - void ChangePluginState( TAiTransitionReason aReason, - void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ); - -public: // new methods - - TBool HandleEvent( TAiStateChanges aStateChange ); - -private: // data - - /** - * Alive master state. - */ - TAiStateAlive iAlive; - - /** - * Suspended state. - */ - TAiStateSuspended iSuspended; - - /** - * Idle master state. - */ - TAiStateIdle iIdle; - - /** - * Pointer to current state. - * Not owned. - */ - MAiPluginState* iCurrentState; - - /** - * Pointer to parent state machine. - * Not owned. - */ - MAiPluginStateResources& iPluginStateResource; - - /** - * Pointer to managed plugin. - * Not owned. - */ - CAiContentPublisher& iPlugin; - - /** - * Online sub-state - */ - TBool iOnline; - }; - -#endif // C_AIPLUGINSTATEMACHINEIMPL_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipluginstatemanager.h --- a/idlefw/inc/framework/aipluginstatemanager.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin state manager -* -*/ - - -#ifndef C_AIPLUGINSTATEMANAGER_H -#define C_AIPLUGINSTATEMANAGER_H - -#include -#include "aistatemanager.h" -#include "aipluginstatemachine.h" -#include "aipluginlifecycleobserver.h" - -#include "aistatealive.h" -#include "aistatesuspended.h" -#include "aistateidle.h" -#include "aifwdefs.h" - -class MAiPSPropertyObserver; -class MAiDeviceStatusObserver; -class CAiPluginStateManager; -class CAiContentPluginManager; -class CAiPluginStateMachine; -class CAiUiFrameworkObserverImpl; -class MAiUiFrameworkObserver; - -/** - * Plugin state manager implementation. - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CAiPluginStateManager ) : public CBase, - public MAiStateManager, - public MAiPluginStateResources, - public MAiPluginLifecycleObserver - { - -public: // Constructor and destructor - - static CAiPluginStateManager* NewL(); - - virtual ~CAiPluginStateManager(); - -public: // From MAiStateManager - - void ReportStateChange( TAiStateChanges aState ); - -public: // From MAiPluginStateMachine - - TBool StateVariable( TAiStateVariable aStateVariable ); - - TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); - - void RestartSuspendTimer(); - -public: // From MAiPluginLifecycleObserver - - void PluginCreatedL( CAiContentPublisher& aPlugin ); - - void PluginDestroyed( CAiContentPublisher& aPlugin ); - - void AllPluginsCreated(); - - void AllPluginsDestroyed(); - -public: // new methods - - /** - * Create system status observers (lights/backup/restore etc.). - */ - void CreateSystemStateObserversL(); - - /** - * Destroy system status observers. - */ - void DestroySystemStateObservers(); - - /** - * Provide accessor for fw observer. - * @return MAiUiFrameworkObserver pointer to fw observer. - */ - MAiUiFrameworkObserver* UiFwObserver() const; - - /** - * Process online state change for a plugin - * @param aPlugin plugin - */ - void ProcessOnlineState( CAiContentPublisher& aPlugin ); - - /** - * Process offline state change for a plugin - * @param aPlugin plugin - */ - void ProcessOfflineState( CAiContentPublisher& aPlugin ); - -private: // Constructors - - CAiPluginStateManager(); - - void ConstructL(); - -private: // New functions - - /** - * Handles Statemachine event event and error array update. - * @param aState new state. - * @param aMachine reference to single state machine. - */ - void ProcessStateChange( TAiStateChanges aState, - CAiPluginStateMachine& aMachine ); - - /** - * Handles Statemachine event event and error array update - * for all state machines. - * @param aState new state. - */ - void ProcessStateChangeForAll( TAiStateChanges aState ); - - /** - * Helper to check idle focus status. - * @return ETrue if idle is focused / foreground app. - */ - TBool IdleFocused() const; - - /** - * Helper to check backup (or restore) status. - * @return ETrue if backup (or restore) is ongoing. - */ - TBool BackupOngoing() const; - - /** - * Helper to check phone lights status. - * @return ETrue if lights are on. - */ - TBool LightsOn() const; - - /** - * Helper to check phone call status. - * @return ETrue if call is ongoing. - */ - TBool CallOngoing() const; - - /** - * Standard callback for CPeriodic ie. T1 timer. - */ - static TInt T1TimerCallback( TAny* aPtr ); - -private: // Data - - /** - * Backup operation state observer. - * Own. - */ - MAiDeviceStatusObserver* iBackupOperationObserver; - - /** - * Call state observer. - * Own. - */ - MAiDeviceStatusObserver* iCallStateObserver; - - /** - * Light state observer. - * Own. - */ - MAiDeviceStatusObserver* iLightStateObserver; - - /** - * Enviroment change observer. - * Own. - */ - MAiDeviceStatusObserver* iEnvironmentObserver; - - /** - * Focus change observer. Using telephony idle visiblity PS. - * Own. - */ - MAiDeviceStatusObserver* iFocusObserver; - - /** - * Keylock observer. - * Own. - */ - MAiDeviceStatusObserver* iKeylockObserver; - - /** - * Enviroment change observer. Full class type is used because - * we need to provide accessor for implemented type MAiUiFrameworkObserver. - * Own. - */ - CAiUiFrameworkObserverImpl* iFrameworkObserver; - - /** - * Timer for suspend, screensaver timout + light fadeout. - * Own. - */ - CPeriodic* iT1Timer; - - /** - * Timer for suspend, screensaver timout + light fadeout. - */ - TInt iT1Delay; - - /** - * New state to be timed. - */ - TAiState iTimedState; - - /** - * Reason for timers activity. - */ - TAiTransitionReason iTimedReason; - - /** - * Indicates whether the device has been properly started. - */ - TBool iIsDeviceStarted; - - /** - * State machines for plugins. - * Own. - */ - RPointerArray iStateMachines; - }; - -#endif // C_AIPLUGINSTATEMANAGER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aipsstatusobserver.h --- a/idlefw/inc/framework/aipsstatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: PS status observer -* -*/ - - -#ifndef C_AIPSSTATUSOBSERVER_H -#define C_AIPSSTATUSOBSERVER_H - -#include -#include -#include "aidevicestatusobserver.h" - -class MAiPSPropertyObserver; -class MAiStateManager; - -/** - * description - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiPSStatusObserver ) : public CBase, - public MAiDeviceStatusObserver - { - -public: - -// Construction - - virtual ~CAiPSStatusObserver(); - -// New functions - - virtual TAiStateChanges Status(); - -protected: - -// Construction - - CAiPSStatusObserver(); - - void BaseConstructL( TCallBack aCallBack, - TUid aCategory, - TInt aKey, - MAiStateManager* aStateManager ); - -protected: // Data - - MAiPSPropertyObserver* iObserver; - - MAiStateManager* iStateManager; - - }; - -#endif // C_AIPSSTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aissaverstatusobserver.h --- a/idlefw/inc/framework/aissaverstatusobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef C_AISSAVERSTATUSOBSERVER_H -#define C_AISSAVERSTATUSOBSERVER_H - -#include -#include -#include "aipsstatusobserver.h" - -class MAiPSPropertyObserver; - -/** - * Publish and subscribe key observer - * - * @lib aifw - * @since S60 3.2 - */ - -NONSHARABLE_CLASS( CAiSSaverStatusObserver ) : public CAiPSStatusObserver - { -public: - -// Construction - - static CAiSSaverStatusObserver* NewL( MAiStateManager* aStateManager ); - - virtual ~CAiSSaverStatusObserver(); - -// functions from base class CAiSSaverStatusObserver - - TAiStateChanges Status(); - -private: - -// Construction - - CAiSSaverStatusObserver(); - - void ConstructL( MAiStateManager* aStateManager ); - -// new functions - - static TInt HandleScreenSaverStateChanged( TAny* aPtr ); - - }; - -#endif // C_AISSAVERSTATUSOBSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistatealive.h --- a/idlefw/inc/framework/aistatealive.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State alive -* -*/ - - -#ifndef T_AISTATEALIVE_H -#define T_AISTATEALIVE_H - -#include "aipluginstate.h" -#include "aipluginstatemachine.h" - -/** - * @ingroup group_aifw - * - * Alive active state - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateAliveActive ) : public MAiPluginState - { -public: // Constructor - - TAiStateAliveActive(); - -public: // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - }; - -/** - * Alive inactive state - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateAliveInactive ) : public MAiPluginState - { -public: // Constructor - - TAiStateAliveInactive(); - -public: // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - }; - -/** - * Alive incall state - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateAliveIncall ) : public MAiPluginState - { -public: // Constructor - - TAiStateAliveIncall(); - -public: // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - }; - -/** - * Alive switch state - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateAlive ) : public MAiPluginState, - public MAiPluginStateMachine - { -public: // Constructor - - TAiStateAlive( MAiPluginStateMachine& aParentStateMachine ); - -public: // from MAiPluginStateMachine - - TBool StateVariable( TAiStateVariable aStateVariable ); - - TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); - - void RestartSuspendTimer(); - - void SwitchToState( TAiState aState, TAiStateChanges aStateChange ); - - CAiContentPublisher& Plugin() const; - - void ChangePluginState( TAiTransitionReason aReason, - void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ); - -public: // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - -private: // data - - /** - * Pointer to current state. - * Not owned. - */ - MAiPluginState* iCurrentState; - - /** - * Pointer to parent state machine. - * Not owned. - */ - MAiPluginStateMachine* iParentStateMachine; - - /** - * Alive active state. - */ - TAiStateAliveActive iStateAliveActive; - - /** - * Alive incall state. - */ - TAiStateAliveIncall iStateAliveIncall; - - /** - * Alive inactive state. - */ - TAiStateAliveInactive iStateAliveInactive; - }; - -#endif // T_AISTATEALIVE_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistateidle.h --- a/idlefw/inc/framework/aistateidle.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State idle -* -*/ - - -#ifndef T_AISTATEIDLE_H -#define T_AISTATEIDLE_H - -#include "aipluginstate.h" -#include "aipluginstatemachine.h" - -/** - * @ingroup group_aifw - * - * Idle state. - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateIdle ) : public MAiPluginState - { -public: - // Construction - - TAiStateIdle(); - - // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - }; - -#endif // T_AISTATEIDLE_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistatemanager.h --- a/idlefw/inc/framework/aistatemanager.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/inc/framework/aistatemanager.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,41 +11,217 @@ * * Contributors: * -* Description: State manager base class +* Description: State Manager * */ -#ifndef M_AISTATEMANAGER_H -#define M_AISTATEMANAGER_H +#ifndef _AISTATEMANAGER_H +#define _AISTATEMANAGER_H + +// System includes +#include +#include -#include "aipluginstatemachine.h" +// User includes +#include +#include "aistateobserver.h" + +// Forward declarations +class CAiPluginFactory; +class CAiCpsCommandBuffer; +class CHsContentPublisher; +class THsPublisherInfo; /** - * description + * State Manager * - * @lib aifw - * @since S60 3.2 + * @ingroup group_aifw + * @lib aifw.lib + * @since S60 5.0 */ -class MAiStateManager +NONSHARABLE_CLASS( CAiStateManager ) : public CBase, + public MAiStateObserver { +private: + // Data types + enum TState + { + ESuspended = 0, + EAlive, + }; - public: + enum TFlags + { + EIsForeground = 0, + EIsLightsOn, + EIsOnline, + EShutdown + }; + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiStateManager* NewL( CAiPluginFactory& aFactory ); + + /** + * Two-phased constructor. Leaving on stack + */ + static CAiStateManager* NewLC( CAiPluginFactory& aFactory ); + + /** + * Destructor + */ + ~CAiStateManager(); + +private: + // private constructors + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CAiStateManager( CAiPluginFactory& aFactory ); + +private: + // from MAiStateObserver + + /** + * @see MAiStateObserver + */ + void NotifyStateChange( + TAiFwState aReason ); + + /** + * @see MAiStateObserver + */ + TInt NotifyLoadPlugin( const THsPublisherInfo& aInfo, + TAiFwLoadReason aReason ); + + /** + * @see MAiStateObserver + */ + void NotifyDestroyPlugin( const THsPublisherInfo& aInfo, + TAiFwDestroyReason aReason ); + + /** + * @see MAiStateObserver + */ + void NotifyReloadPlugins(); - /** - * System status observers use this method to report status variable - * changes to state manager. - * - * @param TAiStateChanges aState the state that has changed. - */ - virtual void ReportStateChange( TAiStateChanges aState ) = 0; + + /** + * @see MAiStateObserver + */ + void NotifyReleasePlugins( const RArray& aUidList ); + +private: + // new functions + + /** + * Evaluates next state + * + * @since S60 5.2 + * @return Next state + */ + TState EvaluateNextState() const; + + /** + * Process state change for all plugins + * + * @since S60 5.2 + * @param aNextState Next state where plugins are driven + */ + void ProcessStateChange( TState aNextState ); + + /** + * Process general theme state change for all plugins + * + * @since S60 5.2 + */ + void ProcessGeneralThemeChange(); + + /** + * Process backup/restore state change for all plugins + * + * @since S60 5.2 + * @param aStarted ETrue when backup started + */ + void ProcessBackupRestore( TBool aStarted ); + + /** + * Process online / offline state change for all plugins + * + * @since S60 5.2 + */ + void ProcessOnlineStateChange(); - protected: + /** + * Runs plugin startup sequence + * + * @since S60 5.2 + * @param aPlugin Plugin to start + * @param aReason Start reason + */ + void StartPlugin( CHsContentPublisher& aPlugin, + CHsContentPublisher::TStartReason aReason ); + + /** + * Runs plugin shutdown sequence + * + * @since S60 5.2 + * @param aPlugin Plugin to stop + * @param aReason Stop reason + */ + void StopPlugin( CHsContentPublisher& aPlugin, + CHsContentPublisher::TStopReason aReason ); + + /** + * Destroys all plugins from plugin factory + * + * @since S60 5.2 + */ + void DestroyPlugins(); + + /** + * Flushes cps command buffer + * + * @since S60 5.2 + */ + void FlushCommandBuffer(); - ~MAiStateManager(){} +private: + // data + /** Plugin Factory, Not owned */ + CAiPluginFactory& iFactory; + /** CPS Command buffer, Owned */ + CAiCpsCommandBuffer* iCommandBuffer; + /** Current state */ + TState iCurrentState; + /** Flags */ + TBitFlags32 iFlags; + /** Halted flag */ + TBool iHalt; + /** List of plugins which should be reloaded */ + RArray iReloadPlugins; + +private: + // friend classes + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiStateManager; +#endif }; - -#endif // M_AISTATEMANAGER_H + +#endif // _AISTATEMANAGER_H -// End of File. +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistateobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistateobserver.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: State Observer +* +*/ + + +#ifndef _AISTATEOBSERVER_H +#define _AISTATEOBSERVER_H + +// System includes + +// User includes +#include + +// Forward declarations +class THsPublisherInfo; + +/** + * State Observer + * + * @ingroup group_aifw + * @lib aifw.lib + * @since S60 5.2 + */ +class MAiStateObserver + { +public: + /** + * State change notification. + * + * @since S60 5.2 + * @param aReason State change. + */ + virtual void NotifyStateChange( TAiFwState aState ) = 0; + + /** + * Content publisher load request. + * + * @since S60 5.2 + * @param aInfo Publisher Info, which describes the plugin to be loaded. + * @param aReason Startup reason, which will be forwarded to the plugin. + * @return Error code, KErrNone if succesfully loaded. + */ + virtual TInt NotifyLoadPlugin( const THsPublisherInfo& aInfo, + TAiFwLoadReason aReason ) = 0; + + /** + * Content publisher destroy request. + * + * @since S60 5.2 + * @param aInfo Publisher Info, which describes the plugin to be destroyed. + * @param aReason Shutdown reason, which will be forwarded to the plugin. + */ + virtual void NotifyDestroyPlugin( const THsPublisherInfo& aInfo, + TAiFwDestroyReason aReason ) = 0; + + /** + * Notifies to reload previously released plugins + * + * @since S60 5.2 + */ + virtual void NotifyReloadPlugins() = 0; + + /** + * Notifies that defined ECom plugins should be released to enable + * plugin upgrade + * + * @since S60 5.2 + */ + virtual void NotifyReleasePlugins( const RArray& aUidList ) = 0; + + }; + +#endif // _AISTATEOBSERVER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistateprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistateprovider.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,205 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: State Provider +* +*/ + + +#ifndef _AISTATEPROVIDER_H +#define _AISTATEPROVIDER_H + +// System includes +#include +#include +#include +#include + +// User includes +#include +#include "aiecomobserver.h" + +// Forward declarations +class MAiPSPropertyObserver; +class MAiStateObserver; +class THsPublisherInfo; + +// Class declaration + +/** + * State Provider + * + * @ingroup group_aifw + * @lib aifw.lib + * @since S60 5.2 + */ +NONSHARABLE_CLASS( CAiStateProvider ) : public CBase, + public MCoeMessageMonitorObserver, + public MHWRMLightObserver, + public MAknsSkinChangeObserver, + public MAiEcomObserver, + public MAiFwStateHandler + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiStateProvider* NewL( MAiStateObserver& aObserver ); + + /** + * Two-phased constructor. Leaving on stack + */ + static CAiStateProvider* NewLC( MAiStateObserver& aObserver ); + + /** + * Destructor + */ + ~CAiStateProvider(); + +private: + // private constructors + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * C++ default constructor + */ + CAiStateProvider( MAiStateObserver& aObserver ); + +public: + // new methods + + /** + * Start state providing + * + * @since S60 5.2 + * @param aCoeEnv Control environment + */ + void StartL( CCoeEnv& aCoeEnv ); + + /** + * Stop state providing + * + * @since S60 5.2 + */ + void Stop(); + +private: + // from MCoeMessageMonitorObserver + + /** + * @see MCoeMessageMonitorObserver + */ + void MonitorWsMessage( const TWsEvent& aEvent ); + +private: + // from MHWRMLightObserver + + /** + * @see MHWRMLightObserver + */ + void LightStatusChanged( TInt aTarget, + CHWRMLight::TLightStatus aStatus ); + +private: + // from MAknsSkinChangeObserver + + /** + * @see MAknsSkinChangeObserver + */ + void SkinContentChanged(); + + /** + * @see MAknsSkinChangeObserver + */ + void SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ); + + /** + * @see MAknsSkinChangeObserver + */ + void SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason aReason ); + +private: + // from MAiEcomObserver + + /** + * @see MAiEcomObserver + */ + void NotifyEcomRegistryChanged(); + +private: + // from MAiFwStateHandler + + /** + * @see MAiFwStateHandler + */ + TInt LoadPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwLoadReason aReason ); + + /** + * @see MAiFwStateHandler + */ + void DestroyPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwDestroyReason aReason ); + + /** + * @see MAiFwStateHandler + */ + void ChangePluginState( TAiFwState aState ); + +private: + // new functions + + static TInt BackupRestoreEvent( TAny* aAny ); + + static TInt SwiUidListEvent( TAny* aAny ); + +private: + // data + + /** ECom observer, owned */ + CAiEcomObserver* iEcomObserver; + /** State observer, Not owned */ + MAiStateObserver& iObserver; + /** Control environment, Not owned */ + CCoeEnv* iCoeEnv; + /** Light status observer, Owned */ + CHWRMLight* iLightObserver; + /** Skin server session, Owned */ + RAknsSrvSession iSkinSrv; + /** Backup Restore observer, Owned */ + MAiPSPropertyObserver* iBackupRestoreObserver; + /** Flag to indicate whether state providing is started */ + TBool iStarted; + /** SWI UID list observer, owned */ + MAiPSPropertyObserver* iSwiUidListObserver; + +private: + // friend classes + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiStateProvider; +#endif + }; + +#endif // _AISTATEPROVIDER_H + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aistatesuspended.h --- a/idlefw/inc/framework/aistatesuspended.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State suspended -* -*/ - - -#ifndef T_AISTATESUSPENDED_H -#define T_AISTATESUSPENDED_H - -#include "aipluginstate.h" - -/** - * @ingroup group_aifw - * - * Suspended state - * - * @lib aifw - * @since S60 3.2 - */ -NONSHARABLE_CLASS( TAiStateSuspended ) : public MAiPluginState - { -public: - // Construction - - TAiStateSuspended(); - - // from MAiPluginState - - void Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - TBool HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - void Exit( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ); - - }; - -#endif // T_AISTATESUSPENDED_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aiuicontrollermanager.h --- a/idlefw/inc/framework/aiuicontrollermanager.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/inc/framework/aiuicontrollermanager.h Wed May 12 13:36:47 2010 +0300 @@ -16,141 +16,159 @@ */ -#ifndef C_AIUICONTROLLERMANAGER_H -#define C_AIUICONTROLLERMANAGER_H +#ifndef _AIUICONTROLLERMANAGER_H +#define _AIUICONTROLLERMANAGER_H - +// System includes #include -#include "aiuiframeworkobserver.h" -#include "aicontentmodel.h" -#include "aifwdefs.h" + +// User includes +// Forward declarations class CAiUiController; -class CAiContentPublisher; class MAiMainUiController; -class MAiFwEventHandler; class CRepository; class CCoeEnv; +class CAiFw; +class MAiFwStateHandler; +// Class declaration /** * @ingroup group_aifw * * Active Idle UI Controller manager. * - * @since S60 3.2 + * @since S60 5.2 */ -NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase, - public MAiUiFrameworkObserver +NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase { - public: // Constructors and destructor +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAiUiControllerManager* NewL( CAiFw* aAiFw ); + + /** + * Destructor + */ + ~CAiUiControllerManager(); + +public: + // new functions + + /** + * Gets UI controllers + * + * @since S60 5.2 + * @return Array of UI controllers + */ + RPointerArray< CAiUiController >& UiControllers() const; + + /** + * Actives UI by calling ActivateUI() for each UI controller + * + * @since S60 5.2 + */ + void ActivateUI(); + + /** + * Gets the main UI controller + * + * @since S60 5.2 + * @return Main UI controller + */ + MAiMainUiController& MainUiController() const; + + /** + * Queries whether aUiController is the main UI controller + * + * @since S60 5.2 + * @return ETrue if main UI controller, EFalse otherwise + */ + TBool IsMainUiController( CAiUiController& aUiController ) const; + + /** + * Calls RunApplicationL for the main UI controller. + * + * @since S60 5.2 + */ + void RunApplicationL(); + + /** + * Calls LoadUIDefinitionL for each UI controller. + * + * @since S60 5.2 + */ + void LoadUIDefinition(); + + /** + * Returns the main UI Controller's CONE environment object. + * + * @since S60 5.2 + * @return Control Environment + */ + CCoeEnv& CoeEnv() const; + + /** + * Destroys all UI controllers except the main controller. + * + * @since S60 5.2 + */ + void DestroySecondaryUiControllers(); + + /** + * Exits main UI controller + * + * @since S60 5.2 + */ + void ExitMainController(); + + /** + * Sets Fw state handler for each UI conttroller + * + * @since S60 5.2 + * @param aHandler State handler to set + */ + void SetStateHandler( MAiFwStateHandler& aHandler ); + +private: + // private constructors - static CAiUiControllerManager* NewL(); - ~CAiUiControllerManager(); - - public: // New functions - - /** - * Returns all UI controllers in an array. - */ - RPointerArray< CAiUiController >& UiControllers() const; - - /** - * Calls ActivateUI() for all UI controllers. - */ - void ActivateUI(); - - /** - * Returns the main ui controller object. - */ - MAiMainUiController& MainUiController() const; - - /** - * Returns true if aUiController is the main UI controller. - */ - TBool IsMainUiController(CAiUiController& aUiController) const; - - /** - * Sets framework event handler for all UI controllers. - */ - void SetEventHandler(MAiFwEventHandler& aEventHandler); - - /** - * Calls RunApplicationL for the main UI controller. - */ - void RunApplicationL(); - - /** - * Calls LoadUIDefinitionL for all UI controllers. - */ - void LoadUIDefinition(); - - /** - * Returns the main UI Controller's CONE environment object. - */ - CCoeEnv& CoeEnv() const; - - /** - * Destroys all UI controllers except the main controller. - */ - void DestroySecondaryUiControllers(); - - /** - * Adds an UI Framework observer. No duplicates are allowed. - */ - void AddObserverL( MAiUiFrameworkObserver& aUiFwObserver ); - - /** - * Removes an UI Framework observer. - */ - void RemoveObserver( MAiUiFrameworkObserver& aUiFwObserver ); - - /** - * Removes plugin from UI. - */ - void RemovePluginFromUI( CAiContentPublisher& aPlugin ); - - /** - * Exits main UI controller - */ - void ExitMainController(); - - private: // From MAiUiFrameworkObserver + /** + * Leaving constructor + */ + void ConstructL( CAiFw* aAiFw ); + + /** + * C++ default constructor + */ + CAiUiControllerManager(); + +private: + // new functions + + void LoadMainControllerL( CRepository& aRepository ); + void LoadSecondaryControllersL( CRepository& aRepository ); - void HandleResourceChange( TInt aType ); - void HandleForegroundEvent( TBool aForeground ); - - private: // Constructors - - CAiUiControllerManager(); - void ConstructL(); - - private: // new functions - - void LoadMainControllerL(CRepository& aCenRepConfig); - void LoadSecondaryControllersL(CRepository& aCenRepConfig); - - private: // data - /** - * UI controller array. - * Own. - */ - mutable RPointerArray iUiControllerArray; - - /** - * Main UI controller for app session. Owned in above array. - */ - MAiMainUiController* iMainUiController; - - /** - * List of UI framework observers to delegate events - */ - RPointerArray iUiFrameworkObservers; - - /** - * List to check for duplicated creations. - */ - RArray iCreatedUICList; +private: + // data + + /** UI controllers, Owned */ + mutable RPointerArray< CAiUiController > iUiControllerArray; + /** Main UI controller, Owned by the above array */ + MAiMainUiController* iMainUiController; + /** List of created UI controllers */ + RArray< TInt > iCreatedUICList; + +private: + // friend class + +#ifdef _AIFW_UNIT_TEST + friend class UT_AiUiControllerManager; +#endif }; -#endif // C_AIUICONTROLLERMANAGER_H +#endif // _AIUICONTROLLERMANAGER_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/aiuiframeworkobserverimpl.h --- a/idlefw/inc/framework/aiuiframeworkobserverimpl.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: UI Framework observer for Active Idle -* -*/ - - -#ifndef C_AIUIFRAMEWORKOBSERVERIMPL_H -#define C_AIUIFRAMEWORKOBSERVERIMPL_H - - -#include -#include "aistatemanager.h" -#include "aiuiframeworkobserver.h" -#include "aidevicestatusobserver.h" - -/** - * CAiUiFrameworkObserverImpl implements MAiUiFrameworkObserver for - * Active Idle framework. It is also a bridge between MAiUiFrameworkObserver - * and Active Idle system state manager. - * - * @lib aifw.lib - * @since S60 3.2 - */ -NONSHARABLE_CLASS( CAiUiFrameworkObserverImpl ) - : public CBase, - public MAiUiFrameworkObserver, - public MAiDeviceStatusObserver - { -public: - - static CAiUiFrameworkObserverImpl* NewL( MAiStateManager& aManager ); - - virtual ~CAiUiFrameworkObserverImpl(); - -// from base class MAiDeviceStatusObserver - - TAiStateChanges Status(); - -private: - - CAiUiFrameworkObserverImpl( MAiStateManager& aManager ); - - void ConstructL(); - -// from base class MAiUiFrameworkObserver - - void HandleResourceChange( TInt aType ); - - void HandleForegroundEvent( TBool aForeground ); - -private: // data - - /** - * State manager. - */ - MAiStateManager& iManager; - - }; - -#endif // C_AIUIFRAMEWORKOBSERVERIMPL_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/framework/caicpscommandbuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/caicpscommandbuffer.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cps command buffer +* +*/ + + +#ifndef C_CAICPSCOMMANDBUFFER_H +#define C_CAICPSCOMMANDBUFFER_H + +// System includes +#include + +// User includes +#include + +// Forward declarations +class CLiwGenericParamList; +class CLiwServiceHandler; +class CLiwCriteriaItem; +class CAiCpsExecuteParam; +class MLiwInterface; + +/** + * AI Cps command buffer + * + * @ingroup group_aifw + * @lib aifw + * @since S60 v5.2 + */ +NONSHARABLE_CLASS( CAiCpsCommandBuffer ) : public CBase, + public MAiCpsCommandBuffer + { +public: + // constructors and destructor + + /** + * Two-phased constructors. + */ + static CAiCpsCommandBuffer* NewL(); + static CAiCpsCommandBuffer* NewLC(); + + /** + * Destructor. + */ + ~CAiCpsCommandBuffer(); + +private: + // constructors + + /** + * C++ default constructor + */ + CAiCpsCommandBuffer(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +public: + // new function + + /** + * Flushes command buffer + * + * @since S60 v5.2 + */ + void Flush(); + + /** + * Gets the CPS interface + * + * @since S60 5.2 + */ + void GetCPSInterfaceL(); + +private: + // from MAiCpsCommandBuffer + + /** + * @see MAiCpsCommandBuffer + */ + void AddCommand( const TDesC& aPluginId, const TDesC& aType, + CLiwDefaultMap* aFilter, const TDesC8& aAction); + + /** + * @see MAiCpsCommandBuffer + */ + CLiwServiceHandler* ServiceHandler() const; + + /** + * @see MAiCpsCommandBuffer + */ + MLiwInterface* CpsInterface() const; + +private: + // new functions + + /** + * Detach the CPS interface + * + * @since S60 5.2 + */ + void DetachL(); + + /** + * Adds a CPS command execute commnad for a spcific Plugin + * Note: aType and Filter will overwrite the previous value + * + * @since S60 5.2 + * @param aPluginId plugin id. + * @param aType type of the cps registry. + * @param aFilter filter values. + * @param aAction action trigger. + */ + void DoAddCommandL(const TDesC& aPluginId,const TDesC& aType, + CLiwDefaultMap* aFilter, const TDesC8& aAction ); + + /** + * Flush all the CPS execute commands.. + * + * @since S60 5.2 + */ + void DoFlushL(); + +private: + // data + /** + * SAPI service handler. + * Owned. + */ + CLiwServiceHandler* iServiceHandler; + + /** + * CPS SAPI service. + * Owned. + */ + CLiwCriteriaItem* iCpsService; + + /** + * Provides hsps services. + * Owned. + */ + MLiwInterface* iCpsInterface; + + /** + * Plugins execute parameter array + * Owned. + */ + RPointerArray iPlugins; + }; + +#endif // C_CAICPSCOMMANDBUFFER_H + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/inc/utility/caiplugintool.h --- a/idlefw/inc/utility/caiplugintool.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/inc/utility/caiplugintool.h Wed May 12 13:36:47 2010 +0300 @@ -15,18 +15,19 @@ * */ - #ifndef C_AIPLUGINTOOL_H #define C_AIPLUGINTOOL_H +// System includes #include + +// User includes #include "aiplugintool.h" -class TAiPublisherInfo; -class CAiContentPublisher; +// Forward declarations +class THsPublisherInfo; +class CHsContentPublisher; class MAiContentItemIterator; -class MAiPropertyExtension; -class MAiEventHandlerExtension; /** * @ingroup group_aiutils @@ -39,35 +40,34 @@ public CBase, public MAiPluginTool { public: + // Constructor static CAiPluginTool* NewL(); private: - + // Constructors + + /** + * C++ default contructor + */ CAiPluginTool(); + /** + * 2nd phase constructor + */ void ConstructL(); +private: + // from MAiPluginTool + + MAiContentItemIterator* ContentItemIterator( + CHsContentPublisher& aContentPublisher, + CHsContentPublisher::TProperty aType = CHsContentPublisher::EPublisherContent ); + void Release(); - - const TAiPublisherInfo* PublisherInfoL( - CAiContentPublisher& aContentPublisher ); - - MAiContentItemIterator* ContentItemIteratorL( - CAiContentPublisher& aContentPublisher, - TInt aContentType = EAiPublisherContent ); - - MAiPropertyExtension* PropertyExt( - CAiContentPublisher& aContentPublisher ); - - MAiEventHandlerExtension* EventHandlerExt( - CAiContentPublisher& aContentPublisher ); - }; #endif // M_AIPLUGINTOOL_H - +// End of file - - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/loc/aifw.loc diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/data/aidevstaplg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/data/aidevstaplg.rss Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// INCLUDES +#include +#include + + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// ?resource_name +// +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + // UID for the DLL + dll_uid = 0x102750F7; + + // Interface info array + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102750F8; + version_no = 1; + display_name = "DeviceStatus"; + default_data = ""; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; +} + +// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/data/aidevstaplgres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/data/aidevstaplgres.rss Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for project ?myapp +* +*/ + + + +NAME AIDP + +#include +#include +#include +#include +#include + +#include + +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf=""; } + +// --------------------------------------------------------------------------- +// ?resource_name +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_activeidle_time_format + { + buf = qtn_idle_time_format; + } + +RESOURCE TBUF r_activeidle_bt_sim_access_profile_string + { + buf = qtn_mode_sap; + } + +RESOURCE TBUF r_activeidle_cug_indicator_format + { + buf = qtn_cug_indic_group; + } + +RESOURCE TBUF r_ai_opn_spn_separator_format + { + buf = qtn_ai_opn_spn_separator; + } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/group/aidevstaplg.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/group/aidevstaplg.mmp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project Devicestatus plugin +* +*/ + + +#include +#include + +TARGET aidevstaplg.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102750F7 + +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE aidevicestatusplugin.cpp +SOURCE aidevicestatuspluginengine.cpp +SOURCE aimulticontentobserver.cpp +SOURCE aidatepublisher.cpp +SOURCE aipublisherfactory.cpp +SOURCE ainetworkinfolistener.cpp +SOURCE aioperatornamepublisher.cpp +SOURCE aibtsappublisher.cpp +SOURCE aisimregpublisher.cpp +SOURCE aimcnpublisher.cpp +SOURCE aicugpublisher.cpp +SOURCE aicugmcnpublisher.cpp +SOURCE aivhzpublisher.cpp +SOURCE aipublishprioritizer.cpp +SOURCE aicontentobserveroptimizer.cpp +SOURCE aioperatorlogopublisher.cpp +SOURCE ainwspublisher.cpp + +USERINCLUDE ../inc +USERINCLUDE ../loc +USERINCLUDE ../../../inc/common +USERINCLUDE ../../../cenrep + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE aidevstaplg.rss +TARGET aidevstaplg.rsc +END + +START RESOURCE aidevstaplgres.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY sssettings.lib +LIBRARY profileeng.lib +LIBRARY networkhandling.lib +LIBRARY phoneclient.lib +LIBRARY fbscli.lib +LIBRARY cone.lib +LIBRARY commonengine.lib +LIBRARY featmgr.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY egul.lib +LIBRARY aknlayout2scalable.lib +LIBRARY cdlengine.lib +LIBRARY gdi.lib +LIBRARY bitgdi.lib +LIBRARY aiutils.lib +LIBRARY flogger.lib +LIBRARY bafl.lib +LIBRARY profileengine.lib + +// End of file + + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The build information file of Devicestatus Plugin +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../loc/aidevstaplgres.loc MW_LAYER_LOC_EXPORT_PATH(aidevstaplgres.loc) + +../rom/aidevicestatusplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(aidevicestatusplugin_resources.iby) +../rom/aidevicestatusplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aidevicestatusplugin.iby) + +PRJ_MMPFILES +aidevstaplg.mmp + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aibtsappublisher.h --- a/idlefw/plugins/devicestatus/inc/aibtsappublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aibtsappublisher.h Wed May 12 13:36:47 2010 +0300 @@ -20,17 +20,20 @@ #ifndef C_AIBTSAPPUBLISHER_H #define C_AIBTSAPPUBLISHER_H - +// System includes #include #include +#include #include #include #include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; /** * @ingroup group_devicestatusplugin @@ -41,7 +44,8 @@ * * @since S60 3.2 */ -class CAiBTSAPPublisher : public CActive, public MAiDeviceStatusPublisher +NONSHARABLE_CLASS( CAiBTSAPPublisher ) : public CActive, + public MAiDeviceStatusPublisher { public: @@ -53,11 +57,12 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); TBool RefreshL( TInt aContentId, TBool aClean ); + TBool SuspendL( TInt aContentId, TBool aClean ); TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); protected: @@ -78,39 +83,22 @@ private: // data - /** - * Property extension. - * Not own. - */ - MAiPropertyExtension* iExtension; - - /** - * Content prioritizer. - * Not own. - */ - MAiPublishPrioritizer* iPrioritizer; - - /** - * Publish broadcaster. - * Not own. - */ - MAiPublisherBroadcaster* iBroadcaster; - - /** - * Publish-subscribe client used to observer BT SAP activation. - */ + /** Property extension, not owned */ + CHsContentPublisher* iExtension; + /** Content prioritizer, not owned */ + MAiPublishPrioritizer* iPrioritizer; + /** Publish broadcaster, not owned */ + MAiPublisherBroadcaster* iBroadcaster; + /** Publish-subscribe client used to observer BT SAP activation */ RProperty iPubSub; - - /** - * Variable which tells if publisher has published previously or not. - */ + /** Variable which tells if publisher has published previously or not */ TBool iFirstPublish; - - /** - * True if publish was successful. - */ - TBool iSuccess; + /** True if publish was successful */ + TBool iSuccess; + /** True if publisher content is suspended */ + TBool iSuspended; }; +#endif // C_AIBTSAPPUBLISHER_H -#endif // C_AIBTSAPPUBLISHER_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aicontentobserveroptimizer.h --- a/idlefw/plugins/devicestatus/inc/aicontentobserveroptimizer.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aicontentobserveroptimizer.h Wed May 12 13:36:47 2010 +0300 @@ -19,10 +19,15 @@ #ifndef C_AIMULTICONTENTOBSERVEROPTIMIZER_H #define C_AIMULTICONTENTOBSERVEROPTIMIZER_H - +// System includes #include + +// User includes #include "aicontentobserver.h" +// Forward declarations +class CHsContentPublisher; + /** * @ingroup group_devicestatusplugin * @@ -34,9 +39,8 @@ * @see MAiContentObserver * @since S60 3.2 */ -class CAiContentObserverOptimizer : public CBase +NONSHARABLE_CLASS( CAiContentObserverOptimizer ) : public CBase { - private: struct TAiPublishBlackList { @@ -80,40 +84,45 @@ /* * @see MAiContentObserver */ - TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TBool CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); /** * @see MAiContentObserver */ - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); /** * @see MAiContentObserver */ - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); /** * @see MAiContentObserver */ - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); /** * @see MAiContentObserver */ - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); /** * @see MAiContentObserver */ - TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TInt Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); /** * Returns the actual content observer. */ MAiContentObserver& Observer() const; + /** + * Clears blacklist + */ + void ClearBlackList(); + private: CAiContentObserverOptimizer(MAiContentObserver& aObserver); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aicugmcnpublisher.h --- a/idlefw/plugins/devicestatus/inc/aicugmcnpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aicugmcnpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,19 +19,23 @@ #ifndef C_AICUGMCNPUBLISHER_H #define C_AICUGMCNPUBLISHER_H - +// System includes #include +#include #include #include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" #include "ainetworkinfoobserver.h" +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CAiNetworkInfoListener; -const TInt KAnimDelay = 2000000; +// Constants +const TInt KAnimDelay( 2000000 ); /** * @ingroup group_devicestatusplugin @@ -40,8 +44,10 @@ * * @since S60 3.2 */ -class CAiCUGMCNPublisher : public CBase, public MAiDeviceStatusPublisher, - public MSSSettingsObserver, public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiCUGMCNPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MSSSettingsObserver, + public MAiNetworkInfoObserver { public: @@ -55,7 +61,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -115,7 +121,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * SS Settings client. Used to observer CUGMCN changes. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aicugpublisher.h --- a/idlefw/plugins/devicestatus/inc/aicugpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aicugpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,15 +19,18 @@ #ifndef C_AICUGPUBLISHER_H #define C_AICUGPUBLISHER_H - +// System includes #include +#include #include #include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; /** * @ingroup group_devicestatusplugin @@ -36,8 +39,9 @@ * * @since S60 3.2 */ -class CAiCUGPublisher : public CBase, public MAiDeviceStatusPublisher, - public MSSSettingsObserver +NONSHARABLE_CLASS( CAiCUGPublisher ): public CBase, + public MAiDeviceStatusPublisher, + public MSSSettingsObserver { public: @@ -52,7 +56,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -87,7 +91,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * SS Settings client. Used to observer CUG changes. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aidatepublisher.h --- a/idlefw/plugins/devicestatus/inc/aidatepublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aidatepublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,13 +19,17 @@ #ifndef C_AIDATEPUBLISHER_H #define C_AIDATEPUBLISHER_H +// System includes #include #include -#include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" +#include +// User includes +#include "aidevicestatuspublisher.h" + +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CEnvironmentChangeNotifier; /** @@ -38,7 +42,8 @@ * * @since S60 3.2 */ -class CAiDatePublisher : public CBase, public MAiDeviceStatusPublisher +NONSHARABLE_CLASS( CAiDatePublisher ) : public CBase, + public MAiDeviceStatusPublisher { public: @@ -52,7 +57,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -90,7 +95,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Content prioritizer. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aidevicestatuscontentmodel.h --- a/idlefw/plugins/devicestatus/inc/aidevicestatuscontentmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Device Status plug-in content model -* -*/ - - -#ifndef AIDEVICESTATUSCONTENTMODEL_H -#define AIDEVICESTATUSCONTENTMODEL_H - -#include - -/** - * Content model for Device Status plug-in. - * This header defines which information Device Status publishes - */ - -// ================================= CONTENT =================================== - -//content item id's -enum TAiDeviceStatusContentIds - { - EAiDeviceStatusContentNetworkIdentity, - EAiDeviceStatusContentProfileName, - EAiDeviceStatusContentGeneralProfileName, - EAiDeviceStatusContentDate, - EAiDeviceStatusContentSilentIndicator, - EAiDeviceStatusContentTimedProfileIndicator, - EAiDeviceStatusContentSIMRegStatus, - EAiDeviceStatusContentNWStatus, - EAiDeviceStatusContentMCNIndicator, - EAiDeviceStatusContentVHZIndicator, - EAiDeviceStatusContentCUGIndicator, - EAiDeviceStatusContentGeneralIndicator, - EAiDeviceStatusContentVHZText, - EAiDeviceStatusContentCUGMCNIndicator - }; - - -//content item textual id's -const wchar_t KAiDeviceStatusContentNetworkIdentity_Cid[] = L"NetworkIdentity"; -const wchar_t KAiDeviceStatusContentProfileName_Cid[] = L"ProfileName"; -const wchar_t KAiDeviceStatusContentGeneralProfileName_Cid[] = L"GeneralProfileName"; -const wchar_t KAiDeviceStatusContentDate_Cid[] = L"Date"; -const wchar_t KAiDeviceStatusContentSilentIndicator_Cid[] = L"SilentIndicator"; -const wchar_t KAiDeviceStatusContentTimedProfileIndicator_Cid[] = L"TimedProfileIndicator"; -const wchar_t KAiDeviceStatusContentSIMRegStatus_Cid[] = L"SIMRegStatus"; -const wchar_t KAiDeviceStatusContentNWStatus_Cid[] = L"NWStatus"; -const wchar_t KAiDeviceStatusContentMCNIndicator_Cid[] = L"MCNIndicator"; -const wchar_t KAiDeviceStatusContentVHZIndicator_Cid[] = L"VHZIndicator"; -const wchar_t KAiDeviceStatusContentCUGIndicator_Cid[] = L"CUGIndicator"; -const wchar_t KAiDeviceStatusContentGeneralIndicator_Cid[] = L"GeneralIndicator"; -const wchar_t KAiDeviceStatusContentVHZText_Cid[] = L"VHZText"; -const wchar_t KAiDeviceStatusContentCUGMCNIndicator_Cid[] = L"CUGMCNIndicator"; - - -const char KAiDeviceStatusMimeTypeTextPlain[] = "text/plain"; - -/** -* Content what device status plugin publishes -*/ - -const TAiContentItem KAiDeviceStatusContent[] = - { - //Published data can be service provider name, offline profile, - //operator logo or anything related to network status - { EAiDeviceStatusContentNetworkIdentity, KAiDeviceStatusContentNetworkIdentity_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is name of the profile from profiles engine - { EAiDeviceStatusContentProfileName, KAiDeviceStatusContentProfileName_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is name of the general profile from profiles engine - { EAiDeviceStatusContentGeneralProfileName, KAiDeviceStatusContentGeneralProfileName_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is current date as a text. Formatted according to current locale - { EAiDeviceStatusContentDate, KAiDeviceStatusContentDate_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data silent indicator as a text - { EAiDeviceStatusContentSilentIndicator, KAiDeviceStatusContentSilentIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data timed profile indicator as a text - { EAiDeviceStatusContentTimedProfileIndicator, KAiDeviceStatusContentTimedProfileIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is resource id - { EAiDeviceStatusContentSIMRegStatus, KAiDeviceStatusContentSIMRegStatus_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is resource id - { EAiDeviceStatusContentNWStatus, KAiDeviceStatusContentNWStatus_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is MCN message - { EAiDeviceStatusContentMCNIndicator, KAiDeviceStatusContentMCNIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is VHZ name - { EAiDeviceStatusContentVHZIndicator, KAiDeviceStatusContentVHZIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is localized text, for example "Group 1" - { EAiDeviceStatusContentCUGIndicator, KAiDeviceStatusContentCUGIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data general indicator as a text - { EAiDeviceStatusContentGeneralIndicator, KAiDeviceStatusContentGeneralIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data VHZ text - { EAiDeviceStatusContentVHZText, KAiDeviceStatusContentVHZText_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - - //Published data is localized text, for example "Group 1" or MCN message - { EAiDeviceStatusContentCUGMCNIndicator, KAiDeviceStatusContentCUGMCNIndicator_Cid, - KAiDeviceStatusMimeTypeTextPlain } - }; - -const TInt KAiDeviceStatusContentCount = sizeof( KAiDeviceStatusContent ) / - sizeof( KAiDeviceStatusContent[0] ); - - - -//content item id's -enum TAiDeviceStatusResourceIds - { - EAiDeviceStatusResourceSIMRegFail, - EAiDeviceStatusResourceNWOk, - EAiDeviceStatusResourceNWLost - }; - -const wchar_t KAiDeviceStatusResourceSIMRegFail_Cid[] = L"SIMRegFail"; -const wchar_t KAiDeviceStatusResourceShowNWLost_Cid[] = L"NWLost"; - - -const TAiContentItem KAiDeviceStatusResources[] = -{ - //Published data is resource id - { EAiDeviceStatusResourceSIMRegFail, KAiDeviceStatusResourceSIMRegFail_Cid, - KAiDeviceStatusMimeTypeTextPlain }, - { EAiDeviceStatusResourceNWLost, KAiDeviceStatusResourceShowNWLost_Cid, - KAiDeviceStatusMimeTypeTextPlain }, -}; - -const TInt KAiDeviceStatusResourceCount = sizeof( KAiDeviceStatusResources ) / - sizeof( KAiDeviceStatusResources[0] ); - - -#endif // AIDEVICESTATUSCONTENTMODEL_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h --- a/idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h Wed May 12 13:36:47 2010 +0300 @@ -19,11 +19,13 @@ #ifndef C_AIDEVICESTATUSPLUGIN_H #define C_AIDEVICESTATUSPLUGIN_H +// System includes -#include -#include +// User includes +#include #include +// Forward declarations class MAiDeviceStatusPublisher; class CAiContentItemArrayIterator; class CAiDeviceStatusPluginEngine; @@ -40,100 +42,110 @@ * * @since S60 3.2 */ -class CAiDeviceStatusPlugin : public CAiContentPublisher, - public MAiPropertyExtension, - public MAiContentRequest +NONSHARABLE_CLASS( CAiDeviceStatusPlugin ) : public CHsContentPublisher, + public MAiContentRequest { public: - + // constructors and destructor static CAiDeviceStatusPlugin* NewL(); static CAiDeviceStatusPlugin* NewLC(); virtual ~CAiDeviceStatusPlugin(); protected: - -// from base class CAiContentPublisher - void Resume( TAiTransitionReason aReason ); - void Suspend( TAiTransitionReason aReason ); - void Stop( TAiTransitionReason aReason ); - void SubscribeL(MAiContentObserver& aObserver); - TAny* Extension(TUid aUid); - void ConfigureL(RAiSettingsItemArray& aSettings); + // from CHsContentPublisher + + /** + * @see CHsContentPublisher + */ + void Start( CHsContentPublisher::TStartReason aReason ); -protected: - -// from base class MAiPropertyExtension - TAny* GetPropertyL(TInt aProperty); - void SetPropertyL(TInt aProperty, TAny* aValue); - -// from base class MAiContentRequest - TBool RefreshContent( TInt aContentId ); - - -private: + /** + * @see CHsContentPublisher + */ + void Stop( CHsContentPublisher::TStopReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Resume( CHsContentPublisher::TResumeReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Suspend( CHsContentPublisher::TSuspendReason aReason ); - CAiDeviceStatusPlugin(); - void ConstructL(); - - void AllocateResourcesL(); - void FreeResources(); - void DoResumeL( TAiTransitionReason aReason ); - TBool IgnoreReason( TAiTransitionReason aReason ); - - /** - * Add device status publisher. + /** + * @see CHsContentPublisher + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * @see CHsContentPublisher + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * @see CHsContentPublisher + */ + TAny* GetProperty( CHsContentPublisher::TProperty aProperty ); + +protected: + // from MAiContentRequest + + /** + * @see MAiContentRequest */ - void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); - -private: // data - - /** - * Device Status Plug-in Engine. - * Own. - */ - CAiDeviceStatusPluginEngine* iEngine; + TBool RefreshContent( TInt aContentId ); /** - * Content observers. - * Own. - */ - CAiMultiContentObserver* iContentObservers; - - /** - * Device Status Plug-in content prioritizer. - * Own. - */ - CAiPublishPrioritizer* iPrioritizer; - + * @see MAiContentRequest + */ + TBool SuspendContent( TInt aContentId ); + +private: + // constructors + /** - * Content item array iterator. - * Own. + * C++ default constructor */ - MAiContentItemIterator* iContent; - - /** - * Content item array iterator for resources. - * Own. - */ - MAiContentItemIterator* iResources; - - /** - * Publisher info. - */ - TAiPublisherInfo iInfo; - - /** - * Offset of the loaded resource file. - */ - TInt iResourceOffset; + CAiDeviceStatusPlugin(); /** - * Network info listener. - * Own. + * 2nd phase constructor */ + void ConstructL(); + +private: + // new functions + + void AllocateResourcesL(); + void FreeResources(); + void DoResumeL(); + + void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); + +private: + // data + + /** Device Status Plug-in Engine, owned */ + CAiDeviceStatusPluginEngine* iEngine; + /** Content observers, owned */ + CAiMultiContentObserver* iContentObservers; + /** Device Status Plug-in content prioritizer, owned */ + CAiPublishPrioritizer* iPrioritizer; + /** Content item array iterator, owned */ + MAiContentItemIterator* iContent; + /** Content item array iterator for resources, owned */ + MAiContentItemIterator* iResources; + /** Offset of the loaded resource file */ + TInt iResourceOffset; + /** Network info listener, owned */ CAiNetworkInfoListener* iListener; + /** Flag to indicate republish need */ + TBool iRequirePublish; }; +#endif // C_AIDEVICESTATUSPLUGIN_H -#endif // C_AIDEVICESTATUSPLUGIN_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h --- a/idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h Wed May 12 13:36:47 2010 +0300 @@ -19,19 +19,23 @@ #ifndef AIDEVICESTATUSPLUGINENGINE_H #define AIDEVICESTATUSPLUGINENGINE_H +// System includes #include + +// User includes #include - #include "aipublisherbroadcaster.h" #include "aidevicestatuspublisher.h" +// Forward declarations +class CHsContentPublisher; +class MAiContentObserver; +class MAiPublishPrioritizer; + +// Constants //device status plugin UI const TInt KImplUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; -class MAiContentObserver; -class MAiPropertyExtension; -class MAiPublishPrioritizer; - /** * @ingroup group_devicestatusplugin @@ -44,17 +48,20 @@ * * @since S60 v3.2 */ -class CAiDeviceStatusPluginEngine : public CBase, public MAiPublisherBroadcaster +NONSHARABLE_CLASS( CAiDeviceStatusPluginEngine ) : public CBase, + public MAiPublisherBroadcaster { +public: + // constructor and destructor + + static CAiDeviceStatusPluginEngine* NewL( MAiContentObserver& aObserver, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer ); + + virtual ~CAiDeviceStatusPluginEngine(); public: - - static CAiDeviceStatusPluginEngine* NewL( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, - MAiPublishPrioritizer& aPrioritizer); - - virtual ~CAiDeviceStatusPluginEngine(); - + // new functions + /** * Resumes all publishers. */ @@ -77,27 +84,41 @@ */ TBool RefreshPublishersL( TInt aContentId, TBool aClean ); + /** + * Suspends specific publishers. + * @param aContentId Indicates which publishers should suspend their + * content. + * @param aClean Indicates if publishers should clean their content before + * suspend. + * @return ETrue if publisher informed that publish was successful. + */ + TBool SuspendPublishersL( TInt aContentId, TBool aClean ); + -public: // from MAiPublisherBroadcaster +public: + // from MAiPublisherBroadcaster TBool RefreshPriorizedPublishersL( TInt aContentId, TInt aPriority ); private: + // constructors CAiDeviceStatusPluginEngine( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, - MAiPublishPrioritizer& aPrioritizer); - + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer ); + void ConstructL(); +private: + // new functions + /** * Add Device Status publisher. */ void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); - -private: // data +private: + // data /** * Array of publishers. @@ -115,7 +136,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Content prioritizer. @@ -125,3 +146,5 @@ }; #endif // AIDEVICESTATUSPLUGINENGINE_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aidevicestatuspublisher.h --- a/idlefw/plugins/devicestatus/inc/aidevicestatuspublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuspublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,9 +19,14 @@ #ifndef M_AIDEVICESTATUSPUBLISHER_H #define M_AIDEVICESTATUSPUBLISHER_H +// System includes #include -#include "aicontentobserver.h" + +// User includes +// Forward declarations +class CHsContentPublisher; +class MAiContentObserver; class MAiPublishPrioritizer; class MAiPublisherBroadcaster; @@ -52,7 +57,7 @@ * @param aBroadcaster is reference for publisher broadcaster. */ virtual void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ) = 0; @@ -84,6 +89,16 @@ virtual TBool RefreshL( TInt /*aContentId*/, TBool /*aClean*/ ) { return EFalse; } /** + * Suspends specific content. + * + * Publisher suspends content publishing specified by aContentId. + * @param aContentId Id of the content item that is requested to suspend. + * @param aClean ETrue if current content needs to be cleaned. + * @return true if content was suspended. + */ + virtual TBool SuspendL( TInt /*aContentId*/, TBool /*aClean*/ ) { return EFalse; } + + /** * Refresh specific content with specific priority. * * This has the same effect as the publisher would get content update from system. @@ -95,5 +110,6 @@ virtual TBool RefreshContentWithPriorityL( TInt /*aContentId*/, TInt /*aPriority*/ ) { return EFalse; } }; +#endif // M_AIDEVICESTATUSPUBLISHER_H -#endif // M_AIDEVICESTATUSPUBLISHER_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aimcnpublisher.h --- a/idlefw/plugins/devicestatus/inc/aimcnpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aimcnpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,14 +19,17 @@ #ifndef C_AIMCNPUBLISHER_H #define C_AIMCNPUBLISHER_H - +// System includes #include +#include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" #include "ainetworkinfoobserver.h" +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CAiNetworkInfoListener; /** @@ -39,8 +42,9 @@ * * @since S60 3.2 */ -class CAiMCNPublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiMCNPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver { public: @@ -54,7 +58,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -87,7 +91,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Network info listener. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aimulticontentobserver.h --- a/idlefw/plugins/devicestatus/inc/aimulticontentobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aimulticontentobserver.h Wed May 12 13:36:47 2010 +0300 @@ -19,13 +19,16 @@ #ifndef C_AIMULTICONTENTOBSERVER_H #define C_AIMULTICONTENTOBSERVER_H - +// System includes #include + +// User includes #include "aicontentobserver.h" - // Forward declarations class CAiContentObserverOptimizer; +class CHsContentPublisher; + /** * @ingroup group_devicestatusplugin * @@ -34,9 +37,8 @@ * @see MAiContentObserver * @since S60 3.2 */ -class CAiMultiContentObserver : - public CBase, - public MAiContentObserver +NONSHARABLE_CLASS( CAiMultiContentObserver ) : public CBase, + public MAiContentObserver { public: static CAiMultiContentObserver* NewL(); @@ -51,30 +53,32 @@ TInt StartTransaction( TInt aTxId ); TInt Commit( TInt aTxId ); TInt CancelTransaction( TInt aTxId ); - TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TBool CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ); - TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ); - TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TInt Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ); TAny* Extension( TUid aUid ); - TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + TBool RequiresSubscription( const THsPublisherInfo& aPublisherInfo ) const; - TInt SetProperty( MAiPropertyExtension& aPlugin, + TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue ); - TInt SetProperty( MAiPropertyExtension& aPlugin, + TInt SetProperty( CHsContentPublisher& aPlugin, const TDesC8& aElementId, const TDesC8& aPropertyName, const TDesC8& aPropertyValue, MAiContentObserver::TValueType aValueType); + void ClearBlackList(); + private: CAiMultiContentObserver(); void ConstructL(); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h --- a/idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h Wed May 12 13:36:47 2010 +0300 @@ -19,14 +19,17 @@ #ifndef C_AINETWORKINFOLISTENER_H #define C_AINETWORKINFOLISTENER_H - +// System includes #include #include +// User includes +// Forward declarations class MAiNetworkInfoObserver; class CNWSession; + /** * @ingroup group_devicestatusplugin * @@ -37,7 +40,8 @@ * * @since S60 3.2 */ -class CAiNetworkInfoListener : public CBase, public MNWMessageObserver +NONSHARABLE_CLASS( CAiNetworkInfoListener ) : public CBase, + public MNWMessageObserver { public: diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/ainwspublisher.h --- a/idlefw/plugins/devicestatus/inc/ainwspublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/ainwspublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,15 +19,17 @@ #ifndef C_AINWSPUBLISHER_H #define C_AINWSPUBLISHER_H - +// System includes #include +#include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" #include "ainetworkinfoobserver.h" - +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CAiNetworkInfoListener; class CRepository; @@ -38,8 +40,9 @@ * * @since S60 3.2 */ -class CAiNwsPublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiNwsPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver { public: @@ -52,7 +55,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); @@ -108,7 +111,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Network info listener. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aioperatorlogopublisher.h --- a/idlefw/plugins/devicestatus/inc/aioperatorlogopublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aioperatorlogopublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,20 +19,24 @@ #ifndef C_AIOPERATORLOGOPUBLISHER_H #define C_AIOPERATORLOGOPUBLISHER_H - +// System includes #include #include #include + +// User includes #include #include "aidevicestatuspublisher.h" #include "ainetworkinfoobserver.h" +// Forward declarations class CAiNetworkInfoListener; class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CGulIcon; class CCenRepNotifyHandler; + /** * @ingroup group_devicestatusplugin * @@ -43,9 +47,10 @@ * * @since S60 3.2 */ -class CAiOperatorLogoPublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver, /*public MAiCenRepNotifierCallBack*/ - public MCenRepNotifyHandlerCallback +NONSHARABLE_CLASS( CAiOperatorLogoPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver, + public MCenRepNotifyHandlerCallback { public: @@ -59,11 +64,12 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); TBool RefreshL( TInt aContentId, TBool aClean ); + TBool SuspendL( TInt aContentId, TBool aClean ); TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); @@ -149,77 +155,39 @@ private: // data - /** - * Network info listener. - * Own. - */ + /** Network info listener, owned */ CAiNetworkInfoListener* iListener; - - /** - * Operator logo bitmap and mask. - * Own. - */ + /** Operator logo bitmap and mask, owned */ CGulIcon* iIcon; - - /** - * Content observer. - * Not own. - */ + /** Content observer, not owned */ MAiContentObserver* iContentObserver; - - /** - * Property extension. - * Not own. - */ - MAiPropertyExtension* iExtension; - - /** - * Content prioritizer. - * Not own. - */ - MAiPublishPrioritizer* iPrioritizer; - - /** - * Publish broadcaster. - * Not own. - */ - MAiPublisherBroadcaster* iBroadcaster; - - /** - * Publish-subscribe client. - */ + /** Property extension, not owned */ + CHsContentPublisher* iExtension; + /** Content prioritizer, not owned */ + MAiPublishPrioritizer* iPrioritizer; + /** Publish broadcaster, not owned */ + MAiPublisherBroadcaster* iBroadcaster; + /** Publish-subscribe client, owned */ MAiPSPropertyObserver* iOperatorLogoObserver; - - /** - * Central repository client. - * Own. - */ + /** Central repository client, owned */ CRepository* iCenRep; - - /** - * Central repository notifier. - * Own. - */ + /** Central repository notifier, owned */ CCenRepNotifyHandler* iCenRepNotify; - - /** - * Operator logo priority, can have one of the following values: + /** Operator logo priority, can have one of the following values: + * * 1) EAiOTAOperatorLogo * 2) EAiProgOperatorLogo * 3) EAiInvalidPriority */ TInt iPriority; - - /** - * True if publish was successful. - */ - TBool iSuccess; - - /** - * Show operator indicator. - */ + /** True if publish was successful. */ + TBool iSuccess; + /** Flag to indicate if the content is suspended */ + TBool iSuspended; + /** Show operator indicator */ TBool iShowOpInd; }; +#endif // C_AIOPERATORLOGOPUBLISHER_H -#endif // C_AIOPERATORLOGOPUBLISHER_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h --- a/idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,15 +19,22 @@ #ifndef C_AIOPERATORPROVIDERNAMEPUBLISHER_H #define C_AIOPERATORPROVIDERNAMEPUBLISHER_H - +// System includes #include #include +#include + +// User includes #include "aidevicestatuspublisher.h" #include "ainetworkinfoobserver.h" +// Forward declarations +class MProfileEngine; +class MProEngNotifyHandler; class CAiNetworkInfoListener; class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; + /** * @ingroup group_devicestatusplugin @@ -39,8 +46,10 @@ * * @since S60 3.2 */ -class CAiOperatorNamePublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiOperatorNamePublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver, + public MProEngProfileActivationObserver { public: @@ -52,11 +61,12 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); TBool RefreshL( TInt aContentId, TBool aClean ); + TBool SuspendL( TInt aContentId, TBool aClean ); TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); @@ -72,6 +82,13 @@ const TNWInfo& aInfo, const TBool aShowOpInd ); +private: + // from MProEngProfileActivationObserver + + /** + * @see MProEngProfileActivationObserver + */ + void HandleProfileActivatedL( TInt aProfileId ); private: @@ -141,56 +158,32 @@ private: // data - /** - * Network info listener. - * Own. - */ + /** Network info listener, not owned */ CAiNetworkInfoListener* iListener; - - /** - * Property extension. - * Not own. - */ - MAiPropertyExtension* iExtension; - - /** - * Content prioritizer. - * Not own. - */ - MAiPublishPrioritizer* iPrioritizer; - - /** - * Publish broadcaster. - * Not own. - */ - MAiPublisherBroadcaster* iBroadcaster; - - /** - * Used to do delayed clean operation. - * Own. - */ - CPeriodic* iPeriodic; - - /** - * True if publish was successful. - */ - TBool iSuccess; - - /** - * Operator name priority - */ - TInt iPriority; - - /** - * Show operator indicator. - */ - TBool iShowOpInd; - - /** - * Network identity name - */ - TPtrC iNetworkIdentityName; + /** Property extension, not owned */ + CHsContentPublisher* iExtension; + /** Content prioritizer, not owned */ + MAiPublishPrioritizer* iPrioritizer; + /** Publish broadcaster, not owned */ + MAiPublisherBroadcaster* iBroadcaster; + /** Used to do delayed clean operation, owned */ + CPeriodic* iPeriodic; + /** True if publish was successful */ + TBool iSuccess; + /** Operator name priority */ + TInt iPriority; + /** Show operator indicator */ + TBool iShowOpInd; + /** Network identity name */ + TPtrC iNetworkIdentityName; + /** Flag to indicate if the content is suspended */ + TBool iSuspended; + /** Profile engine, owned */ + MProfileEngine* iProfileEngine; + /** Profile change notifier, owned */ + MProEngNotifyHandler* iProfileNotifier; }; +#endif // C_AIOPERATORPROVIDERNAMEPUBLISHER_H -#endif // C_AIOPERATORPROVIDERNAMEPUBLISHER_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aiprofilepublisher.h --- a/idlefw/plugins/devicestatus/inc/aiprofilepublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aiprofilepublisher.h Wed May 12 13:36:47 2010 +0300 @@ -20,11 +20,11 @@ #define C_AIPROFILEPUBLISHER_H #include +#include #include #include #include #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" class MProfileEngine; class MAiDeviceStatusContentObserver; diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aipublisherfactory.h --- a/idlefw/plugins/devicestatus/inc/aipublisherfactory.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aipublisherfactory.h Wed May 12 13:36:47 2010 +0300 @@ -34,15 +34,6 @@ public: /** - * Create profile publisher. - * - * @since S60 3.2 - * @return pointer to publisher or NULL if publisher is not supported - * by platform. - */ - static MAiDeviceStatusPublisher* CreateProfilePublisherL(); - - /** * Create date profile publisher. * * @since S60 3.2 diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aipublishprioritizer.h --- a/idlefw/plugins/devicestatus/inc/aipublishprioritizer.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aipublishprioritizer.h Wed May 12 13:36:47 2010 +0300 @@ -19,10 +19,16 @@ #ifndef C_AIPUBLISHPRIORITIZER_H #define C_AIPUBLISHPRIORITIZER_H +// System includes #include + +// User includes #include "ainwidpriorities.h" #include "aiprioritizer.h" -#include "aipropertyextension.h" + +// Forward declarations +class CHsContentPublisher; + /** * @ingroup group_devicestatusplugin @@ -37,13 +43,13 @@ * @since S60 3.2 */ -class CAiPublishPrioritizer : public CBase, public MAiPublishPrioritizer +NONSHARABLE_CLASS( CAiPublishPrioritizer ) : public CBase, + public MAiPublishPrioritizer { - public: static CAiPublishPrioritizer* NewL( MAiContentObserver& aContentObserver, - MAiPropertyExtension& aPropertyExtension ); + CHsContentPublisher& aPropertyExtension ); virtual ~CAiPublishPrioritizer(); @@ -75,7 +81,7 @@ private: CAiPublishPrioritizer( MAiContentObserver& aContentObserver, - MAiPropertyExtension& aPropertyExtension ); + CHsContentPublisher& aPropertyExtension ); private: // data @@ -88,7 +94,7 @@ /** * Property extension. */ - MAiPropertyExtension& iPropertyExtension; + CHsContentPublisher& iPropertyExtension; /// Current priority TInt iPriority; diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aisimregpublisher.h --- a/idlefw/plugins/devicestatus/inc/aisimregpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aisimregpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,17 +19,20 @@ #ifndef C_AISIMREGFAILPUBLISHER_H #define C_AISIMREGFAILPUBLISHER_H - +// System includes #include +#include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" #include "ainetworkinfoobserver.h" - +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CAiNetworkInfoListener; + /** * @ingroup group_devicestatusplugin * @@ -37,8 +40,9 @@ * * @since S60 3.2 */ -class CAiSimRegPublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiSimRegPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver { public: @@ -50,7 +54,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -84,7 +88,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Network info listener. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/inc/aivhzpublisher.h --- a/idlefw/plugins/devicestatus/inc/aivhzpublisher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/inc/aivhzpublisher.h Wed May 12 13:36:47 2010 +0300 @@ -19,14 +19,17 @@ #ifndef C_AIVHZPUBLISHER_H #define C_AIVHZPUBLISHER_H - +// System includes #include +#include + +// User includes #include "aidevicestatuspublisher.h" -#include "aidevicestatuscontentmodel.h" #include "ainetworkinfoobserver.h" +// Forward declarations class MAiDeviceStatusContentObserver; -class MAiPropertyExtension; +class CHsContentPublisher; class CAiNetworkInfoListener; /** @@ -39,8 +42,9 @@ * * @since S60 3.2 */ -class CAiVHZPublisher : public CBase, public MAiDeviceStatusPublisher, - public MAiNetworkInfoObserver +NONSHARABLE_CLASS( CAiVHZPublisher ) : public CBase, + public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver { public: @@ -54,7 +58,7 @@ void ResumeL(); void Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ); void RefreshL( TBool aClean ); @@ -85,7 +89,7 @@ * Property extension. * Not own. */ - MAiPropertyExtension* iExtension; + CHsContentPublisher* iExtension; /** * Network info listener. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/rom/aidevicestatusplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/rom/aidevicestatusplugin.iby Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for Devicestatus plug-in +* +*/ + + +#ifndef AIDEVICESTATUSPLUGIN_IBY +#define AIDEVICESTATUSPLUGIN_IBY + +#include + +#ifdef RD_CUSTOMIZABLE_AI + +ECOM_PLUGIN( aidevstaplg.dll, aidevstaplg.rsc ) + +#endif // RD_CUSTOMIZABLE_AI + +#endif // AIDEVICESTATUSPLUGIN_IBY + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/rom/aidevicestatusplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/rom/aidevicestatusplugin_resources.iby Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: IBY file for Devicestatus plug-in +* +*/ + + +#ifndef AIDEVICESTATUS_RESOURCES_IBY +#define AIDEVICESTATUS_RESOURCES_IBY + +#include + +#ifdef RD_CUSTOMIZABLE_AI + +// AI devicestatus plug-in localizable resources +data=DATAZ_\RESOURCE_FILES_DIR\aidevstaplgres.rsc RESOURCE_FILES_DIR\aidevstaplgres.rsc + +#endif // RD_CUSTOMIZABLE_AI + +#endif // AIDEVICESTATUS_RESOURCES_IBY diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aibtsappublisher.cpp --- a/idlefw/plugins/devicestatus/src/aibtsappublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aibtsappublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -82,7 +82,7 @@ void CAiBTSAPPublisher::Subscribe( MAiContentObserver& /*aObserver*/, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ) { @@ -95,6 +95,12 @@ void CAiBTSAPPublisher::RefreshL( TBool aClean ) { iSuccess = EFalse; + + if ( iSuspended ) + { + return; + } + if( aClean ) { iPrioritizer->TryToCleanL( *iBroadcaster, @@ -165,17 +171,32 @@ TBool CAiBTSAPPublisher::RefreshL( TInt aContentId, TBool aClean ) { - if( aContentId == EAiDeviceStatusContentNetworkIdentity ) + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) { + iSuspended = EFalse; + RefreshL( aClean ); - if( iSuccess ) + + if ( iSuccess ) { return ETrue; } } + return EFalse; } +TBool CAiBTSAPPublisher::SuspendL( TInt aContentId, TBool /*aClean*/ ) + { + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + iSuspended = ETrue; + + return ETrue; + } + + return EFalse; + } TBool CAiBTSAPPublisher::RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ) diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp --- a/idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp Wed May 12 13:36:47 2010 +0300 @@ -78,14 +78,14 @@ } -TBool CAiContentObserverOptimizer::CanPublish( MAiPropertyExtension& aPlugin, +TBool CAiContentObserverOptimizer::CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) { return iObserver.CanPublish( aPlugin, aContent, aIndex ); } -TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, +TInt CAiContentObserverOptimizer::Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) @@ -111,7 +111,7 @@ } -TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, +TInt CAiContentObserverOptimizer::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) @@ -137,7 +137,7 @@ } -TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, +TInt CAiContentObserverOptimizer::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) @@ -164,7 +164,7 @@ } -TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, +TInt CAiContentObserverOptimizer::Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) @@ -190,7 +190,7 @@ } -TInt CAiContentObserverOptimizer::Clean( MAiPropertyExtension& aPlugin, +TInt CAiContentObserverOptimizer::Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) { @@ -228,6 +228,11 @@ return EFalse; } +void CAiContentObserverOptimizer::ClearBlackList() + { + iBlackList.Reset(); + } + CAiContentObserverOptimizer::CAiContentObserverOptimizer(MAiContentObserver& aObserver): iObserver( aObserver ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aicugmcnpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aicugmcnpublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aicugmcnpublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,8 +18,8 @@ #include #include +#include #include "aicugmcnpublisher.h" -#include "aicontentobserver.h" #include "ainetworkinfolistener.h" // ======== MEMBER FUNCTIONS ======== @@ -117,7 +117,7 @@ void CAiCUGMCNPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aicugpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aicugpublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aicugpublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,8 +18,8 @@ #include #include +#include #include "aicugpublisher.h" -#include "aicontentobserver.h" #include "ainetworkinfolistener.h" @@ -72,7 +72,7 @@ void CAiCUGPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aidatepublisher.cpp --- a/idlefw/plugins/devicestatus/src/aidatepublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aidatepublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -21,8 +21,9 @@ #include #include #include +#include + #include "aidatepublisher.h" -#include "aicontentobserver.h" const TInt KMaxDateStringLength = 100; @@ -68,7 +69,7 @@ void CAiDatePublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aidevicestatusplugin.cpp --- a/idlefw/plugins/devicestatus/src/aidevicestatusplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aidevicestatusplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,7 +15,7 @@ * */ - +// System includes #include #include #include @@ -23,17 +23,21 @@ #include #include #include +#include + +// User includes #include "aidevicestatusplugin.h" #include "aidevicestatuspluginengine.h" #include "aipublishprioritizer.h" -#include "aidevicestatuscontentmodel.h" #include "aimulticontentobserver.h" #include "aipluginsettings.h" #include "ainetworkinfolistener.h" +// Constants _LIT( KResourceDrive, "Z:" ); _LIT( KResourceFile, "aidevstaplgres.rsc" ); -#define KResourcePath KDC_APP_RESOURCE_DIR + +#define KResourcePath KDC_RESOURCE_FILES_DIR // ECOM implementation table const TImplementationProxy KImplementationTable[] = @@ -43,17 +47,23 @@ // ======== MEMBER FUNCTIONS ======== - -CAiDeviceStatusPlugin::CAiDeviceStatusPlugin() : - iResourceOffset( KErrNotFound ) +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::CAiDeviceStatusPlugin +// +// ---------------------------------------------------------------------------- +// +CAiDeviceStatusPlugin::CAiDeviceStatusPlugin() + : iResourceOffset( KErrNotFound ) { } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::ConstructL +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPlugin::ConstructL() - { - iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; - + { FeatureManager::InitializeLibL(); // Create master instance to prevent deletion on Stop() @@ -62,11 +72,17 @@ //Create content here since this is needed in optimization phase. iContent = AiUtility::CreateContentItemArrayIteratorL( KAiDeviceStatusContent ); iResources = AiUtility::CreateContentItemArrayIteratorL( KAiDeviceStatusResources ); + iContentObservers = CAiMultiContentObserver::NewL(); + iPrioritizer = CAiPublishPrioritizer::NewL( *iContentObservers, *this ); } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::NewL +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin* CAiDeviceStatusPlugin::NewL() { CAiDeviceStatusPlugin* self = CAiDeviceStatusPlugin::NewLC(); @@ -74,7 +90,11 @@ return self; } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::NewLC +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin* CAiDeviceStatusPlugin::NewLC() { CAiDeviceStatusPlugin* self = new( ELeave ) CAiDeviceStatusPlugin; @@ -83,57 +103,65 @@ return self; } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::~CAiDeviceStatusPlugin +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::~CAiDeviceStatusPlugin() { delete iPrioritizer; + FreeResources(); + delete iContentObservers; + Release( iResources ); Release( iContent ); + FeatureManager::UnInitializeLib(); + if( iListener ) { iListener->Release(); } } - -/** - * Allocates all resourcers required for plug-in operation. - */ +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::AllocateResourcesL +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPlugin::AllocateResourcesL() { //create engine if( !iEngine ) { - iEngine = CAiDeviceStatusPluginEngine::NewL( *iContentObservers, - *this, - *iPrioritizer); + iEngine = CAiDeviceStatusPluginEngine::NewL( + *iContentObservers, *this, *iPrioritizer ); } if( iResourceOffset < 0 ) { - CCoeEnv* coe = CCoeEnv::Static(); - - if( !coe ) - { - User::Leave( KErrNotReady ); - } + CCoeEnv* coe( CCoeEnv::Static() ); - //Add resource file to cone - TFullName resourceFile( KResourceDrive ); - resourceFile.Append( KResourcePath ); - resourceFile.Append( KResourceFile ); - BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resourceFile ); - iResourceOffset = coe->AddResourceFileL( resourceFile ); + if ( coe ) + { + //Add resource file to cone + TFullName resourceFile( KResourceDrive ); + resourceFile.Append( KResourcePath ); + resourceFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( coe->FsSession(), resourceFile ); + iResourceOffset = coe->AddResourceFileL( resourceFile ); + } } } - -/** - * Frees all allocated resources. - */ +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::FreeResources +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPlugin::FreeResources() { if( iResourceOffset >= 0 ) @@ -153,155 +181,153 @@ iEngine = NULL; } - -void CAiDeviceStatusPlugin::Resume(TAiTransitionReason aReason) - { - if( IgnoreReason( aReason ) ) - { - return; - } - // resume all publishers only in startup - if( iEngine ) +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::Start +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::Start( TStartReason /*aReason*/ ) + { + iRequirePublish = ETrue; + + if ( iContentObservers ) { - if ( aReason == EAiIdleForeground || aReason == EAiKeylockDisabled ) - { - // not much can be done if some publisher cannot be refreshed - TRAP_IGNORE( iEngine->RefreshPublishersL( - EAiDeviceStatusContentNetworkIdentity, ETrue ) ); - - TRAP_IGNORE( iEngine->RefreshPublishersL( - EAiDeviceStatusContentCUGMCNIndicator, ETrue ) ); - } - // if layout changed republish some information - else if ( aReason == EAiScreenLayoutChanged ) + iContentObservers->ClearBlackList(); + } + } + +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::Stop +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::Stop( TStopReason /*aReason*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::Resume +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::Resume( TResumeReason aReason ) + { + if ( aReason == EForeground ) + { + if ( iRequirePublish ) { - TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentDate, ETrue )); - TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentCUGMCNIndicator, ETrue )); - TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentVHZText, ETrue )); - TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentNetworkIdentity, ETrue )); - } - return; - } - // If engine has been deleted. create it again. - else - { - iContentObservers->StartTransaction( KImplUidDevStaPlugin ); - - TRAPD( err, DoResumeL(aReason) ); - - if( err == KErrNone ) - { - iContentObservers->Commit( KImplUidDevStaPlugin ); - } - else - { - iContentObservers->CancelTransaction( KImplUidDevStaPlugin ); - } + TRAP_IGNORE( DoResumeL() ); + + iRequirePublish = EFalse; + } } } - - -void CAiDeviceStatusPlugin::DoResumeL(TAiTransitionReason /*aReason*/) - { - AllocateResourcesL( ); - iEngine->ResumePublishersL(); - iEngine->RefreshPublishersL( EFalse ); - } - - -TBool CAiDeviceStatusPlugin::IgnoreReason( TAiTransitionReason aReason ) - { - switch( aReason ) - { - case EAiBacklightOff: - return ETrue; - } - return EFalse; - } - - -void CAiDeviceStatusPlugin::Stop(TAiTransitionReason /*aReason*/) - { - FreeResources(); - } - - -void CAiDeviceStatusPlugin::Suspend(TAiTransitionReason /*aReason*/) + +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::Suspend +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::Suspend( TSuspendReason /*aReason*/ ) { } - -void CAiDeviceStatusPlugin::SubscribeL(MAiContentObserver& aObserver) +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::SubscribeL +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::SubscribeL( MAiContentObserver& aObserver ) { iContentObservers->AddObserverL( aObserver ); } - -TAny* CAiDeviceStatusPlugin::Extension(TUid aUid) +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::ConfigureL +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) { - //Access to extensions - if( aUid == KExtensionUidProperty ) + aSettings.ResetAndDestroy(); + + AllocateResourcesL(); + } + +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::GetProperty +// +// ---------------------------------------------------------------------------- +// +TAny* CAiDeviceStatusPlugin::GetProperty( TProperty aProperty ) + { + if ( aProperty == EPublisherContent ) { - return static_cast(this); + return static_cast< MAiContentItemIterator* >( iContent ); + } + else if ( aProperty == EPublisherResources ) + { + return static_cast< MAiContentItemIterator* >( iResources ); } - + else if ( aProperty == EContentRequest ) + { + return static_cast< MAiContentRequest* >( this ); + } + return NULL; } - -void CAiDeviceStatusPlugin::ConfigureL(RAiSettingsItemArray& aSettings) - { - aSettings.ResetAndDestroy(); +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::DoResumeL +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPlugin::DoResumeL() + { + iEngine->ResumePublishersL(); + iEngine->RefreshPublishersL( EFalse ); } -TAny* CAiDeviceStatusPlugin::GetPropertyL(TInt aProperty) - { - //Return properties. - switch (aProperty) - { - case EAiPublisherInfo: - return &iInfo; - - case EAiPublisherContent: - return static_cast(iContent); - - case EAiPublisherResources: - return static_cast(iResources); - - case EAiContentRequest: - return static_cast(this); - } - - return NULL; - } - -void CAiDeviceStatusPlugin::SetPropertyL(TInt aProperty, TAny* aValue) - { - if( aProperty == EAiPublisherInfo ) - { - ASSERT( aValue ); - - const TAiPublisherInfo* info( - static_cast( aValue ) ); - - iInfo = *info; - } - } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::RefreshContent +// +// ---------------------------------------------------------------------------- +// TBool CAiDeviceStatusPlugin::RefreshContent( TInt aContentId ) { - TBool result = EFalse; + TBool result( EFalse ); TRAP_IGNORE( result = iEngine->RefreshPublishersL( aContentId, EFalse ) ); + return result; } +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPlugin::SuspendContent +// +// ---------------------------------------------------------------------------- +// +TBool CAiDeviceStatusPlugin::SuspendContent( TInt aContentId ) + { + TBool result( EFalse ); + + TRAP_IGNORE( result = iEngine->SuspendPublishersL( aContentId, EFalse ) ); + + return result; + } -/** - * ECom component entry point. - */ -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) +// ======== GLOBAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) { - aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + aTableCount = sizeof(KImplementationTable) / sizeof( TImplementationProxy ); + return KImplementationTable; } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aidevicestatuspluginengine.cpp --- a/idlefw/plugins/devicestatus/src/aidevicestatuspluginengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aidevicestatuspluginengine.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,31 +15,37 @@ * */ +// System includes +// User includes +#include #include "aidevicestatuspluginengine.h" #include "aipublisherfactory.h" #include "aidevicestatuspublisher.h" +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::CAiDeviceStatusPluginEngine +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::CAiDeviceStatusPluginEngine( - MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, - MAiPublishPrioritizer& aPrioritizer ) - : iContentObserver( &aObserver ), - iExtension( &aExtension ), - iPrioritizer( &aPrioritizer ) + MAiContentObserver& aObserver, CHsContentPublisher& aExtension, + MAiPublishPrioritizer& aPrioritizer ) + : iContentObserver( &aObserver ), iExtension( &aExtension ), + iPrioritizer( &aPrioritizer ) { } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::ConstructL +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPluginEngine::ConstructL() { // Instantiate all publishers via factory - MAiDeviceStatusPublisher* publisher = AiPublisherFactory::CreateProfilePublisherL(); - CleanupStack::PushL( publisher ); - AddPublisherL( publisher ); - CleanupStack::Pop( publisher ); - - publisher = AiPublisherFactory::CreateDatePublisherL(); + MAiDeviceStatusPublisher* publisher = AiPublisherFactory::CreateDatePublisherL(); CleanupStack::PushL( publisher ); AddPublisherL( publisher ); CleanupStack::Pop( publisher ); @@ -90,44 +96,54 @@ CleanupStack::Pop( publisher ); // Subscribe all publishers once they are instantiated - const TInt count = iPublishers.Count(); + const TInt count( iPublishers.Count() ); - for( TInt i( 0 ); i < count; i++ ) + for ( TInt i( 0 ); i < count; i++ ) { - iPublishers[i]->Subscribe( *iContentObserver, - *iExtension, - *iPrioritizer, - *this ); + iPublishers[i]->Subscribe( + *iContentObserver, *iExtension, *iPrioritizer, *this ); } } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::NewL +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine* CAiDeviceStatusPluginEngine::NewL( - MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, - MAiPublishPrioritizer& aPrioritizer) + MAiContentObserver& aObserver, CHsContentPublisher& aExtension, + MAiPublishPrioritizer& aPrioritizer ) { CAiDeviceStatusPluginEngine* self = - new( ELeave ) CAiDeviceStatusPluginEngine( aObserver, - aExtension, - aPrioritizer); + new( ELeave ) CAiDeviceStatusPluginEngine( aObserver, aExtension, aPrioritizer ); + CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); return self; } +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::~CAiDeviceStatusPluginEngine +// +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::~CAiDeviceStatusPluginEngine() { iPublishers.ResetAndDestroy(); } - -void CAiDeviceStatusPluginEngine::AddPublisherL( MAiDeviceStatusPublisher* aPublisher ) +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::AddPublisherL +// +// ---------------------------------------------------------------------------- +// +void CAiDeviceStatusPluginEngine::AddPublisherL( + MAiDeviceStatusPublisher* aPublisher ) { //Add publisher to list. - if( aPublisher ) + if ( aPublisher ) { CleanupDeletePushL( aPublisher ); User::LeaveIfError( iPublishers.Append( aPublisher ) ); @@ -135,25 +151,33 @@ } } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::ResumePublishersL +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPluginEngine::ResumePublishersL() { - const TInt count = iPublishers.Count(); + const TInt count( iPublishers.Count() ); - for( TInt i( 0 ); i < count; i++ ) + for ( TInt i( 0 ); i < count; i++ ) { iPublishers[i]->ResumeL(); } } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::RefreshPublishersL +// +// ---------------------------------------------------------------------------- +// void CAiDeviceStatusPluginEngine::RefreshPublishersL( TBool aClean ) { iContentObserver->StartTransaction( KImplUidDevStaPlugin ); - const TInt count = iPublishers.Count(); + const TInt count( iPublishers.Count() ); - for( TInt i( 0 ); i < count; i++ ) + for ( TInt i( 0 ); i < count; i++ ) { iPublishers[i]->RefreshL( aClean ); } @@ -161,19 +185,23 @@ iContentObserver->Commit( KImplUidDevStaPlugin ); } - +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::RefreshPublishersL +// +// ---------------------------------------------------------------------------- +// TBool CAiDeviceStatusPluginEngine::RefreshPublishersL( TInt aContentId, - TBool aClean ) + TBool aClean ) { - TBool success = EFalse; + TBool success( EFalse ); iContentObserver->StartTransaction( KImplUidDevStaPlugin ); - const TInt count = iPublishers.Count(); + const TInt count( iPublishers.Count() ); - for( TInt i( 0 ); i < count; i++ ) + for ( TInt i( 0 ); i < count; i++ ) { - if( iPublishers[i]->RefreshL( aContentId, aClean ) ) + if ( iPublishers[i]->RefreshL( aContentId, aClean ) ) { success = ETrue; } @@ -191,23 +219,54 @@ return success; } +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::SuspendPublishersL +// +// ---------------------------------------------------------------------------- +// +TBool CAiDeviceStatusPluginEngine::SuspendPublishersL( TInt aContentId, + TBool aClean ) + { + TBool success( EFalse ); + + const TInt count( iPublishers.Count() ); + + for ( TInt i( 0 ); i < count; i++ ) + { + if ( iPublishers[i]->SuspendL( aContentId, aClean ) ) + { + success = ETrue; + } + } + + return success; + } +// ---------------------------------------------------------------------------- +// CAiDeviceStatusPluginEngine::RefreshPriorizedPublishersL +// +// ---------------------------------------------------------------------------- +// TBool CAiDeviceStatusPluginEngine::RefreshPriorizedPublishersL( TInt aContentId, - TInt aPriority ) + TInt aPriority ) { iContentObserver->StartTransaction( KImplUidDevStaPlugin ); - TBool success = EFalse; - const TInt count = iPublishers.Count(); + + TBool success( EFalse ); + + const TInt count( iPublishers.Count() ); - for( TInt i( 0 ); i < count; i++ ) + for ( TInt i( 0 ); i < count; i++ ) { - if( iPublishers[i]->RefreshContentWithPriorityL( aContentId, - aPriority ) ) + MAiDeviceStatusPublisher* publisher( iPublishers[i] ); + + if( publisher->RefreshContentWithPriorityL( aContentId, aPriority ) ) { success = ETrue; break; } } + if ( success ) { iContentObserver->Commit( KImplUidDevStaPlugin ); @@ -216,6 +275,8 @@ { iContentObserver->CancelTransaction( KImplUidDevStaPlugin ); } + return success; } +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aidevstaplg.rss --- a/idlefw/plugins/devicestatus/src/aidevstaplg.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INCLUDES -#include - - -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -// ?resource_name -// -// -// ----------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO registry_info -{ - resource_format_version = RESOURCE_FORMAT_VERSION_2; - // UID for the DLL - dll_uid = 0x102750F7; - - // Interface info array - interfaces = - { - INTERFACE_INFO - { - // UID of the implemented interface - interface_uid = 0x102750ED; - - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x102750F8; - version_no = 1; - display_name = "DeviceStatus"; - default_data = ""; - opaque_data = ""; - rom_only = 1; - } - }; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aidevstaplgres.rss --- a/idlefw/plugins/devicestatus/src/aidevstaplgres.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project ?myapp -* -*/ - - - -NAME AIDP - -#include -#include -#include -#include -#include - -#include - -RESOURCE RSS_SIGNATURE { } -RESOURCE TBUF { buf=""; } - -// --------------------------------------------------------------------------- -// ?resource_name -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_activeidle_time_format - { - buf = qtn_idle_time_format; - } - -RESOURCE TBUF r_activeidle_bt_sim_access_profile_string - { - buf = qtn_mode_sap; - } - -RESOURCE TBUF r_activeidle_cug_indicator_format - { - buf = qtn_cug_indic_group; - } - -RESOURCE TBUF r_ai_opn_spn_separator_format - { - buf = qtn_ai_opn_spn_separator; - } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aimcnpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aimcnpublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aimcnpublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,9 +15,8 @@ * */ - +#include #include "aimcnpublisher.h" -#include "aicontentobserver.h" #include "ainetworkinfolistener.h" @@ -61,7 +60,7 @@ void CAiMCNPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp --- a/idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -16,7 +16,6 @@ * */ - #include "aimulticontentobserver.h" #include "aicontentobserveroptimizer.h" @@ -103,7 +102,7 @@ } -TBool CAiMultiContentObserver::CanPublish( MAiPropertyExtension& aPlugin, +TBool CAiMultiContentObserver::CanPublish( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) { @@ -119,7 +118,7 @@ } -TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, +TInt CAiMultiContentObserver::Publish( CHsContentPublisher& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) @@ -138,7 +137,7 @@ } -TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, +TInt CAiMultiContentObserver::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) @@ -157,7 +156,7 @@ } -TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, +TInt CAiMultiContentObserver::Publish( CHsContentPublisher& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) @@ -176,7 +175,7 @@ } -TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, +TInt CAiMultiContentObserver::Publish( CHsContentPublisher& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) @@ -195,7 +194,7 @@ } -TInt CAiMultiContentObserver::Clean( MAiPropertyExtension& aPlugin, +TInt CAiMultiContentObserver::Clean( CHsContentPublisher& aPlugin, TInt aContent, TInt aIndex ) { @@ -219,12 +218,12 @@ } TBool CAiMultiContentObserver::RequiresSubscription( - const TAiPublisherInfo& /*aPublisherInfo*/ ) const + const THsPublisherInfo& /*aPublisherInfo*/ ) const { return ETrue; } -TInt CAiMultiContentObserver::SetProperty( MAiPropertyExtension& /*aPlugin*/, +TInt CAiMultiContentObserver::SetProperty( CHsContentPublisher& /*aPlugin*/, const TDesC8& /*aElementId*/, const TDesC8& /*aPropertyName*/, const TDesC8& /*aPropertyValue*/ ) @@ -232,7 +231,7 @@ return KErrNotSupported; } -TInt CAiMultiContentObserver::SetProperty( MAiPropertyExtension& /*aPlugin*/, +TInt CAiMultiContentObserver::SetProperty( CHsContentPublisher& /*aPlugin*/, const TDesC8& /*aElementId*/, const TDesC8& /*aPropertyName*/, const TDesC8& /*aPropertyValue*/, @@ -241,7 +240,17 @@ return KErrNotSupported; } +void CAiMultiContentObserver::ClearBlackList() + { + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + iObserverOptimizers[i]->ClearBlackList(); + } + } + CAiMultiContentObserver::CAiMultiContentObserver() { } +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp --- a/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,6 +21,8 @@ #include "ainetworkinfolistener.h" #include "ainetworkinfoobserver.h" #include "debug.h" +#include // for KErrGsmMMNetworkFailure +#include // for FeatureManager const TInt KAiMessageCacheGranularity = 4; @@ -39,7 +41,6 @@ //Create network handling engine session. iSession = CreateL( *this, iInfo ); - iShowOpInd = EFalse; //Create message cache iMessageCache = new( ELeave )CArrayFixFlat @@ -114,8 +115,7 @@ User::LeaveIfError( iObservers.Insert( &aObserver, freeSlot ) ); } } - - + void CAiNetworkInfoListener::RemoveObserver( MAiNetworkInfoObserver& aObserver ) { //Remove observer, removing is done by replacing it with NULL pointer. @@ -162,24 +162,19 @@ { err = KErrNone; } - if( err != KErrNone ) { - return; + return; } iShowOpInd = !NotAllowedToDisplayOperatorIndicator( aMessage ); - - + TBool hasNetInfoChanged = HasNetworkInfoChanged( aMessage ); - if ( !hasNetInfoChanged ) { return; } - __PRINT(__DBG_FORMAT("XAI: Show operator indicator %d, info changed %d"), iShowOpInd, hasNetInfoChanged ); - const TInt count( iObservers.Count() ); @@ -206,6 +201,9 @@ void CAiNetworkInfoListener::HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ) { __PRINT(__DBG_FORMAT("XAI: Error code %d"), aErrorCode ); + + TNWMessages errorCode = TNWMessages( KErrGeneral ); + switch ( aOperation ) { case MNWMessageObserver::ENWGetNetworkProviderName: @@ -228,14 +226,22 @@ iInfo.iPLMNField.Zero(); __PRINTS("XAI: SPN error received"); break; + case MNWMessageObserver::ENWNotifyNetworkRegistrationStatusChange: + if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) + && ( KErrGsmMMNetworkFailure == aErrorCode ) ) + { + errorCode = static_cast( aErrorCode ); + } + __PRINTS("XAI: ENWNotifyNetworkRegistrationStatusChange error received"); + + break; default: break; } - - HandleNetworkMessage( TNWMessages( KErrGeneral ) ); + + HandleNetworkMessage( errorCode ); } - - + TBool CAiNetworkInfoListener::NotAllowedToDisplayOperatorIndicator( const TNWMessages aMessage ) { // Service provider name must have been fetched. @@ -243,7 +249,8 @@ // Registration status and network information must have been received. // Operator name information must have been received. // Device must be camped to a network. - + + TBool csAlphaFlag( EFalse ); switch ( aMessage ) { case MNWMessageObserver::ENWMessageNetworkInfoChange: @@ -277,7 +284,24 @@ iReceivedMessageFlags &= ~( EProgrammableOperatorInfoReceived + EProgrammableOperatorInfoReceivedOk ); - break; + break; + case MNWMessageObserver::ENWMessageDynamicCapsChange: + TRAPD(fmerr, FeatureManager::InitializeLibL()); + if ( fmerr == KErrNone ) + { + if( FeatureManager::FeatureSupported( + KFeatureIdFfDisplayNetworkNameAfterCsRegistration )) + { + // CS flag is EFalse, alpha tag should not be shown. + if ( !( RPacketService::KCapsRxCSCall & + iInfo.iDynamicCapsFlags ) ) + { + csAlphaFlag = ETrue; + } + } + FeatureManager::UnInitializeLib(); + } + break; default: break; } @@ -298,7 +322,7 @@ !networkProviderNameFetched || !( registrationStatusReceived && networkInformationReceived && operatorNameInformationReceived ) || - !currentNetworkOk; + !currentNetworkOk || csAlphaFlag; } @@ -309,7 +333,9 @@ // pass through if ( aMessage == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage || aMessage == MNWMessageObserver::ENWMessageNetworkConnectionFailure || - aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage ) + aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage || + aMessage == static_cast( KErrGsmMMNetworkFailure ) + ) { return result; } @@ -337,6 +363,17 @@ iOldInfo.iServiceProviderNameDisplayReq || iInfo.iNPName != iOldInfo.iNPName || iInfo.iPLMNField != iOldInfo.iPLMNField; + TRAPD(fmerr, FeatureManager::InitializeLibL()); + if ( fmerr == KErrNone ) + { + if( FeatureManager::FeatureSupported( + KFeatureIdFfDisplayNetworkNameAfterCsRegistration )) + { + result = result || + iInfo.iDynamicCapsFlags != iOldInfo.iDynamicCapsFlags; + } + FeatureManager::UnInitializeLib(); + } } iOldReceivedMessageFlags = iReceivedMessageFlags; diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/ainwspublisher.cpp --- a/idlefw/plugins/devicestatus/src/ainwspublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/ainwspublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -17,7 +17,7 @@ #include "ainwspublisher.h" -#include "aicontentobserver.h" +#include #include "ainetworkinfolistener.h" #include @@ -73,7 +73,7 @@ void CAiNwsPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aioperatorlogopublisher.cpp --- a/idlefw/plugins/devicestatus/src/aioperatorlogopublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aioperatorlogopublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -35,9 +35,9 @@ #include #include #include +#include #include "aioperatorlogopublisher.h" #include "ainetworkinfolistener.h" -#include "aidevicestatuscontentmodel.h" #include "aiprioritizer.h" #include "ainwidpriorities.h" #include "debug.h" @@ -127,16 +127,23 @@ const TBool aShowOpInd ) { __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: HandleNetworkInfoChange >> aShowOpInd %d "), aShowOpInd); - if( aShowOpInd ) - { - TRAP_IGNORE(UpdateOperatorLogoL( ETrue )); - } - else - { - TRAP_IGNORE (iPrioritizer->TryToCleanL( *iBroadcaster, - EAiDeviceStatusContentNetworkIdentity, - iPriority )); - } + + if ( iSuspended ) + { + __PRINTS("CAiOperatorLogoPublisher:: HandleNetworkInfoChange - suspended <<"); + return; + } + + if( aShowOpInd ) + { + TRAP_IGNORE( UpdateOperatorLogoL( ETrue ) ); + } + else + { + TRAP_IGNORE (iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority )); + } __PRINTS("CAiOperatorLogoPublisher:: HandleNetworkInfoChange <<"); } @@ -154,7 +161,7 @@ void CAiOperatorLogoPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ) { @@ -172,7 +179,6 @@ __PRINTS("CAiOperatorLogoPublisher:: RefresL << "); } - CFbsBitmap* CAiOperatorLogoPublisher::LoadLogoL( TInt aMCC, TInt aMNC ) { @@ -233,6 +239,15 @@ { __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: UpdateOperatorLogoL >> aClean %d"), aClean); iSuccess = EFalse; + + if ( iSuspended ) + { + // EAiDeviceStatusContentNetworkIdentity is suspended + + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL - suspended <<"); + return; + } + if( aClean ) { iPrioritizer->TryToCleanL( *iBroadcaster, @@ -493,10 +508,11 @@ TBool CAiOperatorLogoPublisher::RefreshL( TInt aContentId, TBool aClean ) - { - - if(aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) { + iSuspended = EFalse; + __PRINTS("CAiOperatorLogoPublisher:: RefreshL >> "); RefreshL( aClean ); if( iSuccess ) @@ -506,9 +522,21 @@ } __PRINTS("CAiOperatorLogoPublisher:: RefreshL << failed "); } + return EFalse; } +TBool CAiOperatorLogoPublisher::SuspendL( TInt aContentId, TBool /*aClean*/ ) + { + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + iSuspended = ETrue; + + return ETrue; + } + + return EFalse; + } TInt CAiOperatorLogoPublisher::HandleOperatorLogoUpdateL( TAny *aPtr ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp --- a/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -20,10 +20,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include + #include #include "aioperatornamepublisher.h" #include "ainetworkinfolistener.h" -#include "aidevicestatuscontentmodel.h" #include "aiprioritizer.h" #include "ainwidpriorities.h" #include "activeidle2domaincrkeys.h" @@ -35,6 +41,7 @@ const TInt KBitShiftByFour = 4; const TInt KIsDigitLowLimit = 0; const TInt KIsDigitHighLimit = 10; +const TInt KOfflineProfileId = 5; LOCAL_C void AppendDigit( TDes& aCode, TInt aValue ) { @@ -74,6 +81,9 @@ { iListener = CAiNetworkInfoListener::InstanceL(); iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + iProfileEngine = CreateProfileEngineL(); + iProfileNotifier = ProEngFactory::NewNotifyHandlerL(); + iProfileNotifier->RequestProfileActivationNotificationsL( *this ); } @@ -99,6 +109,15 @@ iPeriodic->Cancel(); delete iPeriodic; } + if ( iProfileNotifier ) + { + iProfileNotifier->CancelAll(); + delete iProfileNotifier; + } + if( iProfileEngine ) + { + iProfileEngine->Release(); + } } @@ -113,23 +132,30 @@ const TNWInfo& /*aInfo*/, const TBool aShowOpInd ) { - if( aShowOpInd ) - { - TRAP_IGNORE ( RefreshL( ETrue )); - } - else - { - TRAP_IGNORE ( - iPrioritizer->TryToCleanL( *iBroadcaster, - EAiDeviceStatusContentNetworkIdentity, - iPriority )); - } - + if ( iSuspended ) + { + return; + } + + if( aShowOpInd ) + { + TRAP_IGNORE ( RefreshL( ETrue )); + } + else + { + if ( iProfileEngine->ActiveProfileId() != KOfflineProfileId ) + { + TRAP_IGNORE ( + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority )); + } + } } void CAiOperatorNamePublisher::Subscribe( MAiContentObserver& /*aObserver*/, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& aPrioritizer, MAiPublisherBroadcaster& aBroadcaster ) { @@ -143,6 +169,24 @@ { iSuccess = EFalse; + if ( iSuspended ) + { + return; + } + + if ( iProfileEngine->ActiveProfileId() == KOfflineProfileId ) + { + MProfile* profile = iProfileEngine->ActiveProfileLC(); + const MProfileName& name = profile->ProfileName(); + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + name.Name(), + iPriority ); + iSuccess = ETrue; + CleanupStack::PopAndDestroy();//profile + return; + } + if( aClean ) { iPrioritizer->TryToCleanL( *iBroadcaster, @@ -610,10 +654,13 @@ TBool CAiOperatorNamePublisher::RefreshL( TInt aContentId, TBool aClean ) { - if( aContentId == EAiDeviceStatusContentNetworkIdentity ) + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) { + iSuspended = EFalse; + RefreshL( aClean ); - if( iSuccess ) + + if ( iSuccess ) { return ETrue; } @@ -622,6 +669,17 @@ return EFalse; } +TBool CAiOperatorNamePublisher::SuspendL( TInt aContentId, TBool /*aClean*/ ) + { + if ( aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + iSuspended = ETrue; + + return ETrue; + } + + return EFalse; + } TBool CAiOperatorNamePublisher::RefreshContentWithPriorityL( TInt aContentId, @@ -708,3 +766,8 @@ } } +void CAiOperatorNamePublisher::HandleProfileActivatedL( TInt /*aProfileId*/ ) + { + RefreshL( EFalse ); + } + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aipublisherfactory.cpp --- a/idlefw/plugins/devicestatus/src/aipublisherfactory.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aipublisherfactory.cpp Wed May 12 13:36:47 2010 +0300 @@ -19,7 +19,6 @@ #include "aipublisherfactory.h" // Publishers -#include "aiprofilepublisher.h" #include "aidatepublisher.h" #include "aioperatorlogopublisher.h" #include "aioperatornamepublisher.h" @@ -54,14 +53,6 @@ } }; - -MAiDeviceStatusPublisher* AiPublisherFactory::CreateProfilePublisherL() - { - TPublisherFactory factory; - return factory.CreatePublisherL(); - } - - MAiDeviceStatusPublisher* AiPublisherFactory::CreateDatePublisherL() { TPublisherFactory factory; diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp --- a/idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,16 +18,16 @@ #include "aipublishprioritizer.h" #include "ainwidpriorities.h" -#include "aidevicestatuscontentmodel.h" +#include #include -#include "aipropertyextension.h" + #include "aipublisherbroadcaster.h" #include "debug.h" CAiPublishPrioritizer::CAiPublishPrioritizer( MAiContentObserver& aContentObserver, - MAiPropertyExtension& aPropertyExtension ) + CHsContentPublisher& aPropertyExtension ) : iContentObserver( aContentObserver ), iPropertyExtension( aPropertyExtension ), iPriority( EAiInvalidPriority ) @@ -37,7 +37,7 @@ CAiPublishPrioritizer* CAiPublishPrioritizer::NewL( MAiContentObserver& aContentObserver, - MAiPropertyExtension& aPropertyExtension ) + CHsContentPublisher& aPropertyExtension ) { return new( ELeave ) CAiPublishPrioritizer( aContentObserver, aPropertyExtension ); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aisimregpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aisimregpublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aisimregpublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -17,7 +17,7 @@ #include "aisimregpublisher.h" -#include "aicontentobserver.h" +#include #include "ainetworkinfolistener.h" #include #include @@ -80,7 +80,7 @@ void CAiSimRegPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/devicestatus/src/aivhzpublisher.cpp --- a/idlefw/plugins/devicestatus/src/aivhzpublisher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/devicestatus/src/aivhzpublisher.cpp Wed May 12 13:36:47 2010 +0300 @@ -19,7 +19,7 @@ #include #include "activeidle2domaincrkeys.h" #include "aivhzpublisher.h" -#include "aicontentobserver.h" +#include #include "ainetworkinfolistener.h" @@ -74,7 +74,7 @@ void CAiVHZPublisher::Subscribe( MAiContentObserver& aObserver, - MAiPropertyExtension& aExtension, + CHsContentPublisher& aExtension, MAiPublishPrioritizer& /*aPrioritizer*/, MAiPublisherBroadcaster& /*aBroadcaster*/ ) { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/group/aidevstaplg.mmp --- a/idlefw/plugins/group/aidevstaplg.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include - -TARGET aidevstaplg.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x102750F7 -VENDORID VID_DEFAULT -CAPABILITY CAP_ECOM_PLUGIN - -SOURCEPATH ../devicestatus/src -SOURCE aidevicestatusplugin.cpp -SOURCE aidevicestatuspluginengine.cpp -SOURCE aimulticontentobserver.cpp -SOURCE aiprofilepublisher.cpp -SOURCE aidatepublisher.cpp -SOURCE aipublisherfactory.cpp -SOURCE ainetworkinfolistener.cpp -SOURCE aioperatornamepublisher.cpp -SOURCE aibtsappublisher.cpp -SOURCE aisimregpublisher.cpp -SOURCE aimcnpublisher.cpp -SOURCE aicugpublisher.cpp -SOURCE aicugmcnpublisher.cpp -SOURCE aivhzpublisher.cpp -SOURCE aipublishprioritizer.cpp -SOURCE aicontentobserveroptimizer.cpp -SOURCE aioperatorlogopublisher.cpp -SOURCE ainwspublisher.cpp - -START RESOURCE aidevstaplg.rss -TARGET aidevstaplg.rsc -END - -START RESOURCE aidevstaplgres.rss -HEADER -TARGET aidevstaplgres.rsc -TARGETPATH APP_RESOURCE_DIR -LANGUAGE_IDS -END - -USERINCLUDE . - -USERINCLUDE ../devicestatus/inc -USERINCLUDE ../devicestatus/loc -USERINCLUDE ../../inc/common -USERINCLUDE ../../cenrep - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY sssettings.lib -LIBRARY profileeng.lib -LIBRARY networkhandling.lib -LIBRARY phoneclient.lib -LIBRARY fbscli.lib -LIBRARY cone.lib -LIBRARY commonengine.lib -LIBRARY featmgr.lib -LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib -LIBRARY egul.lib -LIBRARY aknlayout2scalable.lib -LIBRARY cdlengine.lib -LIBRARY gdi.lib -LIBRARY bitgdi.lib -LIBRARY aiutils.lib -LIBRARY flogger.lib -LIBRARY bafl.lib - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/group/aiwsplugin.mmp --- a/idlefw/plugins/group/aiwsplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This is project specification for idle window server plug- -* in. The plug-in provides service for routing of numeric key -* events to Phone application and activation of key lock. -* -*/ - -#include - -TARGET aiwsplugin.dll -TARGETTYPE ANI -UID 0x10003B22 0x10207206 -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -USERINCLUDE ../wsplugin/inc -USERINCLUDE ../../inc/common -APP_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../wsplugin/src -SOURCE aiwspluginanimdll.cpp -SOURCE aiwspluginanim.cpp -SOURCE modifierkeytracker.cpp -SOURCE keylockhandler.cpp -SOURCE keylockstates.cpp -SOURCE keypadsettings.cpp -SOURCE numerickeyhandler.cpp -SOURCE logslaunchhandler.cpp -SOURCE sindlaunchhandler.cpp -SOURCE keyhandlertimer.cpp -SOURCE panic.cpp - - -LIBRARY euser.lib -LIBRARY cone.lib -LIBRARY ws32.lib -LIBRARY apgrfx.lib -LIBRARY centralrepository.lib -LIBRARY flogger.lib - -LIBRARY featmgr.lib -LIBRARY cenrepnotifhandler.lib -LIBRARY ptiengine.lib -LIBRARY keylockpolicyapi.lib - -LIBRARY aiutils.lib - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/group/bld.inf --- a/idlefw/plugins/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Bld.inf for all plugins under ActiveIdle2 project. +* Description: Bld.inf for all plugins under idlefw project. * */ @@ -22,20 +22,17 @@ DEFAULT PRJ_MMPFILES -aidevstaplg.mmp -aiwsplugin.mmp PRJ_EXPORTS -../wsplugin/rom/aiwsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiwsplugin.iby) // Include bld.inf-files of new plugins here -#include "../shortcutplugin/group/bld.inf" -//#include "../pslnactiveidleplugin/group/bld.inf" +#include "../devicestatus/group/bld.inf" #include "../profileplugin/group/bld.inf" #include "../sapidataplugin/group/bld.inf" #include "../wrtdataplugin/group/bld.inf" #include "../mcsplugin/group/bld.inf" +#include "../wsplugin/group/bld.inf" #endif // RD_CUSTOMIZABLE_AI diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h --- a/idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h Wed May 12 13:36:47 2010 +0300 @@ -86,15 +86,6 @@ void WatchNotify( MMCSPluginWatcherObserver* aObserver ); /** - * StopAndWatch - * - * @param aOperation - * @param aWaitScheduler - */ - void StopAndWatch( CMenuOperation* aOperation, - CActiveSchedulerWait* aWaitScheduler ); - - /** * GetStatus */ TInt GetStatus(); @@ -130,12 +121,6 @@ * Owned */ CMenuOperation* iOperation; - - /** - * Wait scheduler - * Not owned - */ - CActiveSchedulerWait* iWaitScheduler; /** * Observer reference diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp --- a/idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp Wed May 12 13:36:47 2010 +0300 @@ -79,15 +79,6 @@ SetActive(); } -void CMCSPluginWatcher::StopAndWatch( CMenuOperation* aOperation, - CActiveSchedulerWait* aWaitScheduler ) - { - __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); - iWaitScheduler = aWaitScheduler; - iOperation = aOperation; - SetActive(); - } - // --------------------------------------------------------------------------- // Inherited from CActive class // --------------------------------------------------------------------------- @@ -100,11 +91,7 @@ { iObserver->HandleNotifyL(); } - if ( iWaitScheduler && iWaitScheduler->IsStarted() ) - { - Cancel(); - iWaitScheduler->AsyncStop(); - } + //CActiveScheduler::Stop(); } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/data/mcsplugin.rss --- a/idlefw/plugins/mcsplugin/data/mcsplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/data/mcsplugin.rss Wed May 12 13:36:47 2010 +0300 @@ -18,6 +18,7 @@ // INCLUDES #include +#include #include "mcspluginuids.hrh" @@ -41,7 +42,7 @@ INTERFACE_INFO { // UID of interface that is implemented - interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; implementations = { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/data/mcspluginres.rss --- a/idlefw/plugins/mcsplugin/data/mcspluginres.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/data/mcspluginres.rss Wed May 12 13:36:47 2010 +0300 @@ -42,7 +42,8 @@ //---------------------------------------------------- // R_MCS_DISABLE_OPEN_ITEM -// Contains application information. +// Dialog text: Item cannot be run because of backup +// state //---------------------------------------------------- // RESOURCE TBUF r_mcs_disable_open_item @@ -51,6 +52,18 @@ } //---------------------------------------------------- +// R_MCS_DISABLE_OPEN_ITEM_MISSING +// Dialog text: Item cannot be opened because of it is +// missing +//---------------------------------------------------- +// +RESOURCE TBUF r_mcs_disable_open_item_missing +{ + buf = qtn_mcs_disable_open_item_missing; +} + + +//---------------------------------------------------- // R_MCS_DISABLE_OPEN_ITEM_DLG // Contains application information. //---------------------------------------------------- diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/data/mcspluginuids.hrh --- a/idlefw/plugins/mcsplugin/data/mcspluginuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/data/mcspluginuids.hrh Wed May 12 13:36:47 2010 +0300 @@ -19,8 +19,6 @@ #ifndef MCSPLUGINUIDS_HRH #define MCSPLUGINUIDS_HRH -#include - /** * Ecom dll uid for MCS plug-in. */ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/group/bld.inf --- a/idlefw/plugins/mcsplugin/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -46,7 +46,9 @@ OPTION SOURCES -c8,8 qgn_prop_ai_shortcut -c8,8 qgn_menu_url \ -c8,8 qgn_menu_mce_sel_mes -c8,8 qgn_menu_mce_syncmail \ -c8,8 qgn_menu_am -c8,8 qgn_prop_cp_conn_shortcut \ - -c8,8 qgn_prop_psln_ai_sub -c8,8 qgn_mcsplugin_log_out + -c8,8 qgn_prop_psln_ai_sub -c8,8 qgn_mcsplugin_log_out \ + -c8,8 qgn_menu_mce_postcard -c8,8 qgn_menu_mce_email \ + -c8,8 qgn_menu_mce_audio -c8,8 qgn_menu_mce_gene END diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/group/mcsplugin.mmp --- a/idlefw/plugins/mcsplugin/group/mcsplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/group/mcsplugin.mmp Wed May 12 13:36:47 2010 +0300 @@ -41,15 +41,15 @@ APP_LAYER_SYSTEMINCLUDE -SOURCEPATH ../data -START RESOURCE mcsplugin.rss -TARGET mcsplugin.rsc +SOURCEPATH ../data +START RESOURCE mcsplugin.rss +TARGET mcsplugin.rsc END -START RESOURCE mcspluginres.rss +START RESOURCE mcspluginres.rss HEADER -TARGET mcspluginres.rsc -TARGETPATH RESOURCE_FILES_DIR +TARGET mcspluginres.rsc +TARGETPATH RESOURCE_FILES_DIR LANGUAGE_IDS END LIBRARY euser.lib @@ -78,9 +78,7 @@ LIBRARY eikdlg.lib LIBRARY commonengine.lib LIBRARY favouritesengine.lib - +LIBRARY viewcli.lib LIBRARY gfxtrans.lib -LIBRARY centralrepository.lib - // End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/group/mcspluginhandler.mmp --- a/idlefw/plugins/mcsplugin/group/mcspluginhandler.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/group/mcspluginhandler.mmp Wed May 12 13:36:47 2010 +0300 @@ -45,6 +45,7 @@ LIBRARY viewcli.lib LIBRARY apparc.lib LIBRARY apgrfx.lib +LIBRARY msgs.lib SOURCEPATH ../data START RESOURCE mcspluginhandler.rss diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp --- a/idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp Wed May 12 13:36:47 2010 +0300 @@ -58,36 +58,27 @@ APP_LAYER_SYSTEMINCLUDE MW_LAYER_SYSTEMINCLUDE -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY eikcoctl.lib -LIBRARY eikcore.lib -LIBRARY cdlengine.lib -//LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler -LIBRARY gsframework.lib // For base classes -LIBRARY gslistbox.lib // For CGSListBoxItemTextArray -LIBRARY gsecomplugin.lib -LIBRARY commonengine.lib // For RConeResourceLoader -LIBRARY inetprotutil.lib // For TUriParser -//LIBRARY apgrfx.lib // For RApaLsSession -//LIBRARY apparc.lib // For TApaAppInfo -LIBRARY msgs.lib // For Message Server -LIBRARY platformenv.lib // For PathInfo -LIBRARY hlplch.lib // for HlpLauncher -LIBRARY featmgr.lib // For feature manager -LIBRARY favouritesengine.lib -//LIBRARY javaregistryclient.lib // For JavaRegistry -#ifdef __WEB_WIDGETS -//LIBRARY widgetregistryclient.lib -#endif +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY cdlengine.lib +LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY gsecomplugin.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY inetprotutil.lib // For TUriParser +LIBRARY msgs.lib // For Message Server +LIBRARY platformenv.lib // For PathInfo +LIBRARY hlplch.lib // for HlpLauncher +LIBRARY featmgr.lib // For feature manager +LIBRARY favouritesengine.lib -// Debugging dependencies -//LIBRARY flogger.lib LIBRARY mcsmenu.lib LIBRARY hspluginsettings.lib LIBRARY aiutils.lib diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/handler/inc/mcspluginhandler.h --- a/idlefw/plugins/mcsplugin/handler/inc/mcspluginhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/handler/inc/mcspluginhandler.h Wed May 12 13:36:47 2010 +0300 @@ -20,8 +20,10 @@ #include + #include #include // For CVwsSessionWrapper +#include // For MMsvSessionObserver #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include #endif @@ -31,6 +33,7 @@ class CEikonEnv; class CVwsSessionWrapper; +class CMsvSession; /** * @ingroup group_mcsplugin @@ -39,7 +42,7 @@ * * @since S60 9.1 */ -NONSHARABLE_CLASS( CMCSPluginHandler ): public CMenuHandlerPlugin +NONSHARABLE_CLASS( CMCSPluginHandler ): public CMenuHandlerPlugin, public MMsvSessionObserver { public: // construction @@ -92,10 +95,29 @@ const TDesC8& aCommand, const TDesC8& aParams, TRequestStatus& aStatus ); - + +public: // from MMsvSessionObserver + + /** + * Handles an event from the message server. + * Not used, but must be defined to be able to use the messaging server. + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, + TAny* aArg3 ); + + + private: // internal void LaunchShortcutL( CMenuItem& aItem ); + + TInt GetEmailAccountCountL(); private: // data @@ -107,6 +129,12 @@ */ CVwsSessionWrapper* iVwsSession; + /** + * Message server session + * Own. + */ + CMsvSession* iMsvSession; + }; #endif // __MCSPLUGINHANDLER_H__ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp --- a/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,36 +15,38 @@ * */ +// System includes #include #include #include #include - -#include -#include - #include // For CVwsSessionWrapper #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include #endif #include // For TVwsViewId +#include +#include #include #include +// User includes #include "mcsplugincompletedoperation.h" #include "mcspluginhandler.h" #include "mcspluginuids.hrh" -#include "aiscutdefs.h" -class CVwsSessionWrapper; - +// Constants _LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type. _LIT( KMenuAttrParamLogs, "logs:dialed" ); /** Argument value for parameter*/ _LIT( KMenuAttrParam, "param" ); +#define KMCSCmailUidValue 0x2001E277 +#define KMCSCmailMailboxViewIdValue 0x2 +#define KMCSCmailMtmUidValue 0x2001F406 + const TInt KImplUidMCSPluginHandler = AI_UID_ECOM_IMPLEMENTATION_MCSPLUGIN_HANDLER; const TImplementationProxy ImplementationTable[] = @@ -61,6 +63,7 @@ CMCSPluginHandler::~CMCSPluginHandler() { delete iVwsSession; + delete iMsvSession; } // --------------------------------------------------------- @@ -94,6 +97,7 @@ { BaseConstructL(); iVwsSession = CVwsSessionWrapper::NewL(); + iMsvSession = CMsvSession::OpenAsObserverL(*this); } // --------------------------------------------------------- @@ -150,6 +154,20 @@ return NULL; } +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CMCSPluginHandler::HandleSessionEventL( + TMsvSessionEvent /*aEvent*/, + TAny* /*aArg1*/, + TAny* /*aArg2*/, + TAny* /*aArg3*/ ) + { + // No event handling + } + // --------------------------------------------------------- // Handles menu:shortcut specific commands // Must be extended to launch e.g. MailBoxes @@ -187,7 +205,15 @@ } else if ( param == KParamValueEmail ) // New email { - sendUi->CreateAndSendMessageL( KSenduiMtmSmtpUid, NULL, KNullUid, EFalse ); + if ( GetEmailAccountCountL() > 0 ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmSmtpUid, NULL, KNullUid, EFalse ); + } + else + { + iVwsSession->StartApp( TUid::Uid( KMCSCmailUidValue ) ); + } + } #ifdef __SYNCML_DS_EMAIL else if ( param == KParamValueSyncMLMail ) // New SyncML mail @@ -205,19 +231,14 @@ } else if ( param.Find( KParamValueMailbox ) != KErrNotFound ) // Mailbox { - TBool attrExists = ETrue; TInt pos = param.Locate( TChar( ':' ) ) + 1; TPtrC mailboxId = param.Mid( pos ); - - if ( attrExists ) - { - TInt number; - TLex16 lextmp( mailboxId ); - lextmp.Val( number ); - TUid uId = TUid::Uid( number ); - const TVwsViewId viewId( KScutMessagingUid, KScutRemoteMailboxViewId ); - iVwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() ); - } + TInt number; + TLex16 lextmp( mailboxId ); + lextmp.Val( number ); + TUid uId = TUid::Uid( number ); + const TVwsViewId viewId( TUid::Uid( KMCSCmailUidValue ), TUid::Uid( KMCSCmailMailboxViewIdValue ) ); + iVwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() ); } else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound ) { @@ -226,6 +247,37 @@ CleanupStack::PopAndDestroy( sendUi ); } +// --------------------------------------------------------------------------- +// Returns count of Email accounts +// --------------------------------------------------------------------------- +// +TInt CMCSPluginHandler::GetEmailAccountCountL() + { + CMsvEntry* rootEntry = iMsvSession->GetEntryL( KMsvRootIndexEntryIdValue ); + CleanupStack::PushL(rootEntry); + + TInt cnt = rootEntry->Count(); + if ( cnt > 0 ) + { + cnt = 0; + rootEntry->SetSortTypeL( TMsvSelectionOrdering( + KMsvGroupByType | KMsvGroupByStandardFolders, + EMsvSortByDetailsReverse, ETrue ) ); + + for ( TInt i = rootEntry->Count(); --i >= 0; ) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + if (tentry.iMtm.iUid == KMCSCmailMtmUidValue ) + { + cnt++; + } + } + } + CleanupStack::PopAndDestroy(rootEntry); + return cnt; + } + // ============================ GLOBAL FUNCTIONS =============================== EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/help/data/xhtml.zip Binary file idlefw/plugins/mcsplugin/help/data/xhtml.zip has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/loc/mcsplugin.loc --- a/idlefw/plugins/mcsplugin/loc/mcsplugin.loc Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/loc/mcsplugin.loc Wed May 12 13:36:47 2010 +0300 @@ -23,4 +23,12 @@ // #define qtn_mcs_disable_open_item "Application cannot be opened during backup" +// d: A dialog which is shown to user when (s)he is trying to +// d: launch shortcut item which is missing from menu. +// l: popup_note_window +// w: +// r: tb9.2 +// +#define qtn_mcs_disable_open_item_missing "Shortcut cannot be opened because item is missing. Try to insert memory card which contains the item or reinstall the application." + //End file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,277 +19,138 @@ #ifndef CMCSPLUGIN_H #define CMCSPLUGIN_H -#include -#include +// System includes + +// User includes +#include #include -#include -#include -#include "mcspluginwatcher.h" +// Forward declarations class MAiContentObserver; class MAiContentItemIterator; class CMCSPluginEngine; -class TMCSData; -//class CMCSPluginData; +class CMCSData; -//class RAiSettingsItemArray; /** - * @ingroup group_mcsplugin + * @ingroup group_mcsplugin * - * Plug-in main class + * MCS Plug-in main class * - * @since S60 v3.2 + * @since S60 5.2 */ -class CMCSPlugin : public CAiContentPublisher, - public MAiPropertyExtension, - public MAiEventHandlerExtension, - public MMCSPluginWatcherObserver +NONSHARABLE_CLASS( CMCSPlugin ) : public CHsContentPublisher + { +public: + // constructor and destructor - - { - -public: - - /** - * Part of the two phased constuction - * - * @param none - * @return none - */ static CMCSPlugin* NewL(); + ~CMCSPlugin(); + +private: + // constructors + /** - * CompareItems - * - * @param aFirst - * @param aSecond - */ - static TInt CompareItems(const MAiPluginSettings& aFirst, - const MAiPluginSettings& aSecond ); - /** - * Constructor - * - * @param none - * @return none + * C++ default constructor */ CMCSPlugin(); - - /** - * Destructor - * - * @param none - * @return none - */ - ~CMCSPlugin(); - - /** - * Publishes profile names - * - * @param void - * @return void - */ - void PublishL(); /** - * From base class MMCSPluginWatcherObserver - * .a method for Skin UID cenrep key change handeling + * 2nd phase constructor */ - void HandleNotifyL(); - -// from base class CAiContentPublisher + void ConstructL(); + +public: + // from CHsContentPublisher /** - * From CAiContentPublisher - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, e.g. the plug-in - * should unload its engines due backup operation. The method transits the - * plug-in to "Idle" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Stop( TAiTransitionReason aReason ); + * @see CHsContentPublisher + */ + void Start( TStartReason aReason ); /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * allowed to consume CPU resources, e.g plug-in is able to run timers, - * perform asynchronous operations, etc. The method transits the plug-in - * to "Alive" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Resume( TAiTransitionReason aReason ); + * @see CHsContentPublisher + */ + void Stop( TStopReason aReason ); /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timers, cancel outstanding asynchronous operations, etc. The method - * transits the plug-in to "Suspendend" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Suspend( TAiTransitionReason aReason ); + * @see CHsContentPublisher + */ + void Resume( TResumeReason aReason ); /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @return void - */ - void SubscribeL( MAiContentObserver& aObserver ); - + * @see CHsContentPublisher + */ + void Suspend( TSuspendReason aReason ); + /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plugin shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @param aSettings setting items defined in the UI definition. - * @return void - */ + * @see CHsContentPublisher + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * @see CHsContentPublisher + */ void ConfigureL( RAiSettingsItemArray& aSettings ); /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension( TUid aUid ); - -// from base class MAiPropertyExtension + * @see CHsContentPublisher + */ + TAny* GetProperty( TProperty aProperty ); /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - TAny* GetPropertyL( TInt aProperty ); + * @see CHsContentPublisher + */ + void HandleEvent( const TDesC& aEventName, const TDesC& aParam ); + +public: + // new functions /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. + * Publishes data */ - void SetPropertyL( TInt aProperty, TAny* aValue ); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 - */ - void HandleEvent(TInt aEvent, const TDesC& aParam); + void PublishL(); + +private: + // new functions /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEventName - name of the event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where mapping to unique identifier supplied by event - * is failed by the frame work then the and - * are provided to plug-in as-is in the descriptor. + * CompareItems */ - void HandleEvent(const TDesC& aEventName, const TDesC& aParam); - -protected: - -private: - - /** - * Part of the two phased construction - * - * @param void - * @return void - */ - void ConstructL(); - - /** - * Resume the plug-in. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void DoResumeL(TAiTransitionReason aReason); - + static TInt CompareItems( const MAiPluginSettings& aFirst, + const MAiPluginSettings& aSecond ); + /** * Publishes content for one menu item */ - void PublishLItemL( MAiContentObserver& aObserver, TMCSData& aDataItem, TInt aIndex ); + void PublishLItemL( MAiContentObserver& aObserver, CMCSData& aDataItem, TInt aIndex ); /** - * Free the engine - * - * @param void - * @return void - */ - void FreeEngine(); - - /** * Delete content model */ void DeleteContentModel(); -private: // data - - // Iterator for plugin content - // Own - MAiContentItemIterator* iContent; - - // Number of data in the content model. - TInt iDataCount; - - // Dynamic content model - // Own. - TAiContentItem* iContentModel; + /** + * Determines if dirty items exists + */ + TBool PublishRequired() const; + +private: + // data - // Plugin engine - // Own + /** Iterator for plugin content, owned */ + MAiContentItemIterator* iContent; + /** Number of data in the content model */ + TInt iDataCount; + /** Dynamic content model, owned */ + TAiContentItem* iContentModel; + /** Plugin engine, owned */ CMCSPluginEngine* iEngine; - - // Array of content observers - // not own + /** Array of content observers, not owned */ RPointerArray iObservers; - - // Information about the content publisher (this plug-in) - TAiPublisherInfo iInfo; - - // For accessing central repository keys - CRepository* iRepository; - - // For observing central repository Skin UID key change - CMCSPluginWatcher* iRepositoryWatcher; - }; #endif // CMCSPLUGIN_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,22 +25,26 @@ #include #include #include +#include class TMenuItem; class CMCSPluginEngine; -class CMCSPluginWatcher; - /** * @ingroup group_mcsplugin * - * TMCData class + * Stores the MCS Menu Items and keeps track whether + * item needs to be published or not. * * @since S60 v9.1 */ -class TMCSData +NONSHARABLE_CLASS( CMCSData ) : public CBase { public: + CMCSData(); + + ~CMCSData(); + /** * SetMenuItem * @@ -54,8 +58,28 @@ * @return TMenuItem */ TMenuItem& MenuItem(); + + /** + * Name of the item. + */ + TDesC& Name(); + + /** + * Set name of the item, + */ + void SetNameL( const TDesC& aName ); /** + * Value of the item. Used for bookmark url. + */ + TDesC& Value(); + + /* + * Set value of the item. + */ + void SetValueL( const TDesC& aValue ); + + /** * SetDirty * * @param aDirty @@ -75,6 +99,16 @@ * iMenuItem */ TMenuItem iMenuItem; + + /** + * Item name, own + */ + HBufC* iName; + + /** + * Item value, own + */ + HBufC* iValue; /** * iDirty @@ -89,7 +123,7 @@ * * @since */ -class CMCSPluginData : public CBase, +NONSHARABLE_CLASS( CMCSPluginData ) : public CBase, public HSPluginSettingsIf::MHomeScreenSettingsObserver { @@ -128,23 +162,15 @@ * @param aIndex * @return TMCSData& */ - TMCSData& DataItemL( TInt aIndex ); + CMCSData& DataItemL( TInt aIndex ); /** - * ReplaceMenuItemL + * Saves 'Undefined' menu item into settings when mailbox is deleted * * @param aIndex * @param aMenuItem */ - void ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem ); - - /** - * SaveSettingsL - * - * @param aIndex - * @param aMenuItem - */ - void SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ); + void SaveUndefinedItemL( const TInt& aIndex ); /** * DataCount @@ -154,10 +180,15 @@ TInt DataCount(){ return iData.Count();}; /** - * UpdateDataL + * Gets the instance specific settings from HSPS and creates data items */ void UpdateDataL(); + /** + * Removes data item from data list and saves new setting into HSPS + */ + void RemoveDataL( TInt aId ); + // From MHomeScreenSettingsObserver /** * SettingsChangedL @@ -166,9 +197,8 @@ * @param aPluginName * @param aPluginUid * @param aPluginId - * @return TInt */ - TInt SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, + void SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, const TDesC8& aPluginUid, const TDesC8& aPluginId ); private: @@ -182,20 +212,51 @@ void ConstructL(); /** - * CreateMenuItemL + * GetMenuDataL * @param aProperties * @return TMenuItem */ - TMenuItem CreateMenuItemL( + CMCSData* GetMenuDataL( RPointerArray& aProperties ); + + /** + * Get bookmark data item + * @param aView, used for bookmark url + * @param aParam, used for bookmark name + * @param aData, is filled with appropriate values + */ + void GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ); + + /** + * Get folder data item + * @param aParam, is used for folder id (in MCS) + * @param aData, is filled with appropriate values + */ + void GetFolderData( const TDesC8& aParam, CMCSData& aData ); + + /** + * Get mailbox data item + * @param aUid, uid of the mailbox in messaging application + * @param aParam, name of the mailbox + * @param aData, is filled with appropriate values + */ + void GetMailboxDataL( const TDesC8& aUid, const TDesC8& aParam, CMCSData& aData ); + + /** + * Get MCS data item + * @param aProperties, Properties are used to filter correct item from MCS. + * @param aData, is filled with appropriate values + */ + void GetMCSDataL( + RPointerArray& aProperties, CMCSData& aData ); private: // data // Menu items, which are defined in settings // Own - RArray iData; + RPointerArray iData; - // Plugin settings + // Plugin settings. NOT OWNED! HSPluginSettingsIf::CHomescreenSettings* iPluginSettings; // Reference to MCS plug-in engine @@ -203,6 +264,10 @@ // Reference to instance uid of HSPS widget const TDesC8& iInstanceUid; + + // MCS resource handle, owned + RMenu iMenu; + }; #endif // CMCSPLUGINDATA_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,43 +19,36 @@ #ifndef CMCSPLUGINENGINE_H #define CMCSPLUGINENGINE_H -// INCLUDE FILES +// System includes #include #include +#include #include -#include // For MFavouritesDbObserver -#include // For RFavouritesDb -#include // For MMsvSessionObserver +#include +// User includes #include "mcspluginwatcher.h" +// Forward declarations class CGulIcon; class CMCSPluginData; -class TMCSData; +class CMCSData; class CMCSPlugin; -class CActiveFavouritesDbNotifier; + /** - * @ingroup group_mcsplugin + * @ingroup group_mcsplugin * - * MCSPluginEngine class + * MCSPluginEngine class * - * @since S60 9.1 + * @since S60 5.2 */ -class CMCSPluginEngine : public CBase, public MMCSPluginWatcherObserver, - public MFavouritesDbObserver, public MMsvSessionObserver -{ - -public: // Constructors and destructor - - /** - * Constructor to use in the object creation. Initializes the necessary - * data. - * - * @param aPlugin - * @param aInstanceUid - */ - CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ); +NONSHARABLE_CLASS( CMCSPluginEngine ) : public CBase, + public MMCSPluginWatcherObserver, + public MMsvSessionObserver + { +public: + // constructor and destructor /** * Part of the two phased constuction @@ -75,13 +68,29 @@ */ ~CMCSPluginEngine(); +private: + // constructors + + /** + * C++ default constructor + */ + CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ); + + /* + * 2nd phase constructor + */ + void ConstructL(); + +public: + // new functions + /** * Gets the menu data. * * @param aIndex * @return TMCSData& */ - TMCSData& MenuDataL( const TInt& aIndex ); + CMCSData& MenuDataL( const TInt& aIndex ); /** Gets the menu item count * @@ -103,8 +112,8 @@ * @param aMenuItem * @return CMenuItem* */ - CMenuItem* FetchMenuItemL( const TMenuItem& aMenuItem ); - + CMenuItem* FetchMenuItemL( CMCSData& aData); + /** * Returns icon for given menu item and given attribute * @@ -112,7 +121,7 @@ * @param aAttr * @return CGulIcon* */ - CGulIcon* ItemIconL( CMenuItem& aMenuItem, const TDesC& aAttr ); + CGulIcon* ItemIconL( CMenuItem* aMenuItem, const TDesC& aAttr ); /** * Returns text for given menu item and given attribute @@ -120,7 +129,7 @@ * @param aMenuItem * @param aAttr */ - TPtrC ItemTextL( CMenuItem& aMenuItem, const TDesC& aAttr ); + TPtrC ItemTextL( CMenuItem* aMenuItem, const TDesC& aAttr ); /** * Launches menu item @@ -130,81 +139,52 @@ void LaunchItemL( const TInt& aIndex ); /** - * Resumes the engine + * Set backup/restore state * - * @param void + * @param aBackupRestore ETrue if backup/restore is ongoing * @return void */ - void ResumeL(); - - /** - * Suspends the engine - * - * @param void - * @return void - */ - void Suspend(); + void SetBackupRestore( TBool aBackupRestore ); /** * ShowSettingsL */ void ShowSettingsL(); +private: + // from MMCSPluginWatcherObserver + /** - * From MMCSPluginWatcherObserver + * @see MMCSPluginWatcherObserver */ void HandleNotifyL(); - // From MFavouritesDbObserver - /** - * Handles database event. - * @param aEvent Database event. - */ - void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent ); +private: + // from MMsvSessionObserver - // from base class MMsvSessionObserver /** - * Handles an event from the message server. - * Not used, but must be defined to be able to use the messaging server. - * - * @since S60 v3.2 - * @param aEvent Indicates the event type. - * @param aArg1 Event type-specific argument value - * @param aArg2 Event type-specific argument value - * @param aArg3 Event type-specific argument value - */ + * @see MMsvSessionObserver + */ void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); - /** - * Called during plugin desctruction - * Decrements reference counters of all run-time generated items - * and deletes those which have reference counter == 0 - */ - void CleanMCSItemsL(); - private: - /* - * Part of the two phased construction - */ - void ConstructL(); + // new functions /** * InitL */ void InitL(); - + /** - * Tells the settings container to start observing for changes in favorites - * database and mailbox db. - * + * Tells the settings container to start observing + * for changes in mailbox db and changes in MCS. */ void StartObservingL(); /** - * Tells the settings container to stop observing for changes in favorites - * database and mailbox db. - * + * Tells the settings container to stop observing + * for changes in mailbox db. */ void StopObserving(); @@ -215,71 +195,56 @@ * @param aMenuItem * @return TBool */ - TBool ConstructMenuItemForIconL( const TDesC& aPath, CMenuItem& aMenuItem ); + TBool ConstructMenuItemForIconL( + const TDesC& aPath, CMenuItem& aMenuItem ); /** - * Helper method. Adds a given constant to a value of reference counter - * - * @param aItem A Menu Item to update - * @param aValueToAdd A constant to add - * @return The actual value of updated reference count - */ - TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, const TInt aValueToAdd ); - -protected: + * Creates bookmark specific MCS menu item. + */ + CMenuItem* CreateBkmItemL( CMCSData& aData ); + + /** + * Creates mailbox specific MCS menu item. + */ + CMenuItem* CreateMailboxItemL( CMCSData& aData ); + + void LaunchFolderItemL( CMCSData& aData ); + + void LaunchBookmarkItemL( CMCSData& aData ); + + void LaunchMailboxItemL( CMCSData& aData ); + + void LaunchMCSItemL( CMCSData& aData ); private: - - /* Plugin data - * Own - */ + // data + + /** Plugin data, owned */ CMCSPluginData* iPluginData; - - // MCS resource + /** MCS resource handle, owned */ RMenu iMenu; - - // MCS change notifier + /** MCS change notifier handle, owned */ RMenuNotifier iNotifier; - - // MCS asynchronous operation watcher + /** MCS asynchronous operation watcher, owned */ CMCSPluginWatcher* iWatcher; - - // MCS change notifier watcher + /** MCS change notifier watcher, owned */ CMCSPluginWatcher* iNotifyWatcher; - - // + /** MCS plugin, not owned */ CMCSPlugin& iPlugin; - - // Reference to plugin owned instanceUid + /** Reference to plugin owned instanceUid */ const TDesC8& iInstanceUid; - // Indicating that backup is in progress - TBool iSuspend; - //Offset of resource file. + /** Flag Indicating that backup/restore is in progress */ + TBool iBackupRestore; + /** Offset of resource file */ TInt iResourceOffset; - - /** - * Bookmark database change observer. - * Own. - */ - CActiveFavouritesDbNotifier* iBookmarkDbObserver; - - /** - * Bookmark database. - */ - RFavouritesDb iBookmarkDb; - - /** - * Bookmark database session. - */ - RFavouritesSession iBookmarkSession; - - /** - * Message server session - * Own. - */ - CMsvSession* iMsvSession; -}; + /** Message server session, owned */ + CMsvSession* iMsvSession; + /** "Undefined" menu item, owned */ + CMenuItem* iUndefinedItem; + /** "Undefined" menu item header */ + TMenuItem iUndefinedItemHeader; + }; #endif // CMCSPLUGINENGINE_H - +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,50 +15,48 @@ * */ - +// System includes #include #include #include -#include -#include -#include #include -#include // For working with settings API -#include // Headers Used for CRepository - +// User includes +#include +#include +#include #include "mcspluginuids.hrh" #include "mcsplugin.h" #include "mcsplugindata.h" #include "mcspluginengine.h" #include "aipluginsettings.h" - +// Constants const TUint KPluginNameSeprator = '/'; const TInt KImplUidMCSPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN; -// CONST CLASS VARIABLES -const TImplementationProxy KImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KImplUidMCSPlugin, CMCSPlugin::NewL ) - }; _LIT( KEventNameLaunchByIndex, "LaunchByIndex" ); _LIT( KEventNameShowSettings, "ShowSettings" ); _LIT( KContentItemTypeText, "text" ); _LIT( KContentItemTypeImage, "image" ); +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidMCSPlugin, CMCSPlugin::NewL ) + }; + // ======== LOCAL FUNCTIONS ======== // ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::NewL +// +// ---------------------------------------------------------------------------- // CMCSPlugin* CMCSPlugin::NewL() { - CMCSPlugin* self = new (ELeave) CMCSPlugin; + CMCSPlugin* self = new ( ELeave ) CMCSPlugin; CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -66,123 +64,72 @@ return self; } -// --------------------------------------------------------------------------- -// Default constructor -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::CMCSPlugin +// +// ---------------------------------------------------------------------------- // CMCSPlugin::CMCSPlugin() { } -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::ConstructL +// +// ---------------------------------------------------------------------------- // void CMCSPlugin::ConstructL() - { - iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN; - // We need to Query Central Repository - iRepository = CRepository::NewL( KCRUidPersonalisation ); - - // Setting up watcher which calls HandleNotifyL method - // everytime the SkinUID changes in central repository - iRepositoryWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); - iRepository->NotifyRequest( KPslnActiveSkinUid, iRepositoryWatcher->iStatus ); - iRepositoryWatcher->WatchNotify( this ); - } - -// --------------------------------------------------------------------------- -// Handle Skin UID change -// --------------------------------------------------------------------------- -// -void CMCSPlugin::HandleNotifyL() { - - // Skin ID has changed. Set all MenuItems on Widget dirty - // and re-publish to update icons - if ( iEngine ) - { - TInt dataCount = iEngine->MenuItemCount(); - for ( TInt i = 0; i < dataCount; i++ ) - { - iEngine->MenuDataL( i ).SetDirty( ETrue ); - } - PublishL(); - } - - // Skin ID Notification must be activated again - iRepositoryWatcher->Cancel(); - iRepository->NotifyRequest( KPslnActiveSkinUid, iRepositoryWatcher->iStatus ); - iRepositoryWatcher->WatchNotify( this ); } -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // Destructor // Deletes all data created to heap -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // CMCSPlugin::~CMCSPlugin() { - Release( iContent ); - - if ( iEngine ) - { - TRAP_IGNORE( iEngine->CleanMCSItemsL() ); - } - + Release( iContent ); + delete iEngine; iObservers.Close(); DeleteContentModel(); - - if ( iRepository ) - { - delete iRepository; - iRepository = NULL; - } - - if ( iRepositoryWatcher ) - { - iRepositoryWatcher->Cancel(); - delete iRepositoryWatcher; - iRepositoryWatcher = NULL; - } } -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::PublishL // Publishes the all the items -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CMCSPlugin::PublishL() - { - - if ( !iEngine ) - { - iEngine = CMCSPluginEngine::NewL( *this, iInfo.iNamespace ); - } - + { TInt err( KErrNone ); TInt observers( iObservers.Count() ); - TInt transactionId = reinterpret_cast( this ); + TInt transactionId( reinterpret_cast( this ) ); TInt menuItems ( iEngine->MenuItemCount() ); for ( TInt i = 0; i < observers; i++ ) { - MAiContentObserver* observer = iObservers[ i ]; + MAiContentObserver* observer( iObservers[ i ] ); err = observer->StartTransaction( transactionId ); + if ( err == KErrNotSupported ) { return; } + // Publish content to all items for ( TInt j = 0; j < menuItems; j++ ) { // Index has to start from 1 ( j + 1 ) PublishLItemL( *observer, iEngine->MenuDataL( j ), ( j + 1 ) ); }// shortcut count + if ( err == KErrNone ) { err = observer->Commit( transactionId ); + if ( err == KErrNotSupported ) { return; @@ -197,20 +144,22 @@ } } -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::PublishLItemL // Publishes one item to given index -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // -void CMCSPlugin::PublishLItemL( MAiContentObserver& aObserver, TMCSData& aData, TInt aIndex ) +void CMCSPlugin::PublishLItemL( MAiContentObserver& aObserver, + CMCSData& aData, TInt aIndex ) { - if( !aData.IsDirty() ) { return; } - CMenuItem* item = iEngine->FetchMenuItemL( aData.MenuItem() ); + CMenuItem* item = iEngine->FetchMenuItemL( aData ); CleanupStack::PushL( item ); + // One widget item has iDataCount number of elements for ( TInt i = 0; i < iDataCount; i++ ) { @@ -219,137 +168,142 @@ //Publish image if ( aObserver.CanPublish( *this, i, aIndex ) ) { - CGulIcon* icon = iEngine->ItemIconL( *item, TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ); + CGulIcon* icon( iEngine->ItemIconL( item, + TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); + aObserver.PublishPtr( *this, i, icon , aIndex ); } } - else if ( iContentModel[ i ].type == KAiContentTypeText ) + else if ( iContentModel[i].type == KAiContentTypeText ) { //Publish text if ( aObserver.CanPublish( *this, i, aIndex ) ) { - TPtrC name = iEngine->ItemTextL( *item, TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ); + TPtrC name( iEngine->ItemTextL( item, + TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ) ); + aObserver.Publish( *this, i, name, aIndex ); } } }//content items CleanupStack::PopAndDestroy( item ); - } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is requested to unload its engines due backup operation -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::Start +// +// ---------------------------------------------------------------------------- // -void CMCSPlugin::Stop( TAiTransitionReason aReason ) +void CMCSPlugin::Start( TStartReason /*aReason*/ ) { - - if ( aReason == EAiBackupRestoreStarted ) - { - Suspend( aReason ); - } + + } + +// ---------------------------------------------------------------------------- +// CMCSPlugin::Stop +// +// ---------------------------------------------------------------------------- +// +void CMCSPlugin::Stop( TStopReason /*aReason*/ ) + { } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::Resume +// +// ---------------------------------------------------------------------------- // -void CMCSPlugin::Resume( TAiTransitionReason aReason ) - { - if( aReason == EAiIdleBackground ) +void CMCSPlugin::Resume( TResumeReason aReason ) + { + if ( aReason == EForeground ) { - return; - } - - if ( aReason == EAiBackupRestoreEnded ) - { - if ( iEngine ) + iEngine->SetBackupRestore( EFalse ); + + if ( PublishRequired() ) { - TRAP_IGNORE( iEngine->ResumeL() ); - } - } - - TRAP_IGNORE( DoResumeL( aReason ) ); - return; - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is not allowed to consume CPU resources -// --------------------------------------------------------------------------- -// -void CMCSPlugin::Suspend( TAiTransitionReason aReason ) - { - if ( aReason == EAiBackupRestoreStarted && iEngine ) - { - iEngine->Suspend(); + TRAP_IGNORE( PublishL() ); + } } } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// The plug-in MUST maintain a registry of subscribers and send -// notification to all of them whenever the state changes or new content -// is available -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::Suspend +// +// ---------------------------------------------------------------------------- +// +void CMCSPlugin::Suspend( TSuspendReason aReason ) + { + if ( aReason == EGeneralThemeChange ) + { + TInt dataCount( iEngine->MenuItemCount() ); + + for ( TInt i = 0; i < dataCount; i++ ) + { + TRAP_IGNORE( iEngine->MenuDataL( i ).SetDirty( ETrue ) ); + } + } + else if ( aReason == EBackupRestore ) + { + // Prevent item launching during backup / restore + iEngine->SetBackupRestore( ETrue ); + } + } + +// ---------------------------------------------------------------------------- +// CMCSPlugin::SubscribeL +// +// ---------------------------------------------------------------------------- // void CMCSPlugin::SubscribeL( MAiContentObserver& aObserver ) { iObservers.AppendL( &aObserver ); } -// --------------------------------------------------------------------------- -// Compare method to exclude the similar content items from array. -// --------------------------------------------------------------------------- -// -TInt CMCSPlugin::CompareItems( const MAiPluginSettings& aFirst, - const MAiPluginSettings& aSecond ) - { - MAiPluginSettings& first = const_cast(aFirst); - MAiPluginSettings& second = const_cast(aSecond); - return first.AiPluginContentItem().Name().CompareC(second.AiPluginContentItem().Name()); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-ins take ownership of the settings array, so it must either -// store it in a member or free it. -// Creates dynamic content model. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::ConfigureL +// +// ---------------------------------------------------------------------------- // void CMCSPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) - { + { + iEngine = CMCSPluginEngine::NewL( *this, PublisherInfo().Namespace() ); TLinearOrder sortMethod( CMCSPlugin::CompareItems ); RAiSettingsItemArray contentItemsArr; - TInt count = aSettings.Count(); + TInt count( aSettings.Count() ); + for ( TInt i = 0; i < count; i++ ) { - MAiPluginSettings* pluginSetting = aSettings[ i ]; - if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) + MAiPluginSettings* setting( aSettings[ i ] ); + + if( setting->AiPluginItemType() == EAiPluginContentItem ) { - MAiPluginContentItem& contItem = pluginSetting->AiPluginContentItem(); - TPtrC name = contItem.Name(); - TPtrC type = contItem.Type(); - contentItemsArr.InsertInOrder( pluginSetting, sortMethod ); + MAiPluginContentItem& contItem( setting->AiPluginContentItem() ); + TPtrC name( contItem.Name() ); + TPtrC type( contItem.Type() ); + + contentItemsArr.InsertInOrder( setting, sortMethod ); } - } + iDataCount = contentItemsArr.Count(); + if ( iDataCount > 0 ) { // Create the dynamic content Model DeleteContentModel(); + iContentModel = new ( ELeave ) TAiContentItem[ iDataCount ]; + for ( TInt i = 0; i < iDataCount; i++ ) { iContentModel[i].id = i; - MAiPluginContentItem& contentItem = ( contentItemsArr[ i ] )->AiPluginContentItem(); + + MAiPluginContentItem& contentItem( + contentItemsArr[ i ]->AiPluginContentItem() ); if( contentItem.Type() == KContentItemTypeText ) { @@ -361,153 +315,87 @@ // image iContentModel[i].type = KAiContentTypeBitmap; } - TInt pos = contentItem.Name().Locate( KPluginNameSeprator ); + + TInt pos( contentItem.Name().Locate( KPluginNameSeprator ) ); HBufC* contentId = HBufC::NewL( contentItem.Name().Length() ); CleanupStack::PushL( contentId ); - TPtr ptr = contentId->Des(); + + TPtr ptr( contentId->Des() ); ptr = contentItem.Name().Mid( pos + 1 ); - TInt sizeOfContentId = ptr.Size() +sizeof( wchar_t ); - iContentModel[i].cid = static_cast( User::AllocL( sizeOfContentId ) ); - Mem::Copy((TAny*)iContentModel[i].cid, ptr.PtrZ(), sizeOfContentId); + + TInt sizeOfContentId( ptr.Size() + sizeof( wchar_t ) ); + + iContentModel[i].cid = + static_cast( User::AllocL( sizeOfContentId ) ); + + Mem::Copy( ( TAny* )iContentModel[i].cid, + ptr.PtrZ(), sizeOfContentId ); + CleanupStack::PopAndDestroy( contentId ); } - iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); + + iContent = AiUtility::CreateContentItemArrayIteratorL( + iContentModel, iDataCount ); } + contentItemsArr.Reset(); // We own the array so destroy it aSettings.ResetAndDestroy(); } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Returns the extension interface. Actual type depends on the passed -// aUid argument. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::GetProperty +// +// ---------------------------------------------------------------------------- // -TAny* CMCSPlugin::Extension( TUid aUid ) - { - if (aUid == KExtensionUidProperty) - { - return static_cast(this); +TAny* CMCSPlugin::GetProperty( TProperty aProperty ) + { + if( aProperty == EPublisherContent ) + { + return static_cast< MAiContentItemIterator* >( iContent ); } - else if (aUid == KExtensionUidEventHandler) - { - return static_cast(this); - } - else - { - return NULL; - } + + return NULL; } - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Read property of publisher plug-in. -// --------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// CMCSPlugin::HandleEvent +// +// ---------------------------------------------------------------------------- // -TAny* CMCSPlugin::GetPropertyL( TInt aProperty ) - { - TAny* property = NULL; - - switch ( aProperty ) +void CMCSPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) + { + if( aEventName == KEventNameLaunchByIndex ) + { + TInt32 index; + AiUtility::ParseInt( index, aParam ); + + TRAP_IGNORE( iEngine->LaunchItemL( index - 1 ) ); + } + else if( aEventName == KEventNameShowSettings ) { - case EAiPublisherInfo: - { - property = static_cast( &iInfo ); - break; - } - - case EAiPublisherContent: - { - property = static_cast( iContent ); - break; - } - } - return property; + TRAP_IGNORE( iEngine->ShowSettingsL() ); + } } -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Write property value to optimize the content model. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::CompareItems +// +// ---------------------------------------------------------------------------- // -void CMCSPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - { - switch ( aProperty ) - { - case EAiPublisherInfo: - { - if( aValue ) - { - const TAiPublisherInfo* info = static_cast( aValue ); - iInfo.iName.Copy(info->iName); - iInfo.iNamespace.Copy(info->iNamespace); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CMCSPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) +TInt CMCSPlugin::CompareItems( const MAiPluginSettings& aFirst, + const MAiPluginSettings& aSecond ) { - // We have no way of reporting errors to framework so just ignore them. - //TRAP_IGNORE( iEngine->HandleEventL(aEvent, aParam )); - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CMCSPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) - { - if ( iEngine ) - { - if( aEventName == KEventNameLaunchByIndex ) - { - // We have no way of reporting errors to framework so just ignore them. - TInt32 index; - AiUtility::ParseInt( index, aParam ); - TRAP_IGNORE( iEngine->LaunchItemL( index - 1 )); - } - else if( aEventName == KEventNameShowSettings ) - { - TRAP_IGNORE( iEngine->ShowSettingsL() ); - } - } + MAiPluginSettings& first = const_cast(aFirst); + MAiPluginSettings& second = const_cast(aSecond); + return first.AiPluginContentItem().Name().CompareC(second.AiPluginContentItem().Name()); } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// framework instructs plug-in that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPlugin::DeleteContentModel // -void CMCSPlugin::DoResumeL( TAiTransitionReason /*aReason*/ ) - { - PublishL(); - } - -// --------------------------------------------------------------------------- -// Frees engine resources -// --------------------------------------------------------------------------- -// -void CMCSPlugin::FreeEngine() - { - delete iEngine; - iEngine = NULL; - } - -// --------------------------------------------------------------------------- -// Delete content model -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CMCSPlugin::DeleteContentModel() { @@ -528,11 +416,31 @@ iContentModel = NULL; } } - + +// ---------------------------------------------------------------------------- +// CMCSPlugin::PublishRequired +// +// ---------------------------------------------------------------------------- +// +TBool CMCSPlugin::PublishRequired() const + { + TInt count( iEngine->MenuItemCount() ); + + TBool retval( EFalse ); + + for ( TInt i = 0; !retval && i < count; i++ ) + { + TRAP_IGNORE( retval = iEngine->MenuDataL( i ).IsDirty() ); + } + + + return retval; + } + // ======== GLOBAL FUNCTIONS ======== -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // Constructs and returns an application object. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) @@ -541,3 +449,5 @@ sizeof( TImplementationProxy ); return KImplementationTable; } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -24,48 +24,147 @@ using namespace HSPluginSettingsIf; -_LIT8( KAppUid, "271012080" ); _LIT( KMenuAttrParam, "param" ); _LIT( KMenuAttrLocked, "locked" ); _LIT8( KProperNameType, "type" ); _LIT8( KProperNameParam, "param" ); _LIT8( KProperNameUid, "uid" ); _LIT8( KProperNameView, "view" ); +_LIT8( KProperNameLocked, "locked" ); _LIT8( KProperValueFolder, "folder" ); _LIT8( KProperValueBookmark, "bookmark" ); _LIT8( KProperValueAppl, "application" ); +_LIT8( KProperValueMailbox, "mailbox" ); +_LIT8( KMenuAttrUndefUid, "0x99999991" ); + +_LIT( KMyMenuData, "matrixmenudata" ); +_LIT( KMenuTypeMailbox, "menu:mailbox" ); + + +#define KMCSCmailMtmUidValue 0x2001F406 // ======== LOCAL FUNCTIONS ======== -static void ItemMapArrayCleanupFunc( TAny* aPointerArray ) +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroy( TAny* aObj ) { - RPointerArray* p = static_cast*>( aPointerArray ); - p->ResetAndDestroy(); - p->Close(); + if( aObj ) + { + static_cast( aObj )->ResetAndDestroy(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroyPushL(T& aArray) + { + CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy, &aArray ) ); } // ======== MEMBER FUNCTIONS ======== -void TMCSData::SetMenuItem( TMenuItem& aMenuItem ) +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CMCSData::CMCSData() + { + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSData::~CMCSData() + { + delete iName; + delete iValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSData::SetMenuItem( TMenuItem& aMenuItem ) { iMenuItem = aMenuItem; } -TMenuItem& TMCSData::MenuItem() +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TMenuItem& CMCSData::MenuItem() { return iMenuItem; } -void TMCSData::SetDirty( TBool aDirty ) +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TDesC& CMCSData::Name() + { + return *iName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSData::SetNameL( const TDesC& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TDesC& CMCSData::Value() + { + return *iValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSData::SetValueL( const TDesC& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSData::SetDirty( TBool aDirty ) { iDirty = aDirty; } -TBool TMCSData::IsDirty() const +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CMCSData::IsDirty() const { return iDirty; } + // --------------------------------------------------------------------------- // Symbian 2nd phase constructor can leave // --------------------------------------------------------------------------- @@ -95,10 +194,15 @@ // void CMCSPluginData::ConstructL() { - // AILaunch uid in decimal format - iPluginSettings = CHomescreenSettings::NewL( KAppUid, - iInstanceUid, - this ); + iPluginSettings = CHomescreenSettings::Instance(); + if( iPluginSettings == NULL ) + { + User::Leave( KErrUnknown ); + } + iPluginSettings->AddObserverL( this ); + + iMenu.OpenL( KMyMenuData ); + UpdateDataL(); } @@ -107,9 +211,13 @@ // --------------------------------------------------------------------------- // CMCSPluginData::~CMCSPluginData() - { - iData.Close(); - delete iPluginSettings; + { + if( iPluginSettings ) + { + iPluginSettings->RemoveObserver( this ); + } + iData.ResetAndDestroy(); + iMenu.Close(); } // --------------------------------------------------------------------------- @@ -119,61 +227,208 @@ void CMCSPluginData::UpdateDataL() { RPointerArray settings; - TCleanupItem settingsCleanupItem( ItemMapArrayCleanupFunc, &settings ); - CleanupStack::PushL( settingsCleanupItem ); + CleanupResetAndDestroyPushL( settings ); + iPluginSettings->GetSettingsL( iInstanceUid, settings ); TInt count = settings.Count(); - for( TInt i = 0; i < count; i++ ) + TBool wasEmpty = !iData.Count(); + + for ( TInt i = 0; i < count; i++ ) { - CItemMap* itemMap = settings[i]; + CItemMap* itemMap = settings[ i ]; RPointerArray& properties = itemMap->Properties(); - TMenuItem item = CreateMenuItemL( properties ); - TMCSData data; - TInt id = -1; - - if ( count == iData.Count() ) + CMCSData* data = GetMenuDataL( properties ); + + if ( wasEmpty ) { - id = iData[i].MenuItem().Id(); + // list of shortcut slot was empty + // we append the shortcut data slots one-by-one to the list + data->SetDirty( ETrue ); + iData.AppendL( data ); } - - if ( id > 0 ) + else { - if ( item.Id() != id ) + // check for updates in existing shortcut data slot + // if menuitem id has changed, replace the item and + // set as dirty + TInt id = -1; + id = iData[ i ]->MenuItem().Id(); + + if ( data->MenuItem().Id() != id ) { - data.SetMenuItem( item ); - data.SetDirty( ETrue ); + data->SetDirty( ETrue ); + CMCSData* oldData = iData[i]; iData.Remove( i ); + delete oldData; iData.InsertL( data, i ); } - } - else - { - data.SetMenuItem( item ); - data.SetDirty( ETrue ); - iData.AppendL( data ); - } + } } - - CleanupStack::PopAndDestroy(); // settingsCleanupItem + + // Cleanup. + CleanupStack::PopAndDestroy(); // settings } // --------------------------------------------------------------------------- -// +// Removes obsolete data and saves 'Undefined' item to HSPS +// Used when active mailbox is deleted from system. // --------------------------------------------------------------------------- // -TInt CMCSPluginData::SettingsChangedL( const TDesC8& /*aEvent*/, const TDesC8& /*aPluginName*/, - const TDesC8& /*aPluginUid*/, const TDesC8& /*aPluginId*/ ) +void CMCSPluginData::RemoveDataL( TInt aId ) { - UpdateDataL(); - return KErrNone; + TInt count = iData.Count(); + for( TInt i = 0; i < count; i++ ) + { + CMCSData* data = iData[i]; + if( data->MenuItem().Type() == KMenuTypeMailbox && + data->MenuItem().Id() == aId ) + { + iData[i]->MenuItem().SetId( KErrNotFound ); + iData[i]->SetDirty( ETrue ); + SaveUndefinedItemL( i ); + } + } + } + +// --------------------------------------------------------------------------- +// Call back from Homescreen settings +// --------------------------------------------------------------------------- +// +void CMCSPluginData::SettingsChangedL( const TDesC8& /*aEvent*/, const TDesC8& /*aPluginName*/, + const TDesC8& /*aPluginUid*/, const TDesC8& aPluginId ) + { + if( aPluginId.CompareF( iInstanceUid ) == 0 ) + { + UpdateDataL(); + } } // --------------------------------------------------------------------------- // Gets the menu item from engine using the setting properties as filter // --------------------------------------------------------------------------- // -TMenuItem CMCSPluginData::CreateMenuItemL( RPointerArray& aProperties ) +CMCSData* CMCSPluginData::GetMenuDataL( RPointerArray& aProperties ) + { + TPtrC8 type; + TPtrC8 uid; + TPtrC8 view; + TPtrC8 param; + + // first we need to check the item type + for ( TInt i = 0; i < aProperties.Count(); i++ ) + { + if ( aProperties[i]->Name() == KProperNameType ) + { + type.Set( aProperties[i]->Value()); + } + else if( aProperties[i]->Name() == KProperNameUid) + { + uid.Set( aProperties[i]->Value()); + } + else if( aProperties[i]->Name() == KProperNameView) + { + view.Set( aProperties[i]->Value()); + } + else if( aProperties[i]->Name() == KProperNameParam ) + { + param.Set( aProperties[i]->Value()); + } + } + CMCSData* data = new ( ELeave ) CMCSData(); + CleanupStack::PushL( data ); + if( type == KProperValueBookmark ) + { + GetBkmDataL( view, param, *data ); + } + else if( type == KProperValueFolder ) + { + GetFolderData( param, *data ); + } + else if( type == KProperValueMailbox ) + { + GetMailboxDataL( uid, param, *data ); + } + else + { + GetMCSDataL( aProperties, *data ); + } + CleanupStack::Pop( data ); + return data; + } + +// --------------------------------------------------------------------------- +// Creates bookmark data item. +// --------------------------------------------------------------------------- +// +void CMCSPluginData::GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ) + { + TMenuItem item; + item.SetType( KMenuTypeUrl ); + aData.SetMenuItem( item ); + + HBufC* view( NULL ); + view = AiUtility::CopyToBufferL( view, aView ); + CleanupStack::PushL( view ); + aData.SetValueL( *view ); + CleanupStack::PopAndDestroy( view ); + + HBufC* param( NULL ); + param = AiUtility::CopyToBufferL( param, aParam ); + CleanupStack::PushL( param ); + aData.SetNameL( *param ); + CleanupStack::PopAndDestroy( param ); + } + +// --------------------------------------------------------------------------- +// Creates folder data item. +// --------------------------------------------------------------------------- +// +void CMCSPluginData::GetFolderData( const TDesC8& aParam, CMCSData& aData ) + { + // In folder case, we have to extract id from + // param attribute and return item with this id + // convert id to integer + TInt id; + TLex8 lextmp( aParam); + lextmp.Val( id ); + + TMenuItem item; + item.SetType( KMenuTypeFolder ); + item.SetId( id ); + aData.SetMenuItem( item ); + } + +// --------------------------------------------------------------------------- +// Creates mailbox data item. +// --------------------------------------------------------------------------- +// +void CMCSPluginData::GetMailboxDataL( const TDesC8& aUid, const TDesC8& aParam, CMCSData& aData ) + { + TInt id( KErrNotFound ); + TLex8 lextmp( aUid); + lextmp.Val( id ); + + TMenuItem item; + item.SetType( KMenuTypeMailbox ); + item.SetId( id ); + aData.SetMenuItem( item ); + + HBufC* param( NULL ); + param = AiUtility::CopyToBufferL( param, aParam ); + CleanupStack::PushL( param ); + + aData.SetNameL( *param ); + + CleanupStack::PopAndDestroy( param ); + } + +// --------------------------------------------------------------------------- +// Gets data item from MCS +// --------------------------------------------------------------------------- +// +void CMCSPluginData::GetMCSDataL( RPointerArray& aProperties, + CMCSData& aData) { CMenuFilter* filter = CMenuFilter::NewLC(); @@ -181,25 +436,10 @@ // Criterias will be added to filter if setting defines them filter->DoNotHaveAttributeL( KMenuAttrView ); filter->DoNotHaveAttributeL( KMenuAttrParam ); - TBool isFolder = EFalse; - // first, we need to check if the item is folder - for ( TInt i = 0; i < aProperties.Count(); i++ ) - { - if ( aProperties[i]->Name() == KProperNameType ) - { - if ( aProperties[i]->Value() == KProperValueFolder ) - { - isFolder = ETrue; - } - break; - } - } - // then add all property/value pairs to the filter for ( TInt i = 0; i < aProperties.Count(); i++ ) { - // skip the type property if( aProperties[i]->Name() == KProperNameType ) { @@ -215,29 +455,7 @@ if ( value->Length() != 0 ) { - // in case of folder, we just have to extract - // id from param attribute and return item with this id - if ( aProperties[i]->Name() == KProperNameParam && isFolder ) - { - TMenuItem item; - // convert id to integer - TInt id; - TLex16 lextmp( value->Ptr() ); - lextmp.Val( id ); - item.SetType( KMenuTypeFolder ); - item.SetId( id ); - - CleanupStack::PopAndDestroy( value ); - CleanupStack::PopAndDestroy( name ); - CleanupStack::PopAndDestroy( filter ); - - return item; - } - else - { - // otherwise, we just add name/value into filter - filter->HaveAttributeL( *name, *value ); - } + filter->HaveAttributeL( *name, *value ); } CleanupStack::PopAndDestroy( value ); CleanupStack::PopAndDestroy( name ); @@ -248,118 +466,64 @@ TMenuItem item = iEngine.FindMenuItemL( *filter ); CleanupStack::PopAndDestroy( filter ); - return item; + aData.SetMenuItem( item ); } // --------------------------------------------------------------------------- // Returns menu item for given index // --------------------------------------------------------------------------- // -TMCSData& CMCSPluginData::DataItemL( TInt aIndex ) +CMCSData& CMCSPluginData::DataItemL( TInt aIndex ) { if( aIndex < 0 || aIndex >= iData.Count()) { User::Leave( KErrArgument ); } - return iData[aIndex]; + return *iData[aIndex]; } // --------------------------------------------------------------------------- -// Replaces menuitem in data instance +// Save the undefined item. // --------------------------------------------------------------------------- // -void CMCSPluginData::ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem ) - { - TMCSData& data = iData[aIndex]; - data.SetMenuItem( aMenuItem ); - data.SetDirty( ETrue ); - } - -// --------------------------------------------------------------------------- -// Save the setting persistently to HSPS -// TODO HSPS setting api should be changed so that items and properties can -// be added/removed dynamically. Now widgetconfiguration.xml must have all the -// properties for every item even though property is not used. -// It makes this function more compolicated. -// --------------------------------------------------------------------------- -// -void CMCSPluginData::SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ) +void CMCSPluginData::SaveUndefinedItemL( const TInt& aIndex ) { RPointerArray settingItems; - CleanupClosePushL( settingItems ); + CleanupResetAndDestroyPushL( settingItems ); + iPluginSettings->GetSettingsL( iInstanceUid, settingItems ); if ( aIndex >= 0 && aIndex < settingItems.Count() ) { - TBool exists( EFalse ); - CItemMap* itemMap = settingItems[aIndex]; + CItemMap* itemMap = settingItems[ aIndex ]; RPointerArray properties; properties = itemMap->Properties(); - for ( TInt i= 0; i < properties.Count(); i++ ) + for ( TInt i = 0; i < properties.Count(); i++ ) { - if ( properties[i]->Name() == KProperNameType ) + if ( properties[ i ]->Name() == KProperNameType ) { - TPtrC type = aMenuItem.Type(); - if ( type == KMenuTypeUrl ) - { - properties[i]->SetValueL( KProperValueBookmark ); - } - else - { - properties[i]->SetValueL( KProperValueAppl ); - } + properties[ i ]->SetValueL( KProperValueAppl ); } - else if ( properties[i]->Name() == KProperNameUid ) + else if ( properties[ i ]->Name() == KProperNameUid ) { - TPtrC uid = aMenuItem.GetAttributeL( KMenuAttrUid, exists ); - if ( exists ) - { - HBufC8* uid8( NULL ); - uid8 = AiUtility::CopyToBufferL( uid8, uid ); - CleanupStack::PushL( uid8 ); - properties[i]->SetValueL( *uid8 ); - CleanupStack::PopAndDestroy( uid8 ); - } - else - { - properties[i]->SetValueL( KNullDesC8 ); - } + properties[ i ]->SetValueL( KMenuAttrUndefUid ); } - else if ( properties[i]->Name() == KProperNameView ) + else if ( properties[ i ]->Name() == KProperNameView ) { - TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists ); - if ( exists ) - { - HBufC8* view8( NULL ); - view8 = AiUtility::CopyToBufferL( view8, view ); - CleanupStack::PushL( view8 ); - properties[i]->SetValueL( *view8 ); - CleanupStack::PopAndDestroy( view8 ); - } - else - { - properties[i]->SetValueL( KNullDesC8 ); - } + properties[ i ]->SetValueL( KNullDesC8 ); } - else if ( properties[i]->Name() == KProperNameParam ) + else if ( properties[ i ]->Name() == KProperNameParam ) { - TPtrC param = aMenuItem.GetAttributeL( KMenuAttrParam, exists ); - if ( exists ) - { - HBufC8* param8( NULL ); - param8 = AiUtility::CopyToBufferL( param8, param ); - CleanupStack::PushL( param8 ); - properties[i]->SetValueL( *param8 ); - CleanupStack::PopAndDestroy( param8 ); - } - else - { - properties[i]->SetValueL( KNullDesC8 ); - } + properties[ i ]->SetValueL( KNullDesC8 ); + } + else if ( properties[ i ]->Name() == KProperNameLocked ) + { + properties[i]->SetValueL( KNullDesC8 ); } } } - // ETrue tells that changes are stored also to plugin reference + // ETrue tells that modified settings are stored also to plugin reference iPluginSettings->SetSettingsL( iInstanceUid, settingItems, ETrue ); - CleanupStack::PopAndDestroy( &settingItems ); + CleanupStack::PopAndDestroy(); // settingItems } +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,87 +15,160 @@ * */ - -// INCLUDE FILES -#include "mcspluginengine.h" - +// System includes #include -#include #include -#include - -#include #include #include #include -#include -#include - #include #include #include -#include #include +#include +#include +#include +#include +#include +#include // For CVwsSessionWrapper +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif +#include + +// User includes +#include "mcspluginengine.h" #include "mcsplugin.h" #include "mcsplugindata.h" #include "mcspluginuids.hrh" -#include -#include -#include -#include // For Transition effect -#include - -#include +// Constants _LIT( KMyMenuData, "matrixmenudata" ); _LIT( KSkin, "skin" ); _LIT( KMif, "mif" ); _LIT( KResourceDrive, "Z:" ); _LIT( KResourceFile, "mcspluginres.rsc" ); _LIT( KResPath, "\\resource\\" ); -_LIT( KMenuAttrRefcount, "ref_count" ); _LIT( KMMApplication, "mm://" ); _LIT( KHideExit2, "&exit=hide" ); _LIT( KSetFocusString, "!setfocus?applicationgroup_name=" ); _LIT( KApplicationGroupName, "applicationgroup_name" ); _LIT( KIcon, "icon" ); _LIT( KMenuAttrUndefUid, "0x99999991" ); +_LIT( KMenuIconFile, "aimcsplugin.mif" ); +_LIT( KMenuBookmarkIconId, "16386" ); +_LIT( KMenuBookmarkMaskId, "16387" ); +_LIT( KMenuMailboxIconId, "16388" ); +_LIT( KMenuMailboxMaskId, "16389" ); +_LIT( KMenuTypeMailbox, "menu:mailbox" ); +_LIT( KPrefix, "0x" ); const TUid KHomescreenUid = { AI_UID3_AIFW_COMMON }; const TUid KMMUid = { 0x101F4CD2 }; +const TUid KMCSCmailUidValue = { 0x2001E277 }; +const TUid KMCSCmailMailboxViewIdValue = { 0x2 }; +const TUid KBrowserUid = { 0x10008D39 }; // ======== LOCAL FUNCTIONS ======== - +// ---------------------------------------------------------------------------- +// NextIdToken +// ---------------------------------------------------------------------------- +// static TPtrC NextIdToken( TLex& aLexer ) { aLexer.SkipSpace(); aLexer.Mark(); + while( !aLexer.Eos() && !aLexer.Peek().IsSpace() && aLexer.Peek() != ')' ) { aLexer.Inc(); } + return aLexer.MarkedToken(); } +// ---------------------------------------------------------------------------- +// Shows note dailog, with the given resource. +// ---------------------------------------------------------------------------- +// +static void ShowNoteDlgL( TInt aResource ) + { + HBufC* temp = StringLoader::LoadLC( aResource ); + + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ENoTimeout ); + CleanupStack::PushL( dialog ); + dialog->SetTextL( temp->Des() ); + dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG ); + CleanupStack::Pop( dialog ); + CleanupStack::PopAndDestroy( temp ); + } + +// ---------------------------------------------------------------------------- +// Parses uid in Hexadecimal format from the given string. +// ---------------------------------------------------------------------------- +// +TUid ParseHexUidFromString(const TDesC& aUidString ) + { + TUid uid( KNullUid ); + const TInt pos( aUidString.FindF( KPrefix ) ); + + if ( pos != KErrNotFound ) + { + TLex lex( aUidString.Mid( pos + KPrefix().Length() ) ); + + // Hex parsing needs unsigned int + TUint32 value( 0 ); + const TInt parseResult( lex.Val( value, EHex ) ); + + if ( parseResult == KErrNone ) + { + TInt32 value32( value ); + uid.iUid = value32; + } + } + return uid; + } + +// ---------------------------------------------------------------------------- +// Start transition effect. User has launched the application with the given uid. +// ---------------------------------------------------------------------------- +// +void StartEffect( TUid aUid ) + { + //start a full screen effect + GfxTransEffect::BeginFullScreen( + AknTransEffect::EApplicationStart, + TRect(), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( aUid, + AknTransEffect::TParameter::EActivateExplicitContinue )); + } + // ============================ MEMBER FUNCTIONS =============================== -// --------------------------------------------------------- -// Default constructor -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPluginEngine::CMCSPluginEngine // -CMCSPluginEngine::CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ) - : iPlugin( aPlugin ), iInstanceUid( aInstanceUid ), - iSuspend( EFalse ) +// ---------------------------------------------------------------------------- +// +CMCSPluginEngine::CMCSPluginEngine( CMCSPlugin& aPlugin, + const TDesC8& aInstanceUid ) + : iPlugin( aPlugin ), iInstanceUid( aInstanceUid ) { } -// --------------------------------------------------------- -// Two-phased constructor. -// Create instance of concrete ECOM interface implementation -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPluginEngine::NewL +// +// ---------------------------------------------------------------------------- // -CMCSPluginEngine* CMCSPluginEngine::NewL( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ) +CMCSPluginEngine* CMCSPluginEngine::NewL( CMCSPlugin& aPlugin, + const TDesC8& aInstanceUid ) { - CMCSPluginEngine* self = new( ELeave ) CMCSPluginEngine( aPlugin, aInstanceUid ); + CMCSPluginEngine* self = + new( ELeave ) CMCSPluginEngine( aPlugin, aInstanceUid ); + CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -103,9 +176,10 @@ return self; } -// --------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPluginEngine::ConstructL +// +// ---------------------------------------------------------------------------- // void CMCSPluginEngine::ConstructL() { @@ -119,29 +193,38 @@ CCoeEnv::Static()->AddResourceFileL( resourceFile ); InitL(); StartObservingL(); + + // Get "Undefined" item + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); + iUndefinedItemHeader = FindMenuItemL( *filter ); + CleanupStack::PopAndDestroy( filter ); + iUndefinedItem = CMenuItem::OpenL( iMenu, iUndefinedItemHeader ); } - -// --------------------------------------------------------- -// Destructor. -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CMCSPluginEngine::~CMCSPluginEngine +// +// ---------------------------------------------------------------------------- // CMCSPluginEngine::~CMCSPluginEngine() { StopObserving(); - + delete iPluginData; - iNotifier.Close(); + iMenu.Close(); - //iWatcher->Cancel(); delete iWatcher; - delete iNotifyWatcher; + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); + + delete iUndefinedItem; } - // --------------------------------------------------------------------------- -// +// CMCSPluginEngine::InitL +// // --------------------------------------------------------------------------- // void CMCSPluginEngine::InitL() @@ -149,69 +232,55 @@ iMenu.OpenL( KMyMenuData ); iPluginData = CMCSPluginData::NewL( *this, iInstanceUid ); iWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); - TInt err = iNotifier.Open( iMenu ); + + TInt err( iNotifier.Open( iMenu ) ); + if ( err == KErrNone ) { iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); + iNotifier.Notify( 0, - RMenuNotifier::EItemsAddedRemoved | - RMenuNotifier::EItemsReordered | - RMenuNotifier::EItemAttributeChanged, + RMenuNotifier::EItemsAddedRemoved, iNotifyWatcher->iStatus ); iNotifyWatcher->WatchNotify( this ); } } // --------------------------------------------------------------------------- -// Tells the settings container to start observing for changes +// CMCSPluginEngine::StartObservingL +// // --------------------------------------------------------------------------- // void CMCSPluginEngine::StartObservingL() { - // registering to bookmarks db. changes observing - User::LeaveIfError( iBookmarkSession.Connect() ); - User::LeaveIfError( iBookmarkDb.Open( iBookmarkSession, KBrowserBookmarks ) ); - - iBookmarkDbObserver = new (ELeave) CActiveFavouritesDbNotifier( - iBookmarkDb, *this ); - iBookmarkDbObserver->Start(); - // registering to mailbox db. changes observing - iMsvSession = CMsvSession::OpenAsObserverL( *this) ; + iMsvSession = CMsvSession::OpenAsObserverL( *this ); } // --------------------------------------------------------------------------- -// Tells the settings container to stop observing for changes +// CMCSPluginEngine::StopObserving +// // --------------------------------------------------------------------------- // void CMCSPluginEngine::StopObserving() - { - if ( iBookmarkDbObserver ) - { - delete iBookmarkDbObserver; - iBookmarkDbObserver = NULL; - } - iBookmarkDb.Close(); - iBookmarkSession.Close(); - - if ( iMsvSession ) - { - delete iMsvSession; - iMsvSession = NULL; - } + { + delete iMsvSession; + iMsvSession = NULL; } // --------------------------------------------------------------------------- -// +// CMCSPluginEngine::MenuDataL +// // --------------------------------------------------------------------------- // -TMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex ) +CMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex ) { return iPluginData->DataItemL( aIndex ); } // --------------------------------------------------------------------------- -// +// CMCSPluginEngine::MenuItemCount +// // --------------------------------------------------------------------------- // TInt CMCSPluginEngine::MenuItemCount() @@ -220,364 +289,455 @@ } // --------------------------------------------------------------------------- +// CMCSPluginEngine::FindMenuItemL // Returns the menu item header, which matches the given filter. // --------------------------------------------------------------------------- // TMenuItem CMCSPluginEngine::FindMenuItemL( CMenuFilter& aFilter ) { TMenuItem item; - const TInt root = iMenu.RootFolderL(); + const TInt root( iMenu.RootFolderL() ); + RArray items; CleanupClosePushL( items ); + iMenu.GetItemsL( items, root, &aFilter, ETrue ); - if( items.Count() > 0 ) + + if ( items.Count() > 0 ) { - item = items[0]; } CleanupStack::PopAndDestroy( &items ); + return item; } // --------------------------------------------------------------------------- +// CMCSPluginEngine::FetchMenuItemL // Returns the actual menu item for the given header. // --------------------------------------------------------------------------- // -CMenuItem* CMCSPluginEngine::FetchMenuItemL( const TMenuItem& aMenuItem ) +CMenuItem* CMCSPluginEngine::FetchMenuItemL( CMCSData& aData ) { - return CMenuItem::OpenL( iMenu, aMenuItem ); + if( aData.MenuItem().Type() == KMenuTypeUrl ) + { + return CreateBkmItemL( aData ); + } + else if( aData.MenuItem().Type() == KMenuTypeMailbox ) + { + return CreateMailboxItemL( aData); + } + else + { + CMenuItem* item = NULL; + TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); + return item; + } } // --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMenuItem* CMCSPluginEngine::CreateBkmItemL( CMCSData& aData ) + { + CMenuItem* item( NULL ); + if( aData.MenuItem().Id() != KErrNotFound ) + { + item = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 ); + CleanupStack::PushL( item ); + item->SetAttributeL( KMenuAttrLongName, aData.Name() ); + item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); + item->SetAttributeL( KMenuAttrIconId, KMenuBookmarkIconId ); + item->SetAttributeL( KMenuAttrMaskId, KMenuBookmarkMaskId ); + CleanupStack::Pop( item ); + } + return item; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMenuItem* CMCSPluginEngine::CreateMailboxItemL( CMCSData& aData ) + { + CMenuItem* item( NULL ); + if( aData.MenuItem().Id() != KErrNotFound ) + { + item = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 ); + CleanupStack::PushL( item ); + item->SetAttributeL( KMenuAttrLongName, aData.Name() ); + item->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); + item->SetAttributeL( KMenuAttrIconId, KMenuMailboxIconId ); + item->SetAttributeL( KMenuAttrMaskId, KMenuMailboxMaskId ); + CleanupStack::Pop( item ); + } + return item; + } + +// --------------------------------------------------------------------------- +// CMCSPluginEngine::ItemIconL // Returns MCS default icon if attribute is 'icon' else parses the // skin definition from attribute and sets attributes to aMenuItem. // --------------------------------------------------------------------------- // -CGulIcon* CMCSPluginEngine::ItemIconL( CMenuItem& aMenuItem, const TDesC& aAttr ) +CGulIcon* CMCSPluginEngine::ItemIconL( CMenuItem* aMenuItem, + const TDesC& aAttr ) { + + CMenuItem* menuItem; + + // check if item exists in MCS + if ( aMenuItem ) + { + TUint32 flags = aMenuItem->Flags(); + TUint32 isHidden = flags & TMenuItem::EHidden; + TUint32 isMissing = flags & TMenuItem::EMissing; + + if ( iUndefinedItem && ( isHidden || isMissing ) ) + { + menuItem = iUndefinedItem; + } + else + { + menuItem = aMenuItem; + } + } + else + { + // item not found in MCS. Use Undefined Icon + menuItem = iUndefinedItem; + } + CAknIcon* icon( NULL ); CGulIcon* gIcon( NULL ); TBool exists( ETrue ); - if( aAttr != KIcon ) + + if ( aAttr != KIcon ) { // Resolve secondary icon definition from attribute - TPtrC iconDef = aMenuItem.GetAttributeL( aAttr, exists ); - if( exists ) + TPtrC iconDef( menuItem->GetAttributeL( aAttr, exists ) ); + + if ( exists ) { - exists = ConstructMenuItemForIconL( iconDef, aMenuItem ); + exists = ConstructMenuItemForIconL( iconDef, *menuItem ); } } - if( exists ) + + if ( exists ) { - icon = MenuIconUtility::GetItemIconL( aMenuItem ); - if( icon ) + icon = MenuIconUtility::GetItemIconL( *menuItem ); + + if ( icon ) { CleanupStack::PushL( icon ); - gIcon = CGulIcon::NewL(icon->Bitmap(), icon->Mask()); + + gIcon = CGulIcon::NewL( icon->Bitmap(), icon->Mask() ); + // Detach and delete icon->SetBitmap( NULL ); icon->SetMask( NULL ); + CleanupStack::PopAndDestroy( icon ); } } + return gIcon; } // --------------------------------------------------------------------------- +// CMCSPluginEngine::ItemTextL // Returns text string for the given attribute // --------------------------------------------------------------------------- // -TPtrC CMCSPluginEngine::ItemTextL( CMenuItem& aMenuItem, const TDesC& aAttr ) - { +TPtrC CMCSPluginEngine::ItemTextL( CMenuItem* aMenuItem, const TDesC& aAttr ) + { + + CMenuItem* menuItem; + + // check if item exists in MCS + if ( aMenuItem ) + { + TUint32 flags = aMenuItem->Flags(); + TUint32 isHidden = flags & TMenuItem::EHidden; + TUint32 isMissing = flags & TMenuItem::EMissing; + + // if item is hidden or missing (mmc card removed) + // use "Undefined" text instead + if ( iUndefinedItem && ( isHidden || isMissing ) ) + { + menuItem = iUndefinedItem; + } + else + { + menuItem = aMenuItem; + } + } + else + { + // item not found in MCS. Use "Undefined" text + menuItem = iUndefinedItem; + } + TBool exists( KErrNotFound ); - TPtrC name = aMenuItem.GetAttributeL( aAttr, exists ); - if( exists ) + + TPtrC name( menuItem->GetAttributeL( aAttr, exists ) ); + + if ( exists ) { return name; } - else - { - return KNullDesC(); - } + + return KNullDesC(); } // --------------------------------------------------------------------------- +// CMCSPluginEngine::LaunchItemL // Calls the open command for the given menu item header // --------------------------------------------------------------------------- // void CMCSPluginEngine::LaunchItemL( const TInt& aIndex ) { - - if ( iSuspend ) + if ( iBackupRestore ) { - HBufC* temp = StringLoader::LoadLC( R_MCS_DISABLE_OPEN_ITEM ); - - CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( - CAknNoteDialog::EConfirmationTone, - CAknNoteDialog::ENoTimeout ); - dialog->SetTextL( temp->Des() ); - dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG ); - CleanupStack::PopAndDestroy( temp ); - return; - } - if( iWatcher->IsActive()) - { + ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM ); return; } - - TMCSData& dataItem = iPluginData->DataItemL( aIndex ); - CMenuItem* item = CMenuItem::OpenL( iMenu, dataItem.MenuItem()); - CleanupStack::PushL( item ); - TPtrC type = item->Type(); + CMCSData& dataItem( iPluginData->DataItemL( aIndex ) ); + // run item based on its type + TPtrC type( dataItem.MenuItem().Type()); // run folder if ( type == KMenuTypeFolder ) { - - // message for MM application - HBufC8* message; - - // prepare message for launching folder - TBool hasApplicationGroupName = EFalse; - TPtrC applicationGroupName = item->GetAttributeL( KApplicationGroupName, - hasApplicationGroupName ); - if ( !hasApplicationGroupName ) - { - CleanupStack::PopAndDestroy( item ); - return; - } - message = HBufC8::NewLC( KMMApplication().Length() + - KSetFocusString().Length() + - applicationGroupName.Length() + - KHideExit2().Length() ); - - message->Des().Copy( KMMApplication ); - message->Des().Append( KSetFocusString ); - message->Des().Append( applicationGroupName ); - message->Des().Append( KHideExit2 ); - - // find MM application - TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); - TApaTask task = taskList.FindApp( KMMUid ); - - if ( task.Exists() ) - { - // MM is already running in background - send APA Message - task.SendMessage( TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message ); - } - else - { - // MM not running yet - use Command Line Tail - RApaLsSession appArcSession; - CleanupClosePushL( appArcSession ); - User::LeaveIfError( appArcSession.Connect() ); - TApaAppInfo appInfo; - TInt err = appArcSession.GetAppInfo( appInfo, KMMUid ); - if ( err == KErrNone ) - { - CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); - cmdLine->SetExecutableNameL( appInfo.iFullName ); - cmdLine->SetCommandL( EApaCommandRun ); - cmdLine->SetTailEndL( *message ); - appArcSession.StartApp( *cmdLine ); - CleanupStack::PopAndDestroy( cmdLine ); - } - CleanupStack::PopAndDestroy( &appArcSession ); - } - CleanupStack::PopAndDestroy( message ); + LaunchFolderItemL( dataItem ); + } + else if( type == KMenuTypeUrl ) + { + LaunchBookmarkItemL( dataItem ); + } + else if( type == KMenuTypeMailbox ) + { + LaunchMailboxItemL( dataItem ); } else { - TBool exists( EFalse ); - TPtrC desc( item->GetAttributeL( KMenuAttrUid, exists ) ); + LaunchMCSItemL( dataItem ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::LaunchFolderItemL( CMCSData& aData ) + { + CMenuItem* item = NULL; + TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); + + // item does not exist at all in MCS + if ( item == NULL ) + { + ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); + return; + } + + CleanupStack::PushL( item ); + + StartEffect( KMMUid ); + + // message for MM application + HBufC8* message; + + // prepare message for launching folder + TBool hasApplicationGroupName( EFalse ); + + TPtrC applicationGroupName( item->GetAttributeL( + KApplicationGroupName, hasApplicationGroupName ) ); + + if ( !hasApplicationGroupName ) + { + return; + } + + message = HBufC8::NewLC( KMMApplication().Length() + + KSetFocusString().Length() + + applicationGroupName.Length() + + KHideExit2().Length() ); + + message->Des().Copy( KMMApplication ); + message->Des().Append( KSetFocusString ); + message->Des().Append( applicationGroupName ); + message->Des().Append( KHideExit2 ); + + // find MM application + TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); + TApaTask task( taskList.FindApp( KMMUid ) ); + + if ( task.Exists() ) + { + // MM is already running in background - send APA Message + task.SendMessage( + TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message ); + } + else + { + // MM not running yet - use Command Line Tail + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); - if( exists ) - { - _LIT( KPrefix, "0x" ); - const TInt pos( desc.FindF( KPrefix ) ); - - if( pos != KErrNotFound ) - { - TLex lex( desc.Mid( pos + KPrefix().Length() ) ); - // Hex parsing needs unsigned int - TUint32 value = 0; - const TInt parseResult = lex.Val( value, EHex ); - - if ( parseResult == KErrNone ) - { - TUid uid( KNullUid ); - TInt32 value32( value ); - uid.iUid = value32; - - if( uid != KNullUid ) - { - //start a full screen effect - GfxTransEffect::BeginFullScreen( - AknTransEffect::EApplicationStart, - TRect(0,0,0,0), - AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( uid, - AknTransEffect::TParameter::EActivateExplicitContinue )); - } - } - } + User::LeaveIfError( appArcSession.Connect() ); + + TApaAppInfo appInfo; + TInt err( appArcSession.GetAppInfo( appInfo, KMMUid ) ); + + if ( err == KErrNone ) + { + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + cmdLine->SetTailEndL( *message ); + appArcSession.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy( cmdLine ); } - - // run application/shortcut/bookmark - CMenuOperation* operation = item->HandleCommandL( - KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ); - iWatcher->Watch( operation ); + CleanupStack::PopAndDestroy( &appArcSession ); } + CleanupStack::PopAndDestroy( message ); CleanupStack::PopAndDestroy( item ); } // --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::LaunchBookmarkItemL( CMCSData& aData ) + { + StartEffect( KBrowserUid ); + + CSchemeHandler* urlHandler = CSchemeHandler::NewL( aData.Value()); + CleanupStack::PushL( urlHandler ); + urlHandler->HandleUrlStandaloneL(); + CleanupStack::PopAndDestroy( urlHandler ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::LaunchMailboxItemL( CMCSData& aData ) + { + TInt id( aData.MenuItem().Id()); + if ( id == KErrNotFound ) + { + ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); + return; + } + + StartEffect( KMCSCmailUidValue ); + + TUid uId = TUid::Uid( id ); + const TVwsViewId viewId( KMCSCmailUidValue, KMCSCmailMailboxViewIdValue ); + CVwsSessionWrapper* vwsSession = CVwsSessionWrapper::NewL(); + vwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() ); + delete vwsSession; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::LaunchMCSItemL( CMCSData& aData ) + { + if( iWatcher->IsActive()) + { + return; + } + CMenuItem* item = NULL; + TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); + + // item does not exist at all in MCS + if ( item == NULL ) + { + ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); + return; + } + + CleanupStack::PushL( item ); + + TBool attrExists = ETrue; + TPtrC uid = item->GetAttributeL( KMenuAttrUid, attrExists ); + + // trying to run hidden or missing application (e.g. unistalled app + // or app on MMC which was removed ) + // -> We display a note for a user that this is not possible¨ + TUint32 isHidden = item->Flags() & TMenuItem::EHidden; + TUint32 isMissing = item->Flags() & TMenuItem::EMissing; + + if ( ( attrExists && uid == KMenuAttrUndefUid ) || isHidden || isMissing ) + { + CleanupStack::PopAndDestroy( item ); + ShowNoteDlgL( R_MCS_DISABLE_OPEN_ITEM_MISSING ); + return; + } + + if ( attrExists ) + { + StartEffect( ParseHexUidFromString( uid )); + } + + // run application/shortcut + CMenuOperation* operation( item->HandleCommandL( + KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ) ); + iWatcher->Watch( operation ); + CleanupStack::PopAndDestroy( item ); + } + +// --------------------------------------------------------------------------- +// CMCSPluginEngine::HandleNotifyL // Handle the change in Menu Content // --------------------------------------------------------------------------- // void CMCSPluginEngine::HandleNotifyL() { - TInt count( iPluginData->DataCount()); - for( TInt i = 0; i < count; i++ ) + TInt count( iPluginData->DataCount() ); + + for ( TInt i = 0; i < count; i++ ) { - TMCSData& data = iPluginData->DataItemL(i); - // Check that all the data still exist is MCS, if flag is hidden or - // missing, we have to remove data from UI - CMenuItem* menuItem = CMenuItem::OpenL( iMenu, data.MenuItem().Id() ); - CleanupStack::PushL( menuItem ); - if ( !menuItem || - ( menuItem->Flags() & TMenuItem::EHidden ) || - ( menuItem->Flags() & TMenuItem::EMissing ) ) - { - // Get the replacement for hidden data - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - // 'Undefined' item - filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); - TMenuItem undefItem = FindMenuItemL( *filter ); - iPluginData->ReplaceMenuItemL( i, undefItem ); - iPluginData->SaveSettingsL( i, *FetchMenuItemL(undefItem) ); - CleanupStack::PopAndDestroy( filter ); - } - CleanupStack::PopAndDestroy( menuItem ); - menuItem = NULL; + CMCSData& data( iPluginData->DataItemL( i ) ); + data.SetDirty( ETrue ); } + + iPlugin.PublishL(); + // Notification must be activated again iNotifyWatcher->Cancel(); iNotifier.Notify( 0, - RMenuNotifier::EItemsAddedRemoved | - RMenuNotifier::EItemsReordered | - RMenuNotifier::EItemAttributeChanged, - iNotifyWatcher->iStatus ); + RMenuNotifier::EItemsAddedRemoved, + iNotifyWatcher->iStatus ); iNotifyWatcher->WatchNotify( this ); - // Publish changed data - iPlugin.PublishL(); } // --------------------------------------------------------------------------- -// From class MMsvSessionObserver. +// CMCSPluginEngine::HandleSessionEventL // Handles an event from the message server. // --------------------------------------------------------------------------- // -void CMCSPluginEngine::HandleSessionEventL( - TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) - { - switch ( aEvent ) - { - case EMsvEntriesDeleted: - // fall-through intended here - case EMsvEntriesChanged: - { - - } - break; - default: - break; - } - } - -// ----------------------------------------------------------------------------- -// From class MFavouritesDbObserver. -// Handles database event. -// ----------------------------------------------------------------------------- -// -void CMCSPluginEngine::HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent ) +void CMCSPluginEngine::HandleSessionEventL( TMsvSessionEvent aEvent, + TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/) { switch ( aEvent ) { - case RDbNotifier::ERollback: - // fall-through intended here - case RDbNotifier::ERecover: - // fall-through intended here - case RDbNotifier::ECommit: + case EMsvEntriesDeleted: { - // Get list of favourites bookmarks - CFavouritesItemList* favItems = - new (ELeave) CFavouritesItemList(); - CleanupStack::PushL( favItems ); - TInt err = iBookmarkDb.GetAll( *favItems, KFavouritesNullUid, - CFavouritesItem::EItem ); - if ( err != KErrNone ) - { - ASSERT(0); - } - TInt count_fav = favItems->Count(); - - // Do for each plugin data (4x times) - TInt count_data( iPluginData->DataCount() ); - for ( TInt item_index = 0; item_index < count_data; item_index++ ) + CMsvEntrySelection* sel = static_cast( aArg1 ); + TInt count( sel->Count()); + for( TInt i = 0; i < count; i++ ) { - // Get item ID and open its menu related item - TMCSData& data = iPluginData->DataItemL( item_index ); - TInt itemID( data.MenuItem().Id() ); - CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemID ); - CleanupStack::PushL( menuItem ); - - // Get URL aatribute - TBool attrExists = EFalse; - TPtrC url = menuItem->GetAttributeL( _L("url"), attrExists ); - // If bookmark... - if ( attrExists ) - { - // Get bookmark UID - TPtrC uid_item_ptr = menuItem->GetAttributeL( - KMenuAttrUid, attrExists ); - - // Compare with each item in fav. bookmarks list - TBool itemExists = EFalse; - for ( TInt fav_index = count_fav - 1; fav_index >= 0; fav_index-- ) // newest on top - { - // Get list item UID - TUid uid_fav = TUid::Uid( favItems->At( fav_index )->Uid() ); - if ( uid_fav.Name() == uid_item_ptr ) - { - // Bookmark still exist in fav. bookmarks list - itemExists = ETrue; - break; - } - } - - if ( !itemExists ) - { - // If item not axist any more, replace it by undefined icon - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - // 'Undefined' item - filter->HaveAttributeL( KMenuAttrUid, - KMenuAttrUndefUid ); - TMenuItem undefItem = FindMenuItemL( *filter ); - iPluginData->ReplaceMenuItemL( item_index, undefItem ); - iPluginData->SaveSettingsL( item_index, *FetchMenuItemL( - undefItem ) ); - CleanupStack::PopAndDestroy( filter ); - } - } - CleanupStack::PopAndDestroy( menuItem ); + iPluginData->RemoveDataL( sel->At( i ) ); } - CleanupStack::PopAndDestroy( favItems ); } break; default: @@ -586,180 +746,88 @@ } // --------------------------------------------------------------------------- -// Resumes the engine +// CMCSPluginEngine::SetBackupRestore +// // --------------------------------------------------------------------------- // -void CMCSPluginEngine::ResumeL() +void CMCSPluginEngine::SetBackupRestore( TBool aBackupRestore ) { - iSuspend = EFalse; + iBackupRestore = aBackupRestore; } // --------------------------------------------------------------------------- -// Suspends the engine -// --------------------------------------------------------------------------- -// -void CMCSPluginEngine::Suspend() - { - iSuspend = ETrue; - } - -// --------------------------------------------------------------------------- +// CMCSPluginEngine::ShowSettingsL // Launch General Settings plugin // --------------------------------------------------------------------------- // void CMCSPluginEngine::ShowSettingsL() { TUid uid = {AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN}; - CGSLauncher* l = CGSLauncher::NewLC(); - l->LaunchGSViewL ( uid, - KHomescreenUid, - iInstanceUid ); - CleanupStack::PopAndDestroy( l ); + + CGSLauncher* launcher = CGSLauncher::NewLC(); + launcher->LaunchGSViewL ( uid, KHomescreenUid, iInstanceUid ); + CleanupStack::PopAndDestroy( launcher ); + } - } // --------------------------------------------------------------------------- -// ResolveSkinItemId +// CMCSPluginEngine::ConstructMenuItemForIconL // Syntax: skin(major minor):mif(filename bimapId maskId) // --------------------------------------------------------------------------- // -TBool CMCSPluginEngine::ConstructMenuItemForIconL( const TDesC& aPath, CMenuItem& aMenuItem ) +TBool CMCSPluginEngine::ConstructMenuItemForIconL( const TDesC& aPath, + CMenuItem& aMenuItem ) { - TInt pos = aPath.Locate( ':' ); - if( pos == KErrNotFound ) + TInt pos( aPath.Locate( ':' ) ); + if ( pos == KErrNotFound ) { pos = aPath.Length(); } - TPtrC skin = aPath.Left( pos ); - TInt sf = skin.FindF( KSkin ); - if( sf == KErrNotFound ) + TPtrC skin( aPath.Left( pos ) ); + TInt sf( skin.FindF( KSkin ) ); + + if ( sf == KErrNotFound ) { return EFalse; } - TPtrC temp = skin.Mid( sf + KSkin().Length()); - TLex input( temp ); + + TPtrC temp( skin.Mid( sf + KSkin().Length() ) ); + TLex input( temp ); input.SkipSpace(); - if( !input.Eos() && input.Peek() == '(') + + if ( !input.Eos() && input.Peek() == '(' ) { input.Inc(); } - TPtrC majorId = NextIdToken( input ); - TPtrC minorId = NextIdToken( input ); + TPtrC majorId( NextIdToken( input ) ); + TPtrC minorId( NextIdToken( input ) ); + aMenuItem.SetAttributeL( KMenuAttrIconSkinMajorId, majorId ); aMenuItem.SetAttributeL( KMenuAttrIconSkinMinorId, minorId ); - - //TPtrC mif = aPath.Mid( pos + 1 ); - //TInt mf = mif.FindF( KMif ); - if( aPath.Length() > pos && (aPath.Mid( pos + 1 ).FindF( KMif ) != KErrNotFound )) + + if ( aPath.Length() > pos && + ( aPath.Mid( pos + 1 ).FindF( KMif ) != KErrNotFound ) ) { - TPtrC mif = aPath.Mid( pos + 1 ); - TInt mf = mif.FindF( KMif ); - //TPtrC temp1 = mif.Mid( mf+ KMif().Length()); - TLex input1( mif.Mid( mf+ KMif().Length()) ); + TPtrC mif( aPath.Mid( pos + 1 ) ); + TInt mf( mif.FindF( KMif ) ); + + TLex input1( mif.Mid( mf + KMif().Length() ) ); input1.SkipSpace(); - if( !input1.Eos() && input1.Peek() == '(') + + if ( !input1.Eos() && input1.Peek() == '(' ) { input1.Inc(); } - TPtrC file = NextIdToken( input1 ); - TPtrC bitmapId = NextIdToken( input1 ); - TPtrC maskId = NextIdToken( input1 ); + + TPtrC file( NextIdToken( input1 ) ); + TPtrC bitmapId( NextIdToken( input1 ) ); + TPtrC maskId( NextIdToken( input1 ) ); + aMenuItem.SetAttributeL( KMenuAttrIconFile, file ); aMenuItem.SetAttributeL( KMenuAttrIconId, bitmapId ); aMenuItem.SetAttributeL( KMenuAttrMaskId, maskId ); } + return ETrue; } -// --------------------------------------------------------------------------- -// Called during plugin desctruction -// Decrements reference counters of all run-time generated items -// and deletes those which have reference counter == 0 -// --------------------------------------------------------------------------- -// -void CMCSPluginEngine::CleanMCSItemsL() - { - const TInt count( iPluginData->DataCount() ); - for( TInt i = 0; i < count; i++ ) - { - TMCSData& data = iPluginData->DataItemL(i); - - CMenuItem* menuItem = CMenuItem::OpenL( iMenu, data.MenuItem().Id() ); - if( !menuItem ) - { - continue; - } - CleanupStack::PushL( menuItem ); - - // check if ref_count attribute exists - TBool exists = EFalse; - TPtrC param = menuItem->GetAttributeL( KMenuAttrRefcount, exists ); - if( exists ) - { - const TInt references = UpdateMenuItemsRefCountL( menuItem, -1 ); - - // Create a nested loop inside CActiveScheduler. - CActiveSchedulerWait* wait = new (ELeave) CActiveSchedulerWait; - CleanupStack::PushL( wait ); - - if( references > 0 ) - { - // if counter is still > 0, update its value in MCS - CMenuOperation* op = menuItem->SaveL( iWatcher->iStatus ); - iWatcher->StopAndWatch( op, wait ); - - // Start the nested scheduler loop. - wait->Start(); - } - else - { - // counter reached 0 -> item is not referenced by any shortcut - // so remove it from MCS - if( !iWatcher->IsActive() ) - { - CMenuOperation* op = iMenu.RemoveL( menuItem->Id(), iWatcher->iStatus ); - iWatcher->StopAndWatch( op, wait ); - - // Start the nested scheduler loop. - wait->Start(); - } - } - - CleanupStack::PopAndDestroy( wait ); - wait = NULL; - } - - CleanupStack::PopAndDestroy( menuItem ); - menuItem = NULL; - } - } - - -// --------------------------------------------------------------------------- -// Helper method. Adds a given constant to a value of reference counter -// --------------------------------------------------------------------------- -// -TInt CMCSPluginEngine::UpdateMenuItemsRefCountL( CMenuItem* aItem, - const TInt aValueToAdd ) - { - TBool exists = EFalse; - CleanupStack::PushL( aItem ); - TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); - CleanupStack::Pop( aItem ); - if ( exists ) - { - TInt references; - TLex16 lextmp( param ); - lextmp.Val( references ); - references += aValueToAdd; - TBuf<128> buf; - buf.NumUC( references ); - - // set new ref_count - CleanupStack::PushL( aItem ); - aItem->SetAttributeL( KMenuAttrRefcount, buf); - CleanupStack::Pop( aItem ); - // return new ref_count - return references; - } - return -1; - } +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -122,15 +122,6 @@ */ CMCSPluginSettingsContainer* Container(); - /** - * Check if view is activate - * @since S60 5.1 - * @return ETrue if activated, EFalse otherwise - */ - TBool Activated() const; - -protected: - private: // From MEikMenuObserver /** @@ -168,15 +159,6 @@ */ void HandleListBoxSelectionL(); - /** - * DoHandleListBoxSelectionL - * - * @param aAny - * @return TInt - */ - static TInt DoHandleListBoxSelectionL( TAny* aAny ); - - private: // data /** diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,55 +21,12 @@ #include #include // For MDesCArray -#include // For RApaLsSession #include // For MMsvSessionObserver -#include // For MApaAppListServObserver #include // For MenuContentService #include // For HSPS settings property map -/** - * @ingroup group_mcsplugin - * - * Observer interface for application list events - * - * @since S60 v3.2 - */ -class MMCSPluginListObserver -{ -public: - - /** - * AppList event codes - */ - enum TScutListEvent - { - EAppListReady, - EAppListUpdated, - EBkmListUpdated - }; - - /** - * Callback for application list events - * - * @since S60 v3.2 - * @param aEvent AppList event code - * @param aAdded ETrue if applications were added, EFalse if removed - */ - virtual void HandleScutListEventL( - TScutListEvent aEvent, TBool aAdded ) = 0; - - // virtual TBool IsHidden(const TUid& aAppUid) const = 0; - -}; - struct TSettingItem; -/** - * Application list for settings listbox - * - * @since S60 v3.2 - */ - -class CMCSPluginWatcher; +class CMenuItem; /** * @ingroup group_mcsplugin @@ -78,7 +35,7 @@ * * @since S60 v9.1 */ -class CMCSPluginSettingsAppList : public CBase, //public CActive +class CMCSPluginSettingsAppList : public CBase, public MDesCArray, public MMsvSessionObserver { @@ -143,14 +100,14 @@ TAny* aArg3 ); /** - * Starts the asynchronous appliation list initialization + * Starts the asynchronous application list initialization * * @since S60 v3.2 */ void StartL(); /** - * FindItemL + * Finds item from item array based on property values. * * @since S60 * @param aProperties @@ -160,21 +117,18 @@ aProperties ); /** - * + * Returns menu item from list, based on given index * * @since S60 - * @param + * @param aIndex List index * @return */ - CMenuItem& ItemL(const TInt& aIndex ); + CMenuItem* ItemL(const TInt& aIndex ); + /** - * RemoveMenuItemL - * - * @param aIndex + * Returns title for undefined item */ - void RemoveMenuItemL( TInt aIndex ); - -protected: + TPtrC UndefinedText() { return *iUndefinedText; }; private: /** @@ -215,20 +169,6 @@ */ void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ); - /** - * GetID of MCS Plugin Folder - * - * @return TInt - */ - TInt GetMCSPluginFolderIdL(); - - /** - * Update menu items - * - * @return TInt - */ - TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd ); - private: // data /** @@ -242,41 +182,20 @@ * Own. */ CMsvSession* iMsvSession; - - /** - * Registered observer for application list events - */ - //MMCSPluginListObserver& iObserver; - - /** - * A flag indicating if the app list should observe changes - */ - TBool iObserving; - /** * iMenu */ RMenu iMenu; /** - * iSaveWatcher - */ - CMCSPluginWatcher* iSaveWatcher; - - /** - * iUpdateWatcher + * Name of "Undefined" application, own */ - CMCSPluginWatcher* iUpdateWatcher; - - /** - * iRemoveWatcher + HBufC* iUndefinedText; + + /* + * Undefined MCS item, own */ - CMCSPluginWatcher* iRemoveWatcher; - - /** - * iMCSPluginFolderId - */ - TInt iMCSPluginFolderId; + CMenuItem* iUndefinedItem; }; #endif // CMCSPLUGINSETTINGSAPPLIST_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,15 +21,10 @@ #include #include // For MDesCArray -#include // For MFavouritesDbObserver #include // For RFavouritesDb -#include // For CFavouritesItemList #include // For MenuContentService +#include -class CActiveFavouritesDbNotifier; -class CAiScutSettingsItem; -class CMCSPluginSettingsModel; -class CMCSPluginWatcher; struct TSettingItem; /** * @ingroup group_mcsplugin @@ -100,7 +95,7 @@ * @param aIndex Setting item to find * @return MCS menu item */ - CMenuItem& ItemL( TInt aIndex ); + CMenuItem* ItemL( TInt aIndex ); /** * Returns target bookmark data from the given index @@ -110,18 +105,10 @@ * @param aParams On return, the bookmark parameters * @param aCaption On return, the bookmark caption * @return KErrNotFound if the bookmark cannot be found, KErrNone otherwise - */ - //TInt GetDataByIndex(TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const; - + */ TSettingItem FindItemL( RPointerArray& aProperties ); - - /** - * Remove menu item - * - * @param aIndex - */ - void RemoveMenuItemL( TInt aIndex ); + protected: @@ -147,13 +134,6 @@ const TDesC& aUrl, TBookmarkType aType ); /** - * Updates the bookmark list - * - * @since S60 v3.2 - */ - void UpdateBkmListL(); - - /** * Get bookmarks from favourites */ void GetBookmarksFromFavouritesL(); @@ -185,23 +165,6 @@ CMenuItem* MCSMenuItemL( const TDesC& aUid,const TDesC& aName, const TDesC& aUrl ); - /** - * GetMCSPluginFolderIdL - * - * @return TInt - */ - TInt GetMCSPluginFolderIdL(); - - /** - * UpdateMenuItemsRefCountL - * - * @param aItem - * @param aValueToAdd - * @return TInt - */ - TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd ); - - private: /** @@ -289,9 +252,6 @@ */ void ConstructL( const TDesC& aUid, const TDesC& aCaption); - private: // data - - }; private: // data @@ -302,15 +262,13 @@ */ RPointerArray iListItems; - // Runtime created CMenuItems must be stored, because those are refered + /** + * Runtime created CMenuItems must be stored, + * because those are refered later, own. + */ RPointerArray iMenuItems; /** - * A flag indicating if the bookmark list should observe changes - */ - TBool iObserving; - - /** * Bookmark database session. * Own. */ @@ -324,30 +282,9 @@ /** * iMenu + * Own. */ RMenu iMenu; - - /** - * Save watcher - */ - - CMCSPluginWatcher* iSaveWatcher; - - /** - * Update watcher - */ - CMCSPluginWatcher* iUpdateWatcher; - - /** - * Remove watcher - */ - CMCSPluginWatcher* iRemoveWatcher; - - /** - * MCS plugin folder ID - */ - TInt iMCSPluginFolderId; - }; #endif // CMCSPLUGINSETTINGSBKMLIST_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -83,13 +83,6 @@ void HandleHelpCommandL(); /** - * Dialog showing changed - * - * @since S60 v3.2 - */ - TBool IsChangeDialogShowing(); - - /** * Close change dialog * * @since S60 v3.2 @@ -199,7 +192,7 @@ /** * Checks if there is a need to update the middle softkey label. */ - void CheckMiddleSoftkeyLabelL(); + void CheckMiddleSoftkeyLabel(); // From MFavouritesDbObserver /** diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h --- a/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,19 +22,16 @@ // External includes #include #include // For MDesCArray -#include -#include #include #include -// Internal includes -#include "mcspluginsettingsapplist.h" -#include "mcspluginsettingsbkmlist.h" - // Forward declaration class CCoeEnv; +class CMenuItem; +class CMCSPluginSettingsAppList; +class CMCSPluginSettingsBkmList; +class CMCSPluginSettings; class CMCSPluginSettingsContainer; -class CMCSPluginSettings; class HSPluginSettingsIf::CItemMap; /** @@ -43,7 +40,8 @@ enum TSettingType { EApplication, - EBookmark + EBookmark, + EMailbox }; /** @@ -66,7 +64,6 @@ */ class CMCSPluginSettingsModel : public CBase , public MDesCArray - , public HSPluginSettingsIf::MHomeScreenSettingsObserver { public: @@ -155,32 +152,24 @@ /** * Update application list */ - void UpdateAppListL(); + void UpdateAppListL( TBool aUpdateSettings = ETrue ); /** * Update bookmark list */ - void UpdateBkmListL(); + void UpdateBkmListL( TBool aUpdateSettings = ETrue ); /** * Update settings container * * @param aPluginId */ - void UpdateSettingsContainerL( const TDesC8& aPluginId ); - - // From MHomeScreenSettingsObserver + void SetPluginIdL( const TDesC8& aPluginId ); + /** - * Settings changed - * - * @param aEvent - * @param aPluginName - * @param aPluginUid - * @param aPluginId - * @return TInt + * Read settings from HSPS and update settings list */ - TInt SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, - const TDesC8& aPluginUid, const TDesC8& aPluginId ); + void UpdateSettingsL(); private: @@ -198,7 +187,7 @@ void ConstructL(); /** - * ListBoxLineL + * ListBoxLine for list * * @param aCaption * @param aIndex @@ -207,7 +196,7 @@ TPtrC ListBoxLineL( const TDesC& aCaption, TInt aIndex ) const; /** - * ItemL + * Returns setting item based on properties. * * @param aProperties * @return TSettingItem @@ -233,15 +222,10 @@ TBool SettingLockedL( RPointerArray& aProperties ); - /** - * Update settings - * - * @param aPluginId - */ - void UpdateSettingsL( const TDesC8& aPluginId ); + /** - * Save settings + * Save settings into HSPS * * @param aIndex * @param aMenuItem @@ -256,13 +240,20 @@ */ RArray iSettings; - // Homescreen settings API + /** + * Homescreen settings API. Not owned. + */ HSPluginSettingsIf::CHomescreenSettings* iPluginSettings; + /** + * HSPS settings id. + */ HBufC8* iPluginId; - // Stores the text which is drawn by listbox - // Listbox takes only reference + /** + * Stores the text which is drawn by listbox + * Listbox takes only reference, own. + */ mutable HBufC* iListBoxLine; /** diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,19 +16,13 @@ */ #include -#include #include #include -#include #include #include -#include #include #include -#include // For RProperty -#include // For KPSUidActiveIdle2 -#include #include #include @@ -156,8 +150,8 @@ case EAknSoftkeyBack: if (iAppUi->View(KGSMainViewUid)) { - // if we are in GS activate parent plugin view (standby view)... - iAppUi->ActivateLocalViewL(KGSPrslnPluginUid); + // if we are in GS activate parent plugin view (standby view)... + iAppUi->ActivateLocalViewL(KGSPrslnPluginUid); } else { @@ -181,7 +175,7 @@ // ---------------------------------------------------------------------------- // void CMCSPluginSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) -{ + { CEikButtonGroupContainer* cba = Cba(); if (cba) @@ -197,10 +191,12 @@ cba->DrawDeferred(); } - CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); - - iModel->UpdateSettingsContainerL( aCustomMessage ); -} + iModel->SetPluginIdL( aCustomMessage ); + iModel->UpdateAppListL( EFalse ); + iModel->UpdateBkmListL( EFalse ); + iModel->UpdateSettingsL(); + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + } // ---------------------------------------------------------------------------- // From CAknView @@ -208,11 +204,9 @@ // ---------------------------------------------------------------------------- // void CMCSPluginSettings::DoDeactivate() -{ + { CGSBaseView::DoDeactivate(); - - iModel->SetContainer(Container()); -} + } // ---------------------------------------------------------------------------- // From MEikMenuObserver @@ -236,7 +230,7 @@ } // --------------------------------------------------------------------------- -// From CGSPluginInterface. 256 +// From CGSPluginInterface // --------------------------------------------------------------------------- // void CMCSPluginSettings::GetCaptionL(TDes& aCaption) const @@ -295,13 +289,4 @@ Container()->HandleChangeCommandL(); } -// --------------------------------------------------------------------------- -// Returns if container exists or not -// --------------------------------------------------------------------------- -// -TBool CMCSPluginSettings::Activated() const - { - return iContainer ? ETrue : EFalse; - } - // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,34 +15,24 @@ * */ - -#include -#include // For KMsvRootIndexEntryIdValue -#include -#include #include -#include #include #include #include "mcspluginsettingsapplist.h" -#include "mcspluginsettingsmodel.h" -#include "mcspluginwatcher.h" +#include "mcspluginsettingsmodel.h" // For TSettingItem _LIT( KMyMenuData, "matrixmenudata" ); _LIT( KMenuTypeShortcut, "menu:shortcut" ); -_LIT( KMenuAttrRefcount, "ref_count" ); -_LIT( KMenuParamMailbox, "mailbox:" ); +_LIT( KMenuTypeMailbox, "menu:mailbox" ); _LIT( KMenuAttrParameter, "param" ); _LIT( KMenuAttrLocked, "locked" ); -_LIT( KMenuIconFile, "aimcsplugin.mif" ); -_LIT( KMenuIconId, "16388" ); -_LIT( KMenuMaskId, "16389" ); -_LIT( KMailboxUid, "0x100058c5" ); -_LIT( KInitialRefCount, "1" ); -_LIT( KMCSFolder, "mcsplugin_folder" ); _LIT8( KItemLocked, "locked"); _LIT8( KProperValueFolder, "folder" ); +_LIT( KMenuAttrUndefUid, "0x99999991" ); +_LIT( KMenuItemLongName, "long_name" ); + +#define KMCSCmailMtmUidValue 0x2001F406 // ======== MEMBER FUNCTIONS ======== @@ -52,7 +42,6 @@ // CMCSPluginSettingsAppList::CMCSPluginSettingsAppList() { - iMCSPluginFolderId = 0; } // --------------------------------------------------------------------------- @@ -64,9 +53,44 @@ iMsvSession = CMsvSession::OpenAsObserverL(*this); iMenu.OpenL( KMyMenuData ); - iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); - iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); - iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + + // Get "Undefined" icon and text + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + // 'Undefined' item + filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); + + TMenuItem item; + const TInt root = iMenu.RootFolderL(); + RArray items; + CleanupClosePushL( items ); + iMenu.GetItemsL( items, root, filter, ETrue ); + + if ( items.Count() > 0 ) + { + iUndefinedItem = CMenuItem::OpenL( iMenu, items[ 0 ] ); + iUndefinedText = NULL; + + if ( iUndefinedItem ) + { + TBool exists( KErrNotFound );//CleanupStack::PushL( undefinedItem ); + TPtrC undefined = iUndefinedItem->GetAttributeL( KMenuItemLongName, exists ); + + if ( exists ) + { + iUndefinedText = HBufC::NewMaxL( undefined.Length() ); + iUndefinedText->Des().Copy( undefined ); + } + else + { + iUndefinedText = KNullDesC().Alloc(); + } + } + } + + CleanupStack::PopAndDestroy( &items ); + CleanupStack::PopAndDestroy( filter ); } // --------------------------------------------------------------------------- @@ -92,10 +116,9 @@ iListItems.ResetAndDestroy(); iMenu.Close(); - delete iSaveWatcher; - delete iUpdateWatcher; - delete iRemoveWatcher; + delete iUndefinedText; + delete iUndefinedItem; } // --------------------------------------------------------------------------- @@ -115,17 +138,19 @@ // TPtrC CMCSPluginSettingsAppList::MdcaPoint( TInt aIndex ) const { - if (aIndex < 0 || aIndex >= iListItems.Count()) + if ( aIndex < 0 || aIndex >= iListItems.Count() ) { - TPtrC ret(KNullDesC); + TPtrC ret( KNullDesC ); return ret; } - CMenuItem* item = iListItems[aIndex]; + CMenuItem* item = iListItems[ aIndex ]; + TBool attrExists; - TPtrC itm; + TPtrC itm( KNullDesC ); TRAP_IGNORE( itm.Set( item->GetAttributeL( KMenuAttrLongName, attrExists ) ); ) + return itm; } @@ -171,14 +196,13 @@ { if( aProperties[j]->Name() == KType ) { - if ( aProperties[j]->Value() == KProperValueFolder ) { isFolder = ETrue; } break; } - } + } TBool itemFound( EFalse ); @@ -187,7 +211,6 @@ { TBool match( ETrue ); CMenuItem* item = iListItems[ i ]; - for ( TInt j = 0; j < aProperties.Count() && match; j++ ) { // type and locked properties skipped @@ -244,82 +267,19 @@ return settingItem; } - // --------------------------------------------------------------------------- -// Returns menuitems at given index. Since this method is called during -// adding the item to the Desktop widget, we also have to increment -// ref_count attribute if the item is run-time generated (i.e. Mailbox) +// Returns menuitems at given index. // --------------------------------------------------------------------------- // -CMenuItem& CMCSPluginSettingsAppList::ItemL( const TInt& aIndex ) +CMenuItem* CMCSPluginSettingsAppList::ItemL( const TInt& aIndex ) { - CMenuItem* menuItem( NULL ); - - // check if index in within the list boundaries + // check if index is within the list boundaries if ( aIndex >= 0 && aIndex < iListItems.Count() ) { - menuItem = iListItems[ aIndex ]; - - TBool hasParam = EFalse; - CleanupStack::PushL( menuItem ); - TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam ); - CleanupStack::Pop( menuItem ); - - // if item is a mailbox, add it to MCS - // (if it is not already there) - if ( hasParam && param.Find( KMenuParamMailbox ) != KErrNotFound ) - { - - // set up a filter for finding the mailbox - // with given ID in MCS - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - - filter->SetType( KMenuTypeShortcut ); - filter->HaveAttributeL( KMenuAttrParameter, param ); - - // search menu from the Root folder with the filter - const TInt rootId = iMenu.RootFolderL(); - RArray itemArray; - CleanupClosePushL( itemArray ); - iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); - - // save the number of findings - TInt count( itemArray.Count() ); - - // if MenuItem does not exist in MCS - if ( count == 0 ) - { - // save the item into Matrixmenudata.xml - // the "op" variable is cleaned up by iSaveWatcher when asynchronous - // operation finishes - CleanupStack::PushL( menuItem ); - CMenuOperation* op = menuItem->SaveL( iSaveWatcher->iStatus ); - CleanupStack::Pop( menuItem ); - iSaveWatcher->Watch( op ); - } - else - { - // Item already exists in MCS - // If it has reference counter, increment it before returning. - CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); - - TInt newRefCount = UpdateMenuItemsRefCountL( itm, 1 ); - if ( newRefCount > -1 ) - { - CleanupStack::PushL( itm ); - CMenuOperation* op = itm->SaveL( iSaveWatcher->iStatus ); - CleanupStack::PopAndDestroy( itm ); - iSaveWatcher->Watch( op ); - } - } - CleanupStack::PopAndDestroy( &itemArray ); - CleanupStack::PopAndDestroy( filter ); - } } - return *menuItem; + return menuItem; } // --------------------------------------------------------------------------- @@ -351,8 +311,7 @@ CMenuFilter* filter = CMenuFilter::NewL(); CleanupStack::PushL( filter ); - // skip run-time generated items - filter->DoNotHaveAttributeL( KMenuAttrRefcount ); + // skip locked items filter->DoNotHaveAttributeL( KMenuAttrLocked ); const TInt rootId = iMenu.RootFolderL(); RArray itemArray; @@ -366,15 +325,16 @@ TPtrC type = itemArray[ i ].Type(); // we add applications, shortcuts and folders to the list - if ( type == KMenuTypeApp || type == KMenuTypeShortcut || + if ( type == KMenuTypeApp || + type == KMenuTypeShortcut || type == KMenuTypeFolder ) { CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemArray[ i ] ); CleanupStack::PushL( menuItem ); // only non-hidden and non-missing items should be offered to the user - if ( ( menuItem->Flags() & TMenuItem::EHidden ) == EFalse && - ( menuItem->Flags() & TMenuItem::EMissing ) == EFalse ) + if ( ( menuItem->Flags() & TMenuItem::EHidden ) == 0 && + ( menuItem->Flags() & TMenuItem::EMissing ) == 0 ) { User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( menuItem, sortMethod ) ); CleanupStack::Pop( menuItem ); @@ -398,7 +358,7 @@ // CMsvEntry* CMCSPluginSettingsAppList::GetRootEntryL() { - return iMsvSession->GetEntryL(KMsvRootIndexEntryIdValue); + return iMsvSession->GetEntryL( KMsvRootIndexEntryIdValue ); } // --------------------------------------------------------------------------- @@ -407,20 +367,26 @@ // void CMCSPluginSettingsAppList::AddMailboxesL() { - - iListItems.ResetAndDestroy(); CMsvEntry* rootEntry = GetRootEntryL(); CleanupStack::PushL(rootEntry); TBuf<255> mailboxId; - for ( TInt i = rootEntry->Count() - 1; i >= 0; --i ) + TInt cnt = rootEntry->Count(); + if ( cnt > 0 ) { - const TMsvEntry& tentry = (*rootEntry)[i]; - - if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) + rootEntry->SetSortTypeL( TMsvSelectionOrdering( + KMsvGroupByType | KMsvGroupByStandardFolders, + EMsvSortByDetailsReverse, ETrue ) ); + + for ( TInt i = rootEntry->Count(); --i >= 0; ) { - mailboxId.Num( tentry.Id() ); - AddMailboxL( tentry.iDetails, mailboxId ); + const TMsvEntry& tentry = (*rootEntry)[i]; + + if (tentry.iMtm.iUid == KMCSCmailMtmUidValue ) + { + mailboxId.Num( tentry.Id() ); + AddMailboxL( tentry.iDetails, mailboxId ); + } } } CleanupStack::PopAndDestroy(rootEntry); @@ -433,175 +399,19 @@ void CMCSPluginSettingsAppList::AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ) { - // prepare param value - HBufC* params = HBufC::NewLC( KMenuParamMailbox().Length() + aMailboxId.Length() ); - params->Des().Copy( KMenuParamMailbox ); - params->Des().Append( aMailboxId ); - TPtrC paramValue( params->Des() ); - - TLinearOrder sortMethod( CMCSPluginSettingsAppList::CompareNameL ); - CMenuItem* newItem = CMenuItem::CreateL( iMenu, - KMenuTypeShortcut, - GetMCSPluginFolderIdL(), - 0 ); - CleanupStack::PushL( newItem ); + TLinearOrder sortMethod( CMCSPluginSettingsAppList::CompareNameL ); + CMenuItem* newItem = CMenuItem::CreateL( iMenu, KMenuTypeMailbox, 0, 0 ); + CleanupStack::PushL( newItem ); - // mailbox is a shortcut item with "mailbox:mailboxID" parameter - newItem->SetAttributeL( KMenuAttrUid, KMailboxUid ); - newItem->SetAttributeL( KMenuAttrLongName, aMailbox ); - newItem->SetAttributeL( KMenuAttrParameter, paramValue ); - newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount ); + // mailbox is a shortcut item with "mailbox:mailboxID" parameter + newItem->SetAttributeL( KMenuAttrUid, aMailboxId ); + newItem->SetAttributeL( KMenuAttrLongName, aMailbox ); + // Mailbox name is saved to settings into param field. + newItem->SetAttributeL( KMenuAttrParameter, aMailbox ); - // setting icon for the shortcut - newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); - newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId ); - newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId ); - - // append the item into iListItems lists - User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( newItem, sortMethod ) ); - CleanupStack::Pop( newItem ); - CleanupStack::PopAndDestroy( params ); + // append the item into iListItems lists + User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( newItem, sortMethod ) ); + CleanupStack::Pop( newItem ); } -// --------------------------------------------------------------------------- -// Removes run-time generated menuitem (i.e. Mailbox) from MCS -// If the item at given index is not run-time generated, return -// --------------------------------------------------------------------------- -// -void CMCSPluginSettingsAppList::RemoveMenuItemL( TInt aIndex ) - { - - if ( aIndex < 0 || aIndex > iListItems.Count() - 1 ) - { - return; - } - - CMenuItem* menuItem = iListItems[ aIndex ]; - - TBool hasParam = ETrue; - TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam ); - - if ( !hasParam ) - { - // nothing to do - return; - } - - // set up a filter for finding the mailbox - // with given ID in MCS - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - - filter->SetType( KMenuTypeShortcut ); - filter->HaveAttributeL( KMenuAttrParameter, param ); - - // search menu from the Root folder with the filter - const TInt rootId = iMenu.RootFolderL(); - RArray itemArray; - CleanupClosePushL( itemArray ); - iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); - - // save the number of findings - TInt count( itemArray.Count() ); - - if ( count > 0 ) - { - // Item already exists in MCS - // If it has reference counter, increment it before returning. - CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); - - // decrement ref_count attribute - TInt newRefCount = UpdateMenuItemsRefCountL( itm, -1 ); - if ( newRefCount > 0 ) - { - CleanupStack::PushL( itm ); - CMenuOperation* op = itm->SaveL( iUpdateWatcher->iStatus ); - CleanupStack::Pop( itm ); - iUpdateWatcher->Watch( op ); - } - else if ( newRefCount == 0 ) - { - // counter reached 0 -> item is not referenced by any shortcut - // so remove it from MCS - if ( iRemoveWatcher->IsActive() ) - { - return; - } - CMenuOperation* op = iMenu.RemoveL( itm->Id(), iRemoveWatcher->iStatus ); - iRemoveWatcher->Watch( op ); - } - delete itm; - } - CleanupStack::PopAndDestroy( &itemArray ); - CleanupStack::PopAndDestroy( filter ); - } - -// --------------------------------------------------------------------------- -// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used -// for storing run-time generated menuitems -// --------------------------------------------------------------------------- -// -TInt CMCSPluginSettingsAppList::GetMCSPluginFolderIdL() - { - - if ( iMCSPluginFolderId == 0 ) - { - CMenuItem* item( NULL ); - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - filter->SetType( KMenuTypeFolder ); - filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder ); - const TInt rootId = iMenu.RootFolderL(); - RArray itemArray; - CleanupClosePushL( itemArray ); - iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); - if ( itemArray.Count() > 0 ) - { - item = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); - iMCSPluginFolderId = item->Id(); - } - else - { - iMCSPluginFolderId = iMenu.RootFolderL(); - } - CleanupStack::PopAndDestroy( &itemArray ); - CleanupStack::PopAndDestroy( filter ); - delete item; - } - return iMCSPluginFolderId; - - } - -// --------------------------------------------------------------------------- -// Helper method for updating ref_count attribute of run-time generated -// menuitems -// --------------------------------------------------------------------------- -// -TInt CMCSPluginSettingsAppList::UpdateMenuItemsRefCountL( CMenuItem* aItem, - TInt aValueToAdd ) - { - - TBool exists = EFalse; - CleanupStack::PushL( aItem ); - TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); - CleanupStack::Pop( aItem ); - if ( exists ) - { - TInt references; - TLex16 lextmp( param ); - lextmp.Val( references ); - references += aValueToAdd; - TBuf<128> buf; - buf.NumUC( references ); - // set new ref_count - CleanupStack::PushL( aItem ); - aItem->SetAttributeL( KMenuAttrRefcount, buf ); - CleanupStack::Pop( aItem ); - // return new ref_count - return references; - } - return -1; - } - - // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,32 +15,19 @@ * */ - -#include -#include // For CActiveFavouritesDbNotifier +#include #include #include #include -#include -#include #include "mcspluginsettingsmodel.h" -#include "mcspluginsettingsapplist.h" #include "mcspluginsettingsbkmlist.h" -#include "mcspluginwatcher.h" -#include "debug.h" _LIT( KMyMenuData, "matrixmenudata" ); _LIT( KMenuUrl, "menu:url" ); -_LIT( KMenuIconFile, "aimcsplugin.mif" ); -_LIT( KMenuIconId, "16386" ); -_LIT( KMenuMaskId, "16387" ); _LIT( KUrl, "url" ); _LIT8( KUid, "uid" ); -_LIT( KMenuAttrRefcount, "ref_count" ); -_LIT( KInitialRefCount, "1" ); -_LIT( KMCSFolder, "mcsplugin_folder" ); - +_LIT( KMenuAttrParameter, "param" ); // ======== MEMBER FUNCTIONS ======== @@ -51,7 +38,6 @@ // CMCSPluginSettingsBkmList::CMCSPluginSettingsBkmList() { - iMCSPluginFolderId = 0; } // --------------------------------------------------------------------------- @@ -64,10 +50,6 @@ User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); iMenu.OpenL( KMyMenuData ); GetBookmarkListL(); - - iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); - iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); - iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); } // --------------------------------------------------------------------------- @@ -94,9 +76,6 @@ iBookmarkDb.Close(); iBookmarkSess.Close(); iMenu.Close(); - delete iSaveWatcher; - delete iUpdateWatcher; - delete iRemoveWatcher; } // --------------------------------------------------------------------------- @@ -132,7 +111,7 @@ TSettingItem CMCSPluginSettingsBkmList::FindItemL( RPointerArray& aProperties ) { TInt index( KErrNotFound ); - TSettingItem settingItem = { KErrNotFound, EBookmark }; + TSettingItem settingItem = { KErrNotFound, EBookmark, EFalse }; for( TInt i= 0; i < aProperties.Count(); i++ ) { if( aProperties[i]->Name() == KUid ) @@ -202,7 +181,6 @@ // void CMCSPluginSettingsBkmList::GetBookmarksFromMCSL() { - TBool exists( EFalse ); CMenuFilter* filter = CMenuFilter::NewL(); CleanupStack::PushL( filter ); filter->SetType( KMenuUrl ); @@ -213,26 +191,20 @@ TInt count( itemArray.Count() ); for ( TInt i = 0; i < count; i++ ) { + TBool uidExists( EFalse ); + TBool nameExists( EFalse ); + TBool urlExists( EFalse ); CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemArray[i] ); CleanupStack::PushL( menuItem ); - TPtrC uid = menuItem->GetAttributeL( KMenuAttrUid, exists ); - TPtrC name = menuItem->GetAttributeL( KMenuAttrLongName, exists ); - TPtrC url = menuItem->GetAttributeL( KUrl, exists ); - - // Check if bookmark is already present in Bookmark list. - // This may happen in case of Favourite Bookmarks that were - // previously added to MCS. - // If it is, do not add it to Bookmark list anymore. - - TBool isRuntimeGenerated = EFalse; - menuItem->GetAttributeL( KMenuAttrRefcount, isRuntimeGenerated ); - - // if is not runtime generated and url exists, add it - if ( !isRuntimeGenerated && exists ) + TPtrC uid = menuItem->GetAttributeL( KMenuAttrUid, uidExists ); + TPtrC name = menuItem->GetAttributeL( KMenuAttrLongName, nameExists ); + TPtrC url = menuItem->GetAttributeL( KUrl, urlExists ); + // if all attrib exists, add it ( url ignored ) + if ( uidExists && uid.Length() > 0 && + nameExists && name.Length() > 0 ) { AddBookmarkL( uid, name, url, EMCSBookmark ); } - CleanupStack::PopAndDestroy( menuItem ); } @@ -246,68 +218,19 @@ // If predefined bookmark was selected, MCS menu item is retrieved // --------------------------------------------------------------------------- // -CMenuItem& CMCSPluginSettingsBkmList::ItemL( TInt aIndex ) +CMenuItem* CMCSPluginSettingsBkmList::ItemL( TInt aIndex ) { CMenuItem* menuItem( NULL ); CBkmListItem* listItem = iListItems[aIndex]; if ( listItem->iType == EFavBookmark ) - { - TPtrC uid = *listItem->iUid; - TPtrC name = *listItem->iCaption; - TPtrC url = *listItem->iUrl; - menuItem = CreateMenuItemL( uid, name, url ); + { + menuItem = CreateMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl ); } else { menuItem = MCSMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl ); } - return *menuItem; - } - -// --------------------------------------------------------------------------- -// Removes the menu item from MCS if it was created in runtime i.e. type is EFavBookmark. -// Favourite bookmarks have ref_count attribute, which is decremented everytime -// the bookmark is removed from some shortcut. When this counter reaches 0, -// its MenuItem is removed from MCS. -// --------------------------------------------------------------------------- -// -void CMCSPluginSettingsBkmList::RemoveMenuItemL( TInt aIndex ) - { - - if ( aIndex < 0 || aIndex > iListItems.Count() - 1 ) - { - return; - } - - CBkmListItem* listItem = iListItems[aIndex]; - if( listItem->iType == EFavBookmark ) - { - CMenuItem* menuItem = MCSMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl ); - if ( !menuItem ) - { - return; - } - // decrement ref_count attribute - TInt newRefCount = UpdateMenuItemsRefCountL( menuItem, -1 ); - if ( newRefCount > 0 ) - { - CleanupStack::PushL( menuItem ); - CMenuOperation* op = menuItem->SaveL( iUpdateWatcher->iStatus ); - CleanupStack::Pop( menuItem ); - iUpdateWatcher->Watch( op ); - } - else if ( newRefCount == 0 ) - { - // counter reached 0 -> item is not referenced by any shortcut - // so remove it from MCS - if ( iRemoveWatcher->IsActive() ) - { - return; - } - CMenuOperation* op = iMenu.RemoveL( menuItem->Id(), iRemoveWatcher->iStatus ); - iRemoveWatcher->Watch( op ); - } - } + return menuItem; } // --------------------------------------------------------------------------- @@ -320,46 +243,15 @@ const TDesC& aName, const TDesC& aUrl ) { - // try to search item in MCS - CMenuItem* item = MCSMenuItemL( aUid, aName, aUrl ); - - if ( item == NULL ) - { - // Item does not exist in MCS yet. - // We will add a new one with reference counter set to 1. - CMenuItem* newItem = CMenuItem::CreateL( iMenu, - KMenuTypeUrl, - GetMCSPluginFolderIdL(), 0 ); - CleanupStack::PushL( newItem ); - - newItem->SetAttributeL( KMenuAttrUid, aUid ); - newItem->SetAttributeL( KMenuAttrLongName, aName ); - newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); - newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId ); - newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId ); - newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount ); - newItem->SetAttributeL( KUrl , aUrl ); - - CMenuOperation* op = newItem->SaveL( iSaveWatcher->iStatus ); - iSaveWatcher->Watch( op ); - iMenuItems.AppendL( newItem ); - CleanupStack::Pop( newItem ); - return newItem; - } - else - { - // Item already exists in MCS - // If it has reference counter, increment it before returning. - TInt newRefCount = UpdateMenuItemsRefCountL( item, 1 ); - if ( newRefCount > -1 ) - { - CleanupStack::PushL( item ); - CMenuOperation* op = item->SaveL( iSaveWatcher->iStatus ); - CleanupStack::Pop( item ); - iSaveWatcher->Watch( op ); - } - } - return item; + CMenuItem* newItem = CMenuItem::CreateL( iMenu, KMenuTypeUrl, 0, 0 ); + CleanupStack::PushL( newItem ); + newItem->SetAttributeL( KMenuAttrUid, aUid ); + newItem->SetAttributeL( KMenuAttrLongName, aName ); + newItem->SetAttributeL( KMenuAttrView, aUrl ); + newItem->SetAttributeL( KMenuAttrParameter, aName ); + iMenuItems.AppendL( newItem ); + CleanupStack::Pop( newItem ); + return newItem; } // --------------------------------------------------------------------------- @@ -385,9 +277,12 @@ if( itemArray.Count() > 0 ) { item = CMenuItem::OpenL( iMenu, itemArray[0] ); - CleanupStack::PushL( item ); - iMenuItems.AppendL( item ); - CleanupStack::Pop( item ); + if ( item ) + { + CleanupStack::PushL( item ); + iMenuItems.AppendL( item ); + CleanupStack::Pop( item ); + } } CleanupStack::PopAndDestroy( &itemArray ); CleanupStack::PopAndDestroy( filter ); @@ -410,21 +305,17 @@ { listItem->iUrl = aUrl.AllocL(); } + else + { + listItem->iUrl = KNullDesC().AllocL(); + } + TLinearOrder sortMethod(CBkmListItem::CompareCaption); User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); CleanupStack::Pop(listItem); } // --------------------------------------------------------------------------- -// Updates the bookmark list. -// --------------------------------------------------------------------------- -// -void CMCSPluginSettingsBkmList::UpdateBkmListL() - { - GetBookmarkListL(); - } - -// --------------------------------------------------------------------------- //Nested class to store individual bookmark list items // --------------------------------------------------------------------------- // @@ -486,70 +377,5 @@ return TPtrC(*iCaption); } -// --------------------------------------------------------------------------- -// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used -// for storing run-time generated menuitems -// --------------------------------------------------------------------------- -// -TInt CMCSPluginSettingsBkmList::GetMCSPluginFolderIdL() - { - if ( iMCSPluginFolderId == 0 ) - { - CMenuItem* item( NULL ); - CMenuFilter* filter = CMenuFilter::NewL(); - CleanupStack::PushL( filter ); - filter->SetType( KMenuTypeFolder ); - filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder ); - const TInt rootId = iMenu.RootFolderL(); - RArray itemArray; - CleanupClosePushL( itemArray ); - iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); - if ( itemArray.Count() > 0 ) - { - item = CMenuItem::OpenL( iMenu, itemArray[0] ); - iMCSPluginFolderId = item->Id(); - } - else - { - iMCSPluginFolderId = iMenu.RootFolderL(); - } - CleanupStack::PopAndDestroy( &itemArray ); - CleanupStack::PopAndDestroy( filter ); - delete item; - } - return iMCSPluginFolderId; - } - -// --------------------------------------------------------------------------- -// Helper method for updating ref_count attribute of run-time generated -// menuitems -// --------------------------------------------------------------------------- -// -TInt CMCSPluginSettingsBkmList::UpdateMenuItemsRefCountL( CMenuItem* aItem, - TInt aValueToAdd ) - { - - TBool exists = EFalse; - CleanupStack::PushL( aItem ); - TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); - CleanupStack::Pop( aItem ); - if ( exists ) - { - TInt references; - TLex16 lextmp( param ); - lextmp.Val( references ); - references += aValueToAdd; - TBuf<128> buf; - buf.NumUC( references ); - - // set new ref_count - CleanupStack::PushL( aItem ); - aItem->SetAttributeL( KMenuAttrRefcount, buf ); - CleanupStack::Pop( aItem ); - // return new ref_count - return references; - } - return -1; - } // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,27 +15,19 @@ * */ - -#include -#include #include -#include -#include -#include +#include +#include #include -#include -#include #include - #include #include - -// For CActiveFavouritesDbNotifier -#include +#include #include #include "mcspluginsettingscontainer.h" #include "mcspluginsettingsmodel.h" +#include "mcspluginsettingsapplist.h" #include "mcspluginsettingsbkmlist.h" #include "mcspluginsettings.hrh" #include "mcspluginuids.hrh" @@ -61,7 +53,7 @@ iListBox = new (ELeave) CAknSettingStyleListBox; BaseConstructL(aRect, R_AI_MCS_SETTINGS_VIEW_TITLE, NULL); StartObservingL(); - CheckMiddleSoftkeyLabelL(); + CheckMiddleSoftkeyLabel(); } // --------------------------------------------------------------------------- @@ -88,7 +80,7 @@ { iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); iNotifier.Notify( 0, - RMenuNotifier::EItemsAddedRemoved | RMenuNotifier::EItemsReordered, + RMenuNotifier::EItemsAddedRemoved, iNotifyWatcher->iStatus ); iNotifyWatcher->WatchNotify( this ); } @@ -236,15 +228,6 @@ } // --------------------------------------------------------------------------- -// Helper method which indicates if the Applist or Bkmlist is showing -// --------------------------------------------------------------------------- -// -TBool CMCSPluginSettingsContainer::IsChangeDialogShowing() -{ - return ( iAppListDialog || iBkmListDialog ); -} - -// --------------------------------------------------------------------------- // Method for closing change dialog (app or bkm) if it is beeing shown // --------------------------------------------------------------------------- // @@ -290,7 +273,7 @@ } iListBox->SetCurrentItemIndex( aIndex ); - CheckMiddleSoftkeyLabelL(); + CheckMiddleSoftkeyLabel(); } // --------------------------------------------------------------------------- @@ -312,10 +295,6 @@ // fall-through intended here case EMsvEntriesChanged: { - if ( IsChangeDialogShowing() ) - { - CloseChangeDialog(); - } iModel->UpdateAppListL(); } break; @@ -331,19 +310,15 @@ // void CMCSPluginSettingsContainer::ConstructListBoxL(TInt /*aResLbxId*/) { - iListBox->ConstructL(this, EAknListBoxSelectionList); - + iListBox->ConstructL(this, EAknListBoxSelectionList); // Set empty listbox's text. - HBufC* text = iCoeEnv->AllocReadResourceLC(R_AI_MCS_SETTINGS_TXT_ALL_FIXED); - iListBox->View()->SetListEmptyTextL(*text); - CleanupStack::PopAndDestroy(text); - + iListBox->View()->SetListEmptyTextL(KNullDesC); iListBox->Model()->SetItemTextArray(iModel); iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); } // --------------------------------------------------------------------------- -// Chandles a setting change command to select application from a list. +// Handles a setting change command to select application from a list. // --------------------------------------------------------------------------- // TBool CMCSPluginSettingsContainer::HandleAppListChangeCommandL( const TInt& aIndex, @@ -365,7 +340,7 @@ if (iAppListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && index != oldIndex) { - changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EApplication ); + changed = iModel->ReplaceItemL( aSettingIndex, index , EApplication ); } CleanupStack::PopAndDestroy( title ); @@ -396,7 +371,7 @@ if (iBkmListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && index != oldIndex) { - changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EBookmark ); + changed = iModel->ReplaceItemL( aSettingIndex, index , EBookmark ); } CleanupStack::PopAndDestroy( title ); @@ -444,7 +419,7 @@ // Checks if there is a need to update the middle softkey label. // --------------------------------------------------------------------------- // -void CMCSPluginSettingsContainer::CheckMiddleSoftkeyLabelL() +void CMCSPluginSettingsContainer::CheckMiddleSoftkeyLabel() { CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); if (cba) @@ -468,10 +443,7 @@ // fall-through intended here case RDbNotifier::ERollback : { - if ( IsChangeDialogShowing() ) - { - CloseChangeDialog(); - } + CloseChangeDialog(); iModel->UpdateBkmListL(); } break; @@ -487,16 +459,15 @@ // void CMCSPluginSettingsContainer::HandleNotifyL() { - if ( IsChangeDialogShowing() ) - { - CloseChangeDialog(); - } + CloseChangeDialog(); + iModel->UpdateAppListL(); + ResetCurrentListL(0); // Notification must be activated again iNotifyWatcher->Cancel(); iNotifier.Notify( 0, - RMenuNotifier::EItemsAddedRemoved | RMenuNotifier::EItemsReordered, + RMenuNotifier::EItemsAddedRemoved, iNotifyWatcher->iStatus ); iNotifyWatcher->WatchNotify( this ); } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp --- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,22 +18,18 @@ #include #include #include - #include #include #include #include - +#include -#include "mcspluginsettings.h" #include "mcspluginsettingsmodel.h" +#include "mcspluginsettingsapplist.h" +#include "mcspluginsettingsbkmlist.h" #include "mcspluginsettingscontainer.h" -#include "debug.h" - -#include - /** * Line format for the settings list box */ @@ -51,11 +47,38 @@ _LIT8( KProperValueSuite, "suite" ); _LIT8( KProperValueBookmark, "bookmark" ); _LIT8( KProperValueAppl, "application" ); - - +_LIT8( KProperValueMailbox, "mailbox" ); +_LIT( KMenuTypeMailbox, "menu:mailbox" ); using namespace HSPluginSettingsIf; +// ======== LOCAL FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroy( TAny* aObj ) + { + if( aObj ) + { + static_cast( aObj )->ResetAndDestroy(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroyPushL(T& aArray) + { + CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy, &aArray ) ); + } + +// ======== MEMBER FUNCTIONS ======== + // ----------------------------------------------------------------------------- // Creates a formatted listbox line. // ----------------------------------------------------------------------------- @@ -84,7 +107,9 @@ TInt formatLength = KSettingListboxLineFormat().Length(); HBufC* listBoxLine = - HBufC::NewLC(title->Length() + caption.Length() + formatLength); + HBufC::NewLC( title->Length() + + caption.Length() + + formatLength ); TPtr ptr = listBoxLine->Des(); ptr.Format(KSettingListboxLineFormat, title, &caption); @@ -134,10 +159,12 @@ { delete iAppList; delete iBkmList; - iSettings.Reset(); - delete iPluginSettings; + iSettings.Reset(); delete iPluginId; delete iListBoxLine; + + CHomescreenSettings::UnInitialize(); + iPluginSettings = NULL; } // --------------------------------------------------------------------------- @@ -145,38 +172,39 @@ // --------------------------------------------------------------------------- // void CMCSPluginSettingsModel::ConstructL() -{ - iAppList = CMCSPluginSettingsAppList::NewL(); - iAppList->StartL(); - iBkmList = CMCSPluginSettingsBkmList::NewL(); -} - + { + CHomescreenSettings::InitializeL( KAppUid ); + + iPluginSettings = CHomescreenSettings::Instance(); + if( iPluginSettings == NULL ) + { + User::Leave( KErrUnknown ); + } + } // --------------------------------------------------------------------------- // Gets the latest settings from HSPS and updates // --------------------------------------------------------------------------- // -void CMCSPluginSettingsModel::UpdateSettingsL( const TDesC8& aPluginId ) +void CMCSPluginSettingsModel::UpdateSettingsL() { - if( !iPlugin.Activated() ) + iSettings.Reset(); + if( !iPluginId ) { return; } - if( !iPluginSettings ) + + if (iContainer) { - // AILaunch uid in decimal format - iPluginSettings = CHomescreenSettings::NewL( KAppUid, aPluginId, this ); - iPluginId = aPluginId.AllocL(); + iContainer->CloseChangeDialog(); } - - iSettings.Reset(); + RPointerArray settingItems; - CleanupClosePushL( settingItems ); + CleanupResetAndDestroyPushL( settingItems ); iPluginSettings->GetSettingsL( *iPluginId, settingItems ); - TInt count = settingItems.Count(); - for ( TInt i = 0; i < count; i++ ) + for ( TInt i = 0; i < settingItems.Count(); i++ ) { CItemMap* itemMap = settingItems[i]; RPointerArray properties; @@ -184,8 +212,13 @@ TSettingItem item = ItemL( properties ); iSettings.AppendL( item ); } - CleanupStack::Pop( &settingItems ); - settingItems.ResetAndDestroy(); + + CleanupStack::PopAndDestroy(); // settingItems + + if (iContainer) + { + iContainer->ResetCurrentListL(0); + } } // --------------------------------------------------------------------------- @@ -198,11 +231,11 @@ TSettingItem setting = { KErrNotFound, EApplication , EFalse }; TSettingType type = SettingTypeL( aProperties ); - if( type == EApplication ) + if ( type == EApplication || type == EMailbox ) { setting = iAppList->FindItemL( aProperties ); } - else if( type == EBookmark ) + else if ( type == EBookmark ) { setting = iBkmList->FindItemL( aProperties ); } @@ -265,28 +298,62 @@ return EFalse; } - // --------------------------------------------------------------------------- // Saves menuitem to HSPS to the given shortcut index // --------------------------------------------------------------------------- // void CMCSPluginSettingsModel::SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ) - { - - if ( !iPluginSettings ) + { + if( !iPluginId ) { return; } - RPointerArray settingItems; - CleanupClosePushL( settingItems ); + + RPointerArray settingItems; + CleanupResetAndDestroyPushL( settingItems ); iPluginSettings->GetSettingsL( *iPluginId, settingItems ); + if ( aIndex >= 0 && aIndex < settingItems.Count() ) { TBool exists( EFalse ); CItemMap* itemMap = settingItems[ aIndex ]; RPointerArray properties; properties = itemMap->Properties(); + + const TInt KGranularity = 6; + CDesC8Array* propertiesList = new ( ELeave ) CDesC8ArrayFlat( KGranularity ); + CleanupStack::PushL( propertiesList ); + propertiesList->AppendL( KProperNameType ); + propertiesList->AppendL( KProperNameParam ); + propertiesList->AppendL( KProperNameUid ); + propertiesList->AppendL( KProperNameView ); + // skip KProperNameLocked property, attribute may be missing. results into + // leave with -1 when saving settings + + // add missing properties + for ( TInt i=0; iCount(); i++ ) + { + TBool found( EFalse ); + const TPtrC8 namePtr = propertiesList->MdcaPoint( i ); + for ( TInt j=0; jName() ) ? ETrue : EFalse ); + } + if ( !found ) + { + CPropertyMap* property = CPropertyMap::NewLC(); + property->SetNameL( namePtr ); + property->SetValueL( KNullDesC8 ); + itemMap->AddPropertyMapL( property ); + CleanupStack::Pop( property ); + + // get updated list + properties = itemMap->Properties(); + } + } + CleanupStack::PopAndDestroy( propertiesList ); + for ( TInt i = 0; i < properties.Count(); i++ ) { if ( properties[ i ]->Name() == KProperNameType ) @@ -304,6 +371,10 @@ { properties[ i ]->SetValueL( KProperValueSuite ); } + else if( type == KMenuTypeMailbox ) + { + properties[ i ]->SetValueL( KProperValueMailbox ); + } else { properties[ i ]->SetValueL( KProperValueAppl ); @@ -312,7 +383,7 @@ else if ( properties[ i ]->Name() == KProperNameUid ) { TPtrC uid = aMenuItem.GetAttributeL( KMenuAttrUid, exists ); - if ( exists ) + if ( exists && uid.Length() > 0 ) { HBufC8* uid8( NULL ); uid8 = AiUtility::CopyToBufferL( uid8, uid ); @@ -328,7 +399,7 @@ else if ( properties[ i ]->Name() == KProperNameView ) { TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists ); - if( exists ) + if( exists && view.Length() > 0 ) { HBufC8* view8( NULL ); view8 = AiUtility::CopyToBufferL( view8, view ); @@ -354,7 +425,7 @@ isFolder = ETrue; } - if ( exists || isFolder ) + if ( (exists && param.Length() > 0) || (isFolder) ) { // the folder id is stored // in param attribute in HSPS @@ -379,7 +450,7 @@ else if ( properties[ i ]->Name() == KProperNameLocked ) { TPtrC locked = aMenuItem.GetAttributeL( KMenuAttrLocked, exists ); - if ( exists ) + if ( exists && locked.Length() > 0 ) { HBufC8* locked8( NULL ); locked8 = AiUtility::CopyToBufferL( locked8, locked ); @@ -394,45 +465,21 @@ } } } - // ETrue tells that modified settings are stored also to plugin reference - iPluginSettings->SetSettingsL( *iPluginId, settingItems, ETrue ); - CleanupStack::Pop( &settingItems ); - settingItems.ResetAndDestroy(); + // ETrue tells that modified settings are stored also to plugin reference + User::LeaveIfError( iPluginSettings->SetSettingsL( *iPluginId, settingItems, ETrue ) ); + CleanupStack::PopAndDestroy(); // settingItems } // --------------------------------------------------------------------------- // Updates settings container. // --------------------------------------------------------------------------- // -void CMCSPluginSettingsModel::UpdateSettingsContainerL( const TDesC8& aPluginId ) -{ - if (iContainer) - { - if (iContainer->IsChangeDialogShowing()) - { - iContainer->CloseChangeDialog(); - } - } - - UpdateSettingsL( aPluginId ); - - if (iContainer) +void CMCSPluginSettingsModel::SetPluginIdL( const TDesC8& aPluginId ) { - iContainer->ResetCurrentListL(0); - } -} - -// --------------------------------------------------------------------------- -// From MHomeScreenSettingsObserver - handler for HSPS setting change -// --------------------------------------------------------------------------- -// -TInt CMCSPluginSettingsModel::SettingsChangedL( const TDesC8& /*aEvent*/, - const TDesC8& /*aPluginName*/, - const TDesC8& /*aPluginUid*/, - const TDesC8& /*aPluginId*/ ) - { - return KErrNone; + delete iPluginId; + iPluginId = NULL; + iPluginId = aPluginId.AllocL(); } // --------------------------------------------------------------------------- @@ -451,27 +498,38 @@ // --------------------------------------------------------------------------- // TPtrC CMCSPluginSettingsModel::MdcaPoint( TInt aIndex ) const -{ + { if (aIndex < 0 || aIndex >= iSettings.Count()) - { + { TPtrC ret(KNullDesC); return ret; - } + } + + TPtrC line( KNullDesC ); if ( iSettings[aIndex].type == EApplication ) { - const TDesC& caption = iAppList->MdcaPoint( iSettings[aIndex].id ); - TPtrC line; - TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) - return line; + // first, we need to check if the item is missing + // (application uninstalled or mmc card removed) + // If it is, we return "Undefined" application name instead + if ( iSettings[ aIndex ].id == KErrNotFound ) + { + const TDesC& caption = iAppList->UndefinedText(); + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + } + else + { + const TDesC& caption = iAppList->MdcaPoint( iSettings[ aIndex ].id ); + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + } } else { const TDesC& caption = iBkmList->MdcaPoint( iSettings[aIndex].id ); - TPtrC line; TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) - return line; } -} + + return line; + } // --------------------------------------------------------------------------- // Returns a setting ID for the given index. @@ -511,39 +569,28 @@ TInt aId, TSettingType aType ) { + TBool replaced( EFalse ); if (aSettingIndex >= 0 && aSettingIndex < iSettings.Count()) { - // Old setting type is bookmark. Remove bookmark item from MCS - // if it was created in runtime. - if( iSettings[aSettingIndex].type == EBookmark ) - { - iBkmList->RemoveMenuItemL( iSettings[aSettingIndex].id ); - } - - // Old setting type is application. - // Remove app item from MCS if it was created in runtime (mailbox). - if ( iSettings[ aSettingIndex ].type == EApplication ) - { - iAppList->RemoveMenuItemL( iSettings[ aSettingIndex ].id ); - } - - iSettings[aSettingIndex].id = aId; - iSettings[aSettingIndex].type = aType; - + CMenuItem* item( NULL ); if ( aType == EApplication ) { - CMenuItem& item = iAppList->ItemL( aId ); - SaveSettingsL( aSettingIndex, item ); + item = iAppList->ItemL( aId ); } - else + else { - CMenuItem& item = iBkmList->ItemL( aId ); - SaveSettingsL( aSettingIndex, item ); + item = iBkmList->ItemL( aId ); } - - return ETrue; + + if ( item ) + { + SaveSettingsL( aSettingIndex, *item ); + iSettings[ aSettingIndex ].id = aId; + iSettings[ aSettingIndex ].type = aType; + replaced = ETrue; + } } - return EFalse; + return replaced; } // --------------------------------------------------------------------------- @@ -577,20 +624,32 @@ // Updates application list // --------------------------------------------------------------------------- // -void CMCSPluginSettingsModel::UpdateAppListL() -{ +void CMCSPluginSettingsModel::UpdateAppListL( TBool aUpdateSettings ) + { + if( !iAppList ) + { + iAppList = CMCSPluginSettingsAppList::NewL(); + } iAppList->StartL(); -} + if ( aUpdateSettings ) + { + UpdateSettingsL(); + } + } // --------------------------------------------------------------------------- // Updates bookmark list // --------------------------------------------------------------------------- // -void CMCSPluginSettingsModel::UpdateBkmListL() -{ +void CMCSPluginSettingsModel::UpdateBkmListL( TBool aUpdateSettings ) + { delete iBkmList; iBkmList = NULL; iBkmList = CMCSPluginSettingsBkmList::NewL(); -} + if ( aUpdateSettings ) + { + UpdateSettingsL(); + } + } // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/data/aiprofileplugin.rss --- a/idlefw/plugins/profileplugin/data/aiprofileplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/data/aiprofileplugin.rss Wed May 12 13:36:47 2010 +0300 @@ -19,6 +19,7 @@ // INCLUDES #include #include +#include // ----------------------------------------------------------------------------- @@ -41,7 +42,7 @@ INTERFACE_INFO { // UID of interface that is implemented - interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; implementations = { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/data/aiprofilepluginres.rss --- a/idlefw/plugins/profileplugin/data/aiprofilepluginres.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/data/aiprofilepluginres.rss Wed May 12 13:36:47 2010 +0300 @@ -93,4 +93,15 @@ }; } +// ----------------------------------------------------------------------------- +// +// "Insert SIM card and restart" +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_su_note_insert_sim_and_restart + { + buf = qtn_su_note_insert_sim_and_restart; + } + // End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/group/aiprofileplugin.mmp --- a/idlefw/plugins/profileplugin/group/aiprofileplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/group/aiprofileplugin.mmp Wed May 12 13:36:47 2010 +0300 @@ -51,6 +51,7 @@ LIBRARY ecom.lib LIBRARY aiutils.lib LIBRARY sssettings.lib +LIBRARY profileengine.lib LIBRARY profileeng.lib LIBRARY bafl.lib LIBRARY avkon.lib diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/inc/caiprofileengine.h --- a/idlefw/plugins/profileplugin/inc/caiprofileengine.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/inc/caiprofileengine.h Wed May 12 13:36:47 2010 +0300 @@ -19,17 +19,23 @@ #ifndef CAIPROFILEENGINE_H #define CAIPROFILEENGINE_H -// INCLUDE FILES +// System includes #include #include #include #include -#include +#include +#include +#include + +// User includes #include "maiprofilepluginnotifier.h" -class MProfileEngine; -class CProfileChangeNotifyHandler; -class MProfilesNamesArray; +// Forward declarations +class MProEngEngine; +class MProEngNotifyHandler; +class MProEngProfileNameArray; + class RSSSettings; /** @@ -39,21 +45,14 @@ * * @since S60 v3.2 */ -class CAiProfileEngine : public CBase, - public MSSSettingsObserver, - public MProfileChangeObserver -{ - -public: // Constructors and destructor - - /** - * Constructor to use in the object creation. Initializes the necessary data. - * - * @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier - (the object ordering a notification of the content status change) - * @return none - */ - CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier ); +NONSHARABLE_CLASS( CAiProfileEngine ) : public CBase, + public MSSSettingsObserver, + public MProEngActiveProfileObserver, + public MProEngProfileNameArrayObserver, + public MProEngProfileActivationObserver + { +public: + // constructors and destructor /** * Part of the two phased constuction @@ -71,30 +70,32 @@ * @return none */ ~CAiProfileEngine(); + +private: + // constructors /** - * Resumes the engine + * Constructor to use in the object creation. Initializes the necessary data. * - * @param void - * @return void + * @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier + (the object ordering a notification of the content status change) + * @return none */ - void ResumeL(); - + CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier ); + /** - * Suspends the engine - * - * @param void - * @return void - */ - void Suspend(); - + * 2nd phase constructor + */ + void ConstructL(); + public: - + // New functions + const TDesC& ActiveProfileName() const; const TDesC& SwapProfileName() const; - TInt NumberOfProfiles(); + TInt NumberOfProfiles() const; const TDesC& ProfileNameByIndex( TInt aIndex ) const; @@ -102,23 +103,22 @@ void SetActiveProfileL( const TInt aProfileId ); - TBool IsActiveProfileSilentL(); + TBool IsActiveProfileSilentL() const; - TBool IsActiveProfileTimedL(); + TBool IsActiveProfileTimedL() const; void UpdateProfileNamesL(); - TBool IsOffline(); + TBool IsOffline() const; -private: - - void ConstructL(); +private: + // new functions void SetActiveProfileNameL( const TDesC& aName ); void SetSwapProfileNameL( const TDesC& aName ); - void SetProfileNameListL( const MProfilesNamesArray& aArray ); + void SetProfileNameListL( const MProEngProfileNameArray& aArray ); void HandleSwitchByNameL( const TDesC& aParam ); @@ -129,73 +129,69 @@ void HandleEditActiveProfileL(); TBool ShowOfflineMessageL(); - + + void DetermineTimedAndSilentStatesL(); + + void NotifyContentUpdate(); -protected: - -// from base class MSSSettingsObserver - - /** - * Called when SS Settings changes. - */ - void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue ); - - -// from base class MProfileChangeObserver +private: + // from MSSSettingsObserver /** - * Called when active profile changes. + * @see MSSSettingsObserver */ - void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId ); - + void PhoneSettingChanged( + TSSSettingsSetting aSetting, TInt aNewValue ); + private: - /** - * Pointer to the class implementing the MAiProfilePluginNotifier interface - */ - MAiProfilePluginNotifier* iProfilePluginNotifier; - - /** - * Client to listen SS setting changes. - */ - RSSSettings iSSSettings; + // from MProEngActiveProfileObserver /** - * Profile engine. - * Own. - */ - MProfileEngine* iProfileEngine; - - /** - * Profile change notifier. - * Own - */ - CProfileChangeNotifyHandler* iProfileNotifier; + * @see MProEngActiveProfileObserver + */ + void HandleActiveProfileModifiedL(); + +private: + // from MProEngProfileNameArrayObserver - /* - * Active profile name - * Own - */ - HBufC* iActiveProfileName; + /** + * @see MProEngProfileNameArrayObserver + */ + void HandleProfileNameArrayModificationL(); - /* - * Swap profile name - * Own - */ - HBufC* iSwapProfileName; +private: + // from MProEngProfileActivationObserver /** - * Array of Profile Name Pointer. - * Own. - */ - RPointerArray iProfileNamePointerArray; + * @see MProEngProfileActivationObserver + */ + void HandleProfileActivatedL( TInt aProfileId ); + +private: + // data - /** - * Resource loader for own resources. - */ + /** MAiProfilePluginNotifier interface, not owned */ + MAiProfilePluginNotifier* iProfilePluginNotifier; + /** Client to listen SS setting changes, owned */ + RSSSettings iSSSettings; + /** Profile engine, owned */ + MProEngEngine* iProfileEngine; + /** Profile change notifier, owned */ + MProEngNotifyHandler* iProfileNotifier; + /** Active profile name, owned */ + HBufC* iActiveProfileName; + /** Swap profile name, owned */ + HBufC* iSwapProfileName; + /** Array of Profile Names, owned */ + RPointerArray< HBufC > iProfileNamePointerArray; + /** Resource loader, owned */ RConeResourceLoader iResourceLoader; - -}; + /** Flag to indicate whether active profile is timed */ + TBool iTimed; + /** Flag to indicate whether active profile is silent */ + TBool iSilent; + }; #endif // CAIPROFILEENGINE_H - +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/inc/caiprofileplugin.h --- a/idlefw/plugins/profileplugin/inc/caiprofileplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/inc/caiprofileplugin.h Wed May 12 13:36:47 2010 +0300 @@ -19,12 +19,14 @@ #ifndef CAIPROFILEPLUGIN_H #define CAIPROFILEPLUGIN_H -#include -#include +// System includes + +// User includes +#include #include -#include #include "maiprofilepluginnotifier.h" +// Forward declarations class MAiContentObserver; class MAiContentItemIterator; class CAiProfileEngine; @@ -36,16 +38,12 @@ * * @since S60 v3.2 */ -class CAiProfilePlugin : public CAiContentPublisher, - public MAiPropertyExtension, - public MAiProfilePluginNotifier, - public MAiEventHandlerExtension - - +NONSHARABLE_CLASS( CAiProfilePlugin ) : public CHsContentPublisher, + public MAiProfilePluginNotifier { - public: - + // constructors and destructor + /** * Part of the two phased constuction * @@ -53,7 +51,18 @@ * @return none */ static CAiProfilePlugin* NewL(); - + + /** + * Destructor + * + * @param none + * @return none + */ + ~CAiProfilePlugin(); + +private: + // constructors + /** * Constructor * @@ -63,12 +72,63 @@ CAiProfilePlugin(); /** - * Destructor - * - * @param none - * @return none + * 2nd phase constructor */ - ~CAiProfilePlugin(); + void ConstructL(); + +public: + // from CHsContentPublisher + + /** + * @see CHsContentPublisher + */ + void Start( TStartReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Stop( TStopReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Resume( TResumeReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Suspend( TSuspendReason aReason ); + + /** + * @see CHsContentPublisher + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * @see CHsContentPublisher + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * @see CHsContentPublisher + */ + TAny* GetProperty( TProperty aProperty ); + + /** + * @see CHsContentPublisher + */ + void HandleEvent( TInt aEvent, const TDesC& aParam ); + +private: + // from MAiProfilePluginNotifier + + /** + * @see MAiProfilePluginNotifier + */ + void NotifyContentUpdate(); + +public: + // new functions /** * Publishes profile names @@ -77,158 +137,19 @@ * @return void */ void PublishL(); - -// from base class CAiContentPublisher - - /** - * From CAiContentPublisher - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, e.g. the plug-in - * should unload its engines due backup operation. The method transits the - * plug-in to "Idle" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Stop( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * allowed to consume CPU resources, e.g plug-in is able to run timers, - * perform asynchronous operations, etc. The method transits the plug-in - * to "Alive" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Resume( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timers, cancel outstanding asynchronous operations, etc. The method - * transits the plug-in to "Suspendend" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Suspend( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @return void - */ - void SubscribeL( MAiContentObserver& aObserver ); - - /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plugin shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @param aSettings setting items defined in the UI definition. - * @return void - */ - void ConfigureL( RAiSettingsItemArray& aSettings ); - - /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension( TUid aUid ); - -// from base class MAiPropertyExtension - - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - TAny* GetPropertyL( TInt aProperty ); - - /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - void SetPropertyL( TInt aProperty, TAny* aValue ); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 - */ - void HandleEvent(TInt aEvent, const TDesC& aParam); - -// from base class MAiProfilePluginNotifier - - /** - * Receives a notification of the content update event - * - * @param void - * @return void - */ - void NotifyContentUpdate(); -protected: - private: - - /** - * Part of the two phased construction - * - * @param void - * @return void - */ - void ConstructL(); + // new functions /** * Resume the plug-in. * - * @param aReason reason for state change, see TAiTransitionChange. + * @param void * @return void */ - void DoResumeL(TAiTransitionReason aReason); + void DoResumeL(); /** - * Free the engine - * - * @param void - * @return void - */ - void FreeEngine(); - - /** * Clean profile names from published content * * @param void @@ -236,48 +157,33 @@ */ void CleanPublishedProfileNames(); -private: // data - - // Iterator for plugin content - // Own - MAiContentItemIterator* iContent; - - // Iterator for plugin events - // Own - MAiContentItemIterator* iEvents; - - // Iterator for plug-in resources. - // Own - MAiContentItemIterator* iResources; - - // Plugin engine - // Own - CAiProfileEngine* iEngine; +private: + // data - // Array of content observers - // Own - RPointerArray iObservers; - - // Information about the content publisher (this plug-in) - TAiPublisherInfo iInfo; - - // Current profile count + /** Iterator for plugin content, owned */ + MAiContentItemIterator* iContent; + /** Iterator for plugin events, owned */ + MAiContentItemIterator* iEvents; + /** Iterator for plug-in resources, owned */ + MAiContentItemIterator* iResources; + /** Plugin engine, owned */ + CAiProfileEngine* iEngine; + /** Array of content observers */ + RPointerArray iObservers; + /** Current profile count */ TInt iCurrentCount; - - // Profile count that is used as reference when profile list is updated - TInt iPreviousCount; - - //Plug-in state, suspended or alive. - TBool iAlive; - - // Boolean, which expresses whether the content has been updated - TBool iIsUpdated; - - HBufC *iActiveProfileAndChar; - - HBufC *iPreviousProfileNameAndChar; + /** Profile count that is used as reference when profile list is updated */ + TInt iPreviousCount; + /** Active profile, owned */ + HBufC* iActiveProfileAndChar; + /** Previous profile, owned */ + HBufC* iPreviousProfileNameAndChar; + /** Flag to indicate whether publish is required */ + TBool iPublishRequired; }; #endif // CAIPROFILEPLUGIN_H +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/inc/maiprofilepluginnotifier.h --- a/idlefw/plugins/profileplugin/inc/maiprofilepluginnotifier.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/inc/maiprofilepluginnotifier.h Wed May 12 13:36:47 2010 +0300 @@ -30,15 +30,16 @@ */ class MAiProfilePluginNotifier { - public: +public: - /** - * Virtual method, which the plugin class has to implement. - * Method is used to send notification of P&S data's change event - * from engine to plugin. - * - */ - inline virtual void NotifyContentUpdate() = 0; + /** + * Virtual method, which the plugin class has to implement. + * Method is used to send notification of P&S data's change event + * from engine to plugin. + */ + virtual void NotifyContentUpdate() = 0; }; -#endif //MAIPROFILEPLUGINNOTIFIER_H \ No newline at end of file +#endif // MAIPROFILEPLUGINNOTIFIER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/src/caiprofileengine.cpp --- a/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Wed May 12 13:36:47 2010 +0300 @@ -16,16 +16,16 @@ */ -// INCLUDE FILES -#include "caiprofileengine.h" -#include "maiprofilepluginnotifier.h" -#include "aiprofileplugincontentmodel.h" - +// System includes #include +#include #include #include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -36,12 +36,15 @@ #include #include #include - - -#include - #include +// User includes +#include +#include "caiprofileengine.h" +#include "maiprofilepluginnotifier.h" +#include "aiprofileplugincontentmodel.h" + +// Constants const TInt KMaxProfileNameLength( 64 ); const TInt KGeneralProfileId( 0 ); const TInt KSilentProfileId( 1 ); @@ -53,35 +56,41 @@ _LIT( KAiProfilePluginResourceFileName, "z:aiprofilepluginres.rsc"); -// ============================ MEMBER FUNCTIONS =============================== -// --------------------------------------------------------- -// Default constructor -// --------------------------------------------------------- +// ============================ MEMBER FUNCTIONS ============================== +// ---------------------------------------------------------------------------- +// CAiProfileEngine::CAiProfileEngine // -CAiProfileEngine::CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier ) : - iProfilePluginNotifier ( aProfilePluginNotifier ), +// ---------------------------------------------------------------------------- +// +CAiProfileEngine::CAiProfileEngine( + MAiProfilePluginNotifier* aProfilePluginNotifier ) + : iProfilePluginNotifier ( aProfilePluginNotifier ), iResourceLoader( *CCoeEnv::Static() ) { } -// --------------------------------------------------------- -// Two-phased constructor. -// Create instance of concrete ECOM interface implementation -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::NewL +// +// ---------------------------------------------------------------------------- // -CAiProfileEngine* CAiProfileEngine::NewL( MAiProfilePluginNotifier* aProfilePluginNotifier ) +CAiProfileEngine* CAiProfileEngine::NewL( + MAiProfilePluginNotifier* aProfilePluginNotifier ) { - CAiProfileEngine* self = new( ELeave ) CAiProfileEngine( aProfilePluginNotifier ); + CAiProfileEngine* self = + new( ELeave ) CAiProfileEngine( aProfilePluginNotifier ); CleanupStack::PushL( self ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } -// --------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::ConstructL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::ConstructL() { @@ -97,87 +106,154 @@ User::LeaveIfError( iSSSettings.Open() ); - iProfileEngine = CreateProfileEngineL(); - } + // Register to listen ALS activation, if ALS status changes, + // profile must be republished. + TInt err( iSSSettings.Register( ESSSettingsAls, *this ) ); + + if( err == KErrNotSupported || err == KErrAlreadyExists ) + { + // ALS not supported or already registered, that's fine + err = KErrNone; + } + + User::LeaveIfError( err ); + iProfileEngine = ProEngFactory::NewEngineL(); -// --------------------------------------------------------- -// Destructor. -// --------------------------------------------------------- + // Start to listen profile changes. + iProfileNotifier = ProEngFactory::NewNotifyHandlerL(); + + iProfileNotifier->RequestActiveProfileNotificationsL( *this ); + iProfileNotifier->RequestProfileNameArrayNotificationsL( *this ); + iProfileNotifier->RequestProfileActivationNotificationsL( *this ); + + DetermineTimedAndSilentStatesL(); + } + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::~CAiProfileEngine +// +// ---------------------------------------------------------------------------- // CAiProfileEngine::~CAiProfileEngine() { iSSSettings.CancelAll( *this ); iSSSettings.Close(); - delete iProfileNotifier; + delete iActiveProfileName; delete iSwapProfileName; - if( iProfileNamePointerArray.Count() ) - { - iProfileNamePointerArray.ResetAndDestroy(); - } - + iProfileNamePointerArray.ResetAndDestroy(); + + if ( iProfileNotifier ) + { + iProfileNotifier->CancelAll(); + } + + delete iProfileNotifier; + if( iProfileEngine ) { iProfileEngine->Release(); } - - iResourceLoader.Close(); + + iResourceLoader.Close(); } + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::DetermineTimedAndSilentStatesL() +// +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::DetermineTimedAndSilentStatesL() + { + iTimed = EFalse; + iSilent = EFalse; -// --------------------------------------------------------- -// Updates profiles -// --------------------------------------------------------- + MProfileEngine* engine = CreateProfileEngineL(); + + iTimed = engine->IsActiveProfileTimedL(); + + MProfile* profile = engine->ActiveProfileLC(); + + iSilent = profile->IsSilent(); + + CleanupStack::PopAndDestroy(); // profile + + engine->Release(); + } + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::UpdateProfileNamesL() +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::UpdateProfileNamesL() { - //update active profile name - HBufC* activeProfileName = NULL; + // Update active profile name + MProEngProfile* profile( iProfileEngine->ActiveProfileLC() ); - MProfile* profile = iProfileEngine->ActiveProfileLC(); - const MProfileName& name = profile->ProfileName(); - activeProfileName = name.Name().AllocLC(); + const MProEngProfileName& name( profile->ProfileName() ); + + HBufC* activeProfileName( name.Name().AllocLC() ); SetActiveProfileNameL( *activeProfileName ); - //update profile name list - MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + // Update profile name list + MProEngProfileNameArray* profileNamesArray( + iProfileEngine->ProfileNameArrayLC() ); SetProfileNameListL( *profileNamesArray ); - //update swap profile name - HBufC* swapProfileName = NULL; + // Update swap profile name + HBufC* swapProfileName( NULL ); - TInt activeProfileId = iProfileEngine->ActiveProfileId(); + TInt activeProfileId( iProfileEngine->ActiveProfileId() ); if( activeProfileId == KSilentProfileId ) { - const MProfileName* generalProfileName = profileNamesArray->ProfileName( KGeneralProfileId ); - swapProfileName = generalProfileName->Name().AllocLC(); + TInt generalProfileIndex( + profileNamesArray->FindById( KGeneralProfileId ) ); + + if( generalProfileIndex > KErrNotFound ) + { + swapProfileName = + profileNamesArray->MdcaPoint( generalProfileIndex ).AllocLC() ; + } } else { - const MProfileName* silentProfileName = profileNamesArray->ProfileName( KSilentProfileId ); - swapProfileName = silentProfileName->Name().AllocLC(); + TInt silentProfileIndex( + profileNamesArray->FindById( KSilentProfileId ) ); + + if( silentProfileIndex > KErrNotFound ) + { + swapProfileName = + profileNamesArray->MdcaPoint( silentProfileIndex ).AllocLC() ; + } } - TPtrC swapProfileNamePtr( *swapProfileName ); - HBufC* activateProfileString = NULL; - activateProfileString = StringLoader::LoadLC( R_AI_PERS_PROF_TOGGLE, swapProfileNamePtr ); - - SetSwapProfileNameL( *activateProfileString ); + if( swapProfileName ) + { + HBufC* activateProfileString( StringLoader::LoadLC( + R_AI_PERS_PROF_TOGGLE, swapProfileName->Des() ) ); + + SetSwapProfileNameL( *activateProfileString ); + + CleanupStack::PopAndDestroy( 2 ); // swapProfileName, activateProfileString + } - CleanupStack::PopAndDestroy( 5 ); //profile, profileName, profileNamesArray, swapProfileName, activateProfileString + CleanupStack::PopAndDestroy( 3 ); //profile, profileName, profileNamesArray, } -// --------------------------------------------------------- -// Checks SIM card status -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::ShowOfflineMessageL +// +// ---------------------------------------------------------------------------- // TBool CAiProfileEngine::ShowOfflineMessageL() { - TInt result = ETrue; + TInt result( ETrue ); TInt simCardStatus( ESimNotPresent ); @@ -186,42 +262,51 @@ User::LeaveIfError( simStatus.Get( simCardStatus ) ); simStatus.Close(); - if( simCardStatus == ESimNotPresent ) + if ( simCardStatus == ESimNotPresent ) { // SIM card does not exist. - HBufC* infoNoteText = StringLoader::LoadLC( R_SU_NOTE_INSERT_SIM ); + HBufC* infoNoteText = StringLoader::LoadLC( R_SU_NOTE_INSERT_SIM_AND_RESTART ); + CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue ); note->ExecuteLD( *infoNoteText ); + CleanupStack::PopAndDestroy( infoNoteText ); + result = EFalse; } else { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + result = dlg->ExecuteLD( R_AI_LEAVE_OFFLINE_MODE_QUERY ); } return result; } - - -// --------------------------------------------------------- -// -// --------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::SetActiveProfileNameL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::SetActiveProfileNameL( const TDesC& aName ) { - HBufC* temp = aName.AllocL(); + HBufC* temp( aName.AllocL() ); + + TPtr profileNamePtr( temp->Des() ); + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + delete iActiveProfileName; iActiveProfileName = NULL; - TPtr profileNamePtr = temp->Des(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + iActiveProfileName = temp; } -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::ActiveProfileName +// +// ---------------------------------------------------------------------------- // const TDesC& CAiProfileEngine::ActiveProfileName() const { @@ -233,23 +318,29 @@ return KNullDesC(); } -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::SetSwapProfileNameL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::SetSwapProfileNameL( const TDesC& aName ) { - HBufC* temp = aName.AllocL(); - delete iSwapProfileName; + HBufC* temp( aName.AllocL() ); + + TPtr profileNamePtr( temp->Des() ); + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + + delete iSwapProfileName; iSwapProfileName = NULL; - TPtr profileNamePtr = temp->Des(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + iSwapProfileName = temp; } -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::SwapProfileName +// +// ---------------------------------------------------------------------------- // const TDesC& CAiProfileEngine::SwapProfileName() const { @@ -261,82 +352,87 @@ return KNullDesC(); } - -// --------------------------------------------------------- -// Set profile names -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::SetProfileNameListL // -void CAiProfileEngine::SetProfileNameListL( const MProfilesNamesArray& aArray ) +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::SetProfileNameListL( + const MProEngProfileNameArray& aArray ) { - if( iProfileNamePointerArray.Count() ) - { - iProfileNamePointerArray.ResetAndDestroy(); - } - - const TInt count = aArray.MdcaCount(); + iProfileNamePointerArray.ResetAndDestroy(); + + const TInt count( aArray.MdcaCount() ); + TBufC profileName; - for( TInt i = 0; i < count; i++ ) + for ( TInt i = 0; i < count; i++ ) { profileName = aArray.MdcaPoint( i ); - TPtr profileNamePtr = profileName.Des(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); - HBufC* profile = profileNamePtr.AllocLC(); - User::LeaveIfError( iProfileNamePointerArray.Append( profile )); + + TPtr profileNamePtr( profileName.Des() ); + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( + profileNamePtr ); + + HBufC* profile( profileNamePtr.AllocLC() ); + + iProfileNamePointerArray.AppendL( profile ); CleanupStack::Pop( profile ); } } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::ProfileNameByIndex +// +// ---------------------------------------------------------------------------- // const TDesC& CAiProfileEngine::ProfileNameByIndex( TInt aIndex ) const { - if( iProfileNamePointerArray.Count() ) + TInt count( iProfileNamePointerArray.Count() ); + + if( aIndex < count && aIndex >= 0 ) { - return *iProfileNamePointerArray[aIndex]; + return *iProfileNamePointerArray[ aIndex ]; } return KNullDesC(); } -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::IsActiveProfileSilentL // -TBool CAiProfileEngine::IsActiveProfileSilentL() +// ---------------------------------------------------------------------------- +// +TBool CAiProfileEngine::IsActiveProfileSilentL() const { - TBool isSilent = EFalse; - MProfile* profile = iProfileEngine->ActiveProfileLC(); - isSilent = profile->IsSilent(); - CleanupStack::PopAndDestroy(); - return isSilent; + return iSilent; } -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::IsActiveProfileTimedL // -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- // -TBool CAiProfileEngine::IsActiveProfileTimedL() - { - return iProfileEngine->IsActiveProfileTimedL(); +TBool CAiProfileEngine::IsActiveProfileTimedL() const + { + return iTimed; } -// --------------------------------------------------------- -// Number of profiles -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::NumberOfProfiles // -TInt CAiProfileEngine::NumberOfProfiles() +// ---------------------------------------------------------------------------- +// +TInt CAiProfileEngine::NumberOfProfiles() const { return iProfileNamePointerArray.Count(); } - -// --------------------------------------------------------- -// -// --------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleAiEventL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::HandleAiEventL( TInt aEvent, const TDesC& aParam ) { @@ -357,86 +453,96 @@ case EAiProfileEditActive: HandleEditActiveProfileL(); break; + default: break; } } - -// ----------------------------------------------------------------------------- -// Handles profile switch by index event -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleSwitchByIndexL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::HandleSwitchByIndexL( const TDesC& aParam ) { if ( aParam.Length() > 0 ) { - TInt profileId = KErrNotFound; + TInt index( KErrNotFound ); TPtrC ptr( aParam ); TLex lexer( ptr ); - TInt err = lexer.Val( profileId ); + TInt err( lexer.Val( index ) ); + if ( err == KErrNone ) { - MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); - const MProfileName* profileName = profileNamesArray->ProfileName( profileId ); - - if( profileName ) - { - profileId = profileName->Id(); - SetActiveProfileL( profileId ); - } + MProEngProfileNameArray* profileNamesArray( + iProfileEngine->ProfileNameArrayLC() ); + + TInt profileId( profileNamesArray->ProfileId( index ) ); + + if ( profileId != KErrNotFound ) + { + SetActiveProfileL( profileId ); + } CleanupStack::PopAndDestroy(); } } } -// ----------------------------------------------------------------------------- -// Handles profile switch by name event -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleSwitchByNameL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::HandleSwitchByNameL( const TDesC& aParam ) { if ( aParam.Length() > 0 ) - { - TInt profileId = KErrNotFound; - MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); - profileId = profileNamesArray->FindByName( aParam ); - if( profileId != KErrNotFound ) + { + MProEngProfileNameArray* profileNamesArray( + iProfileEngine->ProfileNameArrayLC() ); + + TInt index( profileNamesArray->FindByName( aParam ) ); + + if( index != KErrNotFound ) { - SetActiveProfileL( profileId ); + SetActiveProfileL( profileNamesArray->ProfileId( index ) ); } - + CleanupStack::PopAndDestroy(); } } -// ----------------------------------------------------------------------------- -// Handles profile swap event -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleSwapL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::HandleSwapL( const TDesC& aParam ) { if ( aParam.Length() > 0 ) { - TInt profileId = KErrNotFound; + TInt profileId( KErrNotFound ); TPtrC ptr( aParam ); TLex lexer( ptr ); - TInt err = lexer.Val( profileId ); + TInt err( lexer.Val( profileId ) ); + if ( err == KErrNone ) { - TInt activeProfile = iProfileEngine->ActiveProfileId(); + TInt activeProfile( iProfileEngine->ActiveProfileId() ); if( activeProfile != profileId ) { - MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + MProEngProfileNameArray* profileNamesArray( + iProfileEngine->ProfileNameArrayLC() ); + profileId = profileNamesArray->FindById( profileId ); if( profileId != KErrNotFound ) { - TRAP_IGNORE( SetActiveProfileL( profileId ) ); + SetActiveProfileL( profileId ); } CleanupStack::PopAndDestroy(); @@ -449,45 +555,51 @@ } } -// ----------------------------------------------------------------------------- -// Handles edit active profile event -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleEditActiveProfileL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::HandleEditActiveProfileL() { RWsSession ws; - User::LeaveIfError(ws.Connect()); - CleanupClosePushL(ws); + User::LeaveIfError( ws.Connect() ); + CleanupClosePushL( ws ); // Find the task with uid - TApaTaskList taskList(ws); - TApaTask task = taskList.FindApp( KUidProfileApp ); + TApaTaskList taskList( ws ); + TApaTask task( taskList.FindApp( KUidProfileApp ) ); if ( task.Exists() ) { task.EndTask(); User::After( 500000 ); } - CleanupStack::PopAndDestroy(&ws); + + CleanupStack::PopAndDestroy( &ws ); TVwsViewId viewid( KUidProfileApp, KProfileAppSettingViewId ); - TInt profileId = iProfileEngine->ActiveProfileId(); + + TInt profileId( iProfileEngine->ActiveProfileId() ); + TBuf8 buf; - buf.AppendNum(profileId); - CEikonEnv::Static()->AppUi()->ActivateViewL( viewid ,KProfileAppSettingViewId,buf); + buf.AppendNum( profileId ); - + CEikonEnv::Static()->AppUi()->ActivateViewL( + viewid, KProfileAppSettingViewId, buf ); } -// ----------------------------------------------------------------------------- -// Set active profile -// ----------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::SetActiveProfileL +// +// ---------------------------------------------------------------------------- // void CAiProfileEngine::SetActiveProfileL( const TInt aProfileId ) { - TInt activeProfileId = iProfileEngine->ActiveProfileId(); + TInt activeProfileId( iProfileEngine->ActiveProfileId() ); - if ( activeProfileId == KOfflineProfileId && aProfileId != KOfflineProfileId ) + if ( activeProfileId == KOfflineProfileId && + aProfileId != KOfflineProfileId ) { if( !ShowOfflineMessageL() ) { @@ -499,82 +611,75 @@ iProfileEngine->SetActiveProfileL( aProfileId ); } - -// --------------------------------------------------------------------------- -// Resumes the engine -// --------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::IsOffline // -void CAiProfileEngine::ResumeL() +// ---------------------------------------------------------------------------- +// +TBool CAiProfileEngine::IsOffline() const { - User::LeaveIfError( iSSSettings.Open() ); - - //Register to listen ALS activation, if ALS status changes, - //profile must be republished. - TInt err = iSSSettings.Register( ESSSettingsAls, *this ); - - if( err == KErrNotSupported || err == KErrAlreadyExists ) - { - //ALS not supported or already registered, that's fine - err = KErrNone; - } - - User::LeaveIfError( err ); - - //Start to listen profile changes. - delete iProfileNotifier; - iProfileNotifier = NULL; - - iProfileNotifier = CProfileChangeNotifyHandler::NewL( this ); - } - -// --------------------------------------------------------------------------- -// Suspends the engine -// --------------------------------------------------------------------------- -// -void CAiProfileEngine::Suspend() - { - iSSSettings.CancelAll( *this ); - iSSSettings.Close(); - delete iProfileNotifier; - iProfileNotifier = NULL; + return iProfileEngine->ActiveProfileId() == KOfflineProfileId; } -// --------------------------------------------------------------------------- -// From class MProfileChangeObserver -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CAiProfileEngine::PhoneSettingChanged // - -void CAiProfileEngine::HandleActiveProfileEventL( - TProfileEvent aProfileEvent, - TInt /*aProfileId*/ ) - { - //Profile activated or modified. - if( ( aProfileEvent == EProfileNewActiveProfile ) || - ( aProfileEvent == EProfileActiveProfileModified ) ) - { - UpdateProfileNamesL(); - iProfilePluginNotifier->NotifyContentUpdate(); - } - } - -// --------------------------------------------------------------------------- -// From class MSSSettingsObserver. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // -void CAiProfileEngine::PhoneSettingChanged( - TSSSettingsSetting aSetting, - TInt /*aNewValue*/ ) +void CAiProfileEngine::PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt /*aNewValue*/ ) { if( aSetting == ESSSettingsAls ) { - TRAP_IGNORE( UpdateProfileNamesL() ); - iProfilePluginNotifier->NotifyContentUpdate(); + NotifyContentUpdate(); } } +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleActiveProfileModifiedL +// +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleActiveProfileModifiedL() + { + DetermineTimedAndSilentStatesL(); + + NotifyContentUpdate(); + } -TBool CAiProfileEngine::IsOffline() - { - return iProfileEngine->ActiveProfileId() == KOfflineProfileId; - } +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleProfileNameArrayModificationL +// +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleProfileNameArrayModificationL() + { + NotifyContentUpdate(); + } +// ---------------------------------------------------------------------------- +// CAiProfileEngine::HandleProfileActivatedL +// +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleProfileActivatedL( TInt /*aProfileId*/ ) + { + DetermineTimedAndSilentStatesL(); + + NotifyContentUpdate(); + } + +// ---------------------------------------------------------------------------- +// CAiProfileEngine::NotifyContentUpdate +// +// ---------------------------------------------------------------------------- +// +void CAiProfileEngine::NotifyContentUpdate() + { + TRAP_IGNORE( UpdateProfileNamesL() ); + + iProfilePluginNotifier->NotifyContentUpdate(); + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/profileplugin/src/caiprofileplugin.cpp --- a/idlefw/plugins/profileplugin/src/caiprofileplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/profileplugin/src/caiprofileplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,25 +15,28 @@ * */ - +// System includes #include #include -#include -#include #include #include +// User includes +#include +#include +#include + #include "aiprofileplugincontentmodel.h" -#include #include "caiprofileplugin.h" #include "caiprofileengine.h" #include "aipluginsettings.h" +// Constants + // PUA code for the timed profile, missing from PUAcodes.hrh #define KAiTimedProfilePUA 0xF815 #define KAiRTL 0x200F -// CONST CLASS VARIABLES const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY( KImplUidProfilePlugin, CAiProfilePlugin::NewL ) @@ -42,14 +45,14 @@ // ======== LOCAL FUNCTIONS ======== // ======== MEMBER FUNCTIONS ======== - // --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave +// CAiProfilePlugin::NewL +// // --------------------------------------------------------------------------- // CAiProfilePlugin* CAiProfilePlugin::NewL() { - CAiProfilePlugin* self = new (ELeave) CAiProfilePlugin; + CAiProfilePlugin* self = new ( ELeave ) CAiProfilePlugin; CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -58,7 +61,8 @@ } // --------------------------------------------------------------------------- -// Default constructor +// CAiProfilePlugin::CAiProfilePlugin() +// // --------------------------------------------------------------------------- // CAiProfilePlugin::CAiProfilePlugin() @@ -66,39 +70,46 @@ } // --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave +// CAiProfilePlugin::ConstructL +// // --------------------------------------------------------------------------- // void CAiProfilePlugin::ConstructL() { - iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; - - iContent = AiUtility::CreateContentItemArrayIteratorL( KAiProfileContent ); - iEvents = AiUtility::CreateContentItemArrayIteratorL( KAiProfileEvents ); - iResources = AiUtility::CreateContentItemArrayIteratorL( KAiProfileResources ); + iContent = + AiUtility::CreateContentItemArrayIteratorL( KAiProfileContent ); + + iEvents = + AiUtility::CreateContentItemArrayIteratorL( KAiProfileEvents ); - iIsUpdated = ETrue; - iAlive = EFalse; + iResources = + AiUtility::CreateContentItemArrayIteratorL( KAiProfileResources ); + + iEngine = CAiProfileEngine::NewL( this ); + + iEngine->UpdateProfileNamesL(); } // --------------------------------------------------------------------------- -// Destructor +// CAiProfilePlugin::~CAiProfilePlugin // Deletes all data created to heap // --------------------------------------------------------------------------- // CAiProfilePlugin::~CAiProfilePlugin() - { - CleanPublishedProfileNames(); + { Release( iContent ); Release( iEvents ); - Release( iResources ); + Release( iResources ); + delete iActiveProfileAndChar; delete iPreviousProfileNameAndChar; delete iEngine; + iObservers.Close(); } // --------------------------------------------------------------------------- +// CAiProfilePlugin::PublishL // Publishes the profiles // --------------------------------------------------------------------------- // @@ -106,12 +117,14 @@ { TInt err( KErrNone ); TInt observers( iObservers.Count() ); - TInt transactionId = reinterpret_cast( this ); + TInt transactionId ( reinterpret_cast( this ) ); iCurrentCount = iEngine->NumberOfProfiles(); - for ( int i = 0; i < observers; i++ ) + + for ( TInt i = 0; i < observers; i++ ) { - MAiContentObserver* observer = iObservers[i]; + MAiContentObserver* observer( iObservers[i] ); + err = observer->StartTransaction( transactionId ); if ( err == KErrNotSupported ) @@ -130,11 +143,12 @@ { delete iActiveProfileAndChar; iActiveProfileAndChar = NULL; + // silent/non-silent icon + timed icon + space + possible RTL*2 = 5 - TInt maxChars = iEngine->ActiveProfileName().Length() + 5; + TInt maxChars( iEngine->ActiveProfileName().Length() + 5 ); iActiveProfileAndChar = HBufC::NewL( maxChars ); - TPtr profileNamePtr = iActiveProfileAndChar->Des(); + TPtr profileNamePtr( iActiveProfileAndChar->Des() ); if( AknLayoutUtils::LayoutMirrored() ) { @@ -145,7 +159,8 @@ { profileNamePtr.Append( KAiTimedProfilePUA ); } - if( iEngine->IsActiveProfileSilentL() ) + + if ( iEngine->IsActiveProfileSilentL() ) { profileNamePtr.Append( KPuaCodeSilentSymbol ); } @@ -153,10 +168,12 @@ { profileNamePtr.Append( KPuaCodeAprofSound ); } - _LIT( KSpace, " " ); + + _LIT( KSpace, " " ); + profileNamePtr.Append( KSpace ); - if( AknLayoutUtils::LayoutMirrored() ) + if ( AknLayoutUtils::LayoutMirrored() ) { profileNamePtr.Append( KAiRTL ); } @@ -184,13 +201,14 @@ // clean profiles that are already deleted. // Cleans the array blindly from the end, because in the next // step all the profiles are republished - if( iPreviousCount > iCurrentCount ) + if ( iPreviousCount > iCurrentCount ) { for( TInt k = iCurrentCount; k < iPreviousCount; k++ ) { observer->Clean( *this, EAiProfileContentProfileName, k + 1 ); } } + for ( TInt j = 0; j < iCurrentCount; j++ ) { if ( observer->CanPublish( *this, EAiProfileContentProfileName, j + 1 ) ) @@ -206,6 +224,7 @@ { TBuf<1> silent; // one character silent.Append( KPuaCodeSilentSymbol ); + observer->Publish( *this, EAiProfileActiveProfileSilentChar, silent, EAiProfileActiveProfileSilentChar ); } else @@ -220,7 +239,8 @@ observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileSilentIconResource ); observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileGeneralIconResource ); observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileTimedIconResource ); - if ( iEngine->IsActiveProfileTimedL() ) + + if ( iEngine->IsActiveProfileTimedL() ) { observer->Publish( *this, EAiProfileActiveProfileIcon, @@ -250,9 +270,11 @@ observer->Clean( *this, EAiProfileActiveProfileSilentChar, EAiProfileActiveProfileSilentChar ); observer->Clean( *this, EAiProfileActiveProfileIcon, 1 ); observer->Clean( *this, EAiProfileActiveProfileIcon, 2 ); - // uncomment also this and respective policy lines in profiles.xml if whole widget needs to be hidden in AI3 + + // uncomment also this and respective policy lines in profiles.xml if whole widget needs to be hidden in AI3 //observer->Clean( *this, EAiProfileContentActiveProfileName, EAiProfileContentActiveProfileName ); } + if ( err == KErrNone ) { err = observer->Commit( transactionId ); @@ -261,238 +283,156 @@ { return; } - } - - iIsUpdated = EFalse; + } } + iPreviousCount = iCurrentCount; } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is requested to unload its engines due backup operation +// CAiProfilePlugin::Start +// // --------------------------------------------------------------------------- // -void CAiProfilePlugin::Stop( TAiTransitionReason /*aReason*/ ) - { - FreeEngine(); +void CAiProfilePlugin::Start( TStartReason /*aReason*/ ) + { + iPublishRequired = ETrue; + } + +// --------------------------------------------------------------------------- +// CAiProfilePlugin::Stop +// +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::Stop( TStopReason /*aReason*/ ) + { + CleanPublishedProfileNames(); } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is allowed to consume CPU resources +// CAiProfilePlugin::Resume +// // --------------------------------------------------------------------------- // -void CAiProfilePlugin::Resume( TAiTransitionReason aReason ) +void CAiProfilePlugin::Resume( TResumeReason aReason ) { - TRAP_IGNORE( DoResumeL( aReason ) ); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is not allowed to consume CPU resources -// --------------------------------------------------------------------------- -// -void CAiProfilePlugin::Suspend( TAiTransitionReason /*aReason*/ ) - { - if ( iEngine && iAlive ) + if ( aReason == EForeground ) { - iEngine->Suspend(); + TRAP_IGNORE( DoResumeL() ); } - - iAlive = EFalse; } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// The plug-in MUST maintain a registry of subscribers and send -// notification to all of them whenever the state changes or new content -// is available +// CAiProfilePlugin::Suspend +// +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::Suspend( TSuspendReason /*aReason*/ ) + { + } + +// --------------------------------------------------------------------------- +// CAiProfilePlugin::SubscribeL +// // --------------------------------------------------------------------------- // void CAiProfilePlugin::SubscribeL( MAiContentObserver& aObserver ) - { + { iObservers.AppendL( &aObserver ); } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-ins take ownership of the settings array, so it must either -// store it in a member or free it. -// --------------------------------------------------------------------------- -// -void CAiProfilePlugin::ConfigureL( RAiSettingsItemArray& aSettings ) - { - aSettings.ResetAndDestroy(); - } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Returns the extension interface. Actual type depends on the passed -// aUid argument. +// CAiProfilePlugin::ConfigureL +// // --------------------------------------------------------------------------- // -TAny* CAiProfilePlugin::Extension( TUid aUid ) +void CAiProfilePlugin::ConfigureL( RAiSettingsItemArray& /*aSettings*/ ) { - if (aUid == KExtensionUidProperty) - { - return static_cast(this); - } - else if (aUid == KExtensionUidEventHandler) - { - return static_cast(this); - } - else - { - return NULL; - } } // --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Read property of publisher plug-in. +// CAiProfilePlugin::GetProperty +// // --------------------------------------------------------------------------- // -TAny* CAiProfilePlugin::GetPropertyL( TInt aProperty ) +TAny* CAiProfilePlugin::GetProperty( TProperty aProperty ) { - TAny* property = NULL; - - switch ( aProperty ) - { - case EAiPublisherInfo: - { - property = static_cast( &iInfo ); - break; - } - - case EAiPublisherContent: + if ( aProperty == EPublisherContent ) { - property = static_cast( iContent ); - break; - } - - case EAiPublisherEvents: + return static_cast< MAiContentItemIterator* >( iContent ); + } + else if ( aProperty == EPublisherEvents ) { - property = static_cast( iEvents ); - break; + return static_cast< MAiContentItemIterator* >( iEvents ); } - - case EAiPublisherResources: - property = static_cast( iResources ); - break; - - default: - break; + else if ( aProperty == EPublisherResources ) + { + return static_cast< MAiContentItemIterator* >( iResources ); } - return property; + return NULL; } // --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Write property value to optimize the content model. +// CAiProfilePlugin::HandleEvent +// // --------------------------------------------------------------------------- // -void CAiProfilePlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - { - if( aProperty == EAiPublisherInfo ) +void CAiProfilePlugin::HandleEvent( TInt aEvent, const TDesC& aParam ) + { + TRAP_IGNORE( iEngine->HandleAiEventL( aEvent, aParam ) ); + } + +// --------------------------------------------------------------------------- +// CAiProfilePlugin::DoResumeL +// +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::DoResumeL() + { + if ( iPublishRequired ) { - ASSERT( aValue ); + iPublishRequired = EFalse; - const TAiPublisherInfo* info( - static_cast( aValue ) ); - - iInfo = *info; + PublishL(); } } // --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. +// CAiProfilePlugin::NotifyContentUpdate() +// This method is called from the engine, when the profile data has changed // --------------------------------------------------------------------------- // -void CAiProfilePlugin::HandleEvent(TInt aEvent, const TDesC& aParam) - { - if ( iEngine ) - { - // We have no way of reporting errors to framework so just ignore them. - TRAP_IGNORE( iEngine->HandleAiEventL( aEvent, aParam ) ); - } - } +void CAiProfilePlugin::NotifyContentUpdate() + { + iPublishRequired = ETrue; -// --------------------------------------------------------- -// This method is called from the engine, when the profile -// data content has been changed. Method call is made through -// the MAiProfilePluginNotifier interface. -// --------------------------------------------------------- -// -void CAiProfilePlugin::NotifyContentUpdate() - { - iIsUpdated = ETrue; - - TRAP_IGNORE( PublishL() ); + TRAP_IGNORE( DoResumeL() ); } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// framework instructs plug-in that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- -// -void CAiProfilePlugin::DoResumeL( TAiTransitionReason aReason ) - { - if ( !iEngine ) - { - iEngine = CAiProfileEngine::NewL( this ); - } - - //update in startup phase and idle is on foreground. - if( aReason != EAiBacklightOff && aReason != EAiIdleBackground ) - { - // force republish in case layout has changed - if ( aReason == EAiScreenLayoutChanged ) - { - delete iPreviousProfileNameAndChar; - iPreviousProfileNameAndChar = NULL; - } - - if ( !iAlive ) - { - iEngine->ResumeL(); - } - - iEngine->UpdateProfileNamesL(); - - PublishL(); - iAlive = ETrue; - } - } - -// --------------------------------------------------------------------------- -// Frees engine resources -// --------------------------------------------------------------------------- -// -void CAiProfilePlugin::FreeEngine() - { - delete iEngine; - iEngine = NULL; - iAlive = EFalse; - } - -// --------------------------------------------------------------------------- +// CAiProfilePlugin::CleanPublishedProfileNames // Clean profile names from content // --------------------------------------------------------------------------- // void CAiProfilePlugin::CleanPublishedProfileNames() { TInt obsCount( iObservers.Count() ); + for ( TInt i( 0 ); i < obsCount; i++ ) { - MAiContentObserver* observer = iObservers[i]; - for( TInt j( 0 ); j < iCurrentCount && observer; j++ ) + MAiContentObserver* observer( iObservers[i] ); + + for ( TInt j( 0 ); j < iCurrentCount && observer; j++ ) { observer->Clean( *this, EAiProfileContentProfileName, j + 1 ); } } + + delete iPreviousProfileNameAndChar; + iPreviousProfileNameAndChar = NULL; + + iPreviousCount = 0; } // ======== GLOBAL FUNCTIONS ======== @@ -505,5 +445,6 @@ { aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); + return KImplementationTable; } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidleplugin.rss --- a/idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidleplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM plugin resource file for Active Idle Skinning plugin. -* -*/ - - -#include -#include "pslnactiveidlepluginuids.h" - -RESOURCE REGISTRY_INFO theInfo -{ - dll_uid = KPslnActiveIdlePluginDllUID3; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KPslnPluginInterfaceUID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KPslnActiveIdlePluginImplementationUID; - version_no = 1; - display_name = "Psln AI Plugin"; - default_data = "0"; - opaque_data = "0"; - } - }; - } - , - INTERFACE_INFO - { - interface_uid = KGSPluginInterfaceUID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KGSActiveIdlePluginImplementationUID; - version_no = 1; - display_name = "GS AI Plugin"; - default_data = "0x1020743F"; // parent uid: Standby plugin - opaque_data = "11"; // Order number - } - }; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidlepluginrsc.rss --- a/idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidlepluginrsc.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource file for PslnActiveIdlePlugin. -* -*/ - - -// ========== RESOURCE IDENTIFIER ============================================= - -NAME PSAI // 4 letter ID - -#include // Avkon localized strings -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -// ========== RESOURCE DEFINITIONS ============================================ - -RESOURCE RSS_SIGNATURE -{ -} - -RESOURCE TBUF -{ - buf = ""; -} - -// ---------------------------------------------------------------------------- -// -// Active Idle application specific view. -// -// ---------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_psln_active_idle_view -{ - menubar = r_psln_ai_view_menubar; - //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; - cba = r_softkeys_options_back_empty; -} - -// ---------------------------------------------------------------------------- -// -// Options menu with 'Download', 'Activate', 'Help' and 'Exit' items. -// -// ---------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_psln_ai_view_menubar -{ - titles = - { - MENU_TITLE { menu_pane = r_psln_ai_basic_menupane; }, - MENU_TITLE { menu_pane = R_PSLN_GEN_VIEW_MENUPANE; } - }; -} - -// ---------------------------------------------------------------------------- -// -// Menu pane for view. -// -// ---------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_psln_ai_basic_menupane -{ - items = - { -#ifdef __SERIES60_HELP - MENU_ITEM - { - command = EPslnCmdAppHelp; - txt = qtn_options_help; - }, -#endif // __SERIES60_HELP - MENU_ITEM - { - command = EAknCmdExit; - txt = qtn_options_exit; - } - }; -} - -// ---------------------------------------------------------------------------- -// -// Shortcuts view caption for plugin. max 128 -// -// ---------------------------------------------------------------------------- -// -RESOURCE TBUF r_psln_ai_list_view_caption -{ - buf = qtn_apps_idle_skin_gs; -} - -// ---------------------------------------------------------------------------- -// -// Active Idle specific skin tab title. max 128 -// -// ---------------------------------------------------------------------------- -// -RESOURCE TBUF r_psln_ai_tab_name -{ - buf = qtn_skins_tabs_activeidle; -} - -// ---------------------------------------------------------------------------- -// -// View title for GS Active Idle plugin. -// -// ---------------------------------------------------------------------------- -// -RESOURCE TITLE_PANE r_psln_gs_list_view_title -{ - txt = qtn_apps_idle_skin_gs; -} - -// ---------------------------------------------------------------------------- -// -// View caption for GS Active Idle plugin. max 256 -// -// ---------------------------------------------------------------------------- -// -RESOURCE TBUF r_psln_gs_list_view_caption -{ - buf = qtn_apps_idle_skin_gs; -} - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -RESOURCE CBA r_softkeys_options_back_empty -{ - buttons = - { - CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON {id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON {id = EPslnCmdAppActivate; txt = ""; } - }; -} - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- -// -RESOURCE CBA r_softkeys_options_exit_empty -{ - buttons = - { - CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON {id = EAknSoftkeyExit; txt = text_softkey_exit; }, - CBA_BUTTON {id = EPslnCmdAppActivate; txt = ""; } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/group/bld.inf --- a/idlefw/plugins/pslnactiveidleplugin/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file provides the information required for building -* PslnActiveIdlePlugin. -* -*/ - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -#include -../loc/pslnactiveidle3plugin.loc MW_LAYER_LOC_EXPORT_PATH(pslnactiveidle3plugin.loc) - -//../rom/pslnactiveidleplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(pslnactiveidleplugin_resources.iby) -//../rom/pslnactiveidleplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(pslnactiveidleplugin.iby) - - - - -PRJ_MMPFILES -pslnactiveidleplugin.mmp - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE pslnactiveidleplugin.mif -OPTION HEADERFILE pslnactiveidleplugin.mbg -OPTION SOURCES \ - -c8,8 qgn_prop_psln_ai_sub -END - -PRJ_TESTMMPFILES - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidleplugin.mmp --- a/idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidleplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project specification file. -* -*/ - - -#include -#include // For RESOURCE_FILES_DIR -#include "../inc/pslnactiveidlepluginuids.h" - -//MACRO MY_DEBUG - -TARGET pslnactiveidleplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KPslnActiveIdlePluginDllUID3 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE pslnactiveidlepluginimplementationtable.cpp -SOURCE pslnactiveidleplugincontainer.cpp -SOURCE pslnactiveidlepluginengine.cpp -SOURCE pslnactiveidleplugin.cpp -SOURCE gsactiveidleplugincontainer.cpp -SOURCE gsactiveidleplugin.cpp - -USERINCLUDE ../inc -USERINCLUDE ../loc -USERINCLUDE ../data // For *.rh - -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom - -SOURCEPATH ../data - -START RESOURCE pslnactiveidleplugin.rss -TARGET pslnactiveidleplugin.rsc -END - -START RESOURCE pslnactiveidlepluginrsc.rss -DEPENDS pslncommon.rsg -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -LIBRARY apgrfx.lib -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY efsrv.lib -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY cone.lib -LIBRARY eikcoctl.lib -LIBRARY eikcore.lib -LIBRARY centralrepository.lib - -LIBRARY commonengine.lib // For RConeResourceLoader -LIBRARY aknskins.lib // For enhanced skinning -LIBRARY aknnotify.lib // Global note -LIBRARY featmgr.lib // For feature manager - -LIBRARY pslnframework.lib // For Psln FW base classes -LIBRARY xn3odt.lib // For XUIKON - -LIBRARY gsframework.lib // For GS FW base classes -LIBRARY gsecomplugin.lib - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidlepluginicons.mk --- a/idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidlepluginicons.mk Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -# -# Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - -TARGETDIR=$(ZDIR)\resource\apps -HEADERDIR=\epoc32\include -ICONTARGETFILENAME=$(TARGETDIR)\pslnactiveidleplugin.mif -HEADERFILENAME=$(HEADERDIR)\pslnactiveidleplugin.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,8 qgn_prop_psln_ai_sub.svg - - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugin.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Psln Active Idle settings plugin. -* -*/ - - -#ifndef C_GSACTIVEIDLEPLUGIN_H -#define C_GSACTIVEIDLEPLUGIN_H - -#include -#include - -class CGSActiveIdlePluginContainer; -class CPslnFWPluginInterface; -class CPslnFWPluginHandler; - - -/** - * CGSActiveIdlePlugin view class for Psln Active Idle settings. - * @since S60 3.2 - * - */ -class CGSActiveIdlePlugin : public CGSPluginInterface -{ - -public: // Constructors and destructor - - /** - * Symbian OS two-phased constructor - * - * @param aInitParams param not used. - * @return GS connection view. - */ - static CGSActiveIdlePlugin* NewL(TAny* aInitParams); - - /** - * Destructor - */ - ~CGSActiveIdlePlugin(); - -// From CGSPluginInterface - - /** - * @see CGSPluginInterface header file. - */ - void GetCaptionL(TDes& aCaption) const; - - /** - * @see CGSPluginInterface header file. - */ - TInt PluginProviderCategory() const; - - /** - * @see CGSPluginInterface header file. - */ - TBool Visible() const; - -// from base classes - - /** - * Returns view id. - * @return TUid - */ - TUid Id() const; - - /** - * Handles commands. - * @param aCommand Command to be handled. - * - */ - void HandleCommandL(TInt aCommand); - -protected: // From CAknView - - /** - * @see CAknView. - */ - void DoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage); - - /** - * @see CAknView. - */ - void DoDeactivate(); - -// Construction - - /** - * C++ default constructor. - */ - CGSActiveIdlePlugin(); - - /** - * Symbian OS default constructor. - * - */ - void ConstructL(); - -private: // data - - /// Resource loader. - RConeResourceLoader iResourceLoader; - - /// Container. Owned. - CGSActiveIdlePluginContainer* iContainer; - - /// Previous view id. - TVwsViewId iPrevViewId; - - /// Plugin loader. Owned. - CPslnFWPluginHandler* iPluginLoader; - -}; - -#endif // C_GSACTIVEIDLEPLUGIN_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugincontainer.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugincontainer.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Psln Active Idle settings plugin. -* -*/ - - -#ifndef C_GSACTIVEIDLEPLUGINCONTAINER_H -#define C_GSACTIVEIDLEPLUGINCONTAINER_H - -#include - -/** - * CGSActiveIdlePluginContainer container class - * - * @since S60 3.2 - */ -class CGSActiveIdlePluginContainer : public CCoeControl -{ -public: // Constructors and destructor - - /** - * Symbian OS constructor. - * @param aRect Listbox's rect. - * - */ - void ConstructL(const TRect& aRect); - - ~CGSActiveIdlePluginContainer(); - - CGSActiveIdlePluginContainer(); - -// From CCoeControl - - TInt CountComponentControls() const; - - CCoeControl* ComponentControl(TInt aIndex) const; - - void SizeChanged(); - -}; - -#endif // C_GSACTIVEIDLEPLUGINCONTAINER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View for Active Idle skinning. -* -*/ - - -#ifndef C_PSLNACTIVEIDLEPLUGIN_H -#define C_PSLNACTIVEIDLEPLUGIN_H - -#include -#include -#include -#include -#include - - -class CAknViewAppUi; -class CPslnActiveIdlePluginContainer; -class CPslnActiveIdlePluginEngine; - -enum TAiUIControllers -{ - EAiUICUnknown = -1, - EAiUICNative = 0, - EAiUICXML -}; - -// View item text length -const TInt KPslnItemMaxTextLength = 128; - - -/** - * CPslnActiveIdlePlugin view class for Active Idle Theme settings - * - * @since S60 3.2 - */ -class CPslnActiveIdlePlugin : - public CPslnFWBaseView, - public MPslnFWMSKObserver -{ -public: // Constructors and destructor - - /** - * Symbian OS two-phased constructor - * - * @param aAppUi pointer to app ui, TAny static cast'd. - * @return Psln AI skinning view. - */ - static CPslnActiveIdlePlugin* NewL(TAny* aAppUi); - - /** - * Destructor - */ - ~CPslnActiveIdlePlugin(); - -// From CPslnFWnInterface - - /** - * @see CPslnFWPluginInterface. - */ - void GetCaptionL(TDes& aCaption) const; - - - /** - * @see CPslnFWPluginInterface. - */ - void GetTabTextL(TDes& aCaption) const; - - /** - * @see CPslnFWPluginInterface. - */ - CGulIcon* CreateIconL(); - - /** - * @see CPslnFWPluginInterface. - */ - void GetLocationTypeAndIndex(TPslnFWLocationType& aType, TInt& aIndex) const; - -// from AknView - - /** - * Returns view id. - * @return TUid - */ - TUid Id() const; - - /** - * Handles commands. - * @param aCommand Command to be handled. - */ - void HandleCommandL(TInt aCommand); - -// new methods - - /** - * Get CPslnActiveIdlePlugin's ccontainer. - * @return pointer to container. - */ - CPslnActiveIdlePluginContainer* Container(); - - /** - * From MPslnFWMSKObserver. - * Checks if the MSK label needs to be adjusted. - */ - void CheckMiddleSoftkeyLabelL(); - - /** - * Return engine instance. - */ - CPslnActiveIdlePluginEngine* Engine(); - -protected: // From CAknView - - void DoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage); - - void DoDeactivate(); - -// Construction - - CPslnActiveIdlePlugin(CAknViewAppUi* aAppUi); - - void ConstructL(); - -private: // From MEikMenuObserver - - /** - * Changes MenuPane dynamically - */ - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); - -// from CPslnFWBaseView - - void NewContainerL(); - - void HandleListBoxSelectionL(); - - /** - * Remove command and label from MSK - */ - void RemoveCommandFromMSK(); - - /** - * @see CPslnFWBaseView. - */ - void SetTitlePaneL( TInt& aResourceId ); - -private: // data - - /// Resource loader for own resources. - RConeResourceLoader iResourceLoader; - - /// Resource loader for common psln resources. - RConeResourceLoader iResourceLoaderCommon; - - /// Resource loader for Psln app resources. - RConeResourceLoader iResourceLoaderPsln; - - /// Application UI pointer. Not owned. - CAknViewAppUi* iAppUi; - - /// Navi pane. Not owned. - CAknNavigationDecorator* iNaviPaneContext; - - /// Ai2 perso engine - CPslnActiveIdlePluginEngine* iEngine; - -}; - -#endif // C_PSLNACTIVEIDLEPLUGIN_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.hrh --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.hrh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains common definitions for menu id:s. -* -*/ - - -#ifndef INC_PSLNACTIVEIDLEPLUGIN_HRH -#define INC_PSLNACTIVEIDLEPLUGIN_HRH - -// commands -enum TPslnAIMenuCommands - { - EPslnAICmdAppOpen = 1, - EPslnAICmdAppHelp, - EPslnAICmdAppChange, - EPslnAIAppCmdChange - }; - -#endif // INC_PSLNACTIVEIDLEPLUGIN_HRH - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugincontainer.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugincontainer.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for Application shell theme view. -* -*/ - - -#ifndef C_PSLNACTIVEIDLEPLUGINCONTAINER_H -#define C_PSLNACTIVEIDLEPLUGINCONTAINER_H - -// INCLUDES -#include - -// CONSTANTS -// Download item index -const TInt KPslnDownloadItemIndex = 0; -// View item text length -const TInt KPslnAsItemMaxTextLength = 128; - -// FORWARD DECLARATION -class CXnODT; -class CPslnActiveIdlePlugin; - -// CLASS DECLARATION - -/** -* CPslnActiveIdlePluginContainer container class -* @since S60 v3.1 -*/ -NONSHARABLE_CLASS( CPslnActiveIdlePluginContainer ) : - public CPslnFWBaseContainer - { - public: - - CPslnActiveIdlePluginContainer( - TBool aGSCalling, - CPslnActiveIdlePlugin* aPlugin); - /** - * Symbian OS constructor. - * @param aRect Listbox's rect. - */ - void ConstructL( const TRect& aRect ); - - /** - * Destructor. - */ - ~CPslnActiveIdlePluginContainer(); - - /** - * Return currently active selection from list. - * @return currently selected skin index from list view. - */ - TInt GetCurrentlySelectedIndex() const; - - /** - * Adds new item to the listbox. - * @param aItemIndex index to add. - * @param ODT of the theme to add. - * @since 3.2 - */ - void AddNewItemToListL( - const TInt aItemIndex, - CXnODT* aSkinODT, TInt aUiController ); - - /* - * Removes number of themes from listbox. - * @param aDeleteFrom start point index where to start deleting. - * All themes from this on are deleted. - * @since 3.2 - */ - void RemoveThemes( const TInt aDeleteFrom ); - - /** - * Method for telling to update the listing. - */ - void RefreshList(); - - private: - - /* From CPslnFWBaseContainer. */ - void ConstructListBoxL( TInt aResLbxId ); - - /** - * Required for help. - */ - void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * Adds icons to setting item list. - */ - void AddIconsToListL(); - - private: // data - - /** - * Listbox array for items. - * Not own. - */ - CDesCArray* iItemArray; - - /** - * List of items from resources. - * Own. - */ - CDesCArrayFlat* iItems; - - /** - * Index of currently selected item. - */ - TInt iCurrentlySelected; - - /** - * Pointer to psln plugin. - * Not own. - */ - CPslnActiveIdlePlugin* iPlugin; - - /** - * Indicate if gs started us - */ - TBool iGSCalling; - - }; - -#endif //C_PSLNACTIVEIDLEPLUGINCONTAINER_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginengine.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginengine.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for Psln Active Idle settings view. -* -*/ - -#ifndef C_PSLNACTIVEIDLEPLUGINENGINE_H -#define C_PSLNACTIVEIDLEPLUGINENGINE_H - -#include -#include - -// UID of Active Idle. -const TUid KUidActiveIdle = { 0x102750F0 }; - - -class CPslnFWAppThemeHandler; -class CXnODT; -class CPslnActiveIdlePlugin; // for notifying MSK chech need -class CPeriodic; - - -/** - * CPslnActiveIdlePluginEngine container class - * - * @since S60 3.2 - */ -class CPslnActiveIdlePluginEngine : - public CBase, - public MPslnFWAppThemeObserver -{ -public: // Constructors and destructor - - void ConstructL(const TRect& aRect); - - CPslnActiveIdlePluginEngine(CPslnActiveIdlePlugin* aPlugin); - - ~CPslnActiveIdlePluginEngine(); - -// new methods - - /** - * Activates currently highlighted theme. - */ - void ActivateThemeL(); - -// from MPslnFWAppThemeObserver - - void HandleMessage(TXnServiceCompletedMessage aMessage); - - void HandleMessage( - TXnServiceCompletedMessage aMessage, - CArrayPtrFlat& aAppThemeList); - - TInt CurrentUIController() - { - return iCurrentUIController; - }; - - void AddThemesToContainerL(); - - void ManualGetSkinsRestartL(TBool aForceStart = EFalse); - -private: // new methods - - /** - * Adds new theme(s) to the listbox. Multiple themes are - * only added when list updation is required (icons need - * to be updated). Otherwise latest theme info is inquired - * from XUIKON. - */ - void AddNewThemeL(TXnServiceCompletedMessage aMessage); - TInt GetExtStandbyScreenState(TInt& aValue); - - /** - * Add HS items to list. - */ - void AddHomeScreenThemesL(); - - void CheckCurrentUIControllerL(); - - void CheckCurrentAi1PluginL(); - - void UpdateUIControllersInCenrepL(TInt aControllerId); - - void UpdateStatusPaneVisibilityCenrepL(TBool aPaneHidden); - - void UpdateAi1PluginLoadCenrepL(TInt aNewUid); - - TInt RestartAifw(); - - TBool IsAiRunning(); - - void UiTimerRestart(); - -private: - - static TInt RestartTimerCallback( TAny* aSelf ); - - static TInt UiRefreshTimerCallback( TAny* aSelf ); - -private: // data - - /** - * Application specific skin handler. - * Own. - */ - CPslnFWAppThemeHandler* iPslnFWThemeHandler; - - /** - * List of themes. Each theme is described within an ODT. - * Own. - */ - CArrayPtrFlat* iMySkinList; - - /** - * Indicates that skin list should be updated. - */ - TBool iThemeListUpdated; - - /** - * HomeScreen items start index in iMySkinList. - */ - TInt iHSStartIndex; - - /** - * HomeScreen items end index in iMySkinList. - */ - TInt iHSEndIndex; - - /** - * Flag to indicate if we are avaiting the first restart event. - */ - TBool iFirstUpdateRound; - - /** - * Flag to indicate if we have injected first round data. - */ - TBool iFirstUpdateRoundInjected; - - /** - * Current AI2 UI Controller id. - */ - TInt iCurrentUIController; - - /** - * Current AI1 plugin id. - */ - TInt iCurrentAi1Plugin; - - /** - * Flag to indicate if we have injected first round data. - * Not owned. - */ - CPslnActiveIdlePlugin* iPlugin; - - /** - * Restart timer. To restart AI2. - * Own. - */ - CPeriodic* iRestartTimer; - - /** - * UI Refresh timer. - * Own. - */ - CPeriodic* iUiRefreshTimer; - - /** - * Restart timer. To restart AI2. - * Own. - */ - TInt iRestartRetryCount; - - /** - * Kepp track what has been added to list. - * Own. - */ - TInt iAddIndex; - -}; - -#endif // C_PSLNACTIVEIDLEPLUGINENGINE_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginuids.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginuids.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Uid's of Psln Active Idle settings. -* -*/ - - -#ifndef INC_PSLNACTIVEIDLEPLUGINUIDS_H -#define INC_PSLNACTIVEIDLEPLUGINUIDS_H - -// ======================= -// Psln Active Idle plugin -// ======================= - -// PslnActiveIdlePlugin DLL UID -#define KPslnActiveIdlePluginDllUID3 0x102750A4 - -// PslnActiveIdlePlugin Interface UID -#define KPslnPluginInterfaceUID 0x102750A9 - -// PslnActiveIdlePlugin Implementation UID -#define KPslnActiveIdlePluginImplementationUID 0x102750A7 - -// ============================== -// GS Active Idle Settings plugin -// ============================== - -// GS Plugin interface uid -#define KGSPluginInterfaceUID 0x10207236 - -// GSActiveIdlePlugin Implementation UID -#define KGSActiveIdlePluginImplementationUID 0x102750F5 - -#endif // INC_PSLNACTIVEIDLEPLUGINUIDS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/inc/pslnconst.h --- a/idlefw/plugins/pslnactiveidleplugin/inc/pslnconst.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Constants for psln plugin. -* -*/ - -#ifndef INC_PSLNCONST_H -#define INC_PSLNCONST_H - -// (from psln\inc\pslnconst.h, required by pslnmodel.h) -// Maximum number of characters in Screen saver txt. -const TInt KPslnMaxNumberOfScreenSaverText = 15; - -#endif // INC_PSLNCONST_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/loc/pslnactiveidle3plugin.loc --- a/idlefw/plugins/pslnactiveidleplugin/loc/pslnactiveidle3plugin.loc Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for PslnActiveIdlePlugin. -* -*/ - - -// LOCALISATION STRINGS - -// d:Text of a list item in home screens settings list -// d:Item opens home screen theme settings -// l:list_single_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_idle_skin_gs "Change Idle theme" - -// d:Text of a list item for home screen app in Themes selection list -// d:Item opens home screen theme settings -// l:list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_idle_skin_hs "Change Idle theme" - -// d:Title of home screen theme settings view. -// d: -// l:title_pane_t2/opt9 -// w: -// r: 3.2 -// -#define qtn_apps_idle_skin_title "Change Idle theme" - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin.iby --- a/idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin.iby Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project pslnactiveidleplugin -* -*/ - - -#ifndef PSLNACTIVEIDLEPLUGIN_IBY -#define PSLNACTIVEIDLEPLUGIN_IBY - -#include - -// Psln ActiveIdle plugin -data=DATAZ_\BITMAP_DIR\pslnactiveidleplugin.mif BITMAP_DIR\pslnactiveidleplugin.mif -ECOM_PLUGIN( pslnactiveidleplugin.dll, pslnactiveidleplugin.rsc ) - -// Central repository file, temporarily here -//data=\S60\ActiveIdle2\plugins\shortcutplugin\src\10275104.txt "private\10202BE9\10275104.txt" - -#endif // PSLNACTIVEIDLEPLUGIN_IBY diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin_resources.iby --- a/idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin_resources.iby Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project pslnactiveidleplugin localizable resources -* -*/ - - -#ifndef PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY -#define PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY - -#include - -// Psln ActiveIdle settings plugin localizable resources -data=DATAZ_\RESOURCE_FILES_DIR\pslnactiveidlepluginrsc.rsc RESOURCE_FILES_DIR\pslnactiveidlepluginrsc.rsc - -#endif // PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugin.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Psln Active Idle settings plugin. -* -*/ - - -#include "gsactiveidleplugin.h" -#include "gsactiveidleplugincontainer.h" - -#include -#include -#include -#include "pslnactiveidlepluginuids.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -// GS Active Idle Plugin impl. UID -const TUid KGSActiveIdlePluginUid = { KGSActiveIdlePluginImplementationUID }; - -// Psln Active Idle Plugin impl. UID -const TUid KPslnAIPluginUid = { KPslnActiveIdlePluginImplementationUID }; - -_LIT(KGSActiveIdlePluginResourceFileName, "z:pslnactiveidlepluginrsc.rsc"); - - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::CGSActiveIdlePlugin() -// -// Constructor -// ---------------------------------------------------------------------------- -// -CGSActiveIdlePlugin::CGSActiveIdlePlugin() : iResourceLoader(*iCoeEnv), iPrevViewId() -{ -} - -// --------------------------------------------------------------------------- -// CGSActiveIdlePlugin::NewL() -// -// Symbian OS default constructor -// --------------------------------------------------------------------------- -CGSActiveIdlePlugin* CGSActiveIdlePlugin::NewL(TAny* /*aInitParams*/) -{ - CGSActiveIdlePlugin* self = new (ELeave) CGSActiveIdlePlugin(); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; -} - -// --------------------------------------------------------------------------- -// CGSActiveIdlePlugin::ConstructL() -// -// Symbian OS two-phased constructor -// --------------------------------------------------------------------------- -void CGSActiveIdlePlugin::ConstructL() -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CGSActiveIdlePlugin::ConstructL")); -#endif - - // Find the resource file. - TParse parse; - parse.Set(KGSActiveIdlePluginResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); - TFileName fileName(parse.FullName()); - - // Open resource file. - iResourceLoader.OpenL(fileName); - - BaseConstructL(); - - // Psln first finds and loads all plugins that implement Psln plugin interface. - iPluginLoader = CPslnFWPluginHandler::NewL(AppUi()); - CPslnFWPluginInterface* plugin = iPluginLoader->LoadPluginL(KPslnAIPluginUid); - if (plugin) - { - // Add Psln Active Idle plugin to appui views. Plugin is deleted - // when appui is destroyed. - if (plugin->Id() == KPslnAIPluginUid) - { - CAknView* view = static_cast(plugin); - AppUi()->AddViewL(view); - } - } -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::~CGSActiveIdlePlugin -// -// Destructor -// ---------------------------------------------------------------------------- -CGSActiveIdlePlugin::~CGSActiveIdlePlugin() -{ - if (iContainer) - { - AppUi()->RemoveFromStack(iContainer); - delete iContainer; - iContainer = NULL; - } - - iResourceLoader.Close(); - - delete iPluginLoader; -} - -// --------------------------------------------------------------------------- -// TUid CGSActiveIdlePlugin::Id() -// -// Returns view's ID. -// --------------------------------------------------------------------------- -TUid CGSActiveIdlePlugin::Id() const -{ - return KGSActiveIdlePluginUid; -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::GetCaption -// -// Return application/view caption. 256 -// ---------------------------------------------------------------------------- -// -void CGSActiveIdlePlugin::GetCaptionL(TDes& aCaption) const -{ - iCoeEnv->ReadResourceL(aCaption, R_PSLN_GS_LIST_VIEW_CAPTION); -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::PluginProviderCategory -// -// A means to identify the location of this plug-in in the framework. -// ---------------------------------------------------------------------------- -// -TInt CGSActiveIdlePlugin::PluginProviderCategory() const -{ - // To identify internal plug-ins. - return KGSPluginProviderInternal; -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::Visible -// -// Provides the visibility status of self to framework. -// ---------------------------------------------------------------------------- -// -TBool CGSActiveIdlePlugin::Visible() const -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CGSActiveIdlePlugin::Visible")); -#endif - - return ETrue; -} - -// --------------------------------------------------------------------------- -// CGSActiveIdlePlugin::HandleCommandL(TInt aCommand) -// -// Handles commands directed to this class. -// --------------------------------------------------------------------------- -void CGSActiveIdlePlugin::HandleCommandL(TInt aCommand) -{ - // shouldn't get any commands to handle, but forward them to appui anyway... - AppUi()->HandleCommandL(aCommand); -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::DoActivateL -// -// First method called by the Avkon framwork to invoke a view. -// ---------------------------------------------------------------------------- -// -void CGSActiveIdlePlugin::DoActivateL( - const TVwsViewId& aPrevViewId, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CGSActiveIdlePlugin::DoActivateL")); -#endif - - if (!iContainer) - { - iContainer = new (ELeave) CGSActiveIdlePluginContainer(); - iContainer->SetMopParent(this); - iContainer->ConstructL(ClientRect()); - } - - AppUi()->AddToStackL(*this, iContainer); - - if (iPrevViewId.iViewUid.iUid == 0) - { - iPrevViewId = aPrevViewId; - } - - iContainer->MakeVisible(ETrue); - AppUi()->ActivateLocalViewL(KPslnAIPluginUid); -} - -// ---------------------------------------------------------------------------- -// CGSActiveIdlePlugin::DoDeactivate -// -// Called by the Avkon view framework when closing. -// ---------------------------------------------------------------------------- -// -void CGSActiveIdlePlugin::DoDeactivate() -{ - AppUi()->RemoveFromStack(iContainer); - iContainer->MakeVisible(EFalse); - iPrevViewId.iViewUid.iUid = 0; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugincontainer.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugincontainer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Psln Active Idle settings plugin. -* -*/ - - -#include "gsactiveidleplugincontainer.h" - -// --------------------------------------------------------------------------- -// CGSActiveIdlePluginContainer::ConstructL() -// -// Symbian OS two phased constructor. -// --------------------------------------------------------------------------- -// -void CGSActiveIdlePluginContainer::ConstructL(const TRect& aRect) -{ - CreateWindowL(); // Makes the control a window-owning control - SetRect(aRect); - ActivateL(); -} - -// --------------------------------------------------------------------------- -// CGSActiveIdlePluginContainer::~CGSActiveIdlePluginContainer() -// -// Destructor. -// --------------------------------------------------------------------------- -// -CGSActiveIdlePluginContainer::~CGSActiveIdlePluginContainer() -{ -} - -CGSActiveIdlePluginContainer::CGSActiveIdlePluginContainer() -{ -} - -void CGSActiveIdlePluginContainer::SizeChanged() -{ -} - -TInt CGSActiveIdlePluginContainer::CountComponentControls() const -{ - return 0; -} - -CCoeControl* CGSActiveIdlePluginContainer::ComponentControl(TInt /*aIndex*/ ) const -{ - return NULL; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugin.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,497 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: View for Active Idle skinning. -* -*/ - - -// This plugin specific. -#include -#include -#include "pslnactiveidleplugin.h" -#include "pslnactiveidleplugincontainer.h" -#include "pslnactiveidlepluginengine.h" -#include "pslnactiveidlepluginuids.h" - -// General services. -#include -#include -#include - -// Psln Framework specific. -#include -#include -#include -#include - - -// Path to mbm file. -_LIT(KPslnActiveIdleIconFileName, "pslnactiveidleplugin.mbm"); - -// Path to compiled resource file. -_LIT(KPslnActiveIdlePluginResourceFileName, "z:pslnactiveidlepluginrsc.rsc"); - -// Path to common personalization resources. This resource file is meant for -// shared resources between application and plugins. -_LIT(KPslnCommonResourceFileName, "z:pslncommon.rsc"); - -// Path to Psln application resource file. Plugin uses some localized texts -// from Psln's resources. -_LIT(KPslnApplicationResourceFileName, "z:psln.rsc"); - -// Location of this plugin view within Psln's tab group. -const TInt KPslnActiveIdlePluginLocation = 2; - -const TUid KPslnActiveIdlePluginUid = { KPslnActiveIdlePluginImplementationUID }; - -// Middle Softkey control ID. -const TInt KPslnMSKControlId = 3; - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::CPslnActiveIdlePlugin() -// -// Constructor -// ---------------------------------------------------------------------------- -// -CPslnActiveIdlePlugin::CPslnActiveIdlePlugin(CAknViewAppUi* aAppUi) - : - iResourceLoader(*iCoeEnv), - iResourceLoaderCommon(*iCoeEnv), - iResourceLoaderPsln(*iCoeEnv), - iAppUi(aAppUi) -{ -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::NewL -// -// Symbian OS default constructor -// --------------------------------------------------------------------------- -CPslnActiveIdlePlugin* CPslnActiveIdlePlugin::NewL(TAny* aAppUi) -{ - CAknViewAppUi* appUi = reinterpret_cast(aAppUi); - CPslnActiveIdlePlugin* self = new(ELeave) CPslnActiveIdlePlugin (appUi); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::ConstructL -// -// Symbian OS two-phased constructor -// --------------------------------------------------------------------------- -void CPslnActiveIdlePlugin::ConstructL() -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::ConstructL")); -#endif - - // Find the resource file: - TParse* parse = new (ELeave) TParse; - CleanupStack::PushL(parse); - parse->Set(KPslnCommonResourceFileName, &KDC_APP_RESOURCE_DIR, NULL); - TFileName* fileName = new (ELeave) TFileName(parse->FullName()); - CleanupStack::PushL(fileName); - - // Open resource file: - iResourceLoaderCommon.OpenL(*fileName); - CleanupStack::PopAndDestroy(fileName); - - // Find the resource file: - parse->Set(KPslnApplicationResourceFileName, &KDC_APP_RESOURCE_DIR, NULL); - fileName = new (ELeave) TFileName(parse->FullName()); - CleanupStack::PushL(fileName); - - // Open resource file: - iResourceLoaderPsln.OpenL(*fileName); - CleanupStack::PopAndDestroy(fileName); - CleanupStack::PopAndDestroy(parse); - - // Open own resources for reading. - OpenLocalizedResourceFileL( - KPslnActiveIdlePluginResourceFileName, - iResourceLoader); - - BaseConstructL(R_PSLN_ACTIVE_IDLE_VIEW); - - iEngine = new (ELeave) CPslnActiveIdlePluginEngine(this); - iEngine->ConstructL( TRect() ); - iEngine->ManualGetSkinsRestartL(ETrue); // Force start - -} - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::~CPslnActiveIdlePlugin -// -// Destructor -// ---------------------------------------------------------------------------- -CPslnActiveIdlePlugin::~CPslnActiveIdlePlugin() -{ - iResourceLoaderCommon.Close(); - iResourceLoaderPsln.Close(); - iResourceLoader.Close(); - delete iEngine; -} - -// --------------------------------------------------------------------------- -// TUid CPslnActiveIdlePlugin::Id() -// -// Returns view's ID. -// --------------------------------------------------------------------------- -TUid CPslnActiveIdlePlugin::Id() const -{ - return KPslnActiveIdlePluginUid; -} - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::GetCaption -// -// Return application/view caption. 128 -// ---------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::GetCaptionL(TDes& aCaption) const -{ - // the resource file is already opened. - HBufC* result = StringLoader::LoadL(R_PSLN_AI_LIST_VIEW_CAPTION); - if (aCaption.MaxLength() >= result->Length()) - { - aCaption.Copy(*result); - } - delete result; - } - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::GetTabTextL -// -// Return tab text. 128 -// ---------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::GetTabTextL(TDes& aCaption) const -{ - // the resource file is already opened. - HBufC* result = StringLoader::LoadL(R_PSLN_AI_TAB_NAME); - if (aCaption.MaxLength() >= result->Length()) - { - aCaption.Copy(*result); - } - delete result; - } - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::CreateIconL -// -// Creates Main view icon. -// ---------------------------------------------------------------------------- -// -CGulIcon* CPslnActiveIdlePlugin::CreateIconL() -{ - // Find the resource file: - TParse* parse = new (ELeave) TParse; - CleanupStack::PushL(parse); - parse->Set(KPslnActiveIdleIconFileName, &KDC_APP_BITMAP_DIR, NULL); - HBufC* fileName = parse->FullName().AllocLC(); - TPtr fileNamePtr = fileName->Des(); - - CGulIcon* icon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnPropPslnAiSub, - fileNamePtr, - EMbmPslnactiveidlepluginQgn_prop_psln_ai_sub, - EMbmPslnactiveidlepluginQgn_prop_psln_ai_sub_mask); - - CleanupStack::PopAndDestroy(2, parse); // fileName, parse - - return icon; -} - -// ----------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::GetLocationTypeAndIndex() -// -// -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::GetLocationTypeAndIndex( - TPslnFWLocationType& aType, - TInt& aIndex) const -{ - aType = CPslnFWPluginInterface::EPslnFWSpecified; - aIndex = KPslnActiveIdlePluginLocation; -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::HandleCommandL(TInt aCommand) -// -// Handles commands directed to this class. -// --------------------------------------------------------------------------- -void CPslnActiveIdlePlugin::HandleCommandL(TInt aCommand) -{ - switch (aCommand) - { - case EPslnCmdAppActivate: - iEngine->ActivateThemeL(); - break; - - case EAknSoftkeyBack: - RemoveCommandFromMSK(); - if (iAppUi->View(KPslnMainViewUid)) - { - // if we are in Psln activate Psln main view... - iAppUi->ActivateLocalViewL(KPslnMainViewUid); - } - else if (iAppUi->View(KGSMainViewUid)) - { - // ... else if we are in GS activate parent plugin view (standby view)... - iAppUi->ActivateLocalViewL(KGSStandbyPluginUid); - } - else - { - iAppUi->HandleCommandL(aCommand); - } - break; - - case EAknSoftkeyExit: - // This is here because we use different softkey setups - iAppUi->HandleCommandL(EAknCmdExit); - break; - - case EPslnCmdAppHelp: - case EAknCmdHelp:// Fall trough - CPslnFWBaseView::HandleCommandL(aCommand); - break; - - default: - iAppUi->HandleCommandL(aCommand); - break; - } -} - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::Container -// -// Return handle to container class. -// ---------------------------------------------------------------------------- -// -CPslnActiveIdlePluginContainer* CPslnActiveIdlePlugin::Container() -{ - return static_cast(iContainer); -} - -// ----------------------------------------------------------------------------- -// Checks is there a need to update the middle softkey label. -// This method should do nothing but MSK issues, since it is still called -// if the framework does not support MSK. -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::CheckMiddleSoftkeyLabelL() -{ - CPslnActiveIdlePluginContainer* container = Container(); - TInt highlightedItem = iContainer->iListBox->CurrentItemIndex(); - -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::CheckMiddleSoftkeyLabelL highl = %d, curr = %d"), highlightedItem, container->GetCurrentlySelectedIndex()); -#endif - - // First remove any previous commands. - RemoveCommandFromMSK(); - - if (highlightedItem >= 0 && - highlightedItem != container->GetCurrentlySelectedIndex()) - { - // Activate: - CPslnFWBaseView::SetMiddleSoftKeyLabelL( - R_PSLN_MSK_ACTIVATE, - EPslnCmdAppActivate); - } - else - { - CPslnFWBaseView::SetMiddleSoftKeyLabelL( - R_PSLN_MSK_DUMMY, - EPslnCmdEmptyCommand ); - } -} - -// ----------------------------------------------------------------------------- -// Return engine instance. -// ----------------------------------------------------------------------------- -// -CPslnActiveIdlePluginEngine* CPslnActiveIdlePlugin::Engine() - { - return iEngine; - } - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::DoActivateL -// -// First method called by the Avkon framwork to invoke a view. -// ---------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::DoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage) -{ -#ifdef MY_DEBUG - RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::DoActivateL")); - RDebug::Print(_L("XAI: aCustomMessageId = 0x%08x"), aCustomMessageId.iUid); - RDebug::Print(_L("XAI: aPrevViewId = 0x%08x"), aPrevViewId.iAppUid.iUid); -#endif - - // If called from Psln - set tab group location. - if (iAppUi->View(KPslnMainViewUid)) - { - CPslnFWBaseView::SetNaviPaneL(KPslnActiveIdlePluginLocation); - } - - CEikButtonGroupContainer* cba = Cba(); - - if (cba) - { - if (aCustomMessageId == KUidActiveIdle) - { - cba->SetCommandSetL(R_SOFTKEYS_OPTIONS_EXIT_EMPTY); - } - else - { - cba->SetCommandSetL(R_SOFTKEYS_OPTIONS_BACK_EMPTY); - } - cba->DrawDeferred(); - } - - CPslnFWBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); - - CheckMiddleSoftkeyLabelL(); - - iEngine->ManualGetSkinsRestartL(); -} - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::DoDeactivate -// -// Called by the Avkon view framework when closing. -// ---------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::DoDeactivate() -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::DoDeactivate")); -#endif - CPslnFWBaseView::DoDeactivate(); - RemoveCommandFromMSK(); -} - -// ---------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::DynInitMenuPaneL -// -// -// ---------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::DynInitMenuPaneL( - TInt aResourceId, CEikMenuPane* aMenuPane) -{ - if (aResourceId == R_PSLN_GEN_VIEW_MENUPANE && - aMenuPane) - { - // Since this is common resource it contains download, - // set it off. - aMenuPane->SetItemDimmed(EPslnCmdAppDownload, ETrue); - - CPslnActiveIdlePluginContainer* container = Container(); - TInt highlightedItem = iContainer->iListBox->CurrentItemIndex(); - // Remove Activate command, if highlighted item is already active. - if (highlightedItem == container->GetCurrentlySelectedIndex()) - { - aMenuPane->SetItemDimmed(EPslnCmdAppActivate, ETrue); - } - } - else if (aResourceId == R_PSLN_AI_BASIC_MENUPANE && - aMenuPane) - { - if (!FeatureManager::FeatureSupported(KFeatureIdHelp)) - { - // Disable help if not supported - aMenuPane->SetItemDimmed(EPslnCmdAppHelp, ETrue); - } - } -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::NewContainerL() -// -// Creates new iContainer. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::NewContainerL() -{ - if( !iContainer ) - { - TBool isGSCalling = (NULL != iAppUi->View(KGSMainViewUid)); - iContainer = new (ELeave) CPslnActiveIdlePluginContainer(isGSCalling, this); - iContainer->SetMiddleSoftkeyObserver(this); - } - - RemoveCommandFromMSK(); -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::HandleListBoxSelectionL() -// -// Handles events raised through a rocker key. -// --------------------------------------------------------------------------- -void CPslnActiveIdlePlugin::HandleListBoxSelectionL() -{ - TInt currentItem = iContainer->iListBox->CurrentItemIndex(); - CPslnFWBaseView::SetCurrentItem(currentItem); - - CPslnActiveIdlePluginContainer* container = Container(); - - if (currentItem != container->GetCurrentlySelectedIndex()) - { - HandleCommandL(EPslnCmdAppActivate); - } -} - -// ----------------------------------------------------------------------------- -// Remove MSK command mappings. -// This method should do nothing but MSK issues. -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::RemoveCommandFromMSK() -{ - CEikButtonGroupContainer* cba = Cba(); - - if (cba && iContainer) - { - cba->RemoveCommandFromStack(KPslnMSKControlId, EPslnCmdEmptyCommand); - cba->RemoveCommandFromStack(KPslnMSKControlId, EPslnCmdAppActivate); - } -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePlugin::SetTitlePaneL() -// -// Gives resource ID to be used as plugin view title. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePlugin::SetTitlePaneL( TInt& aResourceId ) - { -#ifdef RD_CONTROL_PANEL - aResourceId = R_PSLN_AI_LIST_VIEW_CAPTION; -#endif // RD_CONTROL_PANEL - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugincontainer.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugincontainer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for the Application Shell plugin -* -*/ - - -// INCLUDE FILES - -// From this plugin. -#include "pslnactiveidleplugincontainer.h" -#include "pslnactiveidlepluginengine.h" -#include "pslnactiveidleplugin.h" - -// From Psln application. -#include - -// From PSLN framework -#include -#include - -// Resources -#include -#include - -// General services -#include - -// XUIKON -#include - -// CONSTANTS -// UID of Personlisation application -const TUid KPslnAppUid = { 0x10005A32 }; - -// ========================= MEMBER FUNCTIONS ================================ - -CPslnActiveIdlePluginContainer::CPslnActiveIdlePluginContainer( - TBool aGSCalling, - CPslnActiveIdlePlugin* aPlugin ) - : - iPlugin( aPlugin ), - iGSCalling( aGSCalling ) - { - } -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::ConstructL( const TRect& aRect ) - { - iListBox = new( ELeave ) CAknSingleGraphicStyleListBox; - TInt titleResId = 0; - - if (iGSCalling) - { - titleResId = R_PSLN_GS_LIST_VIEW_TITLE; - } - BaseConstructL(aRect, titleResId, R_PSLN_PLUGIN_DEFAULT_VIEW_LBX); - // Do not show container immediately - to avoid seeing "No Data" first. - iListBox->MakeVisible( EFalse ); - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CPslnActiveIdlePluginContainer::~CPslnActiveIdlePluginContainer() - { - if( iItemArray ) - { - TInt count = iItemArray->Count(); - iItemArray->Delete(0, count); - } - - delete iItems; - } - -// ----------------------------------------------------------------------------- -// CPslnActiveIdlePluginContainer::GetCurrentlySelectedIndex -// ----------------------------------------------------------------------------- -// -TInt CPslnActiveIdlePluginContainer::GetCurrentlySelectedIndex() const - { - return iCurrentlySelected; - } - -// --------------------------------------------------------------------------- -// Adds new item to the listbox. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::AddNewItemToListL( - const TInt aItemIndex, CXnODT* aSkinODT, TInt aUiController ) - { - HBufC* item = HBufC::NewLC( KPslnItemMaxTextLength ); - TPtr itemPtr = item->Des(); - TBool newActiveItem = EFalse; - - // Get theme ODT and full name. - // Index aItemIndex has been verified in view. - itemPtr = aSkinODT->ThemeFullName(); - if ( aSkinODT->Flags() & EXnThemeStatusActive && - iPlugin->Engine()->CurrentUIController() == aUiController ) - { - itemPtr.Insert( 0, KPslnFWActiveListItemFormat ); - - // Set selected active. - iCurrentlySelected = aItemIndex; - newActiveItem = ETrue; - } - else - { - itemPtr.Insert( 0, KPslnFWNonActiveListItemFormat ); - } - iItemArray->AppendL( itemPtr ); - CleanupStack::PopAndDestroy( item ); - - if ( newActiveItem ) - { - // Set highlight. - iListBox->SetCurrentItemIndex( iCurrentlySelected ); - // Since we now have content, show container. - iListBox->MakeVisible( ETrue ); - if ( iPlugin ) - { - iPlugin->CheckMiddleSoftkeyLabelL(); - } - } - } - -// --------------------------------------------------------------------------- -// Removes themes from listbox. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::RemoveThemes( const TInt aDeleteFrom ) - { - // Validate parameter first. - if ( iItemArray && - ( aDeleteFrom >= 0 ) && - ( aDeleteFrom < iItemArray->Count() ) ) - { - iItemArray->Delete( aDeleteFrom, iItemArray->Count() - aDeleteFrom ); - } - } - -// --------------------------------------------------------------------------- -// Construct the listbox from resource array. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::ConstructListBoxL( TInt aResLbxId ) - { - iListBox->ConstructL( this, EAknListBoxSelectionList ); - - iItemArray = static_cast - ( iListBox->Model()->ItemTextArray() ); - - iItems = iCoeEnv->ReadDesC16ArrayResourceL( aResLbxId ); - - // Create pre- and post-text icons. - AddIconsToListL(); - } - -// --------------------------------------------------------------------------- -// Gets Help context. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::GetHelpContext( - TCoeHelpContext& aContext ) const - { - aContext.iMajor = KPslnAppUid; - aContext.iContext = KSKINS_HLP_APPSKINS_LIST; - } - -// --------------------------------------------------------------------------- -// Adds icons to setting list items. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginContainer::AddIconsToListL() - { - CPslnFWIconHelper* iconHelper = CPslnFWIconHelper::NewL(); - CleanupStack::PushL( iconHelper ); - iconHelper->AddIconsToSettingItemsL( - ETrue, - KErrNotFound, // none, selected - iListBox ); - CleanupStack::PopAndDestroy( iconHelper ); - } - -void CPslnActiveIdlePluginContainer::RefreshList() - { - TRAP_IGNORE(iListBox->HandleItemAdditionL()); - iListBox->SetCurrentItemIndex(iCurrentlySelected); - TRAP_IGNORE(iPlugin->CheckMiddleSoftkeyLabelL()); - DrawDeferred(); - // Since we now have content, show container. - iListBox->MakeVisible( ETrue ); - } - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginengine.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,724 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Container for the Active Idle plugin. -* -*/ - - -// From this plugin. -#include - -#include "pslnactiveidlepluginengine.h" -#include "pslnactiveidleplugincontainer.h" -#include "pslnactiveidleplugin.h" -#include "activeidle2domainpskeys.h" -#include "activeidle2internalpskeys.h" - -// from plugin side -#include // for KExtrStandbyScrFullScreenMode - -// From PSLN framework. -#include -#include - -// General services. -#include -#include -#include - -// Application specific skins. -#include - -// XUIKON. -#include - -// ECOM. -#include -#include - -#include -#include - -#include - -// Granularity of plugin array. -const TInt KPslnPluginArrayGranularity = 4; - -// ActiveIdle1 plugin ECOM interface uid -const TInt KAI1PluginInterfaceUid = 0x101F8700; -const TInt KAIThemeStatusPaneHidden = 0x00000001; - -// AI1 cenrep -const TInt KCRUidActiveIdle = 0x10207467; -const TInt KCRPluginCountKey = 0x00000002; -const TInt KCRFirstPluginKey = 0x00000003; - -const TInt KPSLNOneSecondInMicroSeconds = 1000*1000; - -// ========== LOCAL FUNCTIONS ================================================= - -template -void CleanupResetAndDestroy(TAny* aObj) -{ - if(aObj) - { - static_cast(aObj)->ResetAndDestroy(); - } -} - -template -void CleanupResetAndDestroyPushL(Array& aPointerArray) -{ - CleanupStack::PushL(TCleanupItem(&CleanupResetAndDestroy, &aPointerArray)); -} - -// ========== MEMBER FUNCTIONS ================================================ - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::ConstructL() -// -// Symbian OS two phased constructor -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::ConstructL(const TRect& /*aRect*/) -{ -#ifdef _MY_DEBUG - RDebug::Print(_L("XAI: CPslnActiveIdlePluginEngine::ConstructL")); -#endif - - // Create application theme handler and list for application themes. - iMySkinList = new (ELeave) - CArrayPtrFlat(KPslnPluginArrayGranularity); - iPslnFWThemeHandler = CPslnFWAppThemeHandler::NewL( - *this, - *iMySkinList); - - CheckCurrentUIControllerL(); - CheckCurrentAi1PluginL(); - iRestartTimer = CPeriodic::NewL(EPriorityNormal); - iUiRefreshTimer = CPeriodic::NewL(EPriorityNormal); -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::CPslnActiveIdlePluginEngine -// -// Constructor -// --------------------------------------------------------------------------- -// -CPslnActiveIdlePluginEngine::CPslnActiveIdlePluginEngine( - CPslnActiveIdlePlugin* aPlugin) - : - iFirstUpdateRound(ETrue), - iFirstUpdateRoundInjected(EFalse), - iCurrentUIController(EAiUICUnknown), - iPlugin(aPlugin) -{ -} - -// --------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::~CPslnActiveIdlePluginEngine() -// -// Destructor -// --------------------------------------------------------------------------- -// -CPslnActiveIdlePluginEngine::~CPslnActiveIdlePluginEngine() -{ - if (iRestartTimer) - { - iRestartTimer->Cancel(); - } - delete iRestartTimer; - if (iUiRefreshTimer) - { - iUiRefreshTimer->Cancel(); - } - delete iUiRefreshTimer; - - if (iMySkinList) - { - iMySkinList->ResetAndDestroy(); - } - delete iMySkinList; - delete iPslnFWThemeHandler; -} - -// ----------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::ActivateThemeL -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::ActivateThemeL() -{ - TInt skinIndex = 0; - if( iPlugin->Container() ) - { - skinIndex = iPlugin->Container()->iListBox->CurrentItemIndex(); - } - else - { - // No selection possible yet - return; - } - - if (skinIndex >= 0 && skinIndex < iMySkinList->Count() && - !iRestartTimer->IsActive()) - { - if (skinIndex >= iHSStartIndex && - skinIndex < iHSEndIndex) - { - CXnODT* selectedSkinODT = iMySkinList->At(skinIndex); - UpdateStatusPaneVisibilityCenrepL( - selectedSkinODT->Flags() & KAIThemeStatusPaneHidden); - - if (iCurrentAi1Plugin != selectedSkinODT->ThemeUid()) - { - UpdateAi1PluginLoadCenrepL(selectedSkinODT->ThemeUid()); - CheckCurrentAi1PluginL(); - } - if (iCurrentUIController == EAiUICXML) - { - UpdateUIControllersInCenrepL(EAiUICNative); - CheckCurrentUIControllerL(); - - iRestartTimer->Cancel(); - iRestartRetryCount = 0; - iRestartTimer->Start( - KPSLNOneSecondInMicroSeconds, - KPSLNOneSecondInMicroSeconds, - TCallBack(RestartTimerCallback, this)); - } - else - { - if( IsAiRunning() ) - { - // Recycle this method to bring to foreground - RestartTimerCallback( this ); - } - } - ManualGetSkinsRestartL(); - } - else - { - if (iCurrentUIController == EAiUICNative) - { - UpdateStatusPaneVisibilityCenrepL(EFalse); // Always visible status pane - UpdateUIControllersInCenrepL(EAiUICXML); - CheckCurrentUIControllerL(); - } - - RProperty::Set( KPSUidAiInformation, KActiveIdleRestartAI2, KActiveIdleRestartCode ); - iRestartTimer->Cancel(); - iRestartRetryCount = 0; - iRestartTimer->Start( - KPSLNOneSecondInMicroSeconds, - KPSLNOneSecondInMicroSeconds, - TCallBack(RestartTimerCallback, this)); - CXnODT* selectedSkinODT = iMySkinList->At(skinIndex); - TXnServiceCompletedMessage ret; - - ret = iPslnFWThemeHandler->SetApplicationSkinL( - *selectedSkinODT ); - - if (ret == EXnSetActiveThemeFailed) - { - // Show error note. - HBufC* errorBuf = StringLoader::LoadLC( - R_PSLN_QTN_SKINS_ERROR_CORRUPTED); - // Display global note. - CAknGlobalNote* errorNote = CAknGlobalNote::NewLC(); - errorNote->ShowNoteL(EAknGlobalErrorNote, *errorBuf); - CleanupStack::PopAndDestroy(2, errorBuf); // errorNote also - } - else - { - iRestartTimer->Cancel(); - iRestartRetryCount = 0; - iRestartTimer->Start( - KPSLNOneSecondInMicroSeconds, - KPSLNOneSecondInMicroSeconds, - TCallBack(RestartTimerCallback, this)); - } - } - } -} - -// ----------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::HandleMessage -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::HandleMessage( - TXnServiceCompletedMessage aMessage) -{ - switch (aMessage) - { - case EXnGetListHeadersEmpty: - // Just destroy everything and use default items only. - case EXnGetListHeadersFailed: // fallthrough - if (iMySkinList) - { - iMySkinList->ResetAndDestroy(); - } - break; - case EXnServiceRequestCanceled: // fallthrough - case EXnServiceRequestError: // fallthrough - { - TRAP_IGNORE(ManualGetSkinsRestartL();) - } - break; - default: - break; - } -} - -// ----------------------------------------------------------------------------- -// CPslnActiveIdlePluginEngine::HandleMessage -// ----------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::HandleMessage( - TXnServiceCompletedMessage aMessage, - CArrayPtrFlat& /*aAppThemeList*/) -{ - switch (aMessage) - { - case EXnGetListHeadersRestart: - case EXnGetListHeadersUpdate: // fallthrough - { - TRAP_IGNORE(AddNewThemeL(aMessage)); - break; - } - default: - { - break; - } - } -} - -// --------------------------------------------------------------------------- -// Adds new theme to the container / listbox. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::AddThemesToContainerL() - { - TInt value = 0; - - GetExtStandbyScreenState(value); - - /* value == 0 Only AI2 themes - value != 0 - bit 31 AI2 themes - bit 30-0 External themes - */ - value |= 0x80000000; // Force AI2 themes on - if ((value == 0) || ((value & 0x80000000) != 0)) - { - if( iPlugin->Container() && iMySkinList ) - { - // Remove themes. All. - iPlugin->Container()->RemoveThemes( 0 ); - for ( TInt i = 0; i < iMySkinList->Count(); ++i ) - { - if( i >= iHSStartIndex && - i < iHSEndIndex ) - { - iPlugin->Container()->AddNewItemToListL( i, - iMySkinList->At(i), - EAiUICNative ); - } - else - { - iPlugin->Container()->AddNewItemToListL( i, - iMySkinList->At(i), - EAiUICXML ); - } - } - } - } - } - -// --------------------------------------------------------------------------- -// Adds new theme to the listbox. -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::AddNewThemeL( - TXnServiceCompletedMessage aMessage) -{ - // No themes available - do not add anything. - if (!iMySkinList) - { - return; - } - - // Theme activation causes restart of theme headers list. - if (aMessage == EXnGetListHeadersRestart) - { - iFirstUpdateRound = EFalse; - } - - TInt value = 0; - - GetExtStandbyScreenState(value); - - /* value == 0 Only AI2 themes - value != 0 - bit 31 AI2 themes - bit 30-0 External themes - */ - value |= 0x80000000; // Force AI2 themes on - - if ((value & 0x7FFFFFFF) > 0) - { - if ((iFirstUpdateRound && !iFirstUpdateRoundInjected) || - aMessage == EXnGetListHeadersRestart) - { - iFirstUpdateRoundInjected = ETrue; - AddHomeScreenThemesL(); - } - } - - UiTimerRestart(); -} - -// -// Get external Standby Screen state from Cenrep -// -TInt CPslnActiveIdlePluginEngine::GetExtStandbyScreenState(TInt& aValue ) - { - TInt ret = 0; - TUid uid = { KCRUidActiveIdleLV }; // {0x10275102}; // - - //TRAP_IGNORE: leaving function called in non-leaving function - TRAP_IGNORE - ( - CRepository* cenRep = CRepository::NewLC( uid ); - - ret = cenRep->Get(KAIExternalStatusScreen, aValue ); - - CleanupStack::PopAndDestroy( cenRep ); - ) - - return ret; - } - -// --------------------------------------------------------------------------- -// Add EXT HS themes to listing -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::AddHomeScreenThemesL() -{ - iHSStartIndex = iHSEndIndex = iMySkinList->Count(); - // Resolve AI1 plugins in ECOM - RImplInfoPtrArray eComPlugins; - CleanupResetAndDestroyPushL(eComPlugins); - - REComSession::ListImplementationsL(TUid::Uid(KAI1PluginInterfaceUid), eComPlugins); - for (TInt i = 0; i < eComPlugins.Count(); ++i) - { - CXnODT* skinODT = CXnODT::NewL(); - skinODT->SetThemeUid(eComPlugins[i]->ImplementationUid().iUid); - if (eComPlugins[i]->OpaqueData() == KExtrStandbyScrFullScreenMode) - { - skinODT->SetFlags(KAIThemeStatusPaneHidden); - } - else - { - skinODT->SetFlags(0); - } - CleanupStack::PushL(skinODT); - iMySkinList->AppendL(skinODT); - CleanupStack::Pop(skinODT); - - HBufC* item = HBufC::NewLC(KPslnItemMaxTextLength); - TPtr itemPtr = item->Des(); - if (eComPlugins[i]->DisplayName().Length()) - { - itemPtr = eComPlugins[i]->DisplayName(); - } - else - { - itemPtr = _L("OperatorHomeScreen1"); - } - skinODT->SetThemeFullNameL( itemPtr ); - if (iCurrentAi1Plugin == eComPlugins[i]->ImplementationUid().iUid && - iCurrentUIController == EAiUICNative) - { - itemPtr.Insert(0, KPslnFWActiveListItemFormat); - TInt flags = skinODT->Flags(); - skinODT->SetFlags(flags | EXnThemeStatusActive ); - } - else - { - itemPtr.Insert(0, KPslnFWNonActiveListItemFormat); - } - CleanupStack::PopAndDestroy(item); - ++iHSEndIndex; - } - CleanupStack::PopAndDestroy(); -} - -// --------------------------------------------------------------------------- -// Check active AI2 UI Controller in cenrep keys -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::CheckCurrentUIControllerL() -{ - CRepository* cenRep = CRepository::NewL(TUid::Uid(KCRUidActiveIdleLV)); // KCRUidActiveIdleLV AI2 Cenrep! - TInt value = 0; - if (cenRep->Get(KAiMainUIController, value) == KErrNone) - { - if ((value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE) - || (value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE)) - { - iCurrentUIController = EAiUICNative; - } - else if ((value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML) - || (value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML)) - { - iCurrentUIController = EAiUICXML; - } - } - delete cenRep; -} - -// --------------------------------------------------------------------------- -// Update active AI2 UI Controller in cenrep keys -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::UpdateUIControllersInCenrepL(TInt aControllerId) -{ - if (iCurrentUIController != aControllerId) - { - TUid uid = { KCRUidActiveIdleLV }; // KCRUidActiveIdleLV AI2 Cenrep! - CRepository* cenRep = CRepository::NewL(uid); - if (aControllerId == EAiUICNative) - { - cenRep->Delete(KAiFirstUIController); - cenRep->Delete(KAiFirstUIController + 1); - cenRep->Set(KAiMainUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); - } - else if (aControllerId == EAiUICXML) - { - cenRep->Create(KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); - cenRep->Set(KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); - cenRep->Delete(KAiFirstUIController + 1); - cenRep->Set(KAiMainUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML); - } - delete cenRep; - } -} - -// --------------------------------------------------------------------------- -// Update status pane visibility for status pane cenrep key -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::UpdateStatusPaneVisibilityCenrepL( - TBool aPaneHidden) -{ - TInt value = EAiStatusPaneLayoutIdleNormal; - if (aPaneHidden) - { - value = EAiStatusPaneLayoutIdleHidden; - } - TUid uid = { KCRUidActiveIdleLV }; // KCRUidActiveIdleLV AI2 Cenrep! - CRepository* cenRep = CRepository::NewL(uid); - cenRep->Set(KAiStatusPaneLayout, value); - delete cenRep; -} - -// --------------------------------------------------------------------------- -// Update active AI1 plugin in cenrep -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::UpdateAi1PluginLoadCenrepL(TInt aNewUid) -{ - TUid uid = { KCRUidActiveIdle }; // KCRUidActiveIdle AI1 Cenrep! - CRepository* cenRep = CRepository::NewL(uid); - TInt currentCount = 0; - cenRep->Get(KCRPluginCountKey, currentCount); - - // Delete old keys if any - for (TInt i = 0; i < currentCount; ++i) - { - cenRep->Delete(KCRFirstPluginKey+i); - } - - cenRep->Delete(KCRPluginCountKey); - cenRep->Create(KCRPluginCountKey, 1); - // Set only 1 new key, the selected one - cenRep->Create(KCRFirstPluginKey, aNewUid); - - delete cenRep; -} - -// --------------------------------------------------------------------------- -// Check the current AI1 plugin (ref. External opretor homescreen feature) -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::CheckCurrentAi1PluginL() -{ - TUid uid = { KCRUidActiveIdle }; // KCRUidActiveIdle AI1 Cenrep! - TInt value = 0; - TInt currentCount = 0; - - CRepository* cenRep = CRepository::NewL(uid); - cenRep->Get(KCRPluginCountKey, currentCount); - - if (currentCount) // count must be set - { - cenRep->Get(KCRFirstPluginKey, value); - } - delete cenRep; - - if (value != 0) - { - iCurrentAi1Plugin = value; - } -} - -// --------------------------------------------------------------------------- -// Manually start updating theme/skin listing -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::ManualGetSkinsRestartL(TBool aForceStart) -{ - if( !aForceStart && iMySkinList->Count() > 0 && - iUiRefreshTimer->IsActive() ) - { - return; - } - - // Restart get skins manually! - if( iPlugin->Container() ) - { - iPlugin->Container()->RemoveThemes(0); - } - iMySkinList->ResetAndDestroy(); - iFirstUpdateRound = ETrue; - iFirstUpdateRoundInjected = EFalse; - iPslnFWThemeHandler->CancelGetApplicationSkins(); - iAddIndex = 0; - iPslnFWThemeHandler->GetApplicationSkinsL(KUidActiveIdle); -} - -// --------------------------------------------------------------------------- -// Restart AI2 process -// --------------------------------------------------------------------------- -// -TInt CPslnActiveIdlePluginEngine::RestartAifw() -{ - if (!IsAiRunning()) - { - _LIT(KAiExeName, "z:\\sys\\bin\\ailaunch.exe"); - RProcess process; - TInt ret = process.Create(KAiExeName, KNullDesC); - process.Resume(); - process.Close(); - return ret; - } - return KErrNone; -} - -// --------------------------------------------------------------------------- -// Checks if AI2 process is running -// --------------------------------------------------------------------------- -// -TBool CPslnActiveIdlePluginEngine::IsAiRunning() -{ - TApaTaskList taskList(CCoeEnv::Static()->WsSession()); - TApaTask startTask = taskList.FindApp(TUid::Uid(0x100058f4)); - - if (!startTask.Exists()) // if first boot queries are done continue bringing ai2 to foreground. - { - TApaTask aiTask = taskList.FindApp(TUid::Uid(AI_UID3_AIFW_EXE)); - if (aiTask.Exists()) // App open - { - return ETrue; - } - } - return EFalse; -} - -// --------------------------------------------------------------------------- -// start ui refresh timer -// --------------------------------------------------------------------------- -// -void CPslnActiveIdlePluginEngine::UiTimerRestart() - { - iUiRefreshTimer->Cancel(); - iUiRefreshTimer->Start( - KPSLNOneSecondInMicroSeconds/4, // quarter second delay - KPSLNOneSecondInMicroSeconds/4, - TCallBack(UiRefreshTimerCallback, this)); - } - -// --------------------------------------------------------------------------- -// Call back for restart timer -// --------------------------------------------------------------------------- -// -TInt CPslnActiveIdlePluginEngine::RestartTimerCallback(TAny* aSelf) -{ - CPslnActiveIdlePluginEngine* self = - static_cast(aSelf); - - if (self) - { - ++(self->iRestartRetryCount); - if ( self->RestartAifw() == KErrNone) - { - self->iRestartTimer->Cancel(); - TApaTaskList taskList(CCoeEnv::Static()->WsSession()); - TApaTask startTask = taskList.FindApp(TUid::Uid(0x100058f4)); - - if (!startTask.Exists()) // if first boot queries are done continue bringing ai2 to foreground. - { - TApaTask aiTask = taskList.FindApp(TUid::Uid(AI_UID3_AIFW_EXE)); - if (aiTask.Exists()) // App open - { - //aiTask.BringToForeground(); - CAknSgcClient::MoveApp(aiTask.WgId(), ESgcMoveAppToForeground); - } - } - CAknEnv::RunAppShutter(); - return 0; - } - if (self->iRestartRetryCount > 3) - { - self->iRestartTimer->Cancel(); - TRAP_IGNORE(self->ManualGetSkinsRestartL()); - return 0; - } - } - return 1; -} - -// --------------------------------------------------------------------------- -// Call back for UI refresh timer timer -// --------------------------------------------------------------------------- -// -TInt CPslnActiveIdlePluginEngine::UiRefreshTimerCallback(TAny* aSelf) -{ - CPslnActiveIdlePluginEngine* self = - static_cast(aSelf); - - if (self) - { - self->iUiRefreshTimer->Cancel(); - TRAP_IGNORE(self->AddThemesToContainerL()); - if( self->iPlugin->Container() ) - { - self->iPlugin->Container()->RefreshList(); - } - } - return 0; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginimplementationtable.cpp --- a/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginimplementationtable.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM proxy table for PslnActiveIdlePlugin. -* -*/ - -#include -#include - -#include "pslnactiveidleplugin.h" -#include "gsactiveidleplugin.h" -#include "pslnactiveidlepluginuids.h" - -const TImplementationProxy KPslnActiveIdlePluginImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY(KPslnActiveIdlePluginImplementationUID, CPslnActiveIdlePlugin::NewL) - , - IMPLEMENTATION_PROXY_ENTRY(KGSActiveIdlePluginImplementationUID, CGSActiveIdlePlugin::NewL) -}; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) -{ - aTableCount = sizeof(KPslnActiveIdlePluginImplementationTable) / sizeof(TImplementationProxy); - return KPslnActiveIdlePluginImplementationTable; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/data/sapidataplugin.rss --- a/idlefw/plugins/sapidataplugin/data/sapidataplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/data/sapidataplugin.rss Wed May 12 13:36:47 2010 +0300 @@ -18,6 +18,7 @@ // INCLUDES #include +#include #include "sapidatapluginuids.hrh" @@ -42,7 +43,7 @@ INTERFACE_INFO { // UID of interface that is implemented - interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; implementations = { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/group/sapidataplugin.mmp --- a/idlefw/plugins/sapidataplugin/group/sapidataplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/group/sapidataplugin.mmp Wed May 12 13:36:47 2010 +0300 @@ -40,21 +40,26 @@ END -LIBRARY euser.lib -LIBRARY bafl.lib -LIBRARY efsrv.lib -LIBRARY liwservicehandler.lib -LIBRARY ecom.lib -LIBRARY aiutils.lib -LIBRARY cone.lib -LIBRARY avkon.lib -LIBRARY fbscli.lib -LIBRARY egul.lib -LIBRARY aknskins.lib -LIBRARY charconv.lib -// End of File +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY liwservicehandler.lib +LIBRARY ecom.lib +LIBRARY aiutils.lib +LIBRARY cone.lib +LIBRARY avkon.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY aknskins.lib +LIBRARY charconv.lib +LIBRARY estor.lib + +// Debugging dependencies +LIBRARY flogger.lib + SOURCEPATH ../src - SOURCE sapidataplugin.cpp SOURCE sapidata.cpp SOURCE sapidataobserver.cpp + +// End of File \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/inc/sapidata.h --- a/idlefw/plugins/sapidataplugin/inc/sapidata.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/inc/sapidata.h Wed May 12 13:36:47 2010 +0300 @@ -19,22 +19,32 @@ #ifndef SAPIDATA_H #define SAPIDATA_H -// INCLUDE FILES +// System includes #include #include -#include + +// User includes +#include #include "sapidatapluginconst.h" -#include "aicontentpublisher.h" +// Forward declarations class MLiwInterface; class CLiwServiceHandler; class CSapiDataObserver; class CSapiDataPlugin; - +class MAiContentObserver; +class MAiCpsCommandBuffer; -class CContentItem : public CBase +/** + * @ingroup group_sapidataplugin + * + * Content item + * + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CContentItem ) : public CBase { - public : +public: /** * Part of the two phased constuction @@ -43,19 +53,18 @@ * @return none */ static CContentItem* NewL(); - /* * Destructor */ ~CContentItem(); - private : +private: /* * Constructor */ - CContentItem(); + CContentItem(); /** * Part of the two phased construction @@ -65,7 +74,7 @@ */ void ConstructL(); - public : +public: TInt iId; /* item id */ @@ -81,12 +90,13 @@ * * Sapi data * - * @since S60 v3.2 + * @since S60 5.0 */ -class CSapiData : public CBase +NONSHARABLE_CLASS( CSapiData ) : public CBase { - public: - +public: + // constructor and destructor + /** * Part of the two phased construction * @@ -103,9 +113,9 @@ */ ~CSapiData(); - private : - - +private: + // constructors + /** * Constructor * @@ -113,8 +123,7 @@ * @return none */ CSapiData(); - - + /** * Part of the two phased construction * @@ -122,24 +131,26 @@ * @return void */ void ConstructL(CSapiDataPlugin* aPlugin); - + +public: + // new functions + /** * Change the publisher status * * @param aStatus new status of the publisher * @return void */ - void ChangePublisherStatusL(const TDesC& aStatus); + void ChangePublisherStatusL(const TDesC8& aStatus); /** - * Gets the menu item from the publisher + * Triggers active event with KNoNotification option. + * Notification is not send to observer, action handler + * plug-ins are executed * - * @param none * @return void */ - void GetMenuItemsL(); - - public : + void TriggerActiveL(); /** * Configures the subscriber and data to subscribe. @@ -150,9 +161,22 @@ */ void ConfigureL(RAiSettingsItemArray& aConfigurations); + /** + * Sets content id + * + * @param aId Content id + */ void SetContentIdL(const TDesC8& aId); /** + * Sets startup reason, which will be communicated to CPS client + * in the case of late registration. + * + * @param aStartupReason A reason + */ + void SetStartupReasonL(const TDesC8& aStartupReason); + + /** * Execute the command to get the data from CPS * * @param aRegistry type of registry (publisher/cp_data) @@ -237,14 +261,20 @@ /** * Called by the observer to refresh the changed content * - * @param aPublisher publisher. - * @param aContentType content type. - * @param aContentId content Id. - * @param aOperation operation (add/delete/update/execute). + * @param aPublisher publisher. + * @param aContentType content type. + * @param aContentId content Id. + * @param aOperation operation (add/delete/update/execute). + * @param aDataMap data map if available. Can be NULL. + * Ownership NOT transferred. + * * @return void */ - void RefreshL( TDesC& aPublisher, TDesC& aContentType, - TDesC& aContentId, TDesC& aOperation ); + void RefreshL( TDesC& aPublisher, + TDesC& aContentType, + TDesC& aContentId, + TDesC& aOperation, + CLiwDefaultMap* aDataMap ); /** * Createts the filter map and push it in the stack @@ -278,62 +308,6 @@ * @return boolean (ETrue/EFalse). */ TBool IsPluginActive(); - - /** - * Resume the publisher - * - * @param None - * @return void - */ - void ResumeL(); - - /** - * Suspend the publisher - * - * @param None - * @return void - */ - void SuspendL(); - - /** - * Activate the publisher - * - * @param None - * @return void - */ - void ActivateL(); - - /** - * Deactivate the publisher - * - * @param None - * @return void - */ - void DeActivateL(); - - /** - * OnLineL - * - * @param None - * @return void - */ - void OnLineL(); - - /** - * OffLineL - * - * @param None - * @return void - */ - void OffLineL(); - - /** - * InActiveL - * - * @param None - * @return void - */ - void InActiveL(); /** * Update the publisher status @@ -366,54 +340,68 @@ */ void SetUpdateNeeded(TBool aStatus); - private : - - // Subscriber interface - // own - MLiwInterface* iInterface; - - // Data Observer to CPS content registry - // Own // iConObserver; - CSapiDataObserver* iContentObserver; - - // Data Observer to CPS publisher registry - // Own // iConObserver; - CSapiDataObserver* iPubObserver; - - // Service handler - // Own - CLiwServiceHandler* iServiceHandler; - - // Array of configurations - // Own - RPointerArray iItemList; + /** + * Sets property value. + * + * @since S60 5.2 + * @param aAny - contains pointer to command buffer. + */ + void SetCommandBuffer(TAny* aAny); + +private: + // new functions - // Number of configurations - TInt iItemCount; + /** + * Gets the menu item from the publisher + * + * @param none + * @return void + */ + void GetMenuItemsL(); + + /** + * Change the publisher status with list of actions + * + * @param aActionsList new list of status for the publisher + * @return void + */ + void ChangePublisherStatusL(CLiwDefaultList* aActionsList); - // Command name in configuration Array - HBufC8* iCommandName; - /* publisher id */ +private: + // data + /** CPS Command Buffer Interface, Not Owned */ + MAiCpsCommandBuffer* iCpsExecute; + /** Subscriber interface, Not owned */ + MLiwInterface* iInterface; + /** Service handler, Not owned */ + CLiwServiceHandler* iServiceHandler; + /** Data Observer to CPS content registry, owned */ + CSapiDataObserver* iContentObserver; + /** Data Observer to CPS publisher registry, owned */ + CSapiDataObserver* iPubObserver; + /** Array of configurations, owned */ + RPointerArray iItemList; + /** Number of configurations */ + TInt iItemCount; + /** publisher id, owned */ HBufC* iPublisher; - /* content type */ - HBufC* iContentType; - /* content id */ + /** content id, owned */ HBufC* iContentId; - - // Reference of the sapi data plugin - // Not owned - CSapiDataPlugin* iPlugin; - - // Menu item names - // Own - RPointerArray iMenuItems; - - // Trigger names for the menu items - // Own - RPointerArray iMenuTriggers; - - // Store the status of update needed on resume + /** Startup reason, owned */ + HBufC8* iStartupReason; + /** Reference of the sapi data plugin, not owned */ + CSapiDataPlugin* iPlugin; + /** Menu item names, owned */ + RPointerArray iMenuItems; + /** Trigger names for the menu items, owned */ + RPointerArray iMenuTriggers; + /** Store the status of update needed on resume */ TBool iUpdateNeeded; + // Is Menu item read. + TBool iGetMenuItems; }; -#endif /*SAPIDATA_H*/ +#endif // SAPIDATA_H + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/inc/sapidataobserver.h --- a/idlefw/plugins/sapidataplugin/inc/sapidataobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataobserver.h Wed May 12 13:36:47 2010 +0300 @@ -19,15 +19,26 @@ #ifndef SAPIDATAOBSERVER_H #define SAPIDATAOBSERVER_H -// INCLUDE FILES +// System includes #include +// User includes + +// Forward declarations class CSapiData; -class CSapiDataObserver : public CBase, public MLiwNotifyCallback +/** + * @ingroup group_sapidataplugin + * + * Sapi data observer + * + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CSapiDataObserver ) : public CBase, + public MLiwNotifyCallback { -public: - +public: // constructor and destructor + /** * Part of the two phased constuction * @@ -45,7 +56,7 @@ */ ~CSapiDataObserver(); -private : +private: // construtors /** * Constructor @@ -64,7 +75,7 @@ */ void ConstructL( MLiwInterface* aInterface, CSapiData* aData ); -public: //from MLiwNotifyCallbackc +public: //from MLiwNotifyCallback /** * Handles notifications caused by an asynchronous Execute*CmdL call @@ -84,7 +95,7 @@ CLiwGenericParamList& aEventParamList, const CLiwGenericParamList& /*aInParamList*/); -public: +public: // new functions /** * Registers to CPS for add, delete , update and execute notifications @@ -99,19 +110,15 @@ */ void ReleaseL(); -private: - - // Reference of - // Not owned - MLiwInterface* iInterface; +private: // data - // Reference of the sapi data - // Not owned - CSapiData* iData; - - // Call back error code - TInt iError; - + /** Interface Reference, not owned */ + MLiwInterface* iInterface; + /** Reference of the sapi data, not owned */ + CSapiData* iData; }; -#endif /*SAPIDATAOBSERVER_H*/ +#endif // SAPIDATAOBSERVER_H + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/inc/sapidataplugin.h --- a/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Wed May 12 13:36:47 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Plug-in main class +* Description: SAPI data plug-in main class * */ @@ -19,17 +19,18 @@ #ifndef SAPIDATAPLUGIN_H #define SAPIDATAPLUGIN_H -#include -#include +// System includes + +// User includes +#include #include -#include +// Forward declarations class MAiContentObserver; class MAiContentItemIterator; -class MAiPSPropertyObserver; class CSapiData; -class CDesC16Array; class CGulIcon; +class CLiwDefaultMap; /** * @ingroup group_sapidataplugin @@ -38,13 +39,11 @@ * * @since S60 v3.2 */ -class CSapiDataPlugin : public CAiContentPublisher, - public MAiPropertyExtension, - public MAiEventHandlerExtension - - { +NONSHARABLE_CLASS( CSapiDataPlugin ) : public CHsContentPublisher + { +public: + // data types -public : /** * Plugin's network state. */ @@ -62,11 +61,12 @@ { ENone, EResume, - ESuspend, - EInActive, + ESuspend }; + public: - + // constructor and destructor + /** * Part of the two phased constuction * @@ -84,6 +84,7 @@ ~CSapiDataPlugin(); private: + // constructors /** * Constructor @@ -100,148 +101,72 @@ * @return void */ void ConstructL(); - - /** - * Resume the plug-in. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void DoResumeL(TAiTransitionReason aReason); -public: // from base class CAiContentPublisher +public: + // from CHsContentPublisher /** - * From CAiContentPublisher - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, e.g. the plug-in - * should unload its engines due backup operation. The method transits the - * plug-in to "Idle" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Stop( TAiTransitionReason aReason ); + * @see CHsContentPublisher + */ + void Start( TStartReason aReason ); /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * allowed to consume CPU resources, e.g plug-in is able to run timers, - * perform asynchronous operations, etc. The method transits the plug-in - * to "Alive" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Resume( TAiTransitionReason aReason ); - + * @see CHsContentPublisher + */ + void Stop( TStopReason aReason ); + /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timers, cancel outstanding asynchronous operations, etc. The method - * transits the plug-in to "Suspendend" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Suspend( TAiTransitionReason aReason ); - - /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @return void - */ - void SubscribeL( MAiContentObserver& aObserver ); + * @see CHsContentPublisher + */ + void Resume( TResumeReason aReason ); /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plugin shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @param aSettings setting items defined in the UI definition. - * @return void - */ - void ConfigureL( RAiSettingsItemArray& aSettings ); + * @see CHsContentPublisher + */ + void Suspend( TSuspendReason aReason ); + + /** + * @see CHsContentPublisher + */ + void SetOnline(); + + /** + * @see CHsContentPublisher + */ + void SetOffline(); /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension( TUid aUid ); - -// from base class MAiPropertyExtension - - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - TAny* GetPropertyL( TInt aProperty ); + * @see CHsContentPublisher + */ + void SubscribeL( MAiContentObserver& aObserver ); /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - void SetPropertyL( TInt aProperty, TAny* aValue ); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 + * @see CHsContentPublisher */ - void HandleEvent(TInt aEvent, const TDesC& aParam); - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEventName - name of the event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where mapping to unique identifier supplied by event - * is failed by the frame work then the and - * are provided to plug-in as-is in the descriptor. - */ - void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + void ConfigureL( RAiSettingsItemArray& aSettings ); /** - * Invoked by the framework for querying if plugin has menu item - * - * @param aMenuItem menu item name. - * @return ETrue if plugin has specific menu item, EFalse otherwise - */ - TBool HasMenuItem(const TDesC16& aMenuItem); + * @see CHsContentPublisher + */ + void SetProperty( TProperty aProperty, TAny* aAny ); + + /** + * @see CHsContentPublisher + */ + TAny* GetProperty( TProperty aProperty ); + + /** + * @see CHsContentPublisher + */ + void HandleEvent( const TDesC& aEventName, const TDesC& aParam ); + + /** + * @see CHsContentPublisher + */ + TBool HasMenuItem( const TDesC16& aMenuItem ); -public : // new functions +public: + // new functions /** * Publishes widget's texts and images @@ -270,11 +195,15 @@ /** * RefereshL a specific image of text in the widget * - * @param aContentType content type - * @param aOperation operation performed + * @param aContentType content type + * @param aOperation operation performed + * @param aDataMap data map if available. Can be NULL. + * Ownership NOT transferred. * @return void */ - void RefreshL(TDesC& aContentType, TDesC& aOperation); + void RefreshL( TDesC& aContentType, + TDesC& aOperation, + CLiwDefaultMap* aDataMap ); /** * Is plugin active to publish the data @@ -282,7 +211,7 @@ * @param void * @return boolean (ETrue/EFalse) */ - TBool IsActive(); + TBool IsActive() const; /** * Publish a specific text of the widget @@ -332,69 +261,38 @@ * CSapiData getter * @return Pointer to CSapiData */ - inline CSapiData* Data() const - { - return iData; - } + CSapiData* Data() const; /* * Plugin's network status getter - * @return Pointer to Harvester status observer */ - inline TPluginNetworkStatus NetworkStatus() const - { - return iNetworkStatus; - } - -private: // data - - // Iterator for plugin content - // Own - MAiContentItemIterator* iContent; - - // Array of content observers - // Own - RPointerArray iObservers; - - // Information about the content publisher (this plug-in) - TAiPublisherInfo iInfo; - - // Number of data in the content model. - TInt iDataCount; - - // Dynamic content model - // Own - TAiContentItem* iContentModel; + TPluginNetworkStatus NetworkStatus() const; - // Reference array for Published text - // Own - RPointerArray iDataArray; - - // Service API Data Subscriber. - // Own - CSapiData* iData; - - // References array for published images - // Own - RArray iIconArray; - - // File Server - // Reference - RFs iRfs; - - // Plugin's network status - TPluginNetworkStatus iNetworkStatus; - - // Is Homescreen foreground. - TBool iHSForeGround; - - // Is KeyLockON. - TBool iKeyLockOn; - - // Plugin state +private: + // data + /** Iterator for plugin content, owned */ + MAiContentItemIterator* iContent; + /** Array of content observers, owned */ + RPointerArray iObservers; + /** Number of data in the content model */ + TInt iDataCount; + /** Dynamic content model, owned */ + TAiContentItem* iContentModel; + /** Reference array for Published text, owned */ + RPointerArray< HBufC > iDataArray; + /** Service API Data Subscriber, owned */ + CSapiData* iData; + /** References array for published images, owned */ + RArray< CGulIcon* > iIconArray; + /** Handle to file server session, owned */ + RFs iRfs; + /** Plugin's network status */ + TPluginNetworkStatus iNetworkStatus; + /** Plugin state */ TPluginStates iPluginState; }; #endif // SAPIDATAPLUGIN_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h --- a/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Wed May 12 13:36:47 2010 +0300 @@ -36,6 +36,7 @@ _LIT(KPlugin, "plugin"); _LIT(KNewsTicker ,"newsticker"); +_LIT(KTextEditor, "texteditor"); // CPS Constants @@ -74,16 +75,23 @@ _LIT( KOperationDelete, "delete" ); _LIT( KOperationExecute, "execute" ); _LIT( KAddUpdateDelete, "add:update:delete" ); -_LIT( KUpdate, "update" ); +_LIT( KAddUpdate, "add:update" ); _LIT(KWidget, "hswidget"); -_LIT( KDeActive, "deactive"); -_LIT( KActive, "active"); -_LIT( KSuspend , "suspend"); -_LIT( KResume, "resume"); -_LIT( KOnLine, "online"); -_LIT( KOffLine, "offline"); -_LIT( KInActive, "inactive"); +_LIT8( KDeActive, "deactive"); +_LIT8( KActive, "active"); +_LIT8( KSystemStartup, "systemstartup"); +_LIT8( KPageStartup, "pagestartup"); +_LIT8( KPluginStartup, "pluginstartup"); +_LIT8( KSuspend , "suspend"); +_LIT8( KResume, "resume"); +_LIT8( KSystemShutdown, "systemshutdown"); +_LIT8( KPageShutdown, "pageshutdown"); +_LIT8( KPluginShutdown, "pluginshutdown"); +_LIT8( KOnLine, "online"); +_LIT8( KOffLine, "offline"); + + // reserved extension for retrieving mask handle _LIT8( KMask, "_mask"); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/inc/sapidatapluginuids.hrh --- a/idlefw/plugins/sapidataplugin/inc/sapidatapluginuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginuids.hrh Wed May 12 13:36:47 2010 +0300 @@ -19,8 +19,6 @@ #ifndef SAPIDATAPLUGINUIDS_HRH #define SAPIDATAPLUGINUIDS_HRH -#include - /** * Ecom dll uid for AI Data plug-in. */ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/src/sapidata.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidata.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/src/sapidata.cpp Wed May 12 13:36:47 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,15 +15,20 @@ * */ +// System includes #include #include #include #include +// User includes +#include #include "sapidata.h" #include "sapidatapluginconst.h" #include "sapidataobserver.h" #include "sapidataplugin.h" + +const TUint KDisableNotification = 0x2000; // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -99,10 +104,8 @@ void CSapiData::ConstructL(CSapiDataPlugin* aPlugin) { iPlugin = aPlugin; - iCommandName = NULL; - iContentId = NULL; - iContentType = NULL; iUpdateNeeded = EFalse; + iGetMenuItems = ETrue; } // --------------------------------------------------------------------------- @@ -112,40 +115,29 @@ // CSapiData::~CSapiData() { - delete iCommandName; delete iPublisher; - delete iContentType; delete iContentId; - + delete iStartupReason; if(iPubObserver) { - TRAP_IGNORE(iPubObserver->ReleaseL() ); delete iPubObserver; iPubObserver = NULL; } if(iContentObserver) { - TRAP_IGNORE(iContentObserver->ReleaseL() ); delete iContentObserver; iContentObserver = NULL; } - if( iInterface ) - { - iInterface->Close(); - iInterface = NULL; - } - if( iServiceHandler ) - { - iServiceHandler->Reset(); - delete iServiceHandler; - iServiceHandler = NULL; - } iMenuItems.ResetAndDestroy(); iMenuTriggers.ResetAndDestroy(); iItemList.ResetAndDestroy(); // not owned iPlugin = NULL; + iInterface = NULL; + iServiceHandler = NULL; + iCpsExecute = NULL; + } // --------------------------------------------------------------------------- @@ -154,30 +146,13 @@ // void CSapiData::ConfigureL(RAiSettingsItemArray& aConfigurations ) { - HBufC8* serviceName = NULL; - HBufC8* interfaceName = NULL; - TInt count = aConfigurations.Count(); - for(TInt i = 0;iAiPluginConfigurationItem(); - // if owner is plugin then it (key,value) is for plugin configurations items if(confItem.Owner() == KPlugin()) { - if(confItem.Name() == KService()) - { - serviceName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); - } - else if( confItem.Name() == KInterface() ) - { - interfaceName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); - } - else if( confItem.Name() == KCommand() ) - { - iCommandName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); - } - else if( confItem.Name() == KPublisher16() ) + if( confItem.Name() == KPublisher16() ) { iPublisher = confItem.Value().AllocL(); } @@ -197,62 +172,37 @@ CleanupStack::PopAndDestroy(objectId); } } - iItemCount = iItemList.Count(); - - if( !serviceName || !interfaceName || !iCommandName - || !iContentId || !iPublisher || !iItemCount ) + if( iPublisher->Des().Length() == 0 ) { // No service to offer without plugin configurations User::Leave( KErrNotSupported ); } - iServiceHandler = CLiwServiceHandler::NewL(); - - // for convenience keep pointers to Service Handler param lists - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - - CLiwCriteriaItem* criteriaItem = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, *interfaceName , *serviceName ); - criteriaItem->SetServiceClass( TUid::Uid( KLiwClassBase ) ); - // Interface name - RCriteriaArray criteriaArray; - criteriaArray.AppendL( criteriaItem ); - // attach Liw criteria - iServiceHandler->AttachL( criteriaArray ); - iServiceHandler->ExecuteServiceCmdL( *criteriaItem, *inParamList, *outParamList ); - - CleanupStack::PopAndDestroy(criteriaItem); - criteriaArray.Reset(); - - // extract CPS interface from output params - TInt pos( 0 ); - outParamList->FindFirst( pos, *interfaceName ); - if( pos != KErrNotFound ) - { - //iInterface is MLiwInterface* - iInterface = (*outParamList)[pos].Value().AsInterface(); - User::LeaveIfNull( iInterface ); - } - else - { - User::Leave( KErrNotFound ); - } - inParamList->Reset(); - outParamList->Reset(); - delete interfaceName; - delete serviceName; - - //Gets the menu items from the publisher registry - GetMenuItemsL(); - iContentObserver = CSapiDataObserver::NewL( iInterface, this ); iPubObserver = CSapiDataObserver::NewL( iInterface, this ); } +// --------------------------------------------------------------------------- +// SetContentIdL +// --------------------------------------------------------------------------- +// void CSapiData::SetContentIdL(const TDesC8& aId) { iContentId = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aId); } + +// --------------------------------------------------------------------------- +// SetStartupReasonL +// --------------------------------------------------------------------------- +// +void CSapiData::SetStartupReasonL(const TDesC8& aStartupReason) + { + delete iStartupReason; + iStartupReason = NULL; + iStartupReason = aStartupReason.AllocL(); + ChangePublisherStatusL( aStartupReason ); + } + // --------------------------------------------------------------------------- // GetMenuItemsL // --------------------------------------------------------------------------- @@ -421,6 +371,13 @@ // TBool CSapiData::HasMenuItem(const TDesC& aMenuItem ) { + if ( iGetMenuItems ) + { + //Gets the menu items from the publisher registry + TRAP_IGNORE( GetMenuItemsL() ); + iGetMenuItems = EFalse; + } + TBool found = EFalse; for (TInt i = 0; i < iMenuItems.Count(); i++ ) { @@ -549,27 +506,24 @@ void CSapiData::ExecuteCommandL(const TDesC& aRegistry, CLiwDefaultMap* aInFilter, CLiwGenericParamList* aOutParamList) { - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - - TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); - inParamList->AppendL( type ); - - //append filter to input param - TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); - inParamList->AppendL( item ); - - // execute service.It is assumed that iInterface is already initiated - if(iInterface) - { - iInterface->ExecuteCmdL( *iCommandName, *inParamList, *aOutParamList); - } - else - { - User::Leave( KErrNotSupported ); - } - type.Reset(); - item.Reset(); - inParamList->Reset(); + if( iInterface == NULL ) + { + User::Leave( KErrNotSupported ); + } + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); + inParamList->AppendL( type ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); + inParamList->AppendL( item ); + + // execute service.It is assumed that iInterface is already initiated + iInterface->ExecuteCmdL( KGetList, *inParamList, *aOutParamList); + type.Reset(); + item.Reset(); + inParamList->Reset(); } // --------------------------------------------------------------------------- @@ -578,6 +532,10 @@ // void CSapiData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger ) { + if( iInterface == NULL ) + { + User::Leave( KErrNotSupported ); + } HBufC8* triggerName = HBufC8::NewLC( KSAPIContentNameMaxLength ); CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); @@ -653,7 +611,7 @@ if ( iItemCount > 0) { CLiwDefaultMap* pubRegFilter = CreateFilterLC( KAll(), KAll() ); - pubRegFilter->InsertL( KOperation, TLiwVariant( KUpdate ) ); + pubRegFilter->InsertL( KOperation, TLiwVariant( KAddUpdate ) ); iPubObserver->RegisterL( pubRegFilter, KPubData() ); CleanupStack::PopAndDestroy( pubRegFilter ); } @@ -678,12 +636,15 @@ // RefreshL // --------------------------------------------------------------------------- // -void CSapiData::RefreshL( TDesC& aPublisher, TDesC& aContentType, - TDesC& aContentId, TDesC& aOperation ) +void CSapiData::RefreshL( TDesC& aPublisher, + TDesC& aContentType, + TDesC& aContentId, + TDesC& aOperation, + CLiwDefaultMap* aDataMap ) { if ( CanUpdate( aPublisher, aContentType, aContentId ) ) { - iPlugin->RefreshL( aContentType, aOperation); + iPlugin->RefreshL( aContentType, aOperation, aDataMap ); } } @@ -697,108 +658,89 @@ } // --------------------------------------------------------------------------- -// PublisherStatusL +// ChangePublisherStatusL // --------------------------------------------------------------------------- // -void CSapiData::ChangePublisherStatusL(const TDesC& aStatus) +void CSapiData::ChangePublisherStatusL(const TDesC8& aStatus) { - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - HBufC8* triggerName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aStatus); - CleanupStack::PushL( triggerName ); + if( iCpsExecute == NULL ) + { + User::Leave( KErrNotSupported ); + } - TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); - inParamList->AppendL( type ); - + if ( aStatus == KResume && iUpdateNeeded ) + { + iPlugin->PublishL(); + iUpdateNeeded = EFalse; + } CLiwDefaultMap* filter = CreateFilterLC( KWidget() ); - filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); - - TLiwGenericParam item( KFilter, TLiwVariant( filter )); - inParamList->AppendL( item ); - - if(iInterface) - { - iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); - } - else - { - User::Leave( KErrNotSupported ); - } - + // Add execute command triggers. Idle framework will execute + iCpsExecute->AddCommand( *iContentId, KPubData, filter, aStatus ); CleanupStack::PopAndDestroy( filter ); - CleanupStack::PopAndDestroy( triggerName ); - inParamList->Reset(); - outParamList->Reset(); - } - -// --------------------------------------------------------------------------- -// ResumeL -// --------------------------------------------------------------------------- -// -void CSapiData::ResumeL() - { - if ( iUpdateNeeded ) - { - iPlugin->PublishL(); - iUpdateNeeded = EFalse; - } - ChangePublisherStatusL( KResume ); + } // --------------------------------------------------------------------------- -// SuspendL -// --------------------------------------------------------------------------- -// -void CSapiData::SuspendL() - { - ChangePublisherStatusL( KSuspend ); - } - -// --------------------------------------------------------------------------- -// ActivateL +// ChangePublisherStatusL // --------------------------------------------------------------------------- // -void CSapiData::ActivateL() +void CSapiData::ChangePublisherStatusL(CLiwDefaultList* aActionsList) { - ChangePublisherStatusL( KActive ); - } + if( iInterface == NULL ) + { + User::Leave( KErrNotSupported ); + } + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC( KWidget() ); + // add list of action triggers to execute + filter->InsertL(KActionTrigger, TLiwVariant(aActionsList) ); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); -// --------------------------------------------------------------------------- -// DeActivateL -// --------------------------------------------------------------------------- -// -void CSapiData::DeActivateL() - { - ChangePublisherStatusL( KDeActive ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); + CleanupStack::PopAndDestroy( filter ); + outParamList->Reset(); + inParamList->Reset(); + } // --------------------------------------------------------------------------- -// OnLineL -// --------------------------------------------------------------------------- -// -void CSapiData::OnLineL() - { - ChangePublisherStatusL( KOnLine ); - } - -// --------------------------------------------------------------------------- -// offLineL +// TriggerActiveL // --------------------------------------------------------------------------- // -void CSapiData::OffLineL() +void CSapiData::TriggerActiveL() { - ChangePublisherStatusL( KOffLine ); - } - -// --------------------------------------------------------------------------- -// InActiveL -// --------------------------------------------------------------------------- -// -void CSapiData::InActiveL() - { - ChangePublisherStatusL( KInActive ); - } - + if(iInterface) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC( KAll(), KAll() ); + filter->InsertL(KActionTrigger, TLiwVariant( KActive() )); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList, KDisableNotification ); + + CleanupStack::PopAndDestroy( filter ); + inParamList->Reset(); + outParamList->Reset(); + } + else + { + User::Leave( KErrNotSupported ); + } + } // --------------------------------------------------------------------------- // UpdatePublisherStatusL // --------------------------------------------------------------------------- @@ -806,26 +748,34 @@ void CSapiData::UpdatePublisherStatusL( TDesC& aPublisher ) { if ( aPublisher == iPublisher ) - { - // Resend the plugin status to publisher - ActivateL(); + { + // Resend the plugin status to publisher + CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC(); + actionsToLaunch->AppendL( TLiwVariant( KActive )); + if( iStartupReason->Length() != 0 ) + { + actionsToLaunch->AppendL( TLiwVariant( *iStartupReason )); + } if ( iPlugin->IsActive() ) { - ResumeL(); + actionsToLaunch->AppendL( TLiwVariant( KResume )); } else { - SuspendL(); + actionsToLaunch->AppendL(TLiwVariant( KSuspend )); } // forward the network status if it uses. if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOnline ) { - OnLineL(); + actionsToLaunch->AppendL(TLiwVariant( KOnLine )); } else if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOffline ) { - OffLineL(); + actionsToLaunch->AppendL(TLiwVariant( KOffLine )); } + + ChangePublisherStatusL( actionsToLaunch ); + CleanupStack::PopAndDestroy( actionsToLaunch ); } } @@ -915,3 +865,19 @@ { iUpdateNeeded = aStatus; } + +// --------------------------------------------------------------------------- +// SetCommandBuffer +// --------------------------------------------------------------------------- +// +void CSapiData::SetCommandBuffer(TAny* aAny) + { + iCpsExecute = reinterpret_cast ( aAny ); + if ( iCpsExecute ) + { + iInterface = iCpsExecute->CpsInterface(); + iServiceHandler = iCpsExecute->ServiceHandler(); + } + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -19,6 +19,7 @@ #include #include #include +#include #include "sapidata.h" #include "sapidataobserver.h" #include "sapidatapluginconst.h" @@ -37,6 +38,7 @@ // CSapiDataObserver ::~CSapiDataObserver () { + TRAP_IGNORE( ReleaseL() ); iInterface = NULL; iData = NULL; } @@ -56,9 +58,7 @@ inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant(aRegistry))); inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant(aFilter))); - iError = KErrNone; - TRAP( iError, iInterface->ExecuteCmdL( - KRequestNotification, + TRAP_IGNORE( iInterface->ExecuteCmdL(KRequestNotification, *inParamList, *outParamList, 0, @@ -72,7 +72,7 @@ // Sing off to notification // --------------------------------------------------------------------------- // -void CSapiDataObserver ::ReleaseL() +void CSapiDataObserver::ReleaseL() { if( iInterface ) { @@ -81,9 +81,7 @@ CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); CleanupStack::PushL( outParamList ); - TInt err(KErrNone); - TRAP(err, iInterface->ExecuteCmdL( - KRequestNotification, + TRAP_IGNORE( iInterface->ExecuteCmdL( KRequestNotification, *inParamList, *outParamList, KLiwOptCancel, @@ -129,7 +127,6 @@ { // Is plugin active to refresh the published data - iError = aErrorCode; TInt count(0); TInt pos(0); const TLiwGenericParam* param(NULL); @@ -178,31 +175,61 @@ } } else if ( iData->IsPluginActive() ) - { - // notification from content registry - found = map->FindL( KContentType, variant ); - if (found) - { - contentType = variant.AsDes().AllocLC(); - } - variant.Reset(); - found = map->FindL( KContentId, variant ); - if (found) - { - contentId = variant.AsDes().AllocLC(); - } - variant.Reset(); - iData->RefreshL( *publisher, *contentType, *contentId, *operation ); - - if ( contentId ) - { - CleanupStack::PopAndDestroy( contentId ); - } - if ( contentType ) - { - CleanupStack::PopAndDestroy( contentType ); - } - } + { + // notification from content registry + found = map->FindL( KContentType, variant ); + if( found ) + { + contentType = variant.AsDes().AllocLC(); + } + variant.Reset(); + + // content id + found = map->FindL( KContentId, variant ); + if( found ) + { + contentId = variant.AsDes().AllocLC(); + } + variant.Reset(); + + // Data map. Optional. + CLiwDefaultMap* dataMap = NULL; + + found = map->FindL( KDataMap, variant); + if( found ) + { + TPtrC8 data = variant.AsData(); + RDesReadStream datastrm ( data ); + CleanupClosePushL( datastrm ); + dataMap = CLiwDefaultMap::NewLC( datastrm ); + // There is no CLiwDefaultMap::NewL( RReadStream ) + // so, must do some work with cleanup stack here. + CleanupStack::Pop( dataMap ); + CleanupStack::PopAndDestroy(); // datastrm + dataMap->PushL(); + } + + iData->RefreshL( *publisher, + *contentType, + *contentId, + *operation, + dataMap ); + + if( dataMap ) + { + CleanupStack::PopAndDestroy( dataMap ); + } + + if( contentId ) + { + CleanupStack::PopAndDestroy( contentId ); + } + + if( contentType ) + { + CleanupStack::PopAndDestroy( contentType ); + } + } else { // remember update if plugin is in suspend mode diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -11,18 +11,14 @@ * * Contributors: * -* Description: Profile plug-in publisher +* Description: SAPI data plug-in publisher * */ - +// System includes #include #include -#include -#include -#include #include -#include #include #include #include @@ -30,14 +26,22 @@ #include #include #include + +// User includes +#include +#include +#include +#include +#include #include +#include #include "sapidatapluginconst.h" #include "sapidatapluginuids.hrh" #include "sapidataplugin.h" #include "sapidata.h" -// CONST CLASS VARIABLES +// Constants const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY( KImplUidDataPlugin, CSapiDataPlugin::NewL ) @@ -75,6 +79,7 @@ // --------------------------------------------------------------------------- // CSapiDataPlugin::CSapiDataPlugin() + : iNetworkStatus( EUnknown ), iPluginState( ENone ) { } @@ -83,14 +88,10 @@ // --------------------------------------------------------------------------- // void CSapiDataPlugin::ConstructL() - { - iInfo.iUid.iUid = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; - iPluginState = ENone; - iHSForeGround = EFalse; - iKeyLockOn = EFalse; - iNetworkStatus = EUnknown; - iData = CSapiData::NewL(this); - + { + User::LeaveIfError( iRfs.Connect() ); + + iData = CSapiData::NewL( this ); } // --------------------------------------------------------------------------- @@ -101,123 +102,36 @@ CSapiDataPlugin::~CSapiDataPlugin() { // deactivate the publishers - if( iData ) - { - TRAP_IGNORE(iData->DeActivateL()); - delete iData; - } + delete iData; iObservers.Close(); Release( iContent ); iDataArray.ResetAndDestroy(); - if( iContentModel) + if ( iContentModel ) { - for( TInt i = iDataCount-1;i>=0 ; i-- ) + for ( TInt i = iDataCount - 1; i >= 0 ; i-- ) { User::Free((TAny*)iContentModel[i].cid); } - delete []iContentModel; - } - iIconArray.Reset(); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-ins take ownership of the settings array, so it must either -// store it in a member or free it. -// --------------------------------------------------------------------------- -// -void CSapiDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) - { - if( iDataCount > 0 ) - { - // We own the array so destroy it - aSettings.ResetAndDestroy(); - return; + + delete [] iContentModel; } - RAiSettingsItemArray contentItemsArr; - RAiSettingsItemArray configurationItemsArr; - - TInt count = aSettings.Count(); - for(TInt i = 0; i < count; i++ ) - { - MAiPluginSettings* pluginSetting = aSettings[i]; - if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) - { - contentItemsArr.Append(pluginSetting); - } - else if( pluginSetting->AiPluginItemType() == EAiPluginConfigurationItem ) - { - configurationItemsArr.Append(pluginSetting); - } - } - iDataCount = contentItemsArr.Count(); - if(iDataCount > 0 ) - { - // Create the content Model - HBufC* contentId = HBufC::NewLC( KAiContentIdMaxLength + KAiPluginNameMaxLength ); - iContentModel = new TAiContentItem[iDataCount]; - for(TInt i = 0; i < iDataCount; i++) - { - MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); - iContentModel[i].id = i; - if( contentItem.Type() == KText() || contentItem.Type() == KNewsTicker() ) - { - // text - iContentModel[i].type = KAiContentTypeText; - } - if( contentItem.Type() == KImage() ) - { - // image - iContentModel[i].type = KAiContentTypeBitmap; - } - - contentId->Des().Copy(contentItem.Name()); - contentId->Des().Delete(0, contentId->Des().LocateReverse(KPluginNameSeprator) +1); - - TInt sizeOfContentId = contentId->Des().Size()+sizeof(wchar_t); - iContentModel[i].cid = static_cast( User::Alloc( sizeOfContentId ) ); - Mem::Copy((TAny*)iContentModel[i].cid, contentId->Des().PtrZ(), sizeOfContentId); - - contentId->Des().Delete( 0, contentId->Des().Length()); - } - - CleanupStack::PopAndDestroy( contentId ); - iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); - // Configurations - iData->ConfigureL(configurationItemsArr); - - // Activate the publisher - iData->ActivateL(); - - // Register for notifications - iData->RegisterPublisherObserverL(); - - PublishL(); - - iPluginState = ESuspend; - iData->RegisterContentObserverL(); - } - contentItemsArr.Reset(); - configurationItemsArr.Reset(); - // We own the array so destroy it - aSettings.ResetAndDestroy(); - // publish the initial data + iIconArray.Reset(); + iRfs.Close(); } + // --------------------------------------------------------------------------- // Publishes widget's texts and images // --------------------------------------------------------------------------- // void CSapiDataPlugin::PublishL() - { - User::LeaveIfError( iRfs.Connect() ); - + { TInt observers( iObservers.Count() ); TInt transactionId = reinterpret_cast( this ); - for ( int i = 0; i < observers; i++ ) + for ( TInt i = 0; i < observers; i++ ) { MAiContentObserver* observer = iObservers[i]; @@ -231,10 +145,8 @@ // Release memory of the published text iDataArray.ResetAndDestroy(); // Release memory of the published icons - iIconArray.Reset(); - - } - iRfs.Close(); + iIconArray.Reset(); + } } // --------------------------------------------------------------------------- @@ -340,19 +252,20 @@ } else // Interpret as File path { - RFile* iconFile = new (ELeave) RFile(); - err = iconFile->Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); + RFile iconFile; + + err = iconFile.Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); + if( err == KErrNone ) { - aObserver->Publish( *this, aContentId, *iconFile, aContentId ); + aObserver->Publish( *this, aContentId, iconFile, aContentId ); } else { aObserver->Clean( *this, aContentId, aContentId ); } - iconFile->Close(); - delete iconFile; - iconFile = NULL; + + iconFile.Close(); } } } @@ -438,38 +351,52 @@ } // --------------------------------------------------------------------------- -//Refresh a specific image of text in the widget +//Refresh a specific image or text in the widget // --------------------------------------------------------------------------- // -void CSapiDataPlugin::RefreshL(TDesC& aContentType, TDesC& aOperation) +void CSapiDataPlugin::RefreshL( TDesC& aContentType, + TDesC& aOperation, + CLiwDefaultMap* aDataMap ) { - User::LeaveIfError( iRfs.Connect() ); - TInt observers( iObservers.Count() ); - TInt transactionId = reinterpret_cast( this ); - - for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ ) - { - MAiContentObserver* observer = iObservers[obsIndex]; - - if ( observer->StartTransaction( transactionId ) == KErrNone ) - { - if ( aOperation != KOperationDelete ) - { - iData->PublishL( observer, aContentType ); - } - else - { - iData->RemoveL( observer, aContentType ); - } - - observer->Commit( transactionId ); - } - - // Relese memory of the published text - iDataArray.ResetAndDestroy(); - iIconArray.Reset(); - } - iRfs.Close(); + __PRINTS("*** CSapiDataPlugin::RefreshL ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x, content type: %S, operation: %S" ), + &PublisherInfo().Name(), PublisherInfo().Uid().iUid, &aContentType, &aOperation ); + + const TInt observerCount( iObservers.Count() ); + const TInt transactionId = reinterpret_cast( this ); + + for( TInt obsIndex = 0; obsIndex < observerCount; obsIndex++ ) + { + MAiContentObserver* observer = iObservers[obsIndex]; + + if( observer->StartTransaction( transactionId ) == KErrNone ) + { + if ( aOperation != KOperationDelete ) + { + if( aDataMap ) + { + iData->PublishDataL( observer, aDataMap ); + } + else + { + iData->PublishL( observer, aContentType ); + } + } + else + { + iData->RemoveL( observer, aContentType ); + } + + observer->Commit( transactionId ); + } + + // Relese memory of the published text + iDataArray.ResetAndDestroy(); + iIconArray.Reset(); + } + + __PRINTS("*** CSapiDataPlugin::RefreshL - done ***"); } // --------------------------------------------------------------------------- @@ -483,269 +410,308 @@ { aObserver->Clean( *this, aContentId, aContentId ); } + } - } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is requested to unload its engines due backup operation -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::Start +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::Start( TStartReason aReason ) + { + if( aReason == ESystemStartup ) + { + TRAP_IGNORE( PublishL() ); + TRAP_IGNORE( iData->SetStartupReasonL( KSystemStartup )); + } + else if( aReason == EPageStartup ) + { + TRAP_IGNORE( iData->SetStartupReasonL( KPageStartup )); + } + else if( aReason == EPluginStartup ) + { + TRAP_IGNORE( PublishL() ); + TRAP_IGNORE( iData->SetStartupReasonL( KPluginStartup)); + } + + // Listen for publisher registration to resend the events + TRAP_IGNORE( iData->RegisterPublisherObserverL() ); + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::Stop +// +// ---------------------------------------------------------------------------- // -void CSapiDataPlugin::Stop( TAiTransitionReason aReason ) +void CSapiDataPlugin::Stop( TStopReason aReason ) + { + if( aReason == ESystemShutdown ) + { + TRAP_IGNORE( iData->ChangePublisherStatusL( KSystemShutdown )); + } + else if( aReason == EPageShutdown ) + { + TRAP_IGNORE( iData->ChangePublisherStatusL( KPageShutdown )); + } + else if( aReason == EPluginShutdown ) + { + TRAP_IGNORE( iData->ChangePublisherStatusL( KPluginShutdown )); + } + + if ( iData ) + { + TRAP_IGNORE( iData->ChangePublisherStatusL( KDeActive )); + } + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::Resume +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::Resume( TResumeReason aReason ) { - if( iPluginState == EResume ) + if ( aReason == EForeground ) + { + iPluginState = EResume; + TRAP_IGNORE( iData->ChangePublisherStatusL( KResume )); + } + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::Suspend +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::Suspend( TSuspendReason aReason ) + { + if ( aReason == EBackground ) { - Suspend( aReason ); + iPluginState = ESuspend; + TRAP_IGNORE( iData->ChangePublisherStatusL( KSuspend )); + } + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::SetOnline +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::SetOnline() + { + if ( iNetworkStatus != EOnline ) + { + iNetworkStatus = EOnline; + TRAP_IGNORE( iData->ChangePublisherStatusL( KOnLine )); + } + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::SetOffline +// +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::SetOffline() + { + if ( iNetworkStatus != EOffline ) + { + iNetworkStatus = EOffline; + TRAP_IGNORE( iData->ChangePublisherStatusL( KOffLine )); } } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- -// -void CSapiDataPlugin::Resume( TAiTransitionReason aReason ) - { - TRAP_IGNORE( DoResumeL( aReason ) ); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is not allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::SubscribeL // -void CSapiDataPlugin::Suspend( TAiTransitionReason aReason ) - { - switch( aReason ) - { - case EAiKeylockDisabled: - case EAiKeylockEnabled: - { - // handled in resume - TRAP_IGNORE( DoResumeL( aReason ) ); - break; - } - default : - { - iPluginState = ESuspend; - TRAP_IGNORE ( iData->SuspendL() ); - } - } - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// The plug-in MUST maintain a registry of subscribers and send -// notification to all of them whenever the state changes or new content -// is available -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CSapiDataPlugin::SubscribeL( MAiContentObserver& aObserver ) - { + { iObservers.AppendL( &aObserver ); } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Returns the extension interface. Actual type depends on the passed -// aUid argument. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::ConfigureL +// +// ---------------------------------------------------------------------------- // -TAny* CSapiDataPlugin::Extension( TUid aUid ) - { - if ( aUid == KExtensionUidProperty ) - { - return static_cast( this ); - } - else if (aUid == KExtensionUidEventHandler) - { - return static_cast( this ); - } - else - { - return NULL; - } +void CSapiDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) + { + if ( iDataCount > 0 ) + { + // We own the array so destroy it + aSettings.ResetAndDestroy(); + return; + } + + RAiSettingsItemArray contentItemsArr; + RAiSettingsItemArray configurationItemsArr; + + TInt count( aSettings.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + MAiPluginSettings* setting( aSettings[i] ); + + if ( setting->AiPluginItemType() == EAiPluginContentItem ) + { + contentItemsArr.Append( setting ); + } + else if ( setting->AiPluginItemType() == EAiPluginConfigurationItem ) + { + configurationItemsArr.Append( setting ); + } + } + + iDataCount = contentItemsArr.Count(); + + if ( iDataCount > 0 ) + { + // Create the content Model + HBufC* contentId = HBufC::NewLC( + KAiContentIdMaxLength + KAiPluginNameMaxLength ); + + iContentModel = new TAiContentItem[iDataCount]; + + for ( TInt i = 0; i < iDataCount; i++ ) + { + MAiPluginContentItem& contentItem( + contentItemsArr[i]->AiPluginContentItem() ); + + iContentModel[i].id = i; + + if( contentItem.Type() == KText() || + contentItem.Type() == KNewsTicker() || + contentItem.Type() == KTextEditor() ) + { + // text + iContentModel[i].type = KAiContentTypeText; + } + if( contentItem.Type() == KImage() ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + + contentId->Des().Copy( contentItem.Name() ); + contentId->Des().Delete( 0, + contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); + + TInt sizeOfContentId( contentId->Des().Size() + sizeof( wchar_t ) ); + + iContentModel[i].cid = + static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); + + Mem::Copy( ( TAny* )iContentModel[i].cid, + contentId->Des().PtrZ(), sizeOfContentId ); + + contentId->Des().Delete( 0, contentId->Des().Length() ); + } + + CleanupStack::PopAndDestroy( contentId ); + + iContent = AiUtility::CreateContentItemArrayIteratorL( + iContentModel, iDataCount ); + + iData->SetContentIdL( PublisherInfo().Namespace() ); + + // Configurations + iData->ConfigureL( configurationItemsArr ); + + iPluginState = ESuspend; + + // Listen the publisher content update + iData->RegisterContentObserverL(); + + // Activate the publisher + iData->ChangePublisherStatusL( KActive ); + // Execute the active trigger + iData->TriggerActiveL(); + + } + + contentItemsArr.Reset(); + configurationItemsArr.Reset(); + + // We own the array so destroy it + aSettings.ResetAndDestroy(); } -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Read property of publisher plug-in. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::SetProperty // -TAny* CSapiDataPlugin::GetPropertyL( TInt aProperty ) +// ---------------------------------------------------------------------------- +// +void CSapiDataPlugin::SetProperty( TProperty aProperty, TAny* aAny ) { - TAny* property = NULL; - - switch ( aProperty ) - { - case EAiPublisherInfo: + if (aProperty == ECpsCmdBuffer ) { - property = static_cast( &iInfo ); - break; - } - - case EAiPublisherContent: + iData->SetCommandBuffer( aAny ); + } + } +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::GetProperty +// +// ---------------------------------------------------------------------------- +// +TAny* CSapiDataPlugin::GetProperty( TProperty aProperty ) + { + if ( aProperty == EPublisherContent ) { - property = static_cast( iContent ); - break; - } - default: - break; + return static_cast< MAiContentItemIterator* >( iContent ); } - - return property; + + return NULL; } -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Write property value to optimize the content model. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::HandleEvent // -void CSapiDataPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - { - if( aProperty == EAiPublisherInfo ) - { - ASSERT( aValue ); - - const TAiPublisherInfo* info( - static_cast( aValue ) ); - - iInfo = *info; - - iData->SetContentIdL( info->iNamespace ); - } - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CSapiDataPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) - { - // This is not as there is no event id to retrieve in this dynamic plugin. - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CSapiDataPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) { - // We have no way of reporting errors to framework so just ignore them. - TRAP_IGNORE(iData->ExecuteActionL( aEventName , aParam ) ); + TRAP_IGNORE( iData->ExecuteActionL( aEventName , aParam ) ); + } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::HasMenuItem +// +// ---------------------------------------------------------------------------- +// +TBool CSapiDataPlugin::HasMenuItem( const TDesC16& aMenuItem ) + { + return iData->HasMenuItem ( aMenuItem ); } -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Invoked by the framework for querying if plugin has menu item -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::IsActive // -TBool CSapiDataPlugin::HasMenuItem( const TDesC& aMenuItem ) - { - return iData->HasMenuItem ( aMenuItem ); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// framework instructs plug-in that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // -void CSapiDataPlugin::DoResumeL( TAiTransitionReason aReason ) +TBool CSapiDataPlugin::IsActive() const { - //update in startup phase and idle is on foreground. - switch ( aReason ) - { - case EAiIdleOnLine: - { - iNetworkStatus = EOnline; - iData->OnLineL(); - break; - } - case EAiIdleOffLine: - { - iNetworkStatus = EOffline; - iData->OffLineL(); - break; - } - case EAiIdlePageSwitch: - { - if ( iPluginState == EResume ) - { - iData->SuspendL(); - } - iPluginState = EInActive; - iData->InActiveL(); - } - break; - case EAiSystemStartup: - case EAiIdleForeground: - { - iHSForeGround = ETrue; - } - case EAiBacklightOn: - { - if ( iPluginState == ESuspend && !iKeyLockOn ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockDisabled: - { - iKeyLockOn = EFalse; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == ESuspend ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockEnabled: - { - iKeyLockOn = ETrue; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == EResume ) - { - iPluginState = ESuspend ; - iData->SuspendL(); - } - break; - } - case EAiScreenLayoutChanged: - { - // ignore events - break; - } - case EAiGeneralThemeChanged: - { - // ignore event - break; - } - case EAiIdleBackground: - { - iHSForeGround = EFalse; - } - default : - { - if ( iPluginState == EResume ) - { - iPluginState = ESuspend; - iData->SuspendL(); - } - break; - } - } + return iPluginState == EResume; } -// --------------------------------------------------------------------------- -// Is plugin active to publish the data -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::Data +// +// ---------------------------------------------------------------------------- // -TBool CSapiDataPlugin::IsActive() +CSapiData* CSapiDataPlugin::Data() const { - return (iPluginState == EResume ); + return iData; } + +// ---------------------------------------------------------------------------- +// CSapiDataPlugin::NetworkStatus +// +// ---------------------------------------------------------------------------- +// +CSapiDataPlugin::TPluginNetworkStatus CSapiDataPlugin::NetworkStatus() const + { + return iNetworkStatus; + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/BWINS/aiscutextservu.def --- a/idlefw/plugins/shortcutplugin/BWINS/aiscutextservu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - ?Connect@RAiScutExtServ@@QAEHXZ @ 1 NONAME ; int RAiScutExtServ::Connect(void) - ?IsInShortcuts@RAiScutExtServ@@QBEHAAH@Z @ 2 NONAME ; int RAiScutExtServ::IsInShortcuts(int &) const - ?IssuePutInShortcuts@RAiScutExtServ@@QAEHXZ @ 3 NONAME ; int RAiScutExtServ::IssuePutInShortcuts(void) - ?ResetIcon@RAiScutExtServ@@QAEHXZ @ 4 NONAME ; int RAiScutExtServ::ResetIcon(void) - ?ResetPopupText@RAiScutExtServ@@QAEHXZ @ 5 NONAME ; int RAiScutExtServ::ResetPopupText(void) - ?UpdateIconL@RAiScutExtServ@@QAEHABVCGulIcon@@@Z @ 6 NONAME ; int RAiScutExtServ::UpdateIconL(class CGulIcon const &) - ?UpdatePopupTextL@RAiScutExtServ@@QAEHABVMDesC16Array@@@Z @ 7 NONAME ; int RAiScutExtServ::UpdatePopupTextL(class MDesC16Array const &) - ?Version@RAiScutExtServ@@QBE?AVTVersion@@XZ @ 8 NONAME ; class TVersion RAiScutExtServ::Version(void) const - ?Connect@RAiScutExtServ@@QAEHABVTDesC16@@@Z @ 9 NONAME ; int RAiScutExtServ::Connect(class TDesC16 const &) - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/EABI/aiscutextservu.def --- a/idlefw/plugins/shortcutplugin/EABI/aiscutextservu.def Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - _ZN14RAiScutExtServ11UpdateIconLERK8CGulIcon @ 1 NONAME - _ZN14RAiScutExtServ14ResetPopupTextEv @ 2 NONAME - _ZN14RAiScutExtServ16UpdatePopupTextLERK12MDesC16Array @ 3 NONAME - _ZN14RAiScutExtServ19IssuePutInShortcutsEv @ 4 NONAME - _ZN14RAiScutExtServ7ConnectEv @ 5 NONAME - _ZN14RAiScutExtServ9ResetIconEv @ 6 NONAME - _ZNK14RAiScutExtServ13IsInShortcutsERi @ 7 NONAME - _ZNK14RAiScutExtServ7VersionEv @ 8 NONAME - _ZN14RAiScutExtServ7ConnectERK7TDesC16 @ 9 NONAME - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/cenrep/keys_scutplugin.xls Binary file idlefw/plugins/shortcutplugin/cenrep/keys_scutplugin.xls has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/conf/scutplugin.confml Binary file idlefw/plugins/shortcutplugin/conf/scutplugin.confml has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/conf/scutplugin_10275104.crml Binary file idlefw/plugins/shortcutplugin/conf/scutplugin_10275104.crml has changed diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/group/aiscutextserv.mmp --- a/idlefw/plugins/shortcutplugin/group/aiscutextserv.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for AI Shortcut xSP Extension API -* -*/ - -#include - -TARGET aiscutextserv.dll -TARGETTYPE DLL -UID 0x1000008D 0x10282CDD - -CAPABILITY ALL -TCB -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE aiscutextserv.cpp - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY bafl.lib -LIBRARY estor.lib -LIBRARY egul.lib -LIBRARY fbscli.lib - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/group/aiscutplugin.mmp --- a/idlefw/plugins/shortcutplugin/group/aiscutplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for project ShortcutPlugin -* -*/ - -#include -#include -#include - -//MACRO MY_DEBUG - -//#include "../../../inc/common/debug.h" -//#define AI_ENABLE_RD_LOGGING -#define AI_RD_LOG_TO_DEBUG_OUTPUT - -// Master flag for enabling xSP extensions -#define AI_SCUTPLUGIN_XSP_EXTENSIONS - -TARGET aiscutplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -// xSP extension -#ifdef AI_SCUTPLUGIN_XSP_EXTENSIONS -SOURCE caiscutengineext.cpp -SOURCE caiscutextserver.cpp -SOURCE caiscutextsession.cpp -SOURCE caiscutshortcutext.cpp -SOURCE PopupFSM.cpp -SOURCE cpopupeventhandler.cpp -SOURCE caiscutextdata.cpp -SOURCE caiscutextdatamodel.cpp -SOURCE aiscutfactoryext.cpp -USERINCLUDE . -LIBRARY estor.lib -#else -SOURCE aiscutfactory.cpp -#endif - -SOURCE caiscutplugin.cpp -SOURCE caiscutengine.cpp -SOURCE caiscutshortcut.cpp -SOURCE caiscutshortcutinfo.cpp -SOURCE caiscuttarget.cpp -SOURCE caiscuttargetapp.cpp -SOURCE caiscuttargetbkm.cpp -SOURCE caiscuttargethttp.cpp -SOURCE caiscuttargetkeylock.cpp -SOURCE caiscuttargetmessagingview.cpp -SOURCE caiscuttargetnewmsg.cpp -SOURCE caiscuttargetempty.cpp -SOURCE aiscuttargetshutter.cpp - -SOURCE taiscutparser.cpp -SOURCE aidefaultshortcut.cpp -SOURCE aiscutappuidparser.cpp -SOURCE aiscutrepositorywatcher.cpp - -START RESOURCE aiscutplugin.rss -TARGET aiscutplugin.rsc -END - -START RESOURCE aiscutpluginres.rss -HEADER -TARGET aiscutpluginres.rsc -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -START RESOURCE aiscuttexts.rss -HEADER -TARGET aiscuttexts.rsc -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../../../inc/common -USERINCLUDE ../inc - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY cone.lib -LIBRARY ecom.lib -LIBRARY apparc.lib // TApaTask -LIBRARY apgrfx.lib // CApaAppListNotifier -LIBRARY viewcli.lib // CVwsSessionWrapper -LIBRARY ws32.lib // RWsSession -LIBRARY inetprotutil.lib // TUriParser -LIBRARY centralrepository.lib // CRepository -LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler -LIBRARY msgs.lib // Message Server -LIBRARY muiu.lib // MsvUiServiceUtilities -LIBRARY sendui.lib // Send UI -LIBRARY egul.lib // CGulIcon -LIBRARY aknskins.lib // AknsUtils -LIBRARY charconv.lib // CnvUtfConverter -LIBRARY avkon.lib -LIBRARY aknnotify.lib -LIBRARY featmgr.lib -LIBRARY aiutils.lib -LIBRARY fbscli.lib -LIBRARY aknicon.lib -LIBRARY favouritesengine.lib -LIBRARY commonengine.lib // For RConeResourceLoader -LIBRARY platformenv.lib // For PathInfo -LIBRARY efsrv.lib -LIBRARY bafl.lib -LIBRARY imcm.lib -LIBRARY akncapserverclient.lib // Fastswap -#ifdef __WEB_WIDGETS -LIBRARY widgetregistryclient.lib -#endif -LIBRARY keylockpolicyapi.lib -LIBRARY gfxtrans.lib -LIBRARY akntransitionutils.lib -LIBRARY gslauncher.lib - -// Debugging dependencies -LIBRARY flogger.lib - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/group/aiscutsettings.mmp --- a/idlefw/plugins/shortcutplugin/group/aiscutsettings.mmp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for project ShortcutPlugin settings -* -*/ - - -#include - -#include - -#include - -//#include "../../../inc/common/debug.h" -//#define AI_ENABLE_RD_LOGGING -#define AI_RD_LOG_TO_DEBUG_OUTPUT - -//MACRO MY_DEBUG - -TARGET aiscutsettings.dll -TARGETTYPE PLUGIN -UID 0x10009D8D AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE caiscutsettings.cpp -SOURCE caiscutsettingsimplementationtable.cpp -SOURCE caiscutsettingscontainer.cpp -SOURCE caiscutsettingsmodel.cpp -SOURCE caiscutsettingsitem.cpp -SOURCE caiscutsettingsapplist.cpp -SOURCE caiscutsettingsbkmlist.cpp - -SOURCE taiscutparser.cpp -SOURCE aidefaultshortcut.cpp -SOURCE aiscutappuidparser.cpp -SOURCE aiscutrepositorywatcher.cpp - -START RESOURCE aiscutsettings.rss -TARGET aiscutsettings.rsc -END - -START RESOURCE aiscutsettingsres.rss -HEADER -TARGET aiscutsettingsres.rsc -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../../../inc/common -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY eikcoctl.lib -LIBRARY eikcore.lib -LIBRARY cdlengine.lib -LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler -LIBRARY gsframework.lib // For base classes -LIBRARY gslistbox.lib // For CGSListBoxItemTextArray -LIBRARY gsecomplugin.lib -LIBRARY commonengine.lib // For RConeResourceLoader -LIBRARY inetprotutil.lib // For TUriParser -LIBRARY apgrfx.lib // For RApaLsSession -LIBRARY apparc.lib // For TApaAppInfo -LIBRARY msgs.lib // For Message Server -LIBRARY platformenv.lib // For PathInfo -LIBRARY hlplch.lib // for HlpLauncher -LIBRARY featmgr.lib // For feature manager -LIBRARY favouritesengine.lib -LIBRARY javaregistryclient.lib // For JavaRegistry -#ifdef __WEB_WIDGETS -LIBRARY widgetregistryclient.lib -#endif - -// Debugging dependencies -LIBRARY flogger.lib - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/group/backup_registration.xml --- a/idlefw/plugins/shortcutplugin/group/backup_registration.xml Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/group/bld.inf --- a/idlefw/plugins/shortcutplugin/group/bld.inf Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bld.inf for Shortcut Plugin. -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../loc/ai3scutsettings.loc MW_LAYER_LOC_EXPORT_PATH(ai3scutsettings.loc) -../loc/ai3scutplugin.loc MW_LAYER_LOC_EXPORT_PATH(ai3scutplugin.loc) - -../rom/aiscutplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(aiscutplugin_resources.iby) -../rom/aiscutplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiscutplugin.iby) - - -// Backup registration -backup_registration.xml /epoc32/data/z/private/102750f9/backup_registration.xml -backup_registration.xml /epoc32/release/winscw/udeb/z/private/102750f9/backup_registration.xml -backup_registration.xml /epoc32/release/winscw/urel/z/private/102750f9/backup_registration.xml - -// Generic configuration interface for component cenrep settings -../conf/scutplugin.confml APP_LAYER_CONFML(scutplugin.confml) -../conf/scutplugin_10275104.crml APP_LAYER_CRML(scutplugin_10275104.crml) - -PRJ_EXTENSIONS - -START EXTENSION s60/mifconv -OPTION TARGETFILE aiscutplugin.mif -OPTION HEADERFILE aiscutplugin.mbg -OPTION SOURCES -c8,8 qgn_prop_ai_shortcut -c8,8 qgn_menu_url \ - -c8,8 qgn_menu_mce_sel_mes -c8,8 qgn_menu_mce_syncmail \ - -c8,8 qgn_menu_am -c8,8 qgn_prop_cp_conn_shortcut \ - -c8,8 qgn_prop_psln_ai_sub -END - -PRJ_MMPFILES -aiscutsettings.mmp -aiscutplugin.mmp -aiscutextserv.mmp - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aidefaultshortcut.h --- a/idlefw/plugins/shortcutplugin/inc/aidefaultshortcut.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Platform default shortcuts. -* -*/ - - -#ifndef AIDEFAULTSHORTCUT_H -#define AIDEFAULTSHORTCUT_H - -#include // for TInt -#include // for TUid, TDes - - -class TAiDefaultShortcut -{ -public: - /** - * Get S60 platform default shortcut uid and definition for index aIndex. - * - */ - static void GetDefaultShortcut(TInt aIndex, TUid& aUid, TDes& aDefinition); - -}; - -#endif diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutapptitle.rh --- a/idlefw/plugins/shortcutplugin/inc/aiscutapptitle.rh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in app title structs. -* -*/ - - -#ifndef AISCUTAPPTITLE_RH -#define AISCUTAPPTITLE_RH - -STRUCT AI_APP_TITLE_ITEM -{ - LONG appuid; - LONG viewid = -1; - LTEXT longtitle = ""; - LTEXT shorttitle = ""; - LTEXT skeytitle = ""; - LTEXT msktitle = ""; -} - -STRUCT AI_APP_TITLE_LIST -{ - STRUCT items[]; // AI_APP_TITLE_ITEM items. -} - -#endif // AISCUTAPPTITLE_RH - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutappuidparser.h --- a/idlefw/plugins/shortcutplugin/inc/aiscutappuidparser.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser. -* -*/ - - -#ifndef AISCUTAPPUIDPARSER_H -#define AISCUTAPPUIDPARSER_H - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Parser class that interpretes the given text as a description of - * application position data. - */ -class TAiScutAppUidParser -{ -public: // Construction - - /** - * Standard C++ constructor. - * @param aData Data which will be parsed - * @param aAppPositions This array will be filled with parsed - * application positions. - */ - TAiScutAppUidParser(const TDesC& aData, RArray& aAppPositions); - -public: // Interface - - /** - * Parses the data that was given in constructor and fills the - * application position array with parsed data. - */ - void ParseL(); - -private: // Implementation - /** - * Skips the given char. - * Skipping can be done conditionally or unconditionally. - * If conditional skipping is used, next character in data will be - * skipped only if it is the same as given character. - * If unconditional skipping is used the next character in data must - * be the given character, otherwise the data is invalid and parsing - * will be stopped. - * @param aChar Character that will be skipped. - * @param aConditionalSkip If ETrue, use conditional skipping, - * otherwise unconditional skipping will be - * used. - */ - void SkipChar(TChar aChar, TBool aConditionalSkip); - - /** - * Reads app UID from data. If data doesn't contain app UID in the - * point in which this function is called, data is considered invalid. - * @return App UID that was read from data. - */ - TUid ReadAppUid(); - -private: - - /// Ref: Application positions array that will be filled when parsing - RArray& iUidArray; - - /// Lexer for data - TLex iLex; - - /// Is the data that has been read so far valid. - TBool iLexIsValid; -}; - -#endif // AISCUTAPPUIDPARSER_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutfactory.h --- a/idlefw/plugins/shortcutplugin/inc/aiscutfactory.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in factory class. -* -*/ - - -#ifndef AISCUTENGINEFACTORY_H -#define AISCUTENGINEFACTORY_H - -#include - -class CAiScutEngine; -class CAiScutPlugin; -class CAiScutShortcut; - -/** - * AiScutEngineFactory - * - * Creates various classes used in AiScutPlugin. - * - * @since S60 v3.2 - */ -class AiScutFactory - { - public: - /** - * Creates CAiScutEngine - * @since S60 v3.2 - */ - static CAiScutEngine* CreateAiScutEngineL( CAiScutPlugin& aPlugin ); - - /** - * Creates CAiScutShortcut - * @since S60 v3.2 - */ - static CAiScutShortcut* CreateAiScutShortcutL( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ); - - /** - * Creates CAiScutShortcut - * @since S60 v3.2 - */ - static CAiScutShortcut* CreateAiScutShortcutLC( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ); - }; - -#endif // AISCUTENGINEFACTORY_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutpluginprivatecrkeys.h --- a/idlefw/plugins/shortcutplugin/inc/aiscutpluginprivatecrkeys.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut Plug-in private CenRep keys. -* -*/ - - -#ifndef AISCUTPLUGINPRIVATECRKEYS_H -#define AISCUTPLUGINPRIVATECRKEYS_H - -#include - -#endif // AISCUTPLUGINPRIVATECRKEYS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutrepositorywatcher.h --- a/idlefw/plugins/shortcutplugin/inc/aiscutrepositorywatcher.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser. -* -*/ - - -#ifndef AISCUTREPOSITORYWATCHER_H -#define AISCUTREPOSITORYWATCHER_H - -// INCLUDES -#include -#include // For CCenRepNotifyHandler - -// CLASS DECLARATIONS - -class CAiScutRepositoryWatcher : public CBase, public MCenRepNotifyHandlerCallback -{ -public: - static CAiScutRepositoryWatcher* NewL( - const TUid aUid, - const TUint32 aKey, - CCenRepNotifyHandler::TCenRepKeyType aKeyType, - TCallBack aCallBack, - CRepository* aRepository); - - static CAiScutRepositoryWatcher* NewL( - const TUid aUid, - TCallBack aCallBack, - CRepository* aRepository); - - ~CAiScutRepositoryWatcher(); - - void StartListeningL(); - - void StopListening(); - - TUint32 ChangedKey(); - -public: // from MCenRepNotifyHandlerCallback - void HandleNotifyInt (TUint32 aKey, TInt aNewValue); - void HandleNotifyString (TUint32 aKey, const TDesC16& aNewValue); - void HandleNotifyGeneric(TUint32 aKey); - void HandleNotifyError (TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler); - -private: - CAiScutRepositoryWatcher( - const TUid aUid, - const TUint32 aKey, - TCallBack aCallBack, - CRepository* aRepository); - - void ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType); - - void ConstructL(); - -private: - TUid iUid; - TUint32 iKey; - TUint32 iChangedKey; - TCallBack iCallBack; - CRepository* iRepository; - CCenRepNotifyHandler* iNotifyHandler; - -}; - -#endif // AISCUTREPOSITORYWATCHER_H - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscutsettings.hrh --- a/idlefw/plugins/shortcutplugin/inc/aiscutsettings.hrh Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for Shortcut plug-in -* -*/ - - -#ifndef AISCUTSETTINGS_HRH -#define AISCUTSETTINGS_HRH - -/** - * Menu command ids for the Shortcut plug-in Settings - */ -enum TAiScutSettingsMenuCommands -{ - EAiScutSettingsCmdChange = 0x6000, - - EAiScutSettingsCmdChangeToApps, - EAiScutSettingsCmdChangeToUrl, - EAiScutSettingsCmdChangeToBookmark, - EAiScutSettingsCmdChangeShortcutType -}; - -/** - * Shortcut setting types - */ -enum TAiScutSettingType -{ - EAiScutSettingTypeUndefined = -1, - EAiScutSettingTypeApplication, - EAiScutSettingTypeBookmark, - EAiScutSettingTypeUrl -}; - -#endif // AISCUTSETTINGS_HRH - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/aiscuttargetshutter.h --- a/idlefw/plugins/shortcutplugin/inc/aiscuttargetshutter.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CAISCUTTARGET_H -#define CAISCUTTARGET_H - -#include -#include - -class TApaTask; -class CPeriodic; - -/** - * Base class for shortcut targets - * - * @since S60 v3.2 - */ -class CAiScutTargetShutter : public CActive -{ - -public: - - static CAiScutTargetShutter* NewL( CCoeEnv* aEnv, TUid aAppUid, TBool aIsRunning, TBool aIsDialog ); - - virtual ~CAiScutTargetShutter(); - - void StartL(); - -private: - - CAiScutTargetShutter( CCoeEnv* aEnv, TUid aAppUid ); - - void ConstructL( TBool aIsRunning, TBool aIsDialog ); - - // from base class CActive - - /** - * From CActive - * - * @since S60 v3.2 - */ - void DoCancel(); - - /** - * From CActive - * - * @since S60 v3.2 - */ - void RunL(); - - /** - * From CActive - * Handles an error situation - * - * @since S60 v3.2 - * @param aError Error code received from system - * @return Error code after error handling - */ - TInt RunError( TInt aError ); - - static TInt TaskExistsCallback( TAny* aPtr ); - - static TInt TaskNotExistsCallback( TAny* aPtr ); - - void Run(); - -private: //data - - /** - * Pointer to the control environment - * Not own. - */ - CCoeEnv* iEnv; - - /** - * Target application uid - */ - TUid iAppUid; - - /** - * Window Server session - */ - RWsSession iWsSession; - - /** - * Task exsit or not - */ - TBool iTaskExists; - - /** - * Periodic timer - * Own - */ - CPeriodic* iPeriodic; - - /** - * Count retry times - */ - TInt iCounter; - - /** - * Target application is running - */ - TBool iIsRunning; - - /** - * Target app is dialog - */ - TBool iIsDialog; - - - /** - * - */ - TBool iTaskKilled; -}; - -#endif // CAISCUTTARGET_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutengine.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutengine.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,667 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in engine class. -* -*/ - - -#ifndef CAISCUTENGINE_H -#define CAISCUTENGINE_H - -#include // For MApaAppListServObserver -#include // For MMsvSessionObserver -#include // For RFavouritesDb -#include // For MFavouritesDbObserver -#include -#ifdef __WEB_WIDGETS -#include -#endif - -#include - -#include "aiscutdefs.h" -#include "taiscutparser.h" -#include "aicontentpublisher.h" - -class CCoeEnv; -class CVwsSessionWrapper; -class CActiveFavouritesDbNotifier; -class CAiScutPlugin; -class CAiScutShortcut; -class CRepository; -class CAiScutRepositoryWatcher; -class CAiScutTargetShutter; -class CKeyLockPolicyApi; - -/** - * Defines the different scenarios of shortcut access checking. - */ -enum TScutAccessCheckType -{ - EScutCheckMailbox, - EScutCheckApp, - EScutCheckBkm, - EScutCheckAll -}; - -/** - * Defines which default can be used, when daulting is needed (uninstall/mem card removed) - */ -enum TScutDefault -{ - EScutUserDefined = 0, - EScutDefaultToPlatform, - EScutDefaultToTheme -}; - -enum TScutLockKey - { - EScutFirstLockKey, - EScutSecondLockKey -}; - -/** - * Shortcut plug-in engine class. - * - * Handles most of plug-in activity. - * - * @since S60 v3.2 - */ -class CAiScutEngine : public CBase - , public MMsvSessionObserver - , public MApaAppListServObserver - , public MFavouritesDbObserver -{ - -public: - - /** - * First phase contructor. - * - * @since S60 v3.2 - * @param aPlugin Reference to the main plug-in class - */ - static CAiScutEngine* NewL(CAiScutPlugin& aPlugin); - - virtual ~CAiScutEngine(); - - // from base class MMsvSessionObserver - - /** - * Handles an event from the message server - * - * @since S60 v3.2 - * @param aEvent Indicates the event type. - * @param aArg1 Event type-specific argument value - * @param aArg2 Event type-specific argument value - * @param aArg3 Event type-specific argument value - */ - void HandleSessionEventL( - TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); - - // from base class MApaAppListServObserver - - /** - * From MApaAppListServObserver. - * Handles a change in the application list - * - * @since S60 v3.2 - * @param aEvent Event id - */ - void HandleAppListEvent(TInt aEvent); - - /** - * Resumes the engine - * - * @since S60 v3.2 - */ - virtual void ResumeL(TBool aPublishAll, TAiTransitionReason aReason); - - /** - * Suspends the engine - * - * @since S60 v3.2 - */ - void Suspend(); - - /** - * - */ - static TInt HandleShortcutsChanged(TAny* aPtr); - - /** - * - */ - static TInt HandleHiddenAppsChanged(TAny* aPtr); - - /** - * - */ - TBool IsHidden(const TUid& aAppUid) const; - - /** - * Handles an event sent by the AI framework - * - * @since S60 v3.2 - * @param aEvent Event (service) id - * @param aParam Event parameter(s) - */ - virtual void HandleAiEventL(TInt aEvent, const TDesC& aParam); - - /** - * Called by the timer. Retries the access check for shortcuts. - * - * @since S60 v3.2 - */ - void RetryAccessCheck(); - - /** - * Checks if application is midlet or widget. - * @param aUid Application uid - * @since S60 v3.2 - */ - TBool IsNonNative(const TUid& aUid); - - TBool IsHiddenFromFSW( const TUid& aAppUid ); -#ifdef __WEB_WIDGETS - /** - * Ask client session if given UID is widget. - */ - TBool IsWidget(const TUid& aUid); -#endif - - /** - * Handles call state changes (non-static version). - * - * @since S60 v3.2 - */ - void HandleCallStateChange(); - - /** - * Merges the user defined shortcuts with the defaults. - * @param aType shortcut type - * @param aRecreateAll forces the recreation of shortcuts - * @since S60 v3.2 - */ - void MergeShortcuts(TShortcutType aType, TBool aRecreateAll); - - /** - *Get Application title - */ - TBool GetAppTitle( - const TUid& aAppUid, - const TUid& aViewId, - TDes& aTitle, - TAiScutAppTitleType aType); - - /** - * Returns the application architecture server session owned by the engine - * - * @since S60 v3.2 - * @return Reference to RApaLsSession - */ - inline RApaLsSession& ApaSession(); - - /** - * Returns reference to the bookmark database owned by the engine - * - * @since S60 v3.2 - * @return Reference to RFavouritesDb - */ - inline RFavouritesDb& FavouritesDb(); - - /** - * Returns the message server session owned by the engine - * - * @since S60 v3.2 - * @return Pointer to CMsvSession - */ - inline CMsvSession* MsvSession(); - - /** - * Returns a pointer to view server session wrapper. - * - * @since S60 v3.2 - * @return Pointer to view server session wrapper - */ - inline CVwsSessionWrapper* VwsSession(); - - /** - * Returns a pointer to the coe environment - * - * @since S60 v3.2 - * @return Pointer to coe environment - */ - inline CCoeEnv* Env(); - - /** - * Creates the shortcuts merging the defaults with user defined ones. - * - * @since S60 v3.2 - */ - void CreateShortcutsL(); - -protected: - - - /** - * C++ constructor - * - * @since S60 v3.2 - * @param aPlugin Reference to the main plug-in class - */ - CAiScutEngine(CAiScutPlugin& aPlugin); - - void ConstructL(); - -protected: - - /** - * Merges the user defined shortcuts with the defaults. - * Leaving version - * @param aType shortcut type - * @param aRecreateAll forces the recreation of shortcuts - * @since S60 v3.2 - */ - void MergeShortcutsL(TShortcutType aType, TBool aRecreateAll); - - /** - * Checks shortcut accessibility. If the AppArc server or message server - * respond that they are not ready, a timer is launched to check later. - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @param aPublishAll All shortcuts are published - */ - void CheckAccessAndPublish(TInt aCheckType, TBool aPublishAll); - - /** - * Tells each shortcut to check whether or not its target is accessible. - * Shortcuts will revert to the default setting if the user setting is - * not accessible. - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @param aPublishAll All shortcuts are published - */ - void CheckAccessAndPublishL(TInt aCheckType, TBool aPublishAll); - - /** - * Finds the shortcut object with the given id - * - * @since S60 v3.2 - * @param aId Shortcut id - * @return Shortcut index or KErrNotFound - */ - TInt FindShortcutIndex(TInt32 aId); - - /** - * Handles the shortcut launch by index. - * - * @since S60 v3.2 - * @param aParam Index of the shortcut to launch - */ - void HandleLaunchByIndexL(const TDesC& aParam); - - /** - * Handles the special launching of a shortcut. The - * launching can be done based on the location of - * the shortcut (sk, toolbar item etc) or based on the - * application it points to. Currently when this function is - * called to a shortcut that points to appshell the fastswap - * window is opened - * - * @since s60 v5.0 - * @param aParam Index of the shortcut to perform the special launch - */ - void HandleLaunchByIndexAlternateL(const TDesC& aParam); - /** - * Handles the shortcut launch by value - * - * @since S60 v3.2 - * @param aParam Value of the shortcut to launch - */ - void HandleLaunchByValueL(const TDesC& aParam); - - /** - * Shows the plug-in settings dialog. - * - * @since S60 v3.2 - */ - void ShowSettingsL(const TDesC& aParam); - - /** - * Shows the plug-in setting. - * - * @since S60 v5.0 - */ - void ShowSettingL(const TDesC& aParam); - - /** - * Opens the fast swap window - * - * @since S60 v5.0 - */ - void OpenFastSwap(); - /** - * Handles PS commands from WSPlugin. - * - * @since S60 v3.2 - */ - static TInt HandlePSCommand(TAny* aAny); - - /** - * Handles call state changes. - * - * @since S60 v3.2 - */ - static TInt CallStateChangeCallback(TAny* aPtr); - - /** - * Callback for delay timer - */ - static TInt DelayTimerCallBack(TAny *aSelf ); - - - /** - * Get soft key uid - * - * @since S60 v3.2 - * @param aSoftkeyId shortcut index - */ - TUid SoftkeyUid(TUint32 aSoftkeyId); - - /** - *Check softkey delay is required - * - * @since S60 v3.2 - * @param AppUid application uid - */ - TBool IsDelayRequired(TUid aAppUid); - - /** - * Handles PS commands from WSPlugin (leaving version). - * - * @since S60 v3.2 - */ - void DoHandlePSCommandL(); - - /** - * Activates phone/video call application - * - * @since S60 v3.2 - */ - void ActivateTopMostApp(); - - /** - * Check MsvSession is Needed - */ - TBool IsMsvSessionNeeded(); - - /** - * Check Bookmark Observer is Needed - */ - TBool IsBookmarkObserverNeeded(); - - /** - * Load application titles list - */ - void LoadAppTitleListL(); - - /** - * Get hidden applications - */ - void GetHiddenAppsL(); - - void CheckForThemeDefaultReinstalledL(); - - TBool IsLockKey( TInt aScanCode, TScutLockKey aLockKey ) const; - - TInt AddOverrideIcon( TAiScutIcon &aIcon ); - - /** - * Starts a delay timer that calls HandleLaunchByIndexL() after - * a short delay. Delay is read from cenrep with the key KAIKeyLockTimeout - * - * @param aParam The parameter to pass to HandleLaunchByIndexL() - * - */ - void DelayedLaunchByIndexL( const TDesC &aParam ); -private: // From MFavouritesDbObserver - - /** - * Handles database event. - * @param aEvent Database event. - */ - void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); - -protected: // data - - /** - * Shortcut objects. - * Own. - */ - RAiShortcutArray iShortcuts; - - /** - * Shortcut objects for storing theme default scuts. - * Own. - */ - RAiShortcutInfoArray iThemeShortcuts; - - /** - * Flags for shortcuts to indicate whether platform or theme default is used. - */ - RArray iDefaultUsed; - - /** - * Central Repository session. - * Own. - */ - CRepository* iRepository; - - /** - * Notifier for changes in the application list - * (installations / uninstallations). - * Own. - */ - CApaAppListNotifier* iAppNotifier; - - /** - * Notifier for changes in the shortcut settings. - * Own. - */ - CAiScutRepositoryWatcher* iSettingsNotifier; - - /** - * Message server session. - * Own. - */ - CMsvSession* iMsvSession; - - /** - * Timer that performs the availability check after a given delay. - * Own - */ - CPeriodic* iTimer; - - /** - * Reference to the plug-in. - * Not own. - */ - CAiScutPlugin& iPlugin; - - /** - * Application architecture server session. - */ - RApaLsSession iApaSession; - - /** - * Bookmark database session. - * Own. - */ - RFavouritesSession iBookmarkSess; - - /** - * Bookmark database. - * Own. - */ - RFavouritesDb iBookmarkDb; - - /** - * Bookmark database change observer. - * Own. - */ - CActiveFavouritesDbNotifier* iBookmarkDbObserver; - - /** - * View server session wrapper. - * Own - */ - CVwsSessionWrapper* iVwsSession; - - /** - * Flag to indicate that all shortcus are to be published. Used when resuming. - */ - TBool iPublishAll; - - /** - *Call key event observer - * Own - */ - MAiPSPropertyObserver* iKeyEventObserver; - - /** - * Call state PS observer. - * Own. - */ - MAiPSPropertyObserver* iCallStateObserver; - - /** - * Call state - */ - TBool iActiveCall; - - /** - * First keylock key - */ - TInt iFirstLockKey; - - /** - * First keylock key pressed flag to ensure first lock has been - * pressed when skipping key lock. Enabling the correct response to - * skip command. - */ - TBool iFirstLockKeyPressed; - - /** - * Second keylock key - */ - TInt iSecondLockKey; - - /** - * Resource loader for common text resources. - */ - RConeResourceLoader iResourceLoaderTexts; - - /** - * Resource loader for sendui text resources. - */ - RConeResourceLoader iResourceLoaderSendUi; - - /** - * Coe environment. - * Not own. - */ - CCoeEnv* iEnv; - - /** - * Array of UIDs which are hidden from the TARM - */ - RArray iHiddenApps; - - /** - * Central repository object for Hidden Apps - * Own - */ - CRepository* iHiddenAppsRepository; - - /** - * Central repository change handler for Hidden Apps - * Own - */ - CAiScutRepositoryWatcher* iHiddenAppsNotifier; - - /** - * Application titles list - */ - RArray iAppTitleList; - - /** - * Own - */ - CAiScutTargetShutter* iScutShutter; - - /** - * - */ - TBool iSoftkeyAppRunning; - -#ifdef __WEB_WIDGETS - /** - * Widget registry client session to check if UID means widget. - */ - RWidgetRegistryClientSession iWidgetRegistry; - TBool iWidgetRegistryConnected; -#endif - /** - * for parsing the icon overrides and softkeys - */ - TAiScutParser iParser; - - /** - * Override icons and softkeyicons are held here - */ - RArray iIcons; - - /** - * For checking keylock buttons - * Own - */ - CKeyLockPolicyApi *iKeylockApi; - /** - * Timer user to delay the launching - * of specific shortcuts. - * Own - */ - CPeriodic *iDelayTimer; - - /** - * Command passed to HandleLaunchByIndexL() - * when delayed launching is used - * Own - */ - HBufC *iDelayedLaunchCmd; - - /** - * Delayed launching delay. Read from cenrep - */ - TInt iDelayTimerDelay; -}; - -#include "caiscutengine.inl" - -#endif // CAISCUTENGINE_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutengine.inl --- a/idlefw/plugins/shortcutplugin/inc/caiscutengine.inl Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Inline functions for the shortcut plug-in engine -* -*/ - - -// --------------------------------------------------------------------------- -// Returns the application architecture server session owned by the engine. -// --------------------------------------------------------------------------- -// -inline RApaLsSession& CAiScutEngine::ApaSession() -{ - return iApaSession; -} - -// --------------------------------------------------------------------------- -// Returns reference to the bookmark database owned by the engine. -// --------------------------------------------------------------------------- -// -inline RFavouritesDb& CAiScutEngine::FavouritesDb() -{ - return iBookmarkDb; -} - -// --------------------------------------------------------------------------- -// Returns the message server session owned by the engine. -// --------------------------------------------------------------------------- -// -inline CMsvSession* CAiScutEngine::MsvSession() -{ - return iMsvSession; -} - -// --------------------------------------------------------------------------- -// Returns a pointer to view server session wrapper. -// --------------------------------------------------------------------------- -// -inline CVwsSessionWrapper* CAiScutEngine::VwsSession() -{ - return iVwsSession; -} - -// --------------------------------------------------------------------------- -// Returns a pointer to the coe environment -// --------------------------------------------------------------------------- -// -inline CCoeEnv* CAiScutEngine::Env() -{ - return iEnv; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutengineext.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutengineext.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in engine extension -* -*/ - - -#ifndef CAISCUTENGINEEXT_H -#define CAISCUTENGINEEXT_H - -#include - -#include "caiscutengine.h" -#include "maiscutextmessagehandler.h" -#include "caiscutshortcutext.h" - -class CAiScutPlugin; -class CAiScutExtServer; -class CAiScutExtDataModel; - -/** - * The class extends CAiScutEngine by handling events from - * xSP extension server. - * - * @since S60 v3.2 - */ -class CAiScutEngineExt : public CAiScutEngine, - public MAiScutExtMessageHandler - { - public: - /** - * Factory function - * @see CAiScutEngine - * @since S60 v3.2 - */ - static CAiScutEngineExt* NewL( CAiScutPlugin& aPlugin ); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutEngineExt(); - - private: - /** - * Constructor - * @see CAiScutEngine - * @since S60 v3.2 - */ - CAiScutEngineExt( CAiScutPlugin& aPlugin ); - - void ConstructL(); - - public: // New functions - /** - * Publishes specific shortcut - * @since S60 v3.2 - */ - void CheckAccessAndPublish( CAiScutShortcut& aShortcut ); - - private: // From CAiScutEngine - void HandleAiEventL( TInt aEvent, const TDesC& aParam ); - void ResumeL( TBool aPublishAll, TAiTransitionReason aReason ); - - private: // From MAiScutExtMessageHandler - void HandleSetPopupLineArrayL( const TDesC& aDefinition, CDesCArray* aLineArray ); - void HandleResetPopupLineArrayL( const TDesC& aDefinition ); - void HandleSetIconL( const TDesC& aDefinition, CGulIcon* aIcon ); - void HandleResetIconL( const TDesC& aDefinition ); - TBool HandleIsInShortcutsL( const TDesC& aDefinition ) const; - void HandleIssuePutInShortcutsL( const TDesC& aDefinition ); - - private: // New functions - /** - * Finds a shortcut of which id matches with given. - * @param aId Target id in hexadecimal string format - * @return Pointer to shortcut or NULL if not found - */ - CAiScutShortcutExt* FindShortcutById( const TDesC& aId ) const; - - /** - * Iterates shortcuts and sets new extension data to matching - * ones. - * @param aDefinition Definition - * @param aAiScutExtData Pointer to extension data or NULL - * @return ETrue if matching shortcut(s) found - */ - TBool PopulateExtData( const TDesC& aDefinition, - const MAiScutExtData* aAiScutExtData ); - - private: // data - /** - * xSP extension server instance - * Own. - */ - CAiScutExtServer* iAiScutExtServer; - - /** - * Extension data model - * Own. - */ - CAiScutExtDataModel* iExtDataModel; - }; - -#endif // CAISCUTENGINEEXT_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutextdata.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutextdata.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef CAISCUTEXTDATA_H -#define CAISCUTEXTDATA_H - -#include -#include - -#include "maiscutextdata.h" - -class CGulIcon; - -/** - * @since S60 v3.2 - */ -class CAiScutExtData : public CBase, - public MAiScutExtData - { - public: - /** - * Factory function - * @since S60 v3.2 - */ - static CAiScutExtData* NewL( const TDesC& aTargetDefinition ); - - - /** - * Factory function - * @since S60 v3.2 - */ - static CAiScutExtData* NewLC( const TDesC& aTargetDefinition ); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutExtData(); - - private: - /** - * Constructor - * @see CAiScutEngine - * @since S60 v3.2 - */ - CAiScutExtData(); - - void ConstructL( const TDesC& aTargetDefinition ); - - public: // New functions - /** - * @since S60 v3.2 - */ - const TDesC& TargetDefinition() const; - - /** - * Deletes old and stores new popup line array - * @param aPopupLineArray Popup line array. Ownership is transferred. - * @since S60 v3.2 - */ - void SwitchPopupLineArray( CDesCArray* aPopupLineArray ); - - /** - * @since S60 v3.2 - */ - void ResetPopupLineArray(); - - /** - * Deletes old and stores new icon - * @param aIcon Icon. Ownership is transferred. - * @since S60 v3.2 - */ - void SwitchIcon( CGulIcon* aIcon ); - - /** - * @since S60 v3.2 - */ - void ResetIcon(); - - public: //From MAiScutExtData - const MDesCArray* PopupLineArray() const; - const CGulIcon* Icon() const; - - private: // data - - /** - * Definition string of the target shortcut - * Own. - */ - HBufC* iTargetDefinition; - - /** - * Popup line array - * Own. - */ - CDesCArray* iPopupLineArray; - - /** - * Icon - * Own. - */ - CGulIcon* iIcon; - }; - -#endif // CAISCUTEXTDATA_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutextdatamodel.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutextdatamodel.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in extension data model -* -*/ - - -#ifndef CAISCUTEXTDATAMODEL_H -#define CAISCUTEXTDATAMODEL_H - -#include -#include - -class CGulIcon; -class CAiScutExtData; - -/** - * This class owns an array of CAiScutExtData items and provides an API to - * update popup line array and icon data for different targets. - * @since S60 v3.2 - */ -class CAiScutExtDataModel : public CBase - { - private: - friend class T_CAiScutExtDataModel; - - public: - /** - * Factory function - * @since S60 v3.2 - */ - static CAiScutExtDataModel* NewL(); - - - /** - * Factory function - * @since S60 v3.2 - */ - static CAiScutExtDataModel* NewLC(); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutExtDataModel(); - - private: - /** - * Constructor - * @see CAiScutEngine - * @since S60 v3.2 - */ - CAiScutExtDataModel(); - - void ConstructL(); - - public: // New functions - /** - * Sets the new popup line array for target. The old one is deleted. If - * matching target definition is not found new CAiScutExtData object is - * created. - * @param aDefinition Target definition string - * @param aLineArray Pointer to line array. Ownership is transferred - * @return Pointer to new or existing CAiScutExtData object - * @since S60 v3.2 - */ - CAiScutExtData* SetPopupLineArrayL( const TDesC& aDefinition, CDesCArray* aLineArray ); - - /** - * Resets popup line array. If also the icon is not set the CAiScutExtData - * item is deleted and removed from the array. - * @param aDefinition Target definition string - * @since S60 v3.2 - */ - CAiScutExtData* ResetPopupLineArray( const TDesC& aDefinition ); - - /** - * Sets the new icon for target. The old one is deleted. If - * matching target definition is not found new CAiScutExtData object is - * created. - * @param aDefinition Target definition string - * @param aIcon Pointer to icon. Ownership is transferred - * @return Pointer to new or existing CAiScutExtData object - * @since S60 v3.2 - */ - CAiScutExtData* SetIconL( const TDesC& aDefinition, CGulIcon* aIcon ); - - /** - * Resets icon. If also the popup line array is not set the CAiScutExtData - * item is deleted and removed from the array. - * @param aDefinition Target definition string - * @since S60 v3.2 - */ - CAiScutExtData* ResetIcon( const TDesC& aDefinition ); - - /** - * @return Array of CAiScutExtData objects - * @since S60 v3.2 - */ - TArray AiScutExtDataArray() const; - - /** - * Deletes CAiScutExtData object and removes it from the array. - * @param aDefinition Target definition string - * @since S60 v3.2 - */ - void RemoveAiScutExtData( const TDesC& aDefinition ); - - private: // New functions - TInt FindAiScutExtData( const TDesC& aDefinition ) const; - CAiScutExtData* CreateAiScutExtDataL( const TDesC& aDefinition ); - - private: // data - /** - * Shortcut extension data items - * Own. - */ - RPointerArray iAiScutExtDataArray; - }; - -#endif // CAISCUTEXTDATAMODEL_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutextserver.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutextserver.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension server class. -* -*/ - - -#ifndef CAISCUTEXTSERVER_H -#define CAISCUTEXTSERVER_H - -#include -#include - -#include "maiscutextmessagehandler.h" -#include "aicontentpublisher.h" - -class CAiScutExtServer; -class CAknMessageQueryDialog; - -/** - * - * Helper class for passing parameters to the callback function. - * - * @since S60 v3.2 - */ -class CLinkParams : public CBase - { - public: - - CLinkParams(CAiScutExtServer& aServer, HBufC* aTargetDefinition); - - ~CLinkParams(); - - public: - - /** - * Reference to the server object. - * Ref. - */ - CAiScutExtServer& iServer; - - /** - * Application identifier. - * Own. - */ - HBufC* iTargetDefinition; - - /** - * The dialog that owns the link.. - * Ref. - */ - CAknMessageQueryDialog* iNote; - }; - -/** - * Server class for xSP extensions. - * - * Handles sessions. - * - * @since S60 v3.2 - */ -class CAiScutExtServer : public CServer2 - { - public: - /** - * Constructor - * @param aObserver Reference to observer - * @since S60 v3.2 - */ - CAiScutExtServer( MAiScutExtMessageHandler& aObserver, RWsSession& aWsSession ); - - /** - * 2nd-phase constructor - * @since S60 v3.2 - */ - void ConstructL(); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutExtServer(); - - private: // From CServer2 - - CSession2* NewSessionL( - const TVersion& aVersion, const RMessage2& aMessage ) const; - - private: // New methods - - void ReadAppListL(); - - void WriteAppListL(); - - static TInt LinkCallBack(TAny* aParam); - - static TInt IdleCallBack(TAny* aParam); - - void DoShowTipMessageL(); - - public: - - TBool HasConnectedBefore( TUid& aUid, const RMessage2& aMessage ); - - void ShowTipMessage( TUid aUid ); - - void ResumeL( TAiTransitionReason aReason ); - - private: // data - - /** - * Reference to observer - * Ref. - */ - MAiScutExtMessageHandler& iObserver; - - /** - * Reference to Window Server session - * Ref. - */ - RWsSession& iWsSession; - - /** - * List of applications we are not going to - * show the tip dialog. - * Own. - */ - RArray iUids; - - /** - * List of applications to show the dialog. - * - * Own. - */ - RArray iShowUids; - - /** - * Resource offset for releasing the resoruce on destruction. - * - * Own. - */ - TInt iResourceOffset; - - /** - * CIdle for the tip dialog - * - * Own. - */ - CIdle* iIdle; - - /** - * Foreground/background indication - * - */ - TBool iIsForeground; - - /** - * Tip message visible indication - * - */ - TBool iIsTipMessageVisible; - }; - -#endif // CAISCUTEXTSERVER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutextsession.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutextsession.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension session class. -* -*/ - - -#ifndef CAISCUTEXTSESSION_H -#define CAISCUTEXTSESSION_H - -#include - -class MAiScutExtMessageHandler; - -/** - * Server session class for xSP extensions. - * - * Handles IPC between server and client. Commands and data are passed to - * observer. - * - * @since S60 v3.2 - */ -class CAiScutExtSession : public CSession2 - { - public: - /** - * Constructor - * @param aObserver Reference to observer - * @since S60 v3.2 - */ - CAiScutExtSession( MAiScutExtMessageHandler& aObserver ); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutExtSession(); - - private: // From CSession2 - void ServiceL( const RMessage2& aMessage ); - void DispatchMessageL( const RMessage2& aMessage ); - - private: // New functions - void SetTargetDefinitionL( const RMessage2& aMessage ); - void SetPopupTextL( const RMessage2& aMessage ); - void ResetPopupTextL( const RMessage2& aMessage ); - void SetIconL( const RMessage2& aMessage ); - void ResetIconL( const RMessage2& aMessage ); - void IsInShortcutsL( const RMessage2& aMessage ); - void IssuePutInShortcutsL( const RMessage2& aMessage ); - - void PanicClient( const RMessage2& aMessage, TInt aPanicCode ) const; - - private: // data - - /** - * Reference to observer - * Ref. - */ - MAiScutExtMessageHandler& iObserver; - - /** - * Target definition - * Own. - */ - HBufC* iTargetDefinition; - }; - -#endif // CAISCUTEXTSESSION_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutplugin.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plug-in main class -* -*/ - - -#ifndef CAISCUTPLUGIN_H -#define CAISCUTPLUGIN_H - -#include -#include -#include -#include - -class CAiScutEngine; -class MAiContentObserver; -class MAiContentItemIterator; -class CAiScutShortcut; - -/** - * Plug-in main class - * - * @since S60 v3.2 - */ -class CAiScutPlugin : public CAiContentPublisher - , public MAiPropertyExtension - , public MAiEventHandlerExtension -{ - -public: // factory methods and destructor. - - static CAiScutPlugin* NewL(); - - virtual ~CAiScutPlugin(); - -public: // new methods - - /** - * Publishes the given shortcut - * - * @since S60 v3.2 - * @return Reference to a shortcut to publish - */ - void PublishShortcutsL(RAiShortcutArray& aShortcuts); - - /** - * - */ - TBool IsAlive() const; - - /** - * @return Resume reason - */ - TAiTransitionReason ResumeReason() const; - -public: // methods from base classes - - // from base class CAiContentPublisher - - void Resume(TAiTransitionReason aReason); - - void Suspend(TAiTransitionReason aReason); - - void Stop(TAiTransitionReason aReason); - - /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @since S60 3.2 - * @param aObserver content observer to register. - */ - void SubscribeL(MAiContentObserver& aObserver); - - /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plug-in shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @since S60 3.2 - * @param aSettings setting items defined in the UI definition. - */ - void ConfigureL(RAiSettingsItemArray& aSettings); - - /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @since S60 3.2 - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension(TUid aUid); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 - */ - void HandleEvent(TInt aEvent, const TDesC& aParam); - - /** - * Invoked by the framework for querying if plugin has menu item - * - * @return ETrue if plugin has specific menu item, EFalse otherwise - */ - -// Online/Offline - web widgets - TBool HasMenuItem(const TDesC16& aMenuItem); - - // from base class MAiPropertyExtension - - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - * @since S60 3.2 - */ - TAny* GetPropertyL(TInt aProperty); - - /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - * @since S60 3.2 - */ - void SetPropertyL(TInt aProperty, TAny* aValue); - -protected: - -private: - - CAiScutPlugin(); - - void ConstructL(); - - void DoResumeL(TAiTransitionReason aReason); - - void FreeEngine(); - - void DeleteDefaultShortcutsL(); - - -private: // data - - /** - * Iterator for plug-in content. - * Own. - */ - MAiContentItemIterator* iContent; - - /** - * Iterator for plug-in resources. - * Own. - */ - MAiContentItemIterator* iResources; - - /** - * Iterator for plug-in events. - * Own. - */ - MAiContentItemIterator* iEvents; - - /** - * Plug-in engine - * Own. - */ - CAiScutEngine* iEngine; - - /** - * Array of content observers - * Not own. - */ - RPointerArray iObservers; - - /** - * Information about the content publisher ( this plug-in ). - */ - TAiPublisherInfo iInfo; - - /** - * Plug-in state, suspended or alive. - */ - TBool iAlive; - - /** - * Resume reason - */ - TAiTransitionReason iResumeReason; - - TBool iForcePublishAll; -}; - -#endif // CAISCUTPLUGIN_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettings.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettings.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut settings plug-in main class. -* -*/ - - -#ifndef CAISCUTSETTINGS_H -#define CAISCUTSETTINGS_H - -#include - -class CAiScutSettingsContainer; -class CAiScutSettingsModel; - -/** - * Shortcut settings plug-in main class - * - * @lib aiscutsettings.lib - * @since S60 v3.2 - */ -class CAiScutSettings : public CGSBaseView -{ - -public: - - static CAiScutSettings* NewL(TAny* aInitParams); - - virtual ~CAiScutSettings(); - - // from base class CAknView - - /** - * From CAknView - * Returns view id. - * - * @since S60 3.2 - * @return TUid - */ - TUid Id() const; - - /** - * From CAknView - * Handles commands. - * - * @since S60 3.2 - * @param aCommand Command to be handled. - */ - void HandleCommandL(TInt aCommand); - - /** - * See base class in AknView.h - */ - void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage); - - /** - * See base class. - */ - void DoDeactivate(); - - // from base class CGSPluginInterface - - /** - * From CGSPluginInterface - * - * @since S60 3.2 - * @see CGSPluginInterface header file. - */ - void GetCaptionL(TDes& aCaption) const; - - /** - * From CGSPluginInterface - * - * @since S60 3.2 - * @see CGSPluginInterface header file. - */ - TInt PluginProviderCategory() const; - - /** - * From CGSPluginInterface - * - * @since S60 3.2 - * @see CGSPluginInterface header file. - */ - TBool Visible() const; - - // from base class CGSBaseView - - /** - * From CGSBaseView - * - * @since S60 3.2 - * Returns the container this view has. - * @return pointer to container, does not transfer ownership. - */ - CAiScutSettingsContainer* Container(); - - /** - * See base class - */ - void HandleForegroundEventL(TBool aForeground); - - /** - * Check if view is activate - * @since S60 5.1 - * @return ETrue if activated, EFalse otherwise - */ - TBool Activated() const; - -protected: - -private: // From MEikMenuObserver - - /** - * Changes MenuPane dynamically - */ - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); - -private: - - CAiScutSettings(); - - void ConstructL(); - - - // from base class CGSBaseView - - /** - * From CGSBaseView - * Functionality for creating a container. Called by DoActivateL(). - */ - void NewContainerL(); - - /** - * From CGSBaseView - * Handles listbox selection. Called by HandleListBoxEventL. - * Implement by sub-class. - */ - void HandleListBoxSelectionL(); - - static TInt DoHandleListBoxSelectionL( TAny* aAny ); - - -private: // data - - /** - * Settings plug-in model. - * Own. - */ - CAiScutSettingsModel* iModel; - - /** - * Resource loader for common text resources. - */ - RConeResourceLoader iResourceLoaderTexts; - - /*** - * Idle timer to delay event handling - * Own. - */ - CIdle* iListBoxTimer; - -}; - -#endif // CAISCUTSETTINGS_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingsapplist.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingsapplist.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,553 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Application list for settings listbox. -* -*/ - - -#ifndef CAISCUTSETTINGSAPPLIST_H -#define CAISCUTSETTINGSAPPLIST_H - -#include -#include // For MDesCArray -#include // For RApaLsSession -#include // For MMsvSessionObserver -#include // For MApaAppListServObserver -#include "aiscutsettings.hrh" // For TAiScutSettingType - -class CAiScutSettingsItem; -class CCoeEnv; - -/** - * Shortcut definition parameter for theme change shortcut. - */ -_LIT( KScutParamChangeTheme, "view=0x102750A7" ); - -/** - * Shortcut definition parameter for messaging. New message - */ -_LIT( KScutParamNewMsg, "new=msg" ); - -/** - * Shortcut definition parameter for messaging. New email - */ -_LIT( KScutParamNewEmail, "new=email" ); - -/** - * Shortcut definition parameter for messaging. New syncml mail - */ -_LIT( KScutParamNewSyncMLMail, "new=syncmlmail" ); - -/** - * Shortcut definition parameter for messaging. New postcard - */ -_LIT( KScutParamNewPostcard, "new=postcard" ); - -/** - * Shortcut definition parameter for messaging. New audio message - */ -_LIT( KScutParamNewAudioMsg, "new=audiomsg" ); - -/** - * Shortcut definition parameter for messaging. Select message type - */ -_LIT( KScutParamSelectMsgType, "new" ); - -/** - * Shortcut definition parameter for messaging. Remote mailbox - */ -_LIT( KScutParamMailbox, "mailbox=" ); - -/** - * Shortcut definition parameter for general settings. Connectivity view - */ -_LIT( KScutParamConnectivityView, "view=0x10207250" ); - -/** - * Shortcut definition parameter for general settings. Installations view - */ -_LIT( KScutParamInstallationsView, "view=0x10283321" ); - - -/** - * Observer interface for application list events - * - * @since S60 v3.2 - */ -class MAiScutListObserver -{ -public: - - /** - * AppList event codes - */ - enum TScutListEvent - { - EAppListReady, - EAppListUpdated, - EBkmListUpdated - }; - - /** - * Callback for application list events - * - * @since S60 v3.2 - * @param aEvent AppList event code - * @param aAdded ETrue if applications were added, EFalse if removed - */ - virtual void HandleScutListEventL( TScutListEvent aEvent, TBool aAdded ) = 0; - - virtual TBool IsHidden(const TUid& aAppUid) const = 0; - -}; - - -/** - * Application list for settings listbox - * - * @since S60 v3.2 - */ -class CAiScutSettingsAppList : public CActive - , public MDesCArray - , public MMsvSessionObserver - , public MApaAppListServObserver -{ - -public: - - static CAiScutSettingsAppList* NewL( CCoeEnv* aEnv, MAiScutListObserver& aObserver ); - - virtual ~CAiScutSettingsAppList(); - - // from base class MDesCArray - - /** - * From MDesCArray - * Returns the number of descriptor elements in a descriptor array. - * - * @since S60 v3.2 - * @return The number of descriptor elements in a descriptor array. - */ - TInt MdcaCount() const; - - /** - * From MDesCArray - * Indexes into a descriptor array. - * - * @since S60 v3.2 - * @param aIndex The position of the descriptor element within a descriptor array. - * @return A 16 bit non-modifiable pointer descriptor representing the descriptor - * element located at position aIndex within a descriptor array. - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - // from base class MMsvSessionObserver - - /** - * Handles an event from the message server. - * Not used, but must be defined to be able to use the messaging server. - * - * @since S60 v3.2 - * @param aEvent Indicates the event type. - * @param aArg1 Event type-specific argument value - * @param aArg2 Event type-specific argument value - * @param aArg3 Event type-specific argument value - */ - void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); - - // from base class MApaAppListServObserver - - /** - * From MApaAppListServObserver - * Handles a change in the application list - * - * @since S60 v3.2 - * @param aEvent Event id - */ - void HandleAppListEvent( TInt aEvent ); - - /** - * Starts the asynchronous appliation list initialization - * - * @since S60 v3.2 - */ - void StartL(); - - /** - * Checks if the application list is ready to be shown - * - * @since S60 v3.2 - * @return ETrue if ready, EFalse if not - */ - TBool IsReady() const; - - /** - * Tells the application list to start or stop observing for changes - * - * @since S60 v3.2 - * @param aObserving ETrue if changes should be observed, EFalse if not - */ - void SetObservingL( TBool aObserving ); - - /** - * Finds the index of the given settings item in the application list - * - * @since S60 v3.2 - * @param aItem Setting item to find - * @return Index of the setting item in the application list - */ - TInt FindIndex( CAiScutSettingsItem& aItem ); - - /** - * Returns target application data from the given index - * - * @since S60 v3.2 - * @param aIndex Index of the application in the list - * @param aUid On return, the application uid - * @param aParams On return, the application parameters - * @param aCaption On return, the application caption - * @param aType On return, the application type (app or url) - * @return KErrNotFound if the application cannot be found, KErrNone otherwise - */ - TInt GetDataByIndex( TInt aIndex, TUid& aUid, TPtrC& aParams, TPtrC& aCaption, TAiScutSettingType& aType ) const; - - /** - * Adds extra list items to the application list. - * For example "No Effect" item is added here. - * - * @since S60 v3.2 - */ - void AddExtraItemsL(); - - /** - * Removes extra list items from the application list. - * - * @since S60 v3.2 - */ - void RemoveExtraItemsL(); - -protected: - -private: - - CAiScutSettingsAppList( CCoeEnv* aEnv, MAiScutListObserver& aObserver ); - - void ConstructL(); - - // from base class CActive - - /** - * From CActive - * Implements cancellation of an outstanding request. - * - * @since S60 v3.2 - */ - void DoCancel(); - - /** - * From CActive - * Performs one step of the app list initialization - * - * @since S60 v3.2 - */ - void RunL(); - - /** - * From CActive - * Handles an error situation - * - * @since S60 v3.2 - * @param aError Error code received from system - * @return Error code after error handling - */ - TInt RunError( TInt aError ); - - /** - * Completes own request status to make sure active scheduler - * calls RunL again. - * - * @since S60 v3.2 - */ - void CompleteSelf(); - - /** - * Adds an application to the list - * - * @since S60 v3.2 - * @param aAppInfo Application information object - */ - void AddApplicationL( TApaAppInfo& aAppInfo ); - - /** - * Adds the static list items to the application list. - * For example "New Message" and "New Email" items are added here. - * - * @since S60 v3.2 - */ - void AddStaticItemsL(); - - /** - * Finds all mailboxes defined in the device - */ - CMsvEntry* GetRootEntryL(); - - /** - * Adds remote mailboxes to the application list. - * - * @since S60 v3.2 - */ - void AddMailboxesL(); - - /** - * Adds a mailbox to the list - * - * @since S60 v3.2 - * @param aMailbox Name of the mailbox to add - */ - void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ); - - /** - * Removes a mailbox from the list - * - * @since S60 v3.2 - * @param aMailboxParam Parameter string of the mailbox to remove - */ - void RemoveMailboxL( const TDesC& aMailboxParam ); - - /** - * Adds extra application to applist from central repository - * - * @since S60 v3.2 - */ - void AddExtraItemsFromCRL(); - - TBool IsBannedUid(TUid aUid); - - /** - * Gets the next valid application from application architecture server. - * Valid applications are non-hidden ones - * - * @since S60 v3.2 - * @param aAppInfo Application information of the next valid application - * @return Error code from RApaLsSession or one of system wide errors - */ - TInt GetNextValidApp( TApaAppInfo& aAppInfo ); - - /** - * Updates the application list - * - * @since S60 v3.2 - */ - void UpdateAppListL(); - - /** - * Figures out which application is missing from the list and adds it - * - * @since S60 v3.2 - * @param aCount Amount of applications to add - */ - void AddInstalledAppToListL( TInt aCount ); - - /** - * Figures out which application should not be in the list and removes it - * - * @since S60 v3.2 - * @param aCount Amount of applications to remove - */ - void RemoveUninstalledAppFromListL( TInt aCount ); - - /** - * Checks if application is midlet. - * @param aUid Application uid - * @since S60 v3.2 - */ - TBool IsNonNative(const TUid& aUid); - - /** - * Checks if application is located in ROM. - * @param aUid Application uid - * @since S60 v5.0 - */ - TBool IsInRom( const TUid& aUid ); - - -private: - - /** - * Nested class to store individual application list items - * - * @since S60 v3.2 - */ - class CAppListItem : public CBase - { - public: - - static CAppListItem* NewLC( TUid aUid, const TDesC& aCaption ); - - ~CAppListItem(); - - /** - * Compare method used to add the items to the list in sorted order - * - * @since S60 v3.2 - * @param aFirst The first item to be compared - * @param aSecond The second item to be compared - * @return Negative if first comes before second, zero if equal and - * positive if first comes after second - */ - static TInt CompareCaption( const CAppListItem& aFirst, - const CAppListItem& aSecond ); - - /** - * Returns the item target application uid - * - * @since S60 v3.2 - * @return Target application uid - */ - TUid Uid() const; - - /** - * Returns the item target application caption - * - * @since S60 v3.2 - * @return Target application caption - */ - TPtrC Caption() const; - - /** - * Returns the possible parameters for item target - * - * @since S60 v3.2 - * @return Item target parameters - */ - TPtrC Params() const; - - /** - * Sets the parameters for the item target - * - * @since S60 v3.2 - * @param aParams Parameters for item target - */ - void SetParamsL( const TDesC& aParams ); - - /** - * Sets the type for the item target - * - * @since S60 v3.2 - * @param aType The item target type - */ - void SetType( TAiScutSettingType aType ); - - /** - * Returns the type of this item target - * - * @since S60 v3.2 - * @return Item type - */ - TAiScutSettingType Type() const; - private: - - CAppListItem( TUid aUid ); - - void ConstructL( const TDesC& aCaption ); - - private: // data - - /** - * Target application uid - */ - TUid iUid; - - /** - * Target application caption - */ - HBufC* iCaption; - - /** - * Target application parameters - */ - HBufC* iParams; - /** - * Is this setting a application or URL. - * Needed for URLs added from cenrep - */ - TAiScutSettingType iType; - - }; - -private: // data - - /** - * List of application items - * Own. - */ - RPointerArray iListItems; - - /** - * Application architecture server session - * Own. - */ - RApaLsSession iApaSession; - - /** - * Message server session - * Own. - */ - CMsvSession* iMsvSession; - - /** - * Notifier for changes in the application list - * ( installations / uninstallations ) - * Own. - */ - CApaAppListNotifier* iAppNotifier; - - /** - * Amount of all applications in the device - */ - TInt iTotalAppCount; - - /** - * List of mailbox items. Points to iListItems. - * DO NOT DELETE THROUGH THIS! - * Own. - */ - RPointerArray iMailboxes; - - /** - * Flag indicating if the asynchronous application list generation is ready - */ - TBool iReady; - - /** - * Pointer to the control environment - * Not own. - */ - CCoeEnv* iEnv; - - /** - * Registered observer for application list events - */ - MAiScutListObserver& iObserver; - - /** - * A flag indicating if the app list should observe changes - */ - TBool iObserving; - -}; - -#endif // CAISCUTSETTINGSAPPLIST_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingsbkmlist.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingsbkmlist.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bookmark list for settings listbox. -* -*/ - - -#ifndef CAISCUTSETTINGSBKMLIST_H -#define CAISCUTSETTINGSBKMLIST_H - -#include -#include // For MDesCArray -#include // For MFavouritesDbObserver - -class CCoeEnv; -class CActiveFavouritesDbNotifier; -class CAiScutSettingsItem; -class CAiScutSettingsModel; - -/** - * Bookmark list for settings listbox - * - * @since S60 v3.2 - */ -class CAiScutSettingsBkmList : public CBase - , public MDesCArray - , public MFavouritesDbObserver -{ - -public: - - static CAiScutSettingsBkmList* NewL( - CCoeEnv* aEnv, - CAiScutSettingsModel* aModel, - MAiScutListObserver& aObserver); - - virtual ~CAiScutSettingsBkmList(); - - // from base class MDesCArray - - /** - * From MDesCArray - * Returns the number of descriptor elements in a descriptor array. - * - * @since S60 v3.2 - * @return The number of descriptor elements in a descriptor array. - */ - TInt MdcaCount() const; - - /** - * From MDesCArray - * Indexes into a descriptor array. - * - * @since S60 v3.2 - * @param aIndex The position of the descriptor element within a descriptor array. - * @return A 16 bit non-modifiable pointer descriptor representing the descriptor - * element located at position aIndex within a descriptor array. - */ - TPtrC MdcaPoint(TInt aIndex) const; - - /** - * Gets the bookmark list. - * - * @since S60 v3.2 - */ - void GetBookmarkListL(); - - /** - * Tells the bookmark list to start or stop observing for changes - * - * @since S60 v3.2 - * @param aObserving ETrue if changes should be observed, EFalse if not - */ - void SetObservingL(TBool aObserving); - - /** - * Finds the index of the given settings item in the bookmark list - * - * @since S60 v3.2 - * @param aItem Setting item to find - * @return Index of the setting item in the bookmark list - */ - TInt FindIndex(CAiScutSettingsItem& aItem); - - /** - * Returns target bookmark data from the given index - * - * @since S60 v3.2 - * @param aIndex Index of the bookmark in the list - * @param aParams On return, the bookmark parameters - * @param aCaption On return, the bookmark caption - * @return KErrNotFound if the bookmark cannot be found, KErrNone otherwise - */ - TInt GetDataByIndex(TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const; - -protected: - -private: - - CAiScutSettingsBkmList( - CCoeEnv* aEnv, - CAiScutSettingsModel* aModel, - MAiScutListObserver& aObserver); - - void ConstructL(); - - /** - * Adds an bookmark to the list - * - * @since S60 v3.2 - * @param aBkmInfo Bookmark information object - */ - void AddBookmarkL(TUid aUid, const TDesC& aCaption); - - /** - * Updates the bookmark list - * - * @since S60 v3.2 - */ - void UpdateBkmListL(); - - // From MFavouritesDbObserver - /** - * Handles database event. - * @param aEvent Database event. - */ - void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); - -private: - - /** - * Nested class to store individual bookmark list items - * - * @since S60 v3.2 - */ - class CBkmListItem : public CBase - { - public: - - static CBkmListItem* NewLC(TUid aUid, const TDesC& aCaption); - - ~CBkmListItem(); - - /** - * Compare method used to add the items to the list in sorted order - * - * @since S60 v3.2 - * @param aFirst The first item to be compared - * @param aSecond The second item to be compared - * @return Negative if first comes before second, zero if equal and - * positive if first comes after second - */ - static TInt CompareCaption(const CBkmListItem& aFirst, - const CBkmListItem& aSecond); - - /** - * Returns the item target bookmark uid - * - * @since S60 v3.2 - * @return Target bookmark uid - */ - TUid Uid() const; - - /** - * Returns the item target bookmark caption - * - * @since S60 v3.2 - * @return Target bookmark caption - */ - TPtrC Caption() const; - - /** - * Returns the possible parameters for item target - * - * @since S60 v3.2 - * @return Item target parameters - */ - TPtrC Params() const; - - /** - * Sets the parameters for the item target - * - * @since S60 v3.2 - * @param aParams Parameters for item target - */ - void SetParamsL(const TDesC& aParams); - - private: - - CBkmListItem(TUid aUid); - - void ConstructL(const TDesC& aCaption); - - private: // data - - /** - * Target bookmark uid - */ - TUid iUid; - - /** - * Target bookmark caption - */ - HBufC* iCaption; - - /** - * Target bookmark parameters - */ - HBufC* iParams; - - }; - -private: // data - - /** - * List of bookmark items - * Own. - */ - RPointerArray iListItems; - - /** - * Amount of all bookmarks in the device - */ - TInt iTotalAppCount; - - /** - * Pointer to the control environment - * Not own. - */ - CCoeEnv* iEnv; - - /** - * Settings plug-in model. - * Not own. - */ - CAiScutSettingsModel* iModel; - - /** - * Registered observer for list events - */ - MAiScutListObserver& iObserver; - - /** - * A flag indicating if the bookmark list should observe changes - */ - TBool iObserving; - - /** - * Bookmark database change observer. - * Own. - */ - CActiveFavouritesDbNotifier* iBookmarkDbObserver; - -}; - -#endif // CAISCUTSETTINGSBKMLIST_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingscontainer.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingscontainer.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut settings plug-in container. -* -*/ - - -#ifndef CAISCUTSETTINGSCONTAINER_H -#define CAISCUTSETTINGSCONTAINER_H - -#include - -#include "aiscutsettings.hrh" - -class CAknRadioButtonSettingPage; -class CAknSettingPage; -class CAknWaitDialog; -class CAiScutSettingsModel; -class CAiScutSettingsBkmList; -class CAiScutSettingsItem; - -/** - * Shortcut settings plug-in container - * - * @lib aiscutsettings.lib - * @since S60 v3.2 - */ -class CAiScutSettingsContainer : public CGSBaseContainer -{ - -public: - - CAiScutSettingsContainer(); - - virtual ~CAiScutSettingsContainer(); - - /** - * Sets pointer to settings plug-in model. - * - * @since S60 v3.2 - * @param aModel Pointer to settings plug-in model - */ - void SetModel(CAiScutSettingsModel* aModel); - - /** - * Chandles a setting change command - * - * @since S60 v3.2 - */ - void HandleChangeCommandL(); - - /** - * Chandles a setting type change command - * - * @since S60 v3.2 - */ - void HandleChangeShortcutTypeCommandL(TAiScutSettingType aType); - - /** - * Dialog showing changed - * - * @since S60 v3.2 - */ - TBool IsChangeDialogShowing(); - - /** - * Close change dialog - * - * @since S60 v3.2 - */ - void CloseChangeDialog(); - - /** - * Reset current list - * - * @since S60 v3.2 - */ - void ResetCurrentListL(TInt aIndex); - - /** - * Hides the wait note dialog. - * - * @since S60 v3.2 - */ - void HideWaitNoteDialog(); - - /** - * Dismisses the wait note dialog and possible - * other dialogs and stops the change process. - * - * @since S60 v3.2 - */ - void StopShortcutChangeProcess(); - -private: - - void ConstructL(const TRect& aRect); - - // from base class CGSBaseContainer - - /** - * From CGSBaseContainer - * Constructs the settings listbox - * - * @since S60 v3.2 - * @param aResLbxId Listbox resource id - */ - void ConstructListBoxL(TInt aResLbxId); - - /** - * Chandles a setting change command to select application from a list - * - * @since S60 v3.2 - * @param aItem Applist item to modify - * @param aNew ETrue if selecting an application for first time, EFalse if not - * @return ETrue if shortcut was changed. EFalse if not - */ - TBool HandleAppListChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); - - /** - * Chandles a setting change command to select bookmark from a list - * - * @since S60 v3.2 - * @param aItem Applist item to modify - * @param aNew ETrue if selecting an application for first time, EFalse if not - * @return ETrue if shortcut was changed. EFalse if not - */ - TBool HandleBookmarkChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); - - /** - * Chandles a setting change command to edit an URL - * - * @since S60 v3.2 - * @param aItem Applist item to modify - * @param aNew ETrue if typing a new url, EFalse if editing an existing one - * @return ETrue if shortcut was changed. EFalse if not - */ - TBool HandleUrlChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); - - /** - * Handles text editing in an CAknTextSettingPage - * - * @since S60 v3.2 - * @param aResId Resource id for the text setting page - * @param aDes The text to edit - * @return ETrue if user pressed OK, ETrue if user pressed Cancel - */ - TBool EditTextL(TInt aResId, TDes& aDes); - - /** - * Shows the wait note dialog. - * - * @since S60 v3.2 - */ - void ShowWaitNoteDialogL(); - - /** - * Required for help. - * - */ - void GetHelpContext(TCoeHelpContext& aContext) const; - - /** - * - */ - TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); - - /** - * Checks if there is a need to update the middle softkey label. - */ - void CheckMiddleSoftkeyLabelL(); - -private: // data - - /** - * Settings plug-in model. - * Not own. - */ - CAiScutSettingsModel* iModel; - - /** - * Application selection list page. - * Own. - */ - CAknRadioButtonSettingPage* iAppListDialog; - - /** - * Bookmark selection list page. - * Own. - */ - CAknRadioButtonSettingPage* iBkmListDialog; - - /** - * Text setting page. - * Own. - */ - CAknSettingPage* iEditDialog; - - /** - * Wait dialog that is shown when the application list is not ready. - * Own. - */ - CAknWaitDialog* iWaitDialog; - - /** - * - */ - TAiScutSettingType iOldType; - - /** - * Is the change process stopped by outside "forces" - */ - TBool iChangeProcessStopped; - - /** - * Is the change process in progress - */ - TBool iChangeProcessInProgress; - -}; - -#endif // CAISCUTSETTINGSCONTAINER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for shortcut setting items. -* -*/ - - -#ifndef CAISCUTSETTINGSITEM_H -#define CAISCUTSETTINGSITEM_H - -#include -#include "aiscutsettings.hrh" - -class CAiScutSettingsModel; -class CRepository; - -/** - * Line format for the settings list box - */ -_LIT(KSettingListboxLineFormat, " \t%S\t\t%S"); - -/** - * Implements a shortcut setting item - * - * @since S60 v3.2 - */ -class CAiScutSettingsItem : public CBase -{ - -public: - - /** - * Constructs a new settings item leaving it on the cleanup stack - * - * @since S60 v3.2 - * @param aModel Reference to the plug-in model - * @param aIndex Index of the setting in the setting list - * @param aKey Setting item key - * @param aValue Setting item value - */ - static CAiScutSettingsItem* NewLC( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey); - - static CAiScutSettingsItem* NewLC( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey, - const TDesC& aValue); - - /** - * Get item value from CRepository - */ - void ReadL(CRepository* aRepository); - - /** - * set item value into CRepository - */ - TInt Save(CRepository* aRepository); - - /** - * - */ - virtual ~CAiScutSettingsItem(); - - /** - * Returns the setting item key - * - * @since S60 v3.2 - * @return Setting item key - */ - inline TUint32 Key() const; - - /** - * Returns the target shortcut uid - * - * @since S60 v3.2 - * @return Target shortcut uid - */ - inline TUid Uid() const; - - /** - * Returns the setting item type - * - * @since S60 v3.2 - * @return Setting item type - */ - inline TAiScutSettingType Type() const; - - /** - * Returns the setting item value - * - * @since S60 v3.2 - * @return Setting item value - */ - TPtrC Value() const; - - /** - * Returns the formatted listbox line descriptor - * - * @since S60 v3.2 - * @return Listbox line descriptor - */ - TPtrC ListBoxLine() const; - - /** - * Returns the setting item title - * - * @since S60 v3.2 - * @return setting item title - */ - inline TPtrC Title() const; - - /** - * Changes the setting item target application. - * Can be used to change the setting item type to application setting - * - * @since S60 v3.2 - * @param aUid Target application uid - * @param aParams Target application parameters, if any - * @param aCaption Target application caption - */ - void ChangeApplicationL(TUid aUid, const TDesC& aParams, const TDesC& aCaption); - - /** - * Changes the setting item target bookmark. - * Can be used to change the setting item type to bookmark setting - * - * @since S60 v3.2 - * @param aParams Target bookmark parameters - * @param aCaption Target bookmark caption - */ - void ChangeBookmarkL(const TDesC& aParams, const TDesC& aCaption); - - /** - * Changes the setting item target url - * Can be used to change the setting item type to an url setting - * - * @since S60 v3.2 - * @param aUrl Target url - */ - void ChangeUrlL(const TDesC& aUrl); - -private: - - /** - * - */ - CAiScutSettingsItem( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey); - - /** - * - */ - void ConstructL(); - - /** - * - */ - void ConstructL(const TDesC& aValue); - - /** - * - */ - TInt ParseValueL(const TDesC& aValue); - - /** - * Creates a formatted listbox line - * - * @since S60 v3.2 - * @param aCaption Caption to use in the listbox line - */ - void CreateListBoxLineL(const TDesC& aCaption); - - /** - * Creates a setting item title - * Leaves the created descriptor on cleanup stack - * - * @since S60 v3.2 - * @return Key title - */ - HBufC* CreateItemTitleLC(); - - /** - * Creates a key title for an optionally visible shortcut. - * Leaves the created descriptor on cleanup stack - * - * @since S60 v3.2 - * @return Key title - */ - HBufC* CreateOptionallyVisibleKeyTitleLC(); - - /** - * Creates a key title for a non-visible shortcut. - * Leaves the created descriptor on cleanup stack - * - * @since S60 v3.2 - * @return Key title - */ - // HBufC* CreateNonVisibleKeyTitleLC(); - -protected: // data - - /** - * Reference to the plug-in model - */ - CAiScutSettingsModel& iModel; - - /** - * Setting item index in the setting list - */ - TInt iIndex; - - /** - * Setting item key - */ - TUint32 iKey; - - /** - * Setting item value - * Own. - */ - HBufC* iValue; - - /** - * Target application uid - */ - TUid iUid; - - /** - * Setting item type - */ - TAiScutSettingType iType; - - /** - * Formatted listbox line - * Own. - */ - HBufC* iListBoxLine; - - /** - * Setting item title. Points to the iListBoxLine buffer - */ - TPtrC iTitle; - -}; - -#include "caiscutsettingsitem.inl" - -#endif // CAISCUTSETTINGSITEM_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.inl --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.inl Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Inline functions for the shortcut settings item. -* -*/ - - -// --------------------------------------------------------------------------- -// Returns the setting item key. -// --------------------------------------------------------------------------- -// -inline TUint32 CAiScutSettingsItem::Key() const -{ - return iKey; -} - -// --------------------------------------------------------------------------- -// Returns the target shortcut uid. -// --------------------------------------------------------------------------- -// -inline TUid CAiScutSettingsItem::Uid() const -{ - return iUid; -} - -// --------------------------------------------------------------------------- -// Returns the setting item type. -// --------------------------------------------------------------------------- -// -inline TAiScutSettingType CAiScutSettingsItem::Type() const -{ - return iType; -} - - - -// --------------------------------------------------------------------------- -// Returns the setting item title. -// --------------------------------------------------------------------------- -// -inline TPtrC CAiScutSettingsItem::Title() const -{ - return iTitle; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutsettingsmodel.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutsettingsmodel.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,325 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shrortcut settings plug-in model. -* -*/ - - -#ifndef CAISCUTSETTINGSMODEL_H -#define CAISCUTSETTINGSMODEL_H - -#include -#include // For MDesCArray -#include // For RApaLsSession -#include // For RFavouritesDb -#include // For CFavouritesItemList - -#include "caiscutsettingsapplist.h" -#include "caiscutsettingsbkmlist.h" - -class CCoeEnv; -class CRepository; -class CAiScutSettingsItem; -class CAiScutSettingsContainer; -class CAiScutRepositoryWatcher; -class CAiScutSettings; - -/** - * Shrortcut settings plug-in model - * - * @lib aiscutsettings.lib - * @since S60 v3.2 - */ -class CAiScutSettingsModel : public CBase - , public MDesCArray - , public MAiScutListObserver -{ - -public: - - /** - * - */ - static CAiScutSettingsModel* NewL(CAiScutSettings& aPlugin, CCoeEnv* aEnv); - - /** - * - */ - virtual ~CAiScutSettingsModel(); - -public: // from MDesCArray - - /** - * Returns the number of descriptor elements in a descriptor array. - * - * @since S60 v3.2 - * @return The number of descriptor elements in a descriptor array. - */ - TInt MdcaCount() const; - - /** - * Indexes into a descriptor array. - * - * @since S60 v3.2 - * @param aIndex The position of the descriptor element within a descriptor array. - * @return A 16 bit non-modifiable pointer descriptor representing the descriptor - * element located at position aIndex within a descriptor array. - */ - TPtrC MdcaPoint(TInt aIndex) const; - - /** - * Handle Shortcuts changed - */ - static TInt HandleShortcutsChanged(TAny* aPtr); - - /** - * Handle hidden Applications changed - */ - static TInt HandleHiddenAppsChanged(TAny* aPtr); - -public: // from MAiScutListObserver - - /** - * From MAiScutListObserver - * Callback for application list events - * - * @since S60 v3.2 - * @param aEvent AppList event code - * @param aAdded ETrue if applications were added, EFalse if removed - */ - void HandleScutListEventL(TScutListEvent aEvent, TBool aAdded); - - /** - * Find application is hidden using Uid - */ - TBool IsHidden(const TUid& aAppUid) const; - -public: - - /** - * Tells the application list and bookmark list to start or stop observing for changes - */ - void ActivateObservers(TBool aActivate); - - /** - * Returns a setting item for the given index - * - * @since S60 v3.2 - * @param aIndex Index of the setting item - * @return Pointer to a setting item - */ - CAiScutSettingsItem* Item(TInt aIndex) const; - - /** - * Utility function to retrieve an appliation caption from an uid - * - * @since S60 v3.2 - * @param aUid Application uid - * @return Pointer descriptor to the application caption - */ - TInt GetAppCaption(const TUid aUid, TDes& aCaption); - - /** - * Utility function to retrieve a bookmark caption from an uid - * - * @since S60 v3.2 - * @param aUid Bookmark uid - * @return Pointer descriptor to the bookmark caption - */ - TInt GetBkmCaptionL(const TUid aUid, TDes& aCaption); - - /** - * Returns a pointer to the coe environment - * - * @since S60 v3.2 - * @return Pointer to coe environment - */ - CCoeEnv* Env(); - - /** - * Handles saving a setting item to central repository - * - * @since S60 v3.2 - * @param aItem Item to save - */ - void SaveItemL(CAiScutSettingsItem& aItem); - - /** - * Sets pointer to settings plug-in container. - * - * @since S60 v3.2 - * @param aContainer Pointer to settings plug-in container. - */ - void SetContainer(CAiScutSettingsContainer* aContainer); - - /** - * Read bookmarks from favourites engine. - * - */ - void ReadBookmarksL(); - - /** - * Return bookmark count. - */ - TInt BookmarkCount() const; - - /** - * Get bookmark from index aIndex. - */ - CFavouritesItem* GetBookmark(TInt aIndex); - - /** - * Returns reference to the bookmark database owned by the engine - * - * @return Reference to RFavouritesDb - */ - RFavouritesDb& FavouritesDb(); - - /** - * - */ - CAiScutSettingsAppList* AppList(); - - /** - * - */ - CAiScutSettingsBkmList* BkmList(); - - /** - * - */ - void SetSettingsKeys(RArray& aKeys); - - /** - * - */ - void UpdateSettingsL(); - - /** - * - */ - void UpdateSettingsContainerL(); - -private: - - /** - * - */ - CAiScutSettingsModel(CAiScutSettings& aPlugin, CCoeEnv* aEnv); - - /** - * - */ - void ConstructL(); - - - /** - * - */ - void GetHiddenAppsL(); - -private: // data - - /** - * Array of setting items. - * Own. - */ - RPointerArray iSettings; - - /** - * Array of keys for settings items - * Own. - */ - RArray iKeys; - - /** - * Central repository handler. - * Own. - */ - CRepository* iRepository; - - /** - * Application architecture server session. - * Own. - */ - RApaLsSession iApaSession; - - /** - * Bookmark database session. - * Own. - */ - RFavouritesSession iBookmarkSess; - - /** - * Bookmark database. - * Own. - */ - RFavouritesDb iBookmarkDb; - - /** - * Bookmark list. - * Own. - */ - CFavouritesItemList* iFavItemList; - - /** - * Settings plugin - * Not own. - */ - CAiScutSettings& iPlugin; - - /** - * Coe environment. - * Not own. - */ - CCoeEnv* iEnv; - - /** - * Application list. - * Own. - */ - CAiScutSettingsAppList* iAppList; - - /** - * Bookmark list. - * Own. - */ - CAiScutSettingsBkmList* iBkmList; - - /** - * Notifier for changes in the shortcut settings. - * Own. - */ - CAiScutRepositoryWatcher* iSettingsNotifier; - - /** - * Settings plugin container. - * Not own. - */ - CAiScutSettingsContainer* iContainer; - - // Array of UIDs which are hidden from the TARM - RArray iHiddenApps; - - // Central repository object for Hidden Apps - CRepository* iHiddenAppsRepository; - - // Central repository change handler for Hidden Apps - CAiScutRepositoryWatcher* iHiddenAppsNotifier; - -}; - -#endif // CAISCUTSETTINGSMODEL_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutshortcut.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutshortcut.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,337 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for a shortcut. -* -*/ - - -#ifndef CAISCUTSHORTCUT_H -#define CAISCUTSHORTCUT_H - -#include - -#include "taiscutparser.h" - -class CAiScutEngine; -class CAiScutTarget; -class MAiContentObserver; -class MAiPropertyExtension; - -/** - * Implementation for a shortcut - * - * Handles parsing and launching an application shortcut - * - * @since S60 v3.2 - */ -class CAiScutShortcut : public CTimer -{ - -public: - - /** - * First phase constructor. - * Leaves the object on cleanup stack - * - * @since S60 v3.2 - * @param aId Shortcut id - * @param aTarget The shortcut definition string. - * @param aEngine Reference to shortcut plug-in engine - */ - static CAiScutShortcut* NewLC(TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine); - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aId Shortcut id - * @param aTarget The shortcut definition string - * @param aEngine Reference to shortcut plug-in engine - */ - static CAiScutShortcut* NewL(TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine); - - virtual ~CAiScutShortcut(); - - /** - * Returns the shortcut id - * - * @since S60 v3.2 - * @return Shortcut id - */ - TInt32 Id() const; - - /** - * Publishes the shortcut content, non leaving version - * - * @since S60 v3.2 - * @param aPlugin Reference to plug-in - * @param aObserver Content observer to publish to - */ - void Publish(MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver); - - /** - * Checks if the application pointed to can be launched and reverts to the - * default setting if not. If no valid target can be found, the shortcut - * becomes empty. May only leave with KErrNotReady to signify that application - * architecture server or message server is not ready and access check should - * be retried later. - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @return ETrue if the shortcut target is accessible - */ - TBool CheckAccessL(TInt aCheckType); - - /** - * - */ - TBool IsTargetChanged() const; - - /** - * Changes the shortcut target to the user defined setting - * - * @since S60 v3.2 - * @param aNewTarget The new user defined shortcut target - */ - void SetUserTarget(const TDesC& aNewTarget); - - /** - * Deletes the user target. - * - * @since S60 v3.2 - */ - void DeleteUserTarget(); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Launches the shortcut - * - * @since S60 v5.1 - * @param aMessage A message to pass - */ - void LaunchL(const TDesC8& aMessage); - - /** - * Set call state - * - * @since S60 v3.2 - */ - void SetCallState(TBool aStatus); - - /** - * - * @since S60 v3.2 - */ - void SetToBePublished(TBool aFlag); - - /** - * - * @since S60 v3.2 - */ - TBool NeedsToBePublished(); - - /** - * Return shortcut type. - * - * @since S60 v3.2 - */ - TShortcutType Type() const; - - /** - * Return application uid of this shortcut. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - - /** - * Return an additional id this target may use when - * launching. - * - * @since S60 v3.2 - */ - TUid AdditionalUid() const; - - /** - * Return current valid definition. - * - * @since S60 v3.2 - */ - TPtrC ActiveDefinition(); - - /** - * Set the icon to publish to softkeys, - * icon area or to touch toolbar. Uses - * aIcon.iDestination to determine which icon - * is in question - * - * @since S60 v5.0 - */ - void SetIcon(TAiScutIcon aIcon); - - -protected: - - - CAiScutShortcut(TInt aId, CAiScutEngine& aEngine); - - void ConstructL(const TDesC& aTarget); - - /** - * Creates a shortcut target object - * - * @since S60 v3.2 - * @param aDefinition Shortcut target definition - * @return Pointer to shortcut target object - */ - CAiScutTarget* CreateTargetL( - const TDesC& aDefinition, TBool aCreateUserTarget); - - /** - * Publishes the shortcut content, leaving version - * - * @since S60 v3.2 - * @param aPlugin Reference to plug-in - * @param aObserver Content observer to publish to - */ - virtual void PublishL(MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver); - - /** - * Publishes shortcut caption - * - * @since S60 v3.2 - * @param aPlugin Reference to plug-in - * @param aObserver Content observer to publish to - */ - virtual TInt PublishCaption( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, - TInt aCaptionContentId) const; - - /** - * Publishes shortcut icon - * - * @since S60 v3.2 - * @param aPlugin Reference to plug-in - * @param aObserver Content observer to publish to - */ - virtual TInt PublishIcon( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, TInt aIconContentId); - - /** - * Set the icon to use instead of default icon - * - * @since S60 v3.2 - */ - void SetOverrideIcon(TAiScutIcon aIcon); - - /** - * Set the icon to publish to softkeys - * - * @since S60 v3.2 - */ - void SetSoftkeyIcon(TAiScutIcon aIcon); - - /** - * Set the icon to publish to touch toolbar - * - * @since S60 v5.0 - */ - void SetToolbarIcon(TAiScutIcon aIcon); - -// from CActive/CTimer - - TInt RunError(TInt aError); - - void DoCancel(); - - void RunL(); - -protected: // data - - /** - * Shortcut id. - */ - TInt32 iId; - - /** - * Default shortcut target. - * Own. - */ - CAiScutTarget* iDefaultTarget; - - /** - * User defined shortcut target. - * Own. - */ - CAiScutTarget* iUserTarget; - - /** - * Stores the old target data while the new one is being published. - * During publishing the framework might still dereference pointers in the old - * target so it must be kept alive until the new target is successfully published. - * If publishing fails, this is taken back to use and the new target is deleted. - * Own. - */ - CAiScutTarget* iRetiredTarget; - - /** - * Pointer to the last published target. - * DO NOT DELETE THROUGH THIS! - * Not own. - */ - CAiScutTarget* iLastPublishedTarget; - - /** - * Pointer to the active target. - * Can point either to iDefaultTarget, iUserTarget or NULL - * DO NOT DELETE THROUGH THIS! - * Not own. - */ - CAiScutTarget* iActiveTarget; - - /** - * Reference to the shortcut plug-in engine. - */ - CAiScutEngine& iEngine; - - /** - * Boolean indicating if this shortcut needs to be published. - */ - TBool iNeedsToBePublished; - - /** - * Call state - */ - TBool iActiveCall; - - /** - * Force the publish of this shortcut. For example - * after call state has changed the actual shortcut - * isn't changed but it still needs to be published. - */ - TBool iForcePublish; - -}; - -#endif // CAISCUTSHORTCUT_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutshortcutext.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutshortcutext.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in shortcut extensions -* -*/ - - -#ifndef CAISCUTSHORTCUTEXT_H -#define CAISCUTSHORTCUTEXT_H - -#include -#include -#include - -#include "caiscutshortcut.h" -#include "mpopupeventhandleractions.h" - -class CPopupEventHandler; -class MAiScutExtData; - -/** - * - * The class extends CAiScutShortcut by offering means to store - * changeable popup text lines. The class overrides content publishing - * functions from base class. - * - * @since S60 v3.2 - */ -class CAiScutShortcutExt : public CAiScutShortcut, - public MPopupEventHandlerActions - { - public: - /** - * Factory function - * @see CAiScutShortcut - * @since S60 v3.2 - */ - static CAiScutShortcutExt* NewL( TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine ); - - /** - * Factory function - * @see CAiScutShortcut - * @since S60 v3.2 - */ - static CAiScutShortcutExt* NewLC( TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine ); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CAiScutShortcutExt(); - - private: - CAiScutShortcutExt( TInt aId, CAiScutEngine& aEngine ); - void ConstructL( const TDesC& aTarget ); - - public: // New functions - /** - * @return Definition string of active target - * @since S60 v3.2 - */ - TPtrC ActiveTargetDefinition() const; - - /** - * Handles events (e.g. gain/lost focus) from AI framework - * @param aEvent Event - * @since S60 v3.2 - */ - void HandleAIEventL( TInt aEvent ); - - /** - * Handles Resumed event - * @param aResumeReason Resume reason - * @since S60 v3.2 - */ - void HandleResumed( TAiTransitionReason aResumeReason ); - - /** - * Set extension data - * @param aAiScutExtData Pointer to new extension data - * @since S60 v3.2 - */ - void SetAiScutExtData( const MAiScutExtData* aAiScutExtData ); - - - private: // From CAiScutShortcut - void PublishL( MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver ); - - TInt PublishCaption( MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver, TInt aCaptionContentId) const; - - void PublishPopupText( MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver ) const; - - TInt PublishIcon( MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver, TInt aIconContentId ); - - private: // From MPopupEventHandlerActions - void IssuePublishShortcut(); - - private: // data - - /** - * Extension data - * Ref. - */ - const MAiScutExtData* iAiScutExtData; - - /** - * Flag that tells whether to publish or clean the popup text box. - * The flag is controlled by iPopupEventHandler - * Own. - */ - //TBool iPublishLineArray; - - /** - * Handler of various events, includes state machine - * Own. - */ - CPopupEventHandler* iPopupEventHandler; - - /** - * Pointer to previous popup line array. This is used detect changes - * in data. - * Ref. - */ - const MDesCArray* iPreviousPopupLineArray; - - /** - * Pointer to previous icon. This is used detect changes - * in data. - * Ref. - */ - const CGulIcon* iPreviousIcon; - - /** - * Has the icon changed - */ - TBool iIconChanged; - - /** - * Has the text changed - */ - TBool iTextChanged; - - }; - -#endif // CAISCUTSHORTCUTEXT_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscutshortcutinfo.h --- a/idlefw/plugins/shortcutplugin/inc/caiscutshortcutinfo.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Small container for shortcut info. -* -*/ - - -#ifndef CAISCUTSHORTCUTINFO_H -#define CAISCUTSHORTCUTINFO_H - -#include - -/** - * Implementation for a shortcut - * - * Handles parsing and launching an application shortcut - * - * @since S60 v3.2 - */ -class CAiScutShortcutInfo : public CBase -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aId Shortcut id - * @param aTarget The shortcut definition string - */ - static CAiScutShortcutInfo* NewL(TInt aId, const TDesC& aTarget); - - virtual ~CAiScutShortcutInfo(); - - /** - * Returns the shortcut id - * - * @since S60 v3.2 - * @return Shortcut id - */ - TInt32 Id() const; - - /** - * Returns the shortcut target string. - * - * @since S60 v3.2 - * @return Shortcut target string - */ - const TDesC& Target(); - -protected: - -private: - - CAiScutShortcutInfo(TInt aId); - - void ConstructL(const TDesC& aTarget); - -private: // data - - /** - * Shortcut id. - */ - TInt32 iId; - - /** - * Shortcut target string. - * Own. - */ - HBufC* iTarget; - -}; - -#endif // CAISCUTSHORTCUTINFO_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttarget.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttarget.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,277 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for all shortcut targets. -* -*/ - - -#ifndef CAISCUTTARGET_H -#define CAISCUTTARGET_H - -#include - -#include "taiscutparser.h" -#include "aiscutdefs.h" -#include - -class CAiScutEngine; -class CGulIcon; - -_LIT(KBitmapFile, "aiscutplugin.mif"); - -/** - * Base class for shortcut targets - * - * @since S60 v3.2 - */ -class CAiScutTarget : public CBase -{ - -public: - - virtual ~CAiScutTarget(); - - /** - * Returns the shortcut definition string. - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - virtual TPtrC Definition() const = 0; - - /** - * Returns the shortcut target caption. - * Caption can be either a descriptor or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the descriptor reference parameter is used. - * Default implementation returns KErrNotSupported; - * - * Getting the target caption and icon utilizes the "lazy evaluation" idiom - * which means they are created only when they are first needed. This is because - * there are (atleast) two scenarios where they are never needed: - * 1. The active theme does not support shortcut captions or icons. - * 2. Shortcuts launched using LaunchByValue are never published. - * - * @since S60 v3.2 - * @param aDes On return, the descriptor if used - * @return The resource id or zero to indicate that the descriptor is used. - */ - virtual TInt GetCaption( TPtrC& aDes, TAiScutAppTitleType aTitleType ) const; - - /** - * Returns the shortcut target icon. - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns the icon that has possibly - * been set with @c SetOverrideIcon() and returns - * KErrNotSupported if no override icon has been set. - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - virtual TInt GetIcon( CGulIcon*& aIcon ) const; - - /** - * Returns the shortcut icon that can be published to softkeys - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns the icon that has possibly - * been set with @c SetSoftkeyIcon() and returns - * KErrNotSupported if no softkey icon has been set. - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - virtual TInt GetSoftkeyIcon( CGulIcon*& aIcon ) const; - - /** - * Returns the shortcut icon that can be published to toolbar - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns the icon that has possibly - * been set with @c SetSoftkeyIcon() and returns - * KErrNotSupported if no softkey icon has been set. - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - virtual TInt GetToolbarIcon( CGulIcon*& aIcon ) const; - - /** - * Checks if the shortcut target is accessible. - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @return ETrue if accessible, EFalse if not - */ - virtual TBool IsAccessibleL( TInt aCheckType ) = 0; - - /** - * Launches the shortcut. - * - * @since S60 v3.2 - */ - virtual void LaunchL() = 0; - - /** - * Launches the shortcut. - * - * @since S60 v5.1 - * @param aMessage A message to pass - */ - virtual void LaunchL(const TDesC8& aMessage) { (void)aMessage; }; - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - virtual TUid AppUid() const = 0; - - /** - * Return an additional id this target may use when - * launching. Default implementation return TUid(-1) - * - * @since S60 v3.2 - */ - virtual TUid AdditionalUid() const; - - /** - * Return shortcut type. - * - * @since S60 v3.2 - */ - TShortcutType Type() const; - - /** - * Starts a full screen effect. - */ - void BeginEffectL(); - - /** - * Set the icon that overrides the shortcut default - * icon. Instead of fetching the icon from for example an - * application the icon defined here can be used. The shortcut - * can use the @c GetIcon() to fetch the - * icon defined here. Currently we support - * icon loading from skin or from MIF/MBM-file. - * The file must reside under z:\resource altough - * it can be under some subdirectory. - * - * @since S60 v3.2 - * @param aIcon The overriding icon - */ - void SetOverrideIcon(TAiScutIcon aIcon); - - /** - * Set the icon that is to be published to softkeys - * The @c GetSoftkeyIcon() can be used to fetch the - * icon defined here. Currently we support - * icon loading from skin or from MIF/MBM-file. - * The file must reside under z:\resource altough - * it can be under some subdirectory. - * - * @since S60 v3.2 - * @param aIcon The softkey icon - */ - void SetSoftkeyIcon(TAiScutIcon aIcon); - - /** - * Set the icon that is to be published to touch toolbar - * The @c GetSoftkeyIcon() can be used to fetch the - * icon defined here. Currently we support - * icon loading from skin or from mif-file. - * The mif-file must reside under z:\resource altough - * it can be under some subdirectory. - * - * @since S60 v5.0 - * @param aIcon The softkey icon - */ - void SetToolbarIcon(TAiScutIcon aIcon); - -protected: - - CAiScutTarget( CAiScutEngine& aEngine, TShortcutType aType ); - -private: - - /** - * Returns the icon defined in aIconToLoads. Loads the icon - * from MIF/MBM-file or from skin. - * - * @return KErrNone if no error - */ - TInt GetIcon(const TAiScutIcon &aIconToLoad, CGulIcon *&aIcon ) const; - - /** - * Loads an icon defined in aIconToLoad from skin - * - * @return KErrNone if no error - */ - void LoadIconFromSkinL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const; - - /** - * Loads an icon defined in aIconToLoad from MIF/MBM-file - * The file must reside under z:\resource. It can be under - * some subdirectory. - * - * @return KErrNone if no error - */ - void LoadIconFromFileL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const; - - -protected: // data - - /** - * Reference to shortcut plug-in engine. - */ - CAiScutEngine& iEngine; - - /** - * Shortcut type. - */ - TShortcutType iType; - - /** - * Icon that is meant to override the default icon - */ - TAiScutIcon iOverrideIcon; - - /** - * Icon that is to be published to softkeys - */ - TAiScutIcon iSoftkeyIcon; - - /** - * Icon that is to be published to toolbar - */ - TAiScutIcon iToolbarIcon; - -}; - -#endif // CAISCUTTARGET_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetapp.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetapp.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for application shortcut target. -* -*/ - - -#ifndef CAISCUTTARGETAPP_H -#define CAISCUTTARGETAPP_H - -#include "caiscuttarget.h" - -class CPeriodic; -class MAknsSkinInstance; -/** - * Implements an application shortcut target - * - * Handles parsing and launching an application shortcut target - * - * @since S60 v3.2 - */ -class CAiScutTargetApp : public CAiScutTarget -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aEngine Reference to the plug-in engine - * @param aParser Shortcut definition parser - */ - static CAiScutTargetApp* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); - - virtual ~CAiScutTargetApp(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * Returns the shortcut target caption. - * Caption can be either a descriptor or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the descriptor reference parameter is used. - * Default implementation returns KErrNotSupported; - * - * Getting the target caption and icon utilizes the "lazy evaluation" idiom - * which means they are created only when they are first needed. This is because - * there are (atleast) two scenarios where they are never needed: - * 1. The active theme does not support shortcut captions or icons. - * 2. Shortcuts launched using LaunchByValue are never published. - * - * @since S60 v3.2 - * @param aDes On return, the descriptor if used - * @return The resource id or zero to indicate that the descriptor is used. - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * Returns the shortcut target icon. - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns KErrNotSupported; - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * Returns the shortcut icon that can be published to toolbar - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns the icon that has possibly - * been set with @c SetSoftkeyIcon() and returns - * KErrNotSupported if no softkey icon has been set. - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - TInt GetToolbarIcon(CGulIcon*& aIcon) const; - - /** - * Checks if the shortcut target is accessible - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @return ETrue if accessible, EFalse if not - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Launches the shortcut - * - * @since S60 v5.1 - */ - void LaunchL( const TDesC8& aCustomMessage ); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - - /** - * Return an additional id this target may use when - * launching. Default implementation return TUid(-1) - * - * @since S60 v3.2 - */ - TUid AdditionalUid() const; - -protected: - -private: - - CAiScutTargetApp(CAiScutEngine& aEngine, TShortcutType aType, const TUid aUid); - - void ConstructL(const TAiScutParser& aParser); - - /** - * - */ - void GetCaptionL(TAiScutAppTitleType aTitleType) const; - - /** - * Creates the application icon - * - * @since S60 v3.2 - */ - void CreateAppIconL(CGulIcon*& aIcon) const; - - /** - * Creates the NonNative application icon - * - * @since S60 v3.2 - */ - CGulIcon* CreateNonNativeIconL() const; - - /** - * Performs Central Repository shortcut set - * for EasyVoIP application. - */ - void SetEasyVoIPShortcutStartL() const; - - CGulIcon* CreateSubstituteIconL( MAknsSkinInstance* aSkin, TUid aAppUid, TUid iViewUid ) const; -private: // data - - /** - * Application uid. - */ - TUid iAppUid; - - /** - * Possible view uid. - */ - TUid iViewUid; - - /** - * Shortcut caption. - * Own. - */ - mutable HBufC* iCaption; - - /** - * Shortcut short caption. - * Own. - */ - mutable HBufC* iShortCaption; - - /** - * Holds the shortcut definition string. - * Own. - */ - HBufC* iDefinition; - - /** - * Run the application in the background. - */ - TBool iBackground; - - /** - * Command line parameter. - * Own. - */ - HBufC8* iMsg; - -}; - -#endif // CAISCUTTARGETAPP_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetbkm.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetbkm.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for bookmark shortcut target. -* -*/ - - -#ifndef CAISCUTTARGETBKM_H -#define CAISCUTTARGETBKM_H - -#include "caiscuttarget.h" - -/** - * Implements an bookmark shortcut target - * - * Handles parsing and launching an bookmark shortcut target - * - * @since S60 v3.2 - */ -class CAiScutTargetBkm : public CAiScutTarget -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aEngine Reference to the plug-in engine - * @param aParser Shortcut definition parser - */ - static CAiScutTargetBkm* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); - - virtual ~CAiScutTargetBkm(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * Returns the shortcut target caption. - * Caption can be either a descriptor or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the descriptor reference parameter is used. - * Default implementation returns KErrNotSupported; - * - * Getting the target caption and icon utilizes the "lazy evaluation" idiom - * which means they are created only when they are first needed. This is because - * there are (atleast) two scenarios where they are never needed: - * 1. The active theme does not support shortcut captions or icons. - * 2. Shortcuts launched using LaunchByValue are never published. - * - * @since S60 v3.2 - * @param aDes On return, the descriptor if used - * @return The resource id or zero to indicate that the descriptor is used. - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * Returns the shortcut target icon. - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns KErrNotSupported; - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * Checks if the shortcut target is accessible - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @return ETrue if accessible, EFalse if not - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - - /** - * Return an additional id this target may use when - * launching. Default implementation return TUid(-1) - * - * @since S60 v3.2 - */ - TUid AdditionalUid() const; - -protected: - -private: - - CAiScutTargetBkm(CAiScutEngine& aEngine, TShortcutType aType); - - void ConstructL(const TAiScutParser& aParser); - - /** - * - */ - void GetCaptionL() const; - -private: // data - - /** - * Bookmark uid. - */ - TUid iBkmUid; - - /** - * Shortcut caption. - * Own. - */ - mutable HBufC* iCaption; - - /** - * Holds the shortcut definition string. - * Own. - */ - HBufC* iDefinition; - -}; - -#endif // CAISCUTTARGETAPP_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetempty.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetempty.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Empty target -* -*/ - - -#ifndef CAISCUTEMPTY_H -#define CAISCUTEMPTY_H - -#include "caiscuttarget.h" - -/** - * Empty target. - * - * @since S60 v3.2 - */ -class CAiScutTargetEmpty : public CAiScutTarget -{ -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param - * @return new instance. - */ - static CAiScutTargetEmpty* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget ); - - /** - * Destructor. - */ - virtual ~CAiScutTargetEmpty(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * See base class - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * See base class - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * See base class - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - -private: // New methods - - /** - * C++ default constructor. - */ - CAiScutTargetEmpty( CAiScutEngine& aEngine, TShortcutType aType ); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL( const TDesC& aTarget ); - -private: // Data - - /** - * Holds the shortcut definition string - * Owned. - */ - HBufC* iDefinition; - -}; - -#endif - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargethttp.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargethttp.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for http shortcut target. -* -*/ - - -#ifndef CAISCUTTARGETHTTP_H -#define CAISCUTTARGETHTTP_H - -#include "caiscuttarget.h" - -/** - * Command line parameter for browser to open an url - */ -_LIT( KOpenUrlParam, "4 " ); - -/** - * Implements an http shortcut target - * - * Handles parsing and launching an http shortcut target - * - * @since S60 v3.2 - */ -class CAiScutTargetHttp : public CAiScutTarget -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aEngine Reference to the plug-in engine - * @param aTarget The shortcut definition string - */ - static CAiScutTargetHttp* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser ); - - virtual ~CAiScutTargetHttp(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * See base class - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * See base class - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * See base class - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - - /** - * Return additional UID this target refers to. In - * URL case this is a unique identifer created from the URL - * - * @since S60 v3.2 - */ - TUid AdditionalUid() const; -protected: - -private: - - CAiScutTargetHttp( CAiScutEngine& aEngine, TShortcutType aType ); - - void ConstructL( const TAiScutParser& aParser ); - -private: // data - - /** - * Target caption, part of the http address or - * custom title given with the URL string - */ - mutable HBufC* iCaption; - - /** - * Holds the shortcut definition string - * Owned. - */ - HBufC* iDefinition; - - /** - * Checksum for the URL - */ - TUid iChecksum; - -}; - -#endif // CAISCUTTARGETHTTP_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetkeylock.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetkeylock.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock -* -*/ - - -#ifndef CAISCUTKEYLOCK_H -#define CAISCUTKEYLOCK_H - -#include -#include "caiscuttarget.h" - -/** - * Takes care of locking the keypad. - * - * @since S60 v3.2 - */ -class CAiScutTargetKeyLock : public CAiScutTarget -{ -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param - * @return new instance. - */ - static CAiScutTargetKeyLock* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget); - - /** - * Destructor. - */ - virtual ~CAiScutTargetKeyLock(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * Returns the shortcut target caption. - * Caption can be either a descriptor or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the descriptor reference parameter is used. - * Default implementation returns KErrNotSupported; - * - * Getting the target caption and icon utilizes the "lazy evaluation" idiom - * which means they are created only when they are first needed. This is because - * there are (atleast) two scenarios where they are never needed: - * 1. The active theme does not support shortcut captions or icons. - * 2. Shortcuts launched using LaunchByValue are never published. - * - * @since S60 v3.2 - * @param aDes On return, the descriptor if used - * @return The resource id or zero to indicate that the descriptor is used. - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * Returns the shortcut target icon. - * Icon can be either an icon pointer or a resource id. - * If the return value has a non-zero value, it is the resource id. - * Zero indicates that the icon pointer is used. - * Default implementation returns KErrNotSupported; - * - * Uses the "lazy evaluation" idiom to get the icon. See Caption() - * - * @since S60 v3.2 - * @param aIcon On return, the icon pointer if used - * @return The resource id or zero to indicate that the icon pointer is used. - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * Checks if the shortcut target is accessible - * - * @since S60 v3.2 - * @param aCheckType Specifies which kind of shortcuts should check its access - * @return ETrue if accessible, EFalse if not - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - -private: // New methods - - /** - * Enables keylock. - */ - void EnableKeyLock(); - - /** - * Checks if keylock is enabled. - */ - TBool IsKeyLockEnabled(); - - /** - * C++ default constructor. - */ - CAiScutTargetKeyLock(CAiScutEngine& aEngine, TShortcutType aType); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(const TDesC& aTarget); - -private: // Data - - /** - * Keylock - */ - RAknKeylock2 iKeyLock; - - /** - * Holds the shortcut definition string - * Owned. - */ - HBufC* iDefinition; - -}; - -#endif // CAIKEYLOCK_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetmessagingview.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetmessagingview.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for messaging view shortcut target. -* -*/ - - -#ifndef CAISCUTTARGETMESSAGINGVIEW_H -#define CAISCUTTARGETMESSAGINGVIEW_H - -#include - -#include "caiscuttarget.h" - -class CGulIcon; - -/** - * Implements a mailbox shortcut target - * - * Handles parsing and launching a mailbox shortcut target - * - * @since S60 v3.2 - */ -class CAiScutTargetMessagingView : public CAiScutTarget -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aEngine Reference to the plug-in engine - * @param aParser Shortcut definition parser - */ - static CAiScutTargetMessagingView* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); - - virtual ~CAiScutTargetMessagingView(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * See base class - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * See base class - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * See base class - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - -protected: - -private: - - CAiScutTargetMessagingView(CAiScutEngine& aEngine, TShortcutType aType); - - void ConstructL(const TAiScutParser& aParser); - - /** - * Tries to find a view id - * - * @since S60 v3.2 - * @return Mailbox id - */ - TMsvId FindViewIdL(); - - /** - * Leaving version of GetIcon. - */ - void GetIconL(CGulIcon*& aIcon) const; - -private: // data - - /** - * View name. Contains the remote mailbox name or the messaging view name - * Own. - */ - HBufC* iViewName; - - /** - * Holds the shortcut definition string - * Owned. - */ - HBufC* iDefinition; - -}; - -#endif // CAISCUTTARGETMESSAGINGVIEW_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/caiscuttargetnewmsg.h --- a/idlefw/plugins/shortcutplugin/inc/caiscuttargetnewmsg.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for new message shortcut target. -* -*/ - - -#ifndef CAISCUTTARGETNEWMSG_H -#define CAISCUTTARGETNEWMSG_H - -#include - -#include "caiscuttarget.h" - -class CGulIcon; - -/** - * Implements a new message or new email shortcut target - * - * Handles parsing and launching a new message shortcut target - * - * @since S60 v3.2 - */ -class CAiScutTargetNewMsg : public CAiScutTarget -{ - -public: - - /** - * First phase constructor - * - * @since S60 v3.2 - * @param aEngine Reference to the plug-in engine - * @param aParser Shortcut definition parser - */ - static CAiScutTargetNewMsg* NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); - - virtual ~CAiScutTargetNewMsg(); - - /** - * Returns the shortcut definition string - * - * @since S60 v3.2 - * @return Shortcut definition string - */ - TPtrC Definition() const; - - /** - * See base class - */ - TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; - - /** - * See base class - */ - TInt GetIcon(CGulIcon*& aIcon) const; - - /** - * See base class - */ - TBool IsAccessibleL(TInt aCheckType); - - /** - * Launches the shortcut - * - * @since S60 v3.2 - */ - void LaunchL(); - - /** - * Return application uid this target launches. - * - * @since S60 v3.2 - */ - TUid AppUid() const; - - - - - -protected: - -private: - - CAiScutTargetNewMsg(CAiScutEngine& aEngine, TShortcutType aType); - - void ConstructL(const TAiScutParser& aParser); - - /** - * - */ - void GetCaptionL(TAiScutAppTitleType aTitleType) const; - - /** - * Leaving version of GetIcon. - */ - void GetIconL(CGulIcon*& aIcon) const; - - void ShowErrorNote(); - -private: // data - - /** - * Application uid. - */ - TUid iAppUid; - - /** - * Possible view uid. - */ - TUid iViewUid; - - /** - * Shortcut caption. - * Own. - */ - mutable HBufC* iCaption; - - /** - * Shortcut short caption. - * Own. - */ - mutable HBufC* iShortCaption; - - /** - * Holds the shortcut definition string - * Owned. - */ - HBufC* iDefinition; - - /** - * Message type - */ - TUid iMtm; -}; - -#endif // CAISCUTTARGETNEWMSG_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/cpopupeventhandler.h --- a/idlefw/plugins/shortcutplugin/inc/cpopupeventhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in Popup event handler class -* -*/ - - -#ifndef CPOPUPEVENTHANDLER_H -#define CPOPUPEVENTHANDLER_H - -#include -#include - -#include "PopupFSM.h" -#include "MPopupFSMActions.h" - -class MPopupEventHandlerActions; - -/** - * - * The class handles Popup events (set, reset, gain/lost focus, etc.) by - * delegating them to automatically generated state machine class which in - * turn decides what actions the events cause in different states. - * - * This class has bi-directional friend relationship to CAiScutShortcutExt - * in order to establish concrete actions while decoupling state machine - * related functions out of CAiScutShortcutExt. - * - * @since S60 v3.2 - */ -class CPopupEventHandler : public CActive, - public MPopupFSMActions - { - public: - /** - * Factory function - * @param aPopupEventHandlerActions actions interface - * @since S60 v3.2 - */ - static CPopupEventHandler* NewL( - MPopupEventHandlerActions& aPopupEventHandlerActions ); - - /** - * Factory function - * @param aPopupEventHandlerActions actions interface - * @since S60 v3.2 - */ - static CPopupEventHandler* NewLC( - MPopupEventHandlerActions& aPopupEventHandlerActions ); - - /** - * Destructor - * @since S60 v3.2 - */ - ~CPopupEventHandler(); - - private: - - /** - * Constructor - * @param aPopupEventHandlerActions actions interface - * @since S60 v3.2 - */ - CPopupEventHandler( - MPopupEventHandlerActions& aPopupEventHandlerActions ); - - void ConstructL(); - - public: // New functions - /** - * Accessor for state machine - * @return Reference to state machine instance - * @since S60 v3.2 - */ - TPopupFSM& PopupFSM(); - - TBool PublishPopup() const; - TBool PopupVisible() const; - - /** - * @return Is publishing needed - */ - TBool PublishCaption() const; - - /** - * @return Is caption visible - */ - TBool CaptionVisible() const; - - private: // From CActive - void DoCancel(); - void RunL(); - - private: // From MPopupFSMActions - void CompleteSelf(); - void CancelRequest(); - void StartShortTimer(); - void StartLongTimer(); - void IssuePublishPopup(); - void IssueCleanPopup(); - void IssuePublishCaption(); - void IssueCleanCaption(); - - private: // data - /** - * Actions interface - * Ref. - */ - MPopupEventHandlerActions& iPopupEventHandlerActions; - - /** - * State machine instance - * Own. - */ - TPopupFSM iPopupFSM; - - /** - * Timeout timer - * Own. - */ - RTimer iTimer; - - TBool iPublishPopup; - TBool iPopupVisible; - - TBool iPublishCaption; - TBool iCaptionVisible; - }; - -#endif // CPOPUPEVENTHANDLER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/maiscutextdata.h --- a/idlefw/plugins/shortcutplugin/inc/maiscutextdata.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension data -* -*/ - - -#ifndef MAISCUTEXTDATA_H -#define MAISCUTEXTDATA_H - -#include - -class CGulIcon; - -/** - * @since S60 v3.2 - */ -class MAiScutExtData - { - public: - /** - * @return Pointer to popup line array or NULL if not set - * @since S60 v3.2 - */ - virtual const MDesCArray* PopupLineArray() const = 0; - - /** - * return Pointer to icon or NULL if not set - * @since S60 v3.2 - */ - virtual const CGulIcon* Icon() const = 0; - }; - -#endif // MAISCUTEXTDATA_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/maiscutextmessagehandler.h --- a/idlefw/plugins/shortcutplugin/inc/maiscutextmessagehandler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension server message handler. -* -*/ - - -#ifndef MAISCUTEXTMESSAGEHANDLER_H -#define MAISCUTEXTMESSAGEHANDLER_H - -#include - -class CGulIcon; - -/** - * - * Shortcut plug-in xSP extension server message handler. - * - * @since S60 v3.2 - */ -class MAiScutExtMessageHandler - { - public: - /** - * Notifies that the popup text has been changed. - * @param aDefinition Target shortcut definition - * @param aLineArray Pointer to array of popup line texts. Ownership - * is transferred. - * @since S60 v3.2 - */ - virtual void HandleSetPopupLineArrayL( const TDesC& aDefinition, - CDesCArray* aLineArray ) = 0; - /** - * Notifies that the popup text has been reseted. - * @param aDefinition Target shortcut definition - * @since S60 v3.2 - */ - virtual void HandleResetPopupLineArrayL( const TDesC& aDefinition ) = 0; - - /** - * Notifies that the ion has been changed. - * @param aDefinition Target shortcut definition - * @param aIcon Pointer to new icon. Ownership - * is transferred. - * @since S60 v3.2 - */ - virtual void HandleSetIconL( const TDesC& aDefinition, - CGulIcon* aIcon ) = 0; - - /** - * Notifies that the icon has been reseted. - * @param aDefinition Target shortcut definition - * @since S60 v3.2 - */ - virtual void HandleResetIconL( const TDesC& aDefinition ) = 0; - - /** - * Checks whether the target is in shortcuts - * @param aDefinition Target shortcut definition - * @return ETrue if the target is in shortcuts - * @since S60 v3.2 - */ - virtual TBool HandleIsInShortcutsL( const TDesC& aDefinition ) const = 0; - - /** - * Launches General Settings so that the target definition is passed in. - * @param aDefinition Target shortcut definition - * @since S60 v3.2 - */ - virtual void HandleIssuePutInShortcutsL( const TDesC& aDefinition ) = 0; - }; - -#endif // MAISCUTEXTMESSAGEHANDLER_H - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/mpopupeventhandleractions.h --- a/idlefw/plugins/shortcutplugin/inc/mpopupeventhandleractions.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef MPOPUPEVENTHANDLERACTIONS_H -#define MPOPUPEVENTHANDLERACTIONS_H - -// EXTERNAL INCLUDES -#include - -// CLASS DEFINITION -/** - * MPopupEventHandlerActions. - */ -class MPopupEventHandlerActions - { - public: // Abstract methods - /** - * Publishes the shortcut - */ - virtual void IssuePublishShortcut() = 0; - }; - -#endif // MPOPUPEVENTHANDLERACTIONS_H - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/inc/taiscutparser.h --- a/idlefw/plugins/shortcutplugin/inc/taiscutparser.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,451 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser. -* -*/ - - -#ifndef TAISCUTPARSER_H -#define TAISCUTPARSER_H -#include // For TUriParser16 -#include - -// ============================================================================= -// ========================= Supported URI schemes ============================= -/** URI scheme for local application shortcuts */ -_LIT( KScutURISchemeLocalApp, "localapp" ); - -/** URI sheme for normal web addresses */ -_LIT( KScutURISchemeHttp, "http" ); -/** URI sheme for secure web addresses */ -_LIT( KScutURISchemeHttps, "https" ); -// ============================================================================= - -// ============================================================================= -// ============= Application shortcut formatting literals ====================== - -/** Literal to format an application shortcut without parameters */ -_LIT( KScutFormatApplication, "localapp:0x%x" ); - -/** Literal to format an application shortcut with parameter name and value */ -_LIT( KScutFormatApplicationWithParams, "localapp:0x%x?%S=%S" ); - -/** Literal to format an application shortcut with a single parameter string */ -_LIT( KScutFormatApplicationWithParamString, "localapp:0x%x?%S" ); - -// ============================================================================= - -// ============================================================================= -// ============ Shortcut parameter name and value literals ===================== - -/** Parameter name for view ids */ -_LIT( KScutParamNameView, "view" ); - -/** Parameter name for remote mailboxes. Specific to messaging shortcuts */ -_LIT( KScutParamNameMailbox, "mailbox" ); - -/** Parameter name for new message and new email. Specific to messaging shortcuts */ -_LIT( KScutParamNameNew, "new" ); - -/** Parameter value for new message shortcuts. */ -_LIT( KScutParamValueMsg, "msg" ); - -/** Parameter value for new email shortcuts */ -_LIT( KScutParamValueEmail, "email" ); - -/** Parameter value for new syncml mail shortcuts */ -_LIT( KScutParamValueSyncMLMail, "syncmlmail" ); - -/** Parameter value for new postcard shortcuts */ -_LIT( KScutParamValuePostcard, "postcard" ); - -/** Parameter value for new audio message shortcuts */ -_LIT( KScutParamValueAudioMsg, "audiomsg" ); - -/** Parameter value for the connectivity status view shortcut */ -const TUid KScutParamValueConnectivityView = { 0x10207250 }; - -/** Parameter name for enable keylock */ -_LIT( KScutParamNameOn, "on" ); - -/** Parameter name for missed calls view */ -_LIT( KScutParamValueMissedCalls, "missed" ); - -/** Parameter name for dialled calls view */ -_LIT( KScutParamValueDialledCalls, "dialled" ); - -/** Parameter name for received calls view */ -_LIT( KScutParamValueReceivedCalls, "received" ); - -/** Parameter name for logs main view */ -_LIT( KScutParamValueMainView, "counters" ); - -/** Parameter name for bookmark ids */ -_LIT( KScutParamNameBookmark, "bkm" ); - -/** Parameter name for icon id in skin - Format localapp:0xUID?iconid=majorid;minorid;optionalColourGroup */ -_LIT( KScutParamNameIconSkinId, "iconid" ); - -/** Parameter name for icon path. Left here for backward - compatibility. - Format localapp:0xUID?iconmifpath=mif_file.mif;index */ -_LIT( KScutParamNameIconMifPath, "iconmifpath" ); - -/** Parameter name for icon path. MBM and MIF supported - Format localapp:0xUID?iconmifpath=mif_file.mif;index */ -_LIT( KScutParamNameIconPath, "iconpath" ); -/** Parameter name for custom URL title. - Format http://www.url.com?customtitle=Here is my great title */ -_LIT( KScutParamNameCustomTitle, "customtitle" ); -/** Parameter name for CBA icon - Format localapp:0xUID?iconid=majorid;minorid;optionalColourGroup&cba=1 */ -_LIT( KScutParamNameCBAIcon, "cba" ); - -/** Parameter name for toolbar icon */ -_LIT( KScutParamNameToolbarIcon, "toolbar" ); - -/** Shortcut definition parameter for "no effect" */ -_LIT( KScutParamNoEffect, "noeffect" ); - -// ============================================================================= -// ============================================================================= -// ============ Shortcut parameter name and value literals ===================== - -/** Alias for messaging shortcuts */ -_LIT( KScutTargetAliasMessaging, "msg" ); - -/** Alias for keylock shortcuts */ -_LIT( KScutTargetAliasKeylock, "keylock" ); - -/** Alias for logs shortcuts */ -_LIT( KScutTargetAliasLogs, "logs" ); - -/** Alias for voice dialer shortcuts */ -_LIT( KScutTargetAliasVoiceDial, "voicedial" ); - -// ============================================================================= -/** Maximum length of shortcut definition. Used when composing a definition */ -const TInt KMaxDefinitionLength = 100; - -/** Shortcut parameter value separator character */ -const TText KParamValueSeparator = '='; - -/** Shortcut parameter next param separator */ -const TText KParamNextSeparator = '&'; - -_LIT( KScutMIFExtension, ".mif" ); -_LIT( KScutMBMExtension, ".mbm" ); -_LIT( KScutSkinItemSeparator, ";" ); - -/** - * Shortcut definition components - */ -enum TScutDefComponent -{ - EScutDefScheme, - EScutDefTarget, - EScutDefParamName, - EScutDefParamValue, - EScutDefParamNameAndValue, - EScutDefComplete -}; - -/** - * Shortcut types - */ -enum TShortcutType -{ - EScutUnknown, - EScutAnyType = 0, - EScutNoEffect, - EScutApplication, - EScutApplicationView, - EScutApplicationWithParams, - EScutNewMessage, - EScutNewEmail, - EScutNewSyncMLMail, - EScutNewPostcard, - EScutNewAudioMsg, - EScutNewMsgType, - EScutMailbox, - EScutChangeTheme, - EScutWebAddress, - EScutBookmark, - EScutKeylock, - EScutLogsMissedCallsView, - EScutLogsDialledCallsView, - EScutLogsReceivedCallsView, - EScutLogsMainView, - EScutConnectivityStatusView, - EScutApplicationManagerView -}; - -/** - * Icon type - */ -enum TShortcutIconType -{ - EScutIconNone, - EScutIconSkin, - EScutIconMif, - EScutIconMbm -}; - -enum TShortcutIconDestination -{ - EScutDestinationNormal, - EScutDestinationSoftkey, - EScutDestinationToolbar -}; - -class TAiScutIcon -{ - public: - /** - * Index of the icon in icon file - */ - TInt iIconId; - - /** - * Path to the icon file - */ - TFileName iPath; - - /** - * Skin item id of the icon - */ - TAknsItemID iSkinId; - - /** - * Colour groups id in skin - */ - TInt iColourGroup; - - /** - * Type of the icon. From skin or from mif - */ - TShortcutIconType iType; - - /** - * AppUid that this icon belongs to - */ - TUid iAppUid; - - /** - * Possible view id - */ - TUid iViewId; - - /** - * Type of the shortcut - */ - TShortcutType iShortcutType; - - /** - * Is this CBA specific icon - */ - TShortcutIconDestination iDestination; - -}; - -/** - * Shortcuf definition parser - * - * @since S60 v3.2 - */ -class TAiScutParser -{ - -public: - TAiScutParser(); - - /** - * Static utility function to parse an uid from the given descriptor - * - * @since S60 v3.2 - * @param aString The String to parse - * @return Parsed application uid - */ - static TUid ParseUid( const TDesC& aDesC ); - - /** - * Parses a shortcut definition - * - * @since S60 v3.2 - * @param aDefinition Shortcut definition - * @return System wide error code. KErrCorrupt if not recognized - */ - TInt Parse( const TDesC& aDefinition ); - - /** - * Checks if the shortcut definition was valid - * - * @since S60 v3.2 - * @return ETrue if valid, EFalse if not - */ - TBool IsValid() const; - - /** - * Returns the shortcut target type - * - * @since S60 v3.2 - * @return Shortcut target type - */ - TShortcutType Type() const; - - /** - * Returns the possible shortcut overriding icon - * that has been defined in the URL either with the format - * localapp:0xUID?iconid=majorid;minorid;colourgroup - * or - * localapp:0xUID?iconmifpath=mif_file.mif;index - * - * @since S60 v3.2 - * @return Shortcut icon override - */ - TAiScutIcon Icon() const; - - /** - * Returns the shortcut target uid. Used for application shortcuts - * - * @since S60 v3.2 - * @return Shortcut target uid - */ - TUid Uid() const; - - /** - * Returns a shortcut definition component value - * - * @since S60 v3.2 - * @param aComponent Shortcut definition component - * @return Pointer descriptor to component value - */ - TPtrC Get( TScutDefComponent aComponent ) const; - - /** - * Composes a shortcut definition string from given parameters - * - * @since S60 v3.2 - * @param aDes On return, the shortcut definition. Transfers ownership - * @param aUid Application uid - * @param aParamName Parameter name - * @param aParamValue Parameter value - */ - void ComposeL( HBufC*& aDes, const TUid aUid, - const TDesC& aParamName, const TDesC& aParamValue ); - - /** - * Composes a shortcut definition string from given parameters - * - * @since S60 v3.2 - * @param aDes On return, the shortcut definition. Transfers ownership - * @param aUid Application uid - * @param aParamString Parameter string - */ - void ComposeL( HBufC*& aDes, const TUid aUid, - const TDesC& aParamString ); - - /** - * Creates a checksum for the given aDefinition. This is used - * in URL matching so that no string need to be stored. Checksum is - * done checksum = positionInString * charValue - * - * @since S60 v3.2 - * @param aDefinition The definition to calculate the checksum from - * @return TInt The checksum - */ - TInt ChecksumForString( const TDesC& aDefinition) const; - - /** - * Removes icon definitions from the given string. Icon definitions are - * KScutParamNameIconSkinId, KScutParamNameIconSkinPath, KScutParamNameCBAIcon - * KScutParamNameCustomTitle - * - * @since S60 v3.2 - */ - void RemoveExtraDefinitionsL( TDes &aString ) const; - /** - * Parses the custom title from the current definition. - * Returns ETrue on success and places the extracted - * custom title to the aTarget - * - * @param aTarget Where to place the custom title. It is callers responsibility - * to provide a descriptor with enough room for the custom title. - * - * @return KErrNone if everything is fine, KErrNotFound - * if there is no custom title in the definition, KErrNoMemory in - * case there is not enough room to place the result (low memory situations - * or too small descriptor provided) - */ - TInt CustomTitle( TDes& aTarget ) const; - -protected: -private: - - /** - * Checks if an alias was used in shortcut definition and parses an uid from it - * - * @since S60 v3.2 - * @return ETrue if alias was found and parsed, EFalse if not - */ - TBool ParseAlias(); - - /** - * Parses the possible application shortcut parameters - * - * @since S60 v3.2 - */ - void ParseParams(); - -private: // data - /** - * URI Parser - */ - TUriParser iUriParser; - - /** - * Pointer to the full shortcut definition - */ - TPtrC iDefinition; - - /** - * Shortcut target type - */ - TShortcutType iType; - - /** - * Shortcut application uid - */ - TUid iUid; - - /** - * Pointer to shortcut parameter name - */ - TPtrC iParamName; - - /** - * Pointer to shortcut parameter value - */ - TPtrC iParamValue; - /** - * Shortcut icon that has been given with the - * URL-string - */ - TAiScutIcon iIcon; - }; - -#endif // TAISCUTPARSER_H - -// End of File. \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/loc/ai3scutplugin.loc --- a/idlefw/plugins/shortcutplugin/loc/ai3scutplugin.loc Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project aiscutplugin -* -*/ - - -// d: Header text for Information query pop-up window. -// l: heading_pane_t1 -// w: -// r: TB9.2 -// -#define qtn_ai_sc_query_modify_header "Tip:" - -// d: message part in Information query pop-up window, -// d: which informs the user where to set installed application as a shortcut in idle. -// d: %U in the message is the application name -// d: Path in the query text is a link. -// l: popup_info_list_pane_t1 -// w: -// r: TB9.2 -// -#define qtn_ai_sc_query_modify_gs "%U can show additional information in Shortcut area. If you want to modify shortcuts select Options - Change shortcut settings" - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/loc/ai3scutsettings.loc --- a/idlefw/plugins/shortcutplugin/loc/ai3scutsettings.loc Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2125 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project aiscutsettings -* -*/ - - -//d:Localized name of the plugin -//d: -//l:list_set_graphic_pane_t1 -//w: -//r:3.2 -// -#define qtn_ai_set_cont_apps "Shortcuts" - -// d: Text in title pane -// l: title_pane_t2/opt9 -// w: -// r: 3.2 -// -#define qtn_set_title_pers_shortcuts "Shortcuts" - -// d: Text of a list item in personalisation view's folder list -// d: Item opens Shortcuts folder -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_pers_shortcuts "Shortcuts" - -// d: Application cannot be opened during Backup -// l: popup_note_window -// w: -// r: 3.2 -// -#define qtn_ai_scut_operation_disabled "Application cannot be opened during backup" - -// d: Shortcuts Item caption -// d: Active Idle Shortcut Settings View -// d: %N order number of the shortcut item -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_ai_set_myt_linkn "%N. Shortcut item" - -// d: Prompt text for type new URL data query -// d: Active Idle Shortcut Settings View -// l: popup_query_data_window -// w: -// r: 3.2 -// -#define qtn_ai_shorts_type_url "Type URL" - -// d: Prompt text for edit URL data query -// d: Active Idle Shortcut Settings View -// l: popup_query_data_window -// w: -// r: 3.2 -// -#define qtn_ai_shorts_edit_url "Edit URL" - -// d: Prompt text for change shortcut type query -// d: Active Idle Shortcut Settings View -// l: heading_pane_t1 -// w: -// r: 3.2 -// -#define qtn_sc_set_change_prompt "Change to:" - -// d: Application shortcut type choice item in change shortcut type query -// d: Active Idle Shortcut Settings View -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_sc_set_change_apps "Application" - -// d: Bookmark shortcut type choice item in change shortcut type query -// d: Active Idle Shortcut Settings View -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_sc_set_change_bookmark "Bookmark" - -// d: URL shortcut type choice item in change shortcut type query -// d: Active Idle Shortcut Settings View -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_sc_set_change_url "Web address" - -// d: Text of a list item in shortcut setting view's application list. -// d: User selects this item when she wants Scroll keys or Selection key -// d: have no effect is Idle state. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_skeys_no_effect "No effect" - - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Left idle softkey setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_left_idle_softkey "Left idle softkey" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Right idle softkey setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_right_idle_softkey "Right idle softkey" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Right Scroll key setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_right_scroll "Right Scroll key" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Left Scroll key setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_left_scroll "Left Scroll key" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Down Scroll key setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_down_scroll "Down Scroll key" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Up Scroll key setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_up_scroll "Up Scroll key" - -// d: Title of a list item shortcut setting view's setting list -// d: Item opens Selection key setting page -// l: list_setting_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_selec_key "Selection key" - - -// d: Text for fixed item information note -// d: Shown when user tries to change fixed shortcut in settings -// l: popup_note_window -// w: -// r: 3.2 -// -#define qtn_ai_set_app_note_fixed "Fixed item. Can't be changed" - -// d: Text for empty listbox item -// d: Shown when there are no modifiable shortcuts in settings -// l: main_list_empty_pane -// w: -// r: 3.2 -// -#define qtn_ai_sc_set_all_fixed "(No editable shortcuts available in this Idle theme.)" - -// ===================================================================== -// App titles -// ===================================================================== - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_about_grid "About" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_about_list "About product" - -// d: Focused application name on idle shortcut plugin tooltip. -// l: popup_ai_links_title_window_t1 -// w: -// r: 5.0 -// -#define qtn_app_caption_string "Application Manager" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_am_gs "App. manage" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_am_skey "AppMngr" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_am "AppMngr" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.1 -// -#define qtn_apps_menu_gs "Menu" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_menu_skey "Menu" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_menu "Menu" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_blid_grid "Navigator" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_blid_list "Navigator" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_blid_gs "Navigator" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_blid_skey "Navigator" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_blid "Navigator" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_bluetooth_grid "Bluetooth" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_bluetooth_list "Bluetooth" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_bluetooth_gs "Bluetooth" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_bluetooth_skey "Bluetooth" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_bluetooth "Bluetooth" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_browserng_grid "Web" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_browserng_list "Web" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.1 -// -#define qtn_apps_services_gs_new "WAP services" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_services_skey_new "Services" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_services_new "Services" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_oper_url "%U" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_calculator_grid "Calculator" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_calculator_list "Calculator" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_calculator_gs "Calculator" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_calculator_skey "Calculat." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_calculator "Calculat." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_calendar_grid "Calendar" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_calendar_list "Calendar" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_calendar_gs "Calendar" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_calendar_skey "Calendar" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_calendar "Calendar" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_ccor_grid "Camcorder" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_ccor_list "Camcorder" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_ccor_gs "Camcorder" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_ccor_skey "Camcorder" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_ccor "Camcorder" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_dict_grid "Dictionary" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_dict_list "Dictionary" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_dict_gs "Dictionary" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_dict_skey "Dictionary" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_dict "Dictionary" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_clock_grid "Clock" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_clock_list "Clock" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_clock_gs "Clock" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_clock_skey "Clock" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_clock "Clock" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_cmon_grid "Conn. Manager" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_cmon_list "Conn. Manager" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_cmon_gs "Conn. manager" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_cmon_skey "Conn. m." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_cmon "Conn. m." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_cnv_app_caption_short "Converter" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_cnv_app_caption "Converter" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_converter_gs "Converter" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_converter_skey "Convert." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_converter "Convert." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_dm_grid "Device Manager" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_dm_list "Device Manager" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.6 -// -#define qtn_apps_dm_gs "Device manager" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.6 -// -#define qtn_apps_dm_skey "Dev. mgr." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_dm "Dev. mgr." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_drm_grid "Rights Mgr" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_drm_list "Rights Manager" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_drm_gs "Rights manager" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_drm_skey "DRM Mgr" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_drm "DRM Mgr" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_fax_modem_grid "Modem" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_fax_modem_list "Modem" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_fax_modem_gs "Modem" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_fax_modem_skey "Modem" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_fax_modem "Modem" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_fmgr_grid "File manager" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_fmgr_list "File manager" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_fmgr_gs "File manager" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_fmgr_skey "File manager" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_fmgr "File Manager" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_radio_grid "Radio" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_radio_list "Radio" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_radio_gs "Radio" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.7 -// -#define qtn_apps_radio_skey "Radio" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_radio "Radio" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.7 -// -#define qtn_fmtx_idle_sk "FM Tx sk" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_fmtx_idle_msk "FM Tx msk" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_settings_grid "Settings" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_settings_list "Settings" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_settings_gs "Settings" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_settings_skey "Settings" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_gs "Settings" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 5.0 -// -#define qtn_apps_controlpanel_grid "Control Panel" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 5.0 -// -#define qtn_apps_controlpanel_list "Control Panel" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 5.0 -// -#define qtn_apps_controlpanel_gs "Control Panel" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 5.0 -// -#define qtn_apps_controlpanel_skey "Control Panel" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 5.0 -// -#define qtn_msk_idle_controlpanel "Control Panel" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_help_grid "Help" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_help_list "Help" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_help_gs "Help" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_help_skey "Help" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_help "Help" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_infrared_grid "Infrared" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_infrared_list "Infrared" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_infrared_gs "Infrared" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_infrared_skey "Infrared" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_infrared "Infrared" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_instant_grid "Chat" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_instant_list "Chat" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_instant_gs "Chat" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_instant_skey "Chat" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_instant "Chat" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_udict_grid "User dict." - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_udict_list "User dictionary" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_udict_gs "User dictionary" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_udict_skey "User dict." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_udict "User dict." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_lm_grid "Landmarks" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_lm_list "Landmarks" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_lm_gs "Landmarks" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_lm_skey "Landmarks" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_lm "Landmarks" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_logs_grid "Log" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_logs_list "Log" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_logs_gs "Log" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_logs_skey "Log" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_logs "Log" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mg_grid "Gallery" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mg_list "Gallery" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_mg_gs "Gallery" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_mg_skey "Gallery" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mg "Gallery" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mp_grid "Media Player" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mp_list "Media Player" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_mp_gs "Media Player" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_mp_skey "Media Player" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mp "Media Player" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_memc_appl_grid "Memory" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_memc_appl_list "Memory card" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_mmc_gs "Memory Card" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_mmc_skey "Memory c..." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mmc "Memory c..." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_messaging_grid "Messages" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_messaging_list "Messages" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_messaging_gs "Messages" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_messaging_skey "Messag." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_messaging "Messag." - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_set_idle_skey_new_message "New message" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// d: User is prompted to write SMS, MMS or Email if the softkey is pressed. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_idle_skey_new_message "New msg." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_new_message "New msg." - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special New Message shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_skey_new_msg "New message" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// d: User is prompted to new message if the softkey is pressed. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_idle_skey_new_msg "New message" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_new_msg "New message" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_set_idle_skeys_sms_editor "New SMS" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_sms_skey "New SMS" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_sms "New SMS" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_set_idle_skeys_mms_editor "New MMS" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_mms_skey "New MMS" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mms "New MMS" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special Select message type shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_skey_select_msg_type "Select msg type" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// d: User is prompted to Select message if the softkey is pressed. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_idle_skey_select_msg "Select msg" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_select_msg "Select msg" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special New Email shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_set_idle_skeys_email_editor "New Email" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_email_skey "New Email" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_email "New Email" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special New MMS Postcard shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mmspostcard_gs "New MMS postcard" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_mmspostcard_skey "New MMS postcard" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mmspostcard "New MMS postcard" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special New SyncML mail shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_syncml_mail_gs "New SyncML mail" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_syncml_mail_skey "New SyncML mail" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_syncml_mail "New SyncML mail" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special New Audio message shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_audio_msg_gs "New audio message" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1u -// -#define qtn_apps_audio_msg_skey "New audio msg" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_audio_msg "New audio msg" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mplayer_grid "Music player" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mplayer_list "Music player" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_mplayer_gs "Music player" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_mplayer_skey "Music" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mplayer "Music" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_notepad_grid "Notepad" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_notepad_list "Notepad" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_notepad_gs "Notepad" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_notepad_skey "Notepad" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_notepad "Notepad" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_notepad_newnote_gs "New note" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.2 -// -#define qtn_apps_notepad_newnote_skey "New note" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_notepad_newnote "New note" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_skins_grid "Skins" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_skins_list "Skins" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_skins_gs "Skins" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_skins_skey "Skins" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_skins "Skins" - -// d: Text of a list item in shortcut setting view's application list. -// d: Caption for the special Change Theme shortcut -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_idle_skin_gs "Idle theme" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.2 -// -#define qtn_apps_idle_skin_skey "Idle theme" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_skin "Idle theme" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_phone_grid "Telephone" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_phone_list "Telephone" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_phonebook_grid "Contacts" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_phonebook_list "Contacts" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_phonebook_gs "Contacts" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_phonebook_skey "Contacts" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_phonebook "Contacts" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mode_grid "Profiles" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_mode_list "Profiles" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_mode_gs "Profiles" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_mode_skey "Profiles" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_mode "Profiles" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_ptt_grid "PTT" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_ptt_list "Pust to talk" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_ptt_gs "Push to talk" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.2 -// -#define qtn_apps_ptt_skey "PTT" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_ptt "PTT" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_search_grid "Search" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_search_list "Search" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_search_gs "Search" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.2 -// -#define qtn_apps_search_skey "Search" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_search "Search" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_simapps_grid "SIM services" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_simapps_list "SIM services" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_sd_grid "Speed dial" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_sd_list "Speed dial" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_sd_gs "Speed dial" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_sd_skey "Sp. dials" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_sd "Sp. dials" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_usb_grid "USB" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_usb_list "USB" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_usb_gs "USB" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_usb_skey "USB" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_usb "USB" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_vc_grid "Voice Commands" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_vc_list "Voice Commands" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_vc_gs "Voice Commands" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_vc_skey "Voice Commands" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_vc "Voice Commands" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_smsvo_grid "Voice mail" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_smsvo_list "Voice mailbox" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_smsvo_gs "Voice mailbox" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_smsvo_skey "Voice m." - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_smsvo "Voice m." - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_voip_grid "Voice over IP" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_voip_list "Voice over IP" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 3.0 -// -#define qtn_apps_voip_gs "Voice over IP" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.0 -// -#define qtn_apps_voip_skey "Voice over IP" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_voip "Voice over IP" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_vorec_app_menu_grid "Recorder" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 3.2 -// -#define qtn_vorec_app_menu_list "Recorder" - -// d: Text of a list item in shortcut setting view's application list. -// l: list_set_graphic_pane_t1 -// w: -// r: 2.8 -// -#define qtn_apps_recorder_gs "Recorder" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 2.8 -// -#define qtn_apps_recorder_skey "Recorder" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 3.2 -// -#define qtn_msk_idle_recorder "Recorder" - -// d: Application name in the App Shell grid. -// l: cell_app_pane_t1 -// w: -// r: 3.2 -// -#define qtn_apps_sml_grid "Sync" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1_cp2 -// w: -// r: 3.2 -// -#define qtn_apps_sml_list "Sync" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_video_grid "Vid.Services" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_operatormenu_skey "Oper. menu" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_fplayer_skey "Flash Player" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 3.1 -// -#define qtn_apps_exchangemail_skey "Exh. mail" - -// d: Application name in the App Shell list. -// l: list_single_large_graphic_pane_t1 -// w: -// r: 5.0 -// -#define qtn_apps_connectivity_list "Connectivity" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as Left or Right idle softkey. -// l: control_pane_t1/opt7 -// w: -// r: 5.0 -// -#define qtn_apps_connectivity_skey "Connectivity" - -// d: User can personalize idle softkeys to be other application from general settings. -// d: The text is shown as middle softkey. -// l: control_pane_t3/opt7 -// w: -// r: 5.0 -// -#define qtn_msk_idle_connectivity "Connectivity" - - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/rom/aiscutplugin.iby --- a/idlefw/plugins/shortcutplugin/rom/aiscutplugin.iby Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project aiscutplugin -* -*/ - - -#ifndef AISCUTPLUGIN_IBY -#define AISCUTPLUGIN_IBY - -#include - -// Shortcut plugin -data=DATAZ_\BITMAP_DIR\aiscutplugin.mif BITMAP_DIR\aiscutplugin.mif -ECOM_PLUGIN( aiscutplugin.dll, aiscutplugin.rsc ) - -// Shortcut settings plugin -ECOM_PLUGIN( aiscutsettings.dll, aiscutsettings.rsc ) - -file=ABI_DIR\BUILD_DIR\aiscutextserv.dll SHARED_LIB_DIR\aiscutextserv.dll - -// Central repository file, temporarily here -//data=\S60\ActiveIdle2\plugins\shortcutplugin\src\10275104.txt "private\10202BE9\10275104.txt" - -data=ZPRIVATE\102750F9\backup_registration.xml private\102750F9\backup_registration.xml - -#endif // AISCUTPLUGIN_IBY - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/rom/aiscutplugin_resources.iby --- a/idlefw/plugins/shortcutplugin/rom/aiscutplugin_resources.iby Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Image description file for project aiscutplugin localizable resources -* -*/ - - -#ifndef AISCUTPLUGIN_RESOURCES_IBY -#define AISCUTPLUGIN_RESOURCES_IBY - -#include - -// Shortcut settings plugin localizable resources -data=DATAZ_\RESOURCE_FILES_DIR\aiscutsettingsres.rsc RESOURCE_FILES_DIR\aiscutsettingsres.rsc -data=DATAZ_\RESOURCE_FILES_DIR\aiscuttexts.rsc RESOURCE_FILES_DIR\aiscuttexts.rsc -data=DATAZ_\RESOURCE_FILES_DIR\aiscutpluginres.rsc RESOURCE_FILES_DIR\aiscutpluginres.rsc - -#endif // AISCUTPLUGIN_RESOURCES_IBY - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/GenPopupFSM.py --- a/idlefw/plugins/shortcutplugin/src/GenPopupFSM.py Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,350 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -''' -Finite State Machine generator for Symbian OS projects. - -Just define fsmName, actionsIfaceName and stt and the script generates the -needed files for you. - -The files are: -- State Machine header file (including state classes, overwrites the existing file) -- State Machine source file (including state classes, overwrites the existing file) -- Actions interface header (abstract M-class, overwrites the existing file) -- Header file for tracing (will be generated only if missing) - - -Version 1: 22-Jun-2006, Jaakko Vuori, Initial version -Version 2: 26-Jun-2006, Jaakko Vuori, Added argument passing -Version 3: 27-Jun-2006, Jaakko Vuori, Changed state classes nested in FSM class - -''' -from sets import Set -import os, re, string - -#------------------------------------------------------------------------ -#State machine name -fsmName = "Popup" - -#Actions interface name -actionsIfaceName = "PopupFSMActions" - -#State transition table -stt=[ #source state #event #dest state #actions - ("NotSetOffFocus", [ - ("HandleUpdate()", "SetOffFocus", ["IssueCleanCaption()"]), - ("HandleGotFocus()", "NotSetOnFocus", []), - ("HandleForeground()", "NotSetOffFocus", ["IssuePublishCaption()"]), - ]), - - ("SetOffFocus", [ - ("HandleGotFocus()", "GettingFocus", ["StartShortTimer()"]), - ("HandleReset()", "NotSetOffFocus", ["IssuePublishCaption()"]), - ]), - - ("GettingFocus", [ - ("HandleRequestCompleted()", "Visible", ["IssuePublishPopup()", "StartLongTimer()"]), - ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()", "CancelRequest()"]), - ("HandleLostFocus()", "SetOffFocus", ["CancelRequest()"]), - ]), - - ("LosingFocus", [ - ("HandleRequestCompleted()", "SetOffFocus", ["IssueCleanPopup()"]), - ("HandleReset()", "NotSetOffFocus", ["IssuePublishCaption()", "CancelRequest()"]), - ("HandleGotFocus()", "Visible", ["CancelRequest()", "StartLongTimer()"]), - ]), - - ("NotSetOnFocus", [ - ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), - ("HandleLostFocus()", "NotSetOffFocus", []), - ("HandleBackground()", "BackgroundNotSetOnFocus", []), - ("HandleForeground()", "NotSetOnFocus", ["IssuePublishCaption()"]), - ]), - - ("Visible", [ - ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), - ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()", "IssueCleanPopup()", "CancelRequest()"]), - ("HandleLostFocus()", "LosingFocus", ["CancelRequest()", "CompleteSelf()"]), - ("HandleRequestCompleted()", "NotVisible", ["IssueCleanPopup()"]), - ("HandleBackground()", "BackgroundSetOnFocus", ["CancelRequest()", "IssueCleanPopup()"]), - ]), - - ("NotVisible", [ - ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), - ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()"]), - ("HandleLostFocus()", "SetOffFocus", []), - ]), - - ("BackgroundNotSetOnFocus", [ - ("HandleForeground()", "NotSetOnFocus", ["IssuePublishCaption()"]), - ("HandleUpdate()", "BackgroundSetOnFocus", ["IssueCleanCaption()"]), - ]), - - ("BackgroundSetOnFocus", [ - ("HandleReset()", "BackgroundNotSetOnFocus", ["IssuePublishCaption()"]), - ("HandleForeground()", "Visible", ["IssuePublishPopup()", "StartLongTimer()"]), - ]), - - ] -#------------------------------------------------------------------------ - -def write( s ): - f.write( s + '\n' ) - -def writeHeader(): - global f - fname = '%sFSM.h' % (fsmName) - print "Generating %s..." % (fname) - f = open( fname, 'w' ) - - write( "#ifndef %sFSM_H" % ( fsmName.upper() ) ) - write( "#define %sFSM_H" % ( fsmName.upper() ) ) - write( "" ) - write( "// EXTERNAL INCLUDES" ) - write( "#include " ) - write( "" ) - write( "// FORWARD DECLARATIONS" ) - write( "class T%sFSM;" % (fsmName) ) - write( "class M%s;" % (actionsIfaceName) ) - write( "" ) - write( "// CLASS DEFINITIONS" ) - - write( "/**" ) - write( " * %s state machine" % (fsmName) ) - write( " */" ) - write( "class T%sFSM" % (fsmName) ) - write( " {" ) - - write( " /**" ) - write( " * Base class for states" ) - write( " */" ) - write( " class T%sStateBase" % (fsmName) ) - write( " {" ) - write( " public: // New methods" ) - - events=[] - for s in stt: - for e in s[1]: - events.append( e[0] ) - for event in Set(events): - fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() - if len(args)>0: - write( " virtual void %s( T%sFSM* a%sFSM, M%s& a%s,%s);" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) - else: - write( " virtual void %s( T%sFSM* a%sFSM, M%s& a%s );" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) - - - write( " };" ) - write( "" ) - - for s in stt: - write( " /**" ) - write( " * State class T%s" % (s[0]) ) - write( " */" ) - write( " class T%s : public T%sStateBase" % (s[0],fsmName) ) - write( " {" ) - write( " protected: // Methods derived from T%sState" % (fsmName)) - for event in s[1]: - fname, args = re.match('(.*?)[(](.*?)[)]',event[0]).groups() - if len(args)>0: - write( " void %s( T%sFSM* a%sFSM, M%s& a%s,%s);" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) - else: - write( " void %s( T%sFSM* a%sFSM, M%s& a%s );" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) - - write( " };" ) - write( "" ) - - write( "" ) - write( " public: // Constructors" ) - write( " T%sFSM( M%s& a%s );" % (fsmName,actionsIfaceName,actionsIfaceName)) - write( "" ) - write( " public: // New methods" ) - for event in Set(events): - write( " void %s;" % (event)) - write( "" ) - write( " private: // New methods" ) - write( " void SetState( T%sStateBase* aNewState );" % (fsmName) ) - write( "" ) - write( " private: // Data" ) - write( " //Ref:" ) - write( " T%sStateBase* iCurrentState;" % (fsmName)) - write( " M%s& i%s;" % (actionsIfaceName,actionsIfaceName)) - write( "" ) - write( " //Own:" ) - for s in stt: - write( " T%s i%s;" % (s[0],s[0])) - - write( " private: // Friend class definitions" ) - for s in stt: - write( " friend class T%s;" % (s[0])) - - write( " };" ) - write( "" ) - write( "#endif // %sFSM_H" % (fsmName.upper()) ) - write( "" ) - write( "// End of file" ) - f.close() - - -def writeSource(): - global f - fname = '%sFSM.cpp' % (fsmName) - print "Generating %s..." % (fname) - f = open( fname, 'w' ) - - write( '#include "%sFSM.h"' % (fsmName) ) - write( '#include "M%s.h"' % (actionsIfaceName) ) - write( '#include "%sTrace.h"' % (fsmName) ) - write( '' ) - write( '#pragma warning( disable:4100 )' ) - write( '#pragma warning( disable:4068 )' ) - write( '#pragma warn_unusedarg off' ) - - write( '' ) - write( 'T%sFSM::T%sFSM( M%s& a%s ) : ' % (fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) - write( ' iCurrentState( &i%s ),' % (stt[0][0]) ) - write( ' i%s( a%s )' % (actionsIfaceName,actionsIfaceName) ) - write( ' {' ) - write( ' }' ) - write( '' ) - - events=[] - for s in stt: - for e in s[1]: - events.append( e[0] ) - - for event in Set(events): - fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() - if len(args)>0: - write( 'void T%sFSM::T%sStateBase::%s( T%sFSM* /*a%sFSM*/, M%s& /*a%s*/,%s )' % (fsmName,fsmName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args)) - else: - write( 'void T%sFSM::T%sStateBase::%s( T%sFSM* /*a%sFSM*/, M%s& /*a%s*/ )' % (fsmName,fsmName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName)) - write( ' {' ) - write( ' TRACE( _L("T%sStateBase::%s") );' % (fsmName,event)) - write( ' }' ) - write( '' ) - - for event in Set(events): - fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() - write( 'void T%sFSM::%s(%s)' % (fsmName,fname,args) ) - write( ' {' ) - arglist=args.split(',') - argnames = string.join([arg.split()[-1:][0] for arg in arglist if arg!=""], ', ') - if len(argnames)>0: - write( ' iCurrentState->%s( this, i%s, %s );' % (fname,actionsIfaceName,argnames) ) - else: - write( ' iCurrentState->%s( this, i%s );' % (fname,actionsIfaceName) ) - write( ' }' ) - write( '' ) - - write( 'void T%sFSM::SetState( T%sStateBase* aNewState )' % (fsmName,fsmName) ) - write( ' {' ) - write( ' iCurrentState = aNewState;' ) - write( ' }' ) - write( '' ) - - for s in stt: - stateName, events = s - for event in events: - eventName = event[0] - destState = event[1] - actions = event[2] - fname, args = re.match('(.*?)[(](.*?)[)]',eventName).groups() - if len(actions)>0: - if len(args)>0: - write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& a%s,%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) - else: - write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& a%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) - else: - if len(args)>0: - write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& /*a%s*/,%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) - else: - write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& /*a%s*/ )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) - - write( ' {' ) - write( ' TRACE( _L("T%s::%s") );' % (stateName, eventName) ) - write( ' a%sFSM->SetState( &a%sFSM->i%s );' % (fsmName,fsmName,destState) ) - for action in actions: - fname, args = re.match('(.*?)[(](.*?)[)]',action).groups() - if len(args)>0: - arglist=args.split(',') - argnames = string.join([arg.split()[-1:][0] for arg in arglist if arg!=""], ', ') - write( ' a%s.%s( %s );' % (actionsIfaceName,fname,argnames) ) - else: - write( ' a%s.%s();' % (actionsIfaceName,fname) ) - write( ' }' ) - write( '' ) - - write( '// End of file' ) - - -def writeTraceHeader(): - if not os.path.isfile( '%sTrace.h' % (fsmName) ): - global f - fname = '%sTrace.h' % (fsmName) - print "Generating %s..." % (fname) - f = open( fname, 'w' ) - write( '#ifndef %sTRACE_H' % (fsmName.upper()) ) - write( '#define %sTRACE_H' % (fsmName.upper()) ) - write( '' ) - write( '// MACROS' ) - write( '#define TRACE' ) - write( '' ) - write( '#endif // %sTRACE_H' % (fsmName.upper()) ) - write( '' ) - write( '// End of file' ) - f.close() - - -def writeActionsIface(): - global f - fname = 'M%s.h' % (actionsIfaceName) - print "Generating %s..." % (fname) - f = open( fname, 'w' ) - - write( '#ifndef M%s_H' % (actionsIfaceName.upper()) ) - write( '#define M%s_H' % (actionsIfaceName.upper()) ) - write( '' ) - write( '// EXTERNAL INCLUDES' ) - write( '#include ' ) - write( '' ) - write( '// CLASS DEFINITION' ) - write( '/**' ) - write( ' * M%s actions.' % (actionsIfaceName) ) - write( ' * Note: This file has been generated automatically. Do not edit!' ) - write( ' */' ) - write( 'class M%s' % (actionsIfaceName) ) - write( ' {' ) - write( ' public: // Abstract methods' ) - - actions=[] - for s in stt: - for e in s[1]: - actions.extend( e[2] ) - for action in Set(actions): - write( ' virtual void %s = 0;' % (action)) - write( ' };' ) - write( '' ) - write( '#endif // M%s_H' % (actionsIfaceName.upper()) ) - write( '' ) - write( '// End of file' ) - f.close() - -if __name__ == "__main__": - writeHeader() - writeSource() - writeTraceHeader() - writeActionsIface() diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/MPopupFSMActions.h --- a/idlefw/plugins/shortcutplugin/src/MPopupFSMActions.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef MPOPUPFSMACTIONS_H -#define MPOPUPFSMACTIONS_H - -// EXTERNAL INCLUDES -#include - -// CLASS DEFINITION -/** - * MPopupFSMActions actions. - * Note: This file has been generated automatically. Do not edit! - */ -class MPopupFSMActions - { - public: // Abstract methods - virtual void StartLongTimer() = 0; - virtual void IssueCleanPopup() = 0; - virtual void IssuePublishPopup() = 0; - virtual void IssuePublishCaption() = 0; - virtual void IssueCleanCaption() = 0; - virtual void StartShortTimer() = 0; - virtual void CompleteSelf() = 0; - virtual void CancelRequest() = 0; - }; - -#endif // MPOPUPFSMACTIONS_H - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/PopupFSM.cpp --- a/idlefw/plugins/shortcutplugin/src/PopupFSM.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,306 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include "PopupFSM.h" -#include "MPopupFSMActions.h" -#include "PopupTrace.h" - -#pragma warning( disable:4100 ) -#pragma warning( disable:4068 ) -#pragma warn_unusedarg off - -TPopupFSM::TPopupFSM( MPopupFSMActions& aPopupFSMActions ) : - iCurrentState( &iNotSetOffFocus ), - iPopupFSMActions( aPopupFSMActions ) - { - } - -void TPopupFSM::TPopupStateBase::HandleForeground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleForeground()") ); - } - -void TPopupFSM::TPopupStateBase::HandleUpdate( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleUpdate()") ); - } - -void TPopupFSM::TPopupStateBase::HandleRequestCompleted( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleRequestCompleted()") ); - } - -void TPopupFSM::TPopupStateBase::HandleReset( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleReset()") ); - } - -void TPopupFSM::TPopupStateBase::HandleBackground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleBackground()") ); - } - -void TPopupFSM::TPopupStateBase::HandleGotFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleGotFocus()") ); - } - -void TPopupFSM::TPopupStateBase::HandleLostFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TPopupStateBase::HandleLostFocus()") ); - } - -void TPopupFSM::HandleForeground() - { - iCurrentState->HandleForeground( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleUpdate() - { - iCurrentState->HandleUpdate( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleRequestCompleted() - { - iCurrentState->HandleRequestCompleted( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleReset() - { - iCurrentState->HandleReset( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleBackground() - { - iCurrentState->HandleBackground( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleGotFocus() - { - iCurrentState->HandleGotFocus( this, iPopupFSMActions ); - } - -void TPopupFSM::HandleLostFocus() - { - iCurrentState->HandleLostFocus( this, iPopupFSMActions ); - } - -void TPopupFSM::SetState( TPopupStateBase* aNewState ) - { - iCurrentState = aNewState; - } - -void TPopupFSM::TNotSetOffFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotSetOffFocus::HandleUpdate()") ); - aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); - aPopupFSMActions.IssueCleanCaption(); - } - -void TPopupFSM::TNotSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TNotSetOffFocus::HandleGotFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - } - -void TPopupFSM::TNotSetOffFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotSetOffFocus::HandleForeground()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TSetOffFocus::HandleGotFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iGettingFocus ); - aPopupFSMActions.StartShortTimer(); - } - -void TPopupFSM::TSetOffFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TSetOffFocus::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TGettingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TGettingFocus::HandleRequestCompleted()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.IssuePublishPopup(); - aPopupFSMActions.StartLongTimer(); - } - -void TPopupFSM::TGettingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TGettingFocus::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - aPopupFSMActions.CancelRequest(); - } - -void TPopupFSM::TGettingFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TGettingFocus::HandleLostFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); - aPopupFSMActions.CancelRequest(); - } - -void TPopupFSM::TLosingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TLosingFocus::HandleRequestCompleted()") ); - aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); - aPopupFSMActions.IssueCleanPopup(); - } - -void TPopupFSM::TLosingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TLosingFocus::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); - aPopupFSMActions.IssuePublishCaption(); - aPopupFSMActions.CancelRequest(); - } - -void TPopupFSM::TLosingFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TLosingFocus::HandleGotFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.CancelRequest(); - aPopupFSMActions.StartLongTimer(); - } - -void TPopupFSM::TNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotSetOnFocus::HandleUpdate()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.IssueCleanCaption(); - aPopupFSMActions.IssuePublishPopup(); - aPopupFSMActions.StartLongTimer(); - } - -void TPopupFSM::TNotSetOnFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TNotSetOnFocus::HandleLostFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); - } - -void TPopupFSM::TNotSetOnFocus::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TNotSetOnFocus::HandleBackground()") ); - aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); - } - -void TPopupFSM::TNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotSetOnFocus::HandleForeground()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TVisible::HandleUpdate()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.IssueCleanCaption(); - aPopupFSMActions.IssuePublishPopup(); - aPopupFSMActions.StartLongTimer(); - } - -void TPopupFSM::TVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TVisible::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - aPopupFSMActions.IssueCleanPopup(); - aPopupFSMActions.CancelRequest(); - } - -void TPopupFSM::TVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TVisible::HandleLostFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iLosingFocus ); - aPopupFSMActions.CancelRequest(); - aPopupFSMActions.CompleteSelf(); - } - -void TPopupFSM::TVisible::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TVisible::HandleRequestCompleted()") ); - aPopupFSM->SetState( &aPopupFSM->iNotVisible ); - aPopupFSMActions.IssueCleanPopup(); - } - -void TPopupFSM::TVisible::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TVisible::HandleBackground()") ); - aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); - aPopupFSMActions.CancelRequest(); - aPopupFSMActions.IssueCleanPopup(); - } - -void TPopupFSM::TNotVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotVisible::HandleUpdate()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.IssueCleanCaption(); - aPopupFSMActions.IssuePublishPopup(); - aPopupFSMActions.StartLongTimer(); - } - -void TPopupFSM::TNotVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TNotVisible::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TNotVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) - { - TRACE( _L("TNotVisible::HandleLostFocus()") ); - aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); - } - -void TPopupFSM::TBackgroundNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TBackgroundNotSetOnFocus::HandleForeground()") ); - aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TBackgroundNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TBackgroundNotSetOnFocus::HandleUpdate()") ); - aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); - aPopupFSMActions.IssueCleanCaption(); - } - -void TPopupFSM::TBackgroundSetOnFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TBackgroundSetOnFocus::HandleReset()") ); - aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); - aPopupFSMActions.IssuePublishCaption(); - } - -void TPopupFSM::TBackgroundSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) - { - TRACE( _L("TBackgroundSetOnFocus::HandleForeground()") ); - aPopupFSM->SetState( &aPopupFSM->iVisible ); - aPopupFSMActions.IssuePublishPopup(); - aPopupFSMActions.StartLongTimer(); - } - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/PopupFSM.h --- a/idlefw/plugins/shortcutplugin/src/PopupFSM.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef POPUPFSM_H -#define POPUPFSM_H - -// EXTERNAL INCLUDES -#include - -// FORWARD DECLARATIONS -class TPopupFSM; -class MPopupFSMActions; - -// CLASS DEFINITIONS -/** - * Popup state machine - */ -class TPopupFSM - { - /** - * Base class for states - */ - class TPopupStateBase - { - public: // New methods - virtual void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - virtual void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TNotSetOffFocus - */ - class TNotSetOffFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TSetOffFocus - */ - class TSetOffFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TGettingFocus - */ - class TGettingFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TLosingFocus - */ - class TLosingFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TNotSetOnFocus - */ - class TNotSetOnFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TVisible - */ - class TVisible : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TNotVisible - */ - class TNotVisible : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TBackgroundNotSetOnFocus - */ - class TBackgroundNotSetOnFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - /** - * State class TBackgroundSetOnFocus - */ - class TBackgroundSetOnFocus : public TPopupStateBase - { - protected: // Methods derived from TPopupState - void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); - }; - - - public: // Constructors - TPopupFSM( MPopupFSMActions& aPopupFSMActions ); - - public: // New methods - void HandleForeground(); - void HandleUpdate(); - void HandleRequestCompleted(); - void HandleReset(); - void HandleBackground(); - void HandleGotFocus(); - void HandleLostFocus(); - - private: // New methods - void SetState( TPopupStateBase* aNewState ); - - private: // Data - //Ref: - TPopupStateBase* iCurrentState; - MPopupFSMActions& iPopupFSMActions; - - //Own: - TNotSetOffFocus iNotSetOffFocus; - TSetOffFocus iSetOffFocus; - TGettingFocus iGettingFocus; - TLosingFocus iLosingFocus; - TNotSetOnFocus iNotSetOnFocus; - TVisible iVisible; - TNotVisible iNotVisible; - TBackgroundNotSetOnFocus iBackgroundNotSetOnFocus; - TBackgroundSetOnFocus iBackgroundSetOnFocus; - private: // Friend class definitions - friend class TNotSetOffFocus; - friend class TSetOffFocus; - friend class TGettingFocus; - friend class TLosingFocus; - friend class TNotSetOnFocus; - friend class TVisible; - friend class TNotVisible; - friend class TBackgroundNotSetOnFocus; - friend class TBackgroundSetOnFocus; - }; - -#endif // POPUPFSM_H - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/PopupTrace.h --- a/idlefw/plugins/shortcutplugin/src/PopupTrace.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#ifndef POPUPTRACE_H -#define POPUPTRACE_H - -// MACROS -#define TRACE - -#endif // POPUPTRACE_H - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aidefaultshortcut.cpp --- a/idlefw/plugins/shortcutplugin/src/aidefaultshortcut.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Platform default shortcuts. -* -*/ - - -#include "aidefaultshortcut.h" -#include "taiscutparser.h" -#include -#include -#include -#include // For wchar_t - -namespace { - - struct TDefaultShortcut - { - /** - * Identifier - */ - TInt id; - - /** - * Key to identify this shortcut - */ - TInt key; - - /** - * Definition for this shortcut - */ - const wchar_t* definition; - }; - - enum TDefaultShortcutCenrepId - { - EDefaultShortcutFirst = 0, - EDefaultShortcutSecond, - EDefaultShortcutThird, - EDefaultShortcutFourth, - EDefaultShortcutFifth, - EDefaultShortcutSixth, - EDefaultShortcutSeventh, - EDefaultShortcutEighth, - EDefaultShortcutNaviLeft, - EDefaultShortcutNaviRight, - EDefaultShortcutNaviUp, - EDefaultShortcutNaviDown, - EDefaultShortcutNaviKey, - EDefaultShortcutLSK, - EDefaultShortcutRSK - }; - - // Platform default shortcuts. - const TDefaultShortcut KDefaultShortcuts[] = - { - { EDefaultShortcutFirst, 0x00000001, L"localapp:0x101F4CCE" }, // Phonebook, - { EDefaultShortcutSecond, 0x00000002, L"localapp:0x100058C5" }, // Messaging, - { EDefaultShortcutThird, 0x00000003, L"localapp:0x10008D39" }, // Browser, - { EDefaultShortcutFourth, 0x00000004, L"localapp:0x200009EE" }, // Photos, - { EDefaultShortcutFifth, 0x00000005, L"localapp:0x10005901" }, // Calendar, - { EDefaultShortcutSixth, 0x00000006, L"localapp:msg?new=msg" }, // New message, - { EDefaultShortcutSeventh, 0x00000007, L"localapp:0x102072C3" }, // Music Player, - { EDefaultShortcutEighth, 0x00000008, L"localapp:0x10207A89" }, // Radio, - { EDefaultShortcutNaviLeft, 0x01000000, L"localapp:0x100058C5?new=msg" }, // New message, - { EDefaultShortcutNaviRight, 0x01000001, L"localapp:0x10005901" }, // Calendar, - { EDefaultShortcutNaviUp, 0x01000002, L"localapp:0x101F4CCE" }, // Contacts, - { EDefaultShortcutNaviDown, 0x01000003, L"localapp:0x101F4CCE" }, // Contacts, - { EDefaultShortcutNaviKey, 0x01000004, L"localapp:0x100058C5" }, // Messagind, - { EDefaultShortcutLSK, 0x01000100, L"localapp:0x101F4CD2" }, // Menu, - { EDefaultShortcutRSK, 0x01000101, L"localapp:0x101F4CCE" } // Contacts, - }; - - const TInt KDefaultShortcutCount = (sizeof(KDefaultShortcuts)/sizeof(KDefaultShortcuts[0])); -} - -inline TPtrC16 DefaultDefinition( const TDefaultShortcut& aShortcut ) - { - return TPtrC16( (const TText16*) aShortcut.definition ); - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void GetPlatformDefaultShortcut(TInt aIndex, TUid& aUid, TDes& aDefinition) - { - TInt err = KErrNone; - TAiScutParser parser; - if (aIndex < 0) - { - aIndex = 0; - } - - aIndex = aIndex % ::KDefaultShortcutCount; - aDefinition.Copy( ::DefaultDefinition(::KDefaultShortcuts[aIndex]) ); - - err = parser.Parse( aDefinition ); - if ( err == KErrNone ) - { - aUid = TAiScutParser::ParseUid( parser.Get( EScutDefTarget) ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt ResolveCenrepIdFromKey( TInt aKey, TInt &aCenrepId ) - { - TInt ret = KErrNotFound; - for ( TInt i = 0; i < KDefaultShortcutCount; ++i ) - { - if ( KDefaultShortcuts[i].key == aKey ) - { - aCenrepId = KDefaultShortcuts[i].id; - ret = KErrNone; - break; - } - } - return ret; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void TAiDefaultShortcut::GetDefaultShortcut(TInt aKey, TUid& aUid, TDes& aDefinition) -{ - CRepository *cr = NULL; - TInt err = KErrNone; - TInt index = KErrNotFound; - err = ::ResolveCenrepIdFromKey( aKey, index ); - TInt32 crIndex = KAIBackupShortcutDefinitionStart; - if ( err == KErrNone ) - { - TRAP( err, cr = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ) ); - - aUid.iUid = KErrNotFound; - if ( err == KErrNone ) - { - crIndex += index; - err = cr->Get( crIndex, aDefinition ); - // In case of a null definition use the platform default - if ( aDefinition.Length() <= 0 ) - { - err = KErrNotFound; - } - else if ( err == KErrNone ) - { - TAiScutParser parser; - err = parser.Parse( aDefinition ); - if ( err == KErrNone ) - { - aUid = TAiScutParser::ParseUid( parser.Get( EScutDefTarget) ); - } - } - } - } - - // Ensure that some definition is returned - // in case of any error occurrs - if ( err != KErrNone ) - { - ::GetPlatformDefaultShortcut( index, aUid, aDefinition ); - } - delete cr; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutappuidparser.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscutappuidparser.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser -* -*/ - - -#include "aiscutappuidparser.h" - -// ========================= MEMBER FUNCTIONS ================================ - -// --------------------------------------------------------------------------- -// TAiScutAppUidParser::TAiScutAppUidParser -// --------------------------------------------------------------------------- -// -TAiScutAppUidParser::TAiScutAppUidParser(const TDesC& aData, RArray& aUidArray) - : - iUidArray(aUidArray), - iLex(aData), - iLexIsValid(EFalse) -{ -} - -// --------------------------------------------------------------------------- -// TAiScutAppUidParser::SkipChar -// --------------------------------------------------------------------------- -// -void TAiScutAppUidParser::SkipChar(TChar aChar, TBool aConditionalSkip) -{ - iLex.SkipSpaceAndMark(); - if (iLex.Peek() == aChar) - { - iLex.Inc(); - } - else - { - // If not conditional skip, then the input data is invalid - if (!aConditionalSkip) - { - iLexIsValid = EFalse; - } - } - iLex.SkipSpaceAndMark(); -} - -// --------------------------------------------------------------------------- -// TAiScutAppUidParser::ReadAppUid -// --------------------------------------------------------------------------- -// -TUid TAiScutAppUidParser::ReadAppUid() -{ - TUint32 appUid; - - iLex.Mark(); - while (iLex.Peek().IsHexDigit()) - { - iLex.Inc(); - } - TPtrC uidToken = iLex.MarkedToken(); - TLex uidLex(uidToken); - if (uidLex.Val(appUid, EHex) != KErrNone) - { - iLexIsValid = EFalse; - } - - return TUid::Uid(appUid); -} - -// --------------------------------------------------------------------------- -// TAiScutAppUidParser::ParseL -// --------------------------------------------------------------------------- -// -void TAiScutAppUidParser::ParseL() -{ - iLexIsValid = ETrue; - - while (!iLex.Eos() && iLexIsValid) - { - SkipChar(',', ETrue); - TUid applicationUid = ReadAppUid(); - - if (iLexIsValid) - { - iUidArray.AppendL(TUid(applicationUid)); - } - } -} - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutextserv.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscutextserv.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: AI Shortcut xSP Extension API -* -*/ - - -#include -#include -#include -#include - -#include -#include - -// ======== LOCAL DEFINITIONS ======== - -namespace - { - // LOCAL CONSTANTS - /** - * Default message slots - */ - const TUint KDefaultMessageSlots = 4; - - /** - * Marshalling buffer expand size - */ - const TInt KBufExpandSize = 32; - - /** - * Target string format that matches with aiscutplugin - */ - _LIT( KTargetStringFormat, "localapp:0x%x" ); - - // LOCAL TYPES - typedef TBuf<19> TTargetString; - - // LOCAL FUNCTIONS - /** - * Panics server - * @aReason Panic reason code - */ - void Panic( TInt aReason ) - { - User::Panic( KAiScutExtServerName, aReason ); - } - - /** - * Generates target string from Uid3 of current process - */ - TTargetString DefaultTargetString() - { - TUid uid3 = RProcess().Type()[ 2 ]; - TTargetString targetString; - targetString.Format( KTargetStringFormat, uid3 ); - return targetString; - } - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::Connect() - { - return Connect( DefaultTargetString() ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::Connect( const TDesC& aTargetDefinition ) - { - TInt err = CreateSession( KAiScutExtServerName, Version(), - KDefaultMessageSlots ); - if( err == KErrNone ) - { - TIpcArgs args( &aTargetDefinition ); - err = SendReceive( EAiScutExtServSetTargetDefinition, args ); - if( err != KErrNone ) - { - Close(); - } - } - return err; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TVersion RAiScutExtServ::Version() const - { - return( TVersion( - KAiScutExtServMajorVersionNumber, - KAiScutExtServMinorVersionNumber, - KAiScutExtServBuildVersionNumber ) ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::UpdatePopupTextL( - const MDesCArray& aPopupTextLines ) - { - TInt lineCount = aPopupTextLines.MdcaCount(); - __ASSERT_ALWAYS( lineCount <= KMaxPopupTextLines, Panic( KErrArgument ) ); - CBufBase* lineArrayBuf = CBufFlat::NewL( KBufExpandSize ); - CleanupStack::PushL( lineArrayBuf ); - - RBufWriteStream stream( *lineArrayBuf ); - - stream.WriteUint8L( lineCount ); - for( TInt i = 0; i < lineCount; i++ ) - { - stream << aPopupTextLines.MdcaPoint( i ); - } - - TPtr8 lineArray = lineArrayBuf->Ptr( 0 ); - - TIpcArgs args( &lineArray ); - TInt err = SendReceive( EAiScutExtServSetPopupText, args ); - - CleanupStack::PopAndDestroy( lineArrayBuf ); - return err; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::ResetPopupText() - { - return SendReceive( EAiScutExtServResetPopupText ); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::UpdateIconL( const CGulIcon& aIcon ) - { - CBufBase* marshallBuf = CBufFlat::NewL( KBufExpandSize ); - CleanupStack::PushL( marshallBuf ); - - RBufWriteStream stream( *marshallBuf ); - - aIcon.Bitmap()->ExternalizeL( stream ); - aIcon.Mask()->ExternalizeL( stream ); - - TPtr8 marshalledData = marshallBuf->Ptr( 0 ); - - TIpcArgs args( &marshalledData ); - TInt err = SendReceive( EAiScutExtServSetIcon, args ); - - CleanupStack::PopAndDestroy( marshallBuf ); - return err; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::ResetIcon() - { - return SendReceive( EAiScutExtServResetIcon ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::IsInShortcuts( TBool& aIsInShortcuts ) const - { - TPtr8 isInShortcutsDes( - reinterpret_cast< TUint8* >( &aIsInShortcuts ), - sizeof( aIsInShortcuts ), - sizeof( aIsInShortcuts ) ); - - TIpcArgs args( &isInShortcutsDes ); - - return SendReceive( EAiScutExtServIsInShortcuts, args ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RAiScutExtServ::IssuePutInShortcuts() - { - return SendReceive( EAiScutExtServIssuePutInShortcuts ); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutfactory.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscutfactory.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in factory class. -* -*/ - - -#include "aiscutfactory.h" -#include "caiscutengine.h" -#include "caiscutshortcut.h" - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngine* AiScutFactory::CreateAiScutEngineL( CAiScutPlugin& aPlugin ) - { - return CAiScutEngine::NewL( aPlugin ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* AiScutFactory::CreateAiScutShortcutL( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ) - { - return CAiScutShortcut::NewL( aId, aTarget, aEngine ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* AiScutFactory::CreateAiScutShortcutLC( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ) - { - return CAiScutShortcut::NewLC( aId, aTarget, aEngine ); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutfactoryext.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscutfactoryext.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in factory class. -* -*/ - - -#include "aiscutfactory.h" -#include "caiscutengineext.h" -#include "caiscutshortcutext.h" - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngine* AiScutFactory::CreateAiScutEngineL( CAiScutPlugin& aPlugin ) - { - return CAiScutEngineExt::NewL( aPlugin ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* AiScutFactory::CreateAiScutShortcutL( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ) - { - return CAiScutShortcutExt::NewL( aId, aTarget, aEngine ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* AiScutFactory::CreateAiScutShortcutLC( TInt aId, - const TDesC& aTarget, CAiScutEngine& aEngine ) - { - return CAiScutShortcutExt::NewLC( aId, aTarget, aEngine ); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutplugin.rss --- a/idlefw/plugins/shortcutplugin/src/aiscutplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM plug-in resource file. -* -*/ - - -#include - -#include - -// --------------------------------------------------------------------------- -// registry_info -// -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO registry_info -{ - resource_format_version = RESOURCE_FORMAT_VERSION_2; - - dll_uid = AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN; - - // Interface info array. - interfaces = - { - INTERFACE_INFO - { - // UID of the implemented interface. - interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; - - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; - version_no = 1; - display_name = "Shortcut Plug-in"; - default_data = ""; - opaque_data = ""; - } - }; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutpluginres.rss --- a/idlefw/plugins/shortcutplugin/src/aiscutpluginres.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for Shortcut plug-in settings -* -*/ - - -#include -#include -#include - -#include - -NAME SCPL - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf="SCPL"; } - -//---------------------------------------------------- -// EIK_APP_INFO -// Contains application information. -//---------------------------------------------------- -// -RESOURCE EIK_APP_INFO -{ -} - -// ---------------------------------------------------------------------------- -// -// %U application can show additional information in Shortcut area..." -// -// ---------------------------------------------------------------------------- -// -RESOURCE TBUF r_ai_sc_query_modify_gs - { - buf = qtn_ai_sc_query_modify_gs; - } - -//---------------------------------------------------------- -// r_scut_xsptip_note -// -//---------------------------------------------------------- -// -RESOURCE DIALOG r_scut_xsptip_note -{ - flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtPopupHeadingPane; - id = EAknMessageQueryHeaderId; - control = AVKON_HEADING - { - label = qtn_ai_sc_query_modify_header; - headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE; - // headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS; - }; - }, - DLG_LINE - { - type = EAknCtMessageQuery; - id = EAknMessageQueryContentId; - control = AVKON_MESSAGE_QUERY - { - }; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutrepositorywatcher.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscutrepositorywatcher.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser -* -*/ - - -#include "aiscutrepositorywatcher.h" -#include // For CRepository - - - -CAiScutRepositoryWatcher* CAiScutRepositoryWatcher::NewL( - const TUid aUid, - const TUint32 aKey, - CCenRepNotifyHandler::TCenRepKeyType aKeyType, - TCallBack aCallBack, - CRepository* aRepository) -{ - CAiScutRepositoryWatcher* self = - new (ELeave) CAiScutRepositoryWatcher(aUid, aKey, aCallBack, aRepository); - - CleanupStack::PushL(self); - self->ConstructL(aKeyType); - CleanupStack::Pop(self); - - return self; -} - -CAiScutRepositoryWatcher* CAiScutRepositoryWatcher::NewL( - const TUid aUid, - TCallBack aCallBack, - CRepository* aRepository) -{ - CAiScutRepositoryWatcher* self = - new (ELeave) CAiScutRepositoryWatcher( - aUid, - NCentralRepositoryConstants::KInvalidNotificationId, - aCallBack, - aRepository); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; -} - -CAiScutRepositoryWatcher::~CAiScutRepositoryWatcher() -{ - if (iNotifyHandler) - { - iNotifyHandler->StopListening(); - delete iNotifyHandler; - } -} - -CAiScutRepositoryWatcher::CAiScutRepositoryWatcher( - const TUid aUid, - const TUint32 aKey, - TCallBack aCallBack, - CRepository* aRepository) -: -iUid(aUid), iKey(aKey), iCallBack(aCallBack), iRepository(aRepository) -{ -} - -void CAiScutRepositoryWatcher::ConstructL( - CCenRepNotifyHandler::TCenRepKeyType aKeyType) -{ - iNotifyHandler = CCenRepNotifyHandler::NewL( - *this, *iRepository, aKeyType, iKey); -} - -void CAiScutRepositoryWatcher::ConstructL() -{ - iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository); -} - -void CAiScutRepositoryWatcher::StartListeningL() -{ - if (iNotifyHandler) - { - iNotifyHandler->StartListeningL(); - } -} - -void CAiScutRepositoryWatcher::StopListening() -{ - if (iNotifyHandler) - { - iNotifyHandler->StopListening(); - } -} - -TUint32 CAiScutRepositoryWatcher::ChangedKey() -{ - return iChangedKey; -} - -void CAiScutRepositoryWatcher::HandleNotifyInt(TUint32 aKey, TInt /*aNewValue*/) -{ - iChangedKey = aKey; - iCallBack.CallBack(); - iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; -} - -void CAiScutRepositoryWatcher::HandleNotifyString( - TUint32 aKey, const TDesC16& /*aNewValue*/) -{ - iChangedKey = aKey; - iCallBack.CallBack(); - iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; -} - -void CAiScutRepositoryWatcher::HandleNotifyGeneric(TUint32 aKey) -{ - iChangedKey = aKey; - iCallBack.CallBack(); - iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; -} - -void CAiScutRepositoryWatcher::HandleNotifyError( - TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/) -{ -} - -// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutsettings.rss --- a/idlefw/plugins/shortcutplugin/src/aiscutsettings.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ECOM plug-in resource file -* -*/ - - -#include - -#include - -// --------------------------------------------------------------------------- -// registry_info -// -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO registry_info -{ - resource_format_version = RESOURCE_FORMAT_VERSION_2; - - dll_uid = AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN; - - // Interface info array. - interfaces = - { - INTERFACE_INFO - { - // UID of the implemented interface. - interface_uid = 0x10207236; - - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN; - version_no = 1; - display_name = "Shortcuts"; - default_data = "0x1020723B"; // Parent UID (PrslnPlugin) - opaque_data = "-1"; // Order number - } - }; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscutsettingsres.rss --- a/idlefw/plugins/shortcutplugin/src/aiscutsettingsres.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,443 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for Shortcut plug-in settings -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "aiscutsettings.hrh" - - -NAME SCSE - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf="SCSE"; } - -//---------------------------------------------------- -// EIK_APP_INFO -// Contains application information. -//---------------------------------------------------- -// -RESOURCE EIK_APP_INFO -{ -} - -//---------------------------------------------------- -// r_scutsettings_menubar -// -//---------------------------------------------------- -// -RESOURCE MENU_BAR r_scutsettings_menubar -{ - titles = - { - MENU_TITLE { menu_pane = r_scutsettings_menupane; } - }; -} - -//---------------------------------------------------- -// r_scutsettings_menupane -// Options menu. -//---------------------------------------------------- -// -RESOURCE MENU_PANE r_scutsettings_menupane -{ - items = - { - MENU_ITEM - { - command = EAiScutSettingsCmdChange; - txt = qtn_options_change; - } - -#ifdef __SERIES60_HELP - , - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - } -#endif // __SERIES60_HELP - , - MENU_ITEM - { - command = EAknCmdExit; - txt = qtn_options_exit; - } - }; -} - -//---------------------------------------------------- -// r_scut_settings_view -// Settings views. -//---------------------------------------------------- -// -RESOURCE AVKON_VIEW r_scut_settings_view -{ - menubar = r_scutsettings_menubar; - //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; - cba = r_scut_softkeys_options_back_change; -} - -//---------------------------------------------------- -// r_setting_listbox -// Common listbox editor resource for setting pages. -//---------------------------------------------------- -// -RESOURCE LISTBOX r_setting_listbox -{ - flags = EEikListBoxMultipleSelection; -} - -//---------------------------------------------------- -// r_scut_settings_applist_page -// Selection key idle softkey setting page. -//---------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_scut_settings_applist_page -{ - number = EAknSettingPageNoOrdinalDisplayed; - // label = qtn_set_idle_selec_key; - // note: default cba resource is ok_cancel_select - //softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; - type = EAknSetListBox; - editor_resource_id = r_setting_listbox; -} - -//---------------------------------------------------------- -// r_scut_type_url_page -// Setting page editing an url. -//---------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_scut_type_url_page -{ - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - number= EAknSettingPageNoOrdinalDisplayed; - label= qtn_ai_shorts_type_url; - type = EEikCtEdwin; - editor_resource_id = r_scut_url_editor; -} - -//---------------------------------------------------------- -// r_scut_edit_url_page -// Setting page editing an url. -//---------------------------------------------------------- -// -RESOURCE AVKON_SETTING_PAGE r_scut_edit_url_page -{ - softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - number= EAknSettingPageNoOrdinalDisplayed; - label= qtn_ai_shorts_edit_url; - type = EEikCtEdwin; - editor_resource_id = r_scut_url_editor; -} - -//---------------------------------------------------------- -// r_scut_url_editor -// URL editor. -//---------------------------------------------------------- -// -RESOURCE EDWIN r_scut_url_editor -{ - width = 10; - lines = 2; - maxlength = 1000; - numeric_keymap = EAknEditorCalculatorNumberModeKeymap; - allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; - default_input_mode = EAknEditorTextInputMode; - special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG; - default_case = EAknEditorLowerCase; - flags = EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks; - avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly; -} - -//---------------------------------------------------- -// r_scut_change_to_page -// "Change To" setting page. -//---------------------------------------------------- -// -RESOURCE ARRAY r_scut_change_to_page_lbx -{ - items = - { - LBUF { txt = qtn_sc_set_change_apps; }, - LBUF { txt = qtn_sc_set_change_bookmark; } - - // Only this menu option disabled. - // The implementation of url functionality still exists in code, - // even though this option has been decided to remove due to better - // usability. Affects lots of code if removed entirely. - /*, - LBUF { txt = qtn_sc_set_change_url; }*/ - }; -} - -//---------------------------------------------------- -// r_scut_listquery_change_to_page -// "Change To" setting page. -//---------------------------------------------------- -// -RESOURCE AVKON_LIST_QUERY r_scut_listquery_change_to_page -{ - softkeys=R_AVKON_SOFTKEYS_SELECT_CANCEL; - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSinglePopupMenuListBox; - heading = qtn_sc_set_change_prompt; - listbox = AVKON_LIST_QUERY_LIST - { - // array of items will be defined dynamically - }; - }; - } - }; -} - -//---------------------------------------------------------- -// r_scut_wait_note -// -//---------------------------------------------------------- -// -RESOURCE DIALOG r_scut_wait_note -{ - flags = EAknWaitNoteFlags | EEikDialogFlagWait; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EWaitLayout; - singular_label = qtn_gen_note_opening; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; -} - -//---------------------------------------------------- -// r_scut_settings_view_caption -// View caption for plug-in. max 256 -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_view_caption -{ - buf = qtn_set_pers_shortcuts; -} - -//---------------------------------------------------- -// r_scut_settings_view_title -// View title. -//---------------------------------------------------- -// -RESOURCE TITLE_PANE r_scut_settings_view_title -{ - txt = qtn_set_title_pers_shortcuts; -} - -//---------------------------------------------------- -// r_ai_settings_txt_fixed_item -// Text used in information note when attempting -// to change a read-only shortcut -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_txt_fixed_item -{ - buf = qtn_ai_set_app_note_fixed; -} - -//---------------------------------------------------- -// r_scut_settings_txt_all_fixed -// Text for empty listbox item -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_txt_all_fixed -{ - buf = qtn_ai_sc_set_all_fixed; -} - -//---------------------------------------------------- -// r_scut_settings_txt_linkn -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_txt_linkn -{ - buf = qtn_ai_set_myt_linkn; -} - -//---------------------------------------------------- -// r_scut_settings_softkey_left -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_softkey_left -{ - buf = qtn_set_left_idle_softkey; -} - -//---------------------------------------------------- -// r_scut_settings_softkey_right -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_softkey_right -{ - buf = qtn_set_right_idle_softkey; -} - -//---------------------------------------------------- -// r_scut_settings_scroll_left -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_scroll_left -{ - buf = qtn_set_idle_left_scroll; -} - -//---------------------------------------------------- -// r_scut_settings_scroll_right -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_scroll_right -{ - buf = qtn_set_idle_right_scroll; -} - -//---------------------------------------------------- -// r_scut_settings_scroll_up -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_scroll_up -{ - buf = qtn_set_idle_up_scroll; -} - -//---------------------------------------------------- -// r_scut_settings_scroll_down -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_scroll_down -{ - buf = qtn_set_idle_down_scroll; -} - -//---------------------------------------------------- -// r_scut_settings_selection_key -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_selection_key -{ - buf = qtn_set_idle_selec_key; -} - -// ----------------------------------------------------------------------------- -// r_scut_settings_no_effect -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_no_effect -{ - buf = qtn_set_idle_skeys_no_effect; -} - -// ----------------------------------------------------------------------------- -// r_scut_msk_edit -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_scut_msk_edit -{ - buf = qtn_msk_edit; -} - -// ----------------------------------------------------------------------------- -// r_scut_msk_change -// -// ----------------------------------------------------------------------------- -// -RESOURCE TBUF r_scut_msk_change -{ - buf = qtn_msk_change; -} - -/* -//---------------------------------------------------- -// r_scut_settings_key_press -// -//---------------------------------------------------- -// -//RESOURCE TBUF r_scut_settings_key_press -// { -// buf = qtn_ai_shorts_key_press; -// } - -*/ - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE CBA r_scut_softkeys_options_back_change -{ - buttons = - { - CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON {id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } - }; -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -RESOURCE CBA r_scut_softkeys_options_exit_change -{ - buttons = - { - CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON {id = EAknSoftkeyExit; txt = text_softkey_exit; }, - CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscuttargetshutter.cpp --- a/idlefw/plugins/shortcutplugin/src/aiscuttargetshutter.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include //TApaTask -#include //RApaLsSession - -#include "aiscuttargetshutter.h" -#include "aiscutdefs.h" -#include "debug.h" - -#include - -const TUid KMenuUID3 = { 0x101F4CD2 }; - -const TInt KTaskExistsDelay = 1500000; //1.5 second -const TInt KTaskNotExistsDelay = 500000; //0.5 second -const TInt KMaxNumberOfTries = 3; - - -// ======== MEMBER FUNCTIONS ======== - -CAiScutTargetShutter::CAiScutTargetShutter(CCoeEnv* aEnv, TUid aAppUid) - : CActive(CActive::EPriorityLow) - , iEnv(aEnv) - , iAppUid(aAppUid) -{ - CActiveScheduler::Add(this); -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetShutter::~CAiScutTargetShutter() -{ - if (iPeriodic) - { - iPeriodic->Cancel(); - delete iPeriodic; - } - - iWsSession.Close(); - Cancel(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetShutter::ConstructL(TBool aIsRunning, TBool aIsDialog) -{ - iIsRunning = aIsRunning; - iIsDialog = aIsDialog; - iTaskExists = EFalse; - iTaskKilled = EFalse; - iCounter = 0; - iPeriodic = CPeriodic::NewL(CActive::EPriorityLow); - User::LeaveIfError(iWsSession.Connect()); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetShutter* CAiScutTargetShutter::NewL(CCoeEnv* aEnv, TUid aAppUid, TBool aIsRunning, TBool aIsDialog) -{ - CAiScutTargetShutter* self = new (ELeave) CAiScutTargetShutter(aEnv, aAppUid); - CleanupStack::PushL(self); - self->ConstructL(aIsRunning, aIsDialog); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetShutter::StartL() -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutTargetShutter::Start() app uid=0x%x"), iAppUid.iUid); - - - TApaTaskList taskList(iWsSession); - TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); - - if ( idleTask.Exists() && iIsRunning) - { - if ( iIsDialog ) - { - TKeyEvent keyEvent; - keyEvent.iCode = EKeyEscape; - keyEvent.iModifiers = 0; - keyEvent.iRepeats = 0; - iEnv->SimulateKeyEventL(keyEvent, EEventKey); - } - //idleTask.BringToForeground(); - CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); - iTaskExists = ETrue; - __PRINTS( "XAI: exists and running"); - - } - else - { - TKeyEvent keyEvent; - keyEvent.iCode = EKeyEscape; - keyEvent.iModifiers = 0; - keyEvent.iRepeats = 0; - iEnv->SimulateKeyEventL(keyEvent, EEventKey); - - // bring active idle to foreground - TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); - if (idleTask.Exists()) - { - __PRINTS("XAI: idle to foreground"); - //idleTask.BringToForeground(); - CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); - } - TApaTask task(taskList.FindApp(iAppUid)); - if (task.Exists()) - { - //task.SendToBackground(); - CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToBackground); - } - } - if( !iPeriodic->IsActive() ) - { - if (iTaskExists) - { - iPeriodic->Start(KTaskExistsDelay, KTaskExistsDelay, - TCallBack(TaskExistsCallback, this)); - } - else - { - iPeriodic->Start(KTaskNotExistsDelay, KTaskNotExistsDelay, - TCallBack(TaskNotExistsCallback, this)); - } - - } -} - -// --------------------------------------------------------------------------- -// From CActive -// --------------------------------------------------------------------------- -// -void CAiScutTargetShutter::DoCancel() -{ - if (iPeriodic) - { - iPeriodic->Cancel(); - } -} - -// --------------------------------------------------------------------------- -// From CActive. -// --------------------------------------------------------------------------- -// -void CAiScutTargetShutter::RunL() -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutTargetShutter::RunL() app uid=0x%x"), iAppUid.iUid); - - TUid menuUid = KMenuUID3; - - TApaTaskList taskList(iWsSession); - TApaTask task(taskList.FindApp(iAppUid)); - - if (iTaskExists) - { - RWindowGroup windowGroup = iEnv->RootWin(); - - if (windowGroup.OrdinalPosition() != 0) - { - TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); - if (idleTask.Exists()) - { - __PRINTS( "XAI: idle to foreground"); - - //idleTask.BringToForeground(); - CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); - } - } - iPeriodic->Cancel(); - } - else - { - if (iCounter >= KMaxNumberOfTries || iTaskKilled) - { - iPeriodic->Cancel(); - } - else if (task.Exists() && iAppUid != menuUid) - { - __PRINTS("XAI: shutdown task"); - //task.SendToBackground(); - CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToBackground); - task.SendSystemEvent(EApaSystemEventShutdown); - iTaskKilled = ETrue; - } - else - { - iCounter++; - } - } -} - -// --------------------------------------------------------------------------- -// From CActive -// Handles an error situation. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetShutter::RunError(TInt aError) -{ - return aError; -} - -// --------------------------------------------------------------------------- -// -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetShutter::Run() -{ - SetActive(); - TRequestStatus *status = &iStatus; - User::RequestComplete(status, KErrNone); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetShutter::TaskExistsCallback(TAny* aPtr) -{ - CAiScutTargetShutter* self = static_cast(aPtr); - - if (self) - { - self->Run(); - } - - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetShutter::TaskNotExistsCallback(TAny* aPtr) -{ - CAiScutTargetShutter* self = static_cast(aPtr); - - if (self) - { - self->Run(); - } - - return KErrNone; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/aiscuttexts.rss --- a/idlefw/plugins/shortcutplugin/src/aiscuttexts.rss Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,707 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in common texts -* -*/ - - -#include -#include -#include -#include -#include -#include -//#include -//#include -//#include -//#include -//#include - -#include - -#include "aiscutapptitle.rh" -#include "aiscutappuids.hrh" - -NAME SCTX - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf=""; } - -//---------------------------------------------------- -// r_scut_plugin_name -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_plugin_name -{ - buf = qtn_ai_set_cont_apps; -} - -//---------------------------------------------------- -// r_scut_settings_change_theme -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_change_theme -{ - buf = qtn_apps_idle_skin_gs; -} - -//---------------------------------------------------- -// r_scut_settings_new_msg -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_new_msg -{ - buf = qtn_set_idle_skey_new_msg; -} - -//---------------------------------------------------- -// r_scut_settings_new_email -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_new_email -{ - buf = qtn_set_idle_skeys_email_editor; -} - -//---------------------------------------------------- -// r_scut_settings_new_syncml_mail -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_new_syncml_mail -{ - buf = qtn_apps_syncml_mail_gs; -} - -//---------------------------------------------------- -// r_scut_settings_new_postcard -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_new_postcard -{ - buf = qtn_apps_mmspostcard_gs; -} - -//---------------------------------------------------- -// r_scut_settings_new_audio_msg -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_new_audio_msg -{ - buf = qtn_apps_audio_msg_gs; -} - -//---------------------------------------------------- -// r_scut_settings_select_msg_type -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_select_msg_type -{ - buf = qtn_set_idle_skey_select_msg_type; -} - -//---------------------------------------------------- -// r_scut_settings_connectivity_status -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_connectivity_status -{ - buf = qtn_apps_connectivity_list; -} - -//---------------------------------------------------- -// r_scut_settings_connectivity_status -// -//---------------------------------------------------- -// -RESOURCE TBUF r_scut_settings_appmngr -{ - buf = qtn_apps_am_gs; -} - -//---------------------------------------------------- -// r_ai_scut_operation_disabled -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_ai_scut_operation_disabled - { - buf = qtn_ai_scut_operation_disabled; - } - - -// ----------------------------------------------------------------------------- -// r_scut_app_title_list -// -// ----------------------------------------------------------------------------- -// -RESOURCE AI_APP_TITLE_LIST r_scut_app_title_list -{ - items = - { - AI_APP_TITLE_ITEM - { - appuid = KScutAboutUidValue; - //longtitle = qtn_apps_about_list; - //shorttitle = qtn_apps_about_grid; - skeytitle = qtn_apps_about_grid; - msktitle = qtn_apps_about_grid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutGeneralSettingsUidValue; - viewid = KScutInstallationViewIdValue; - longtitle = qtn_app_caption_string; - shorttitle = qtn_apps_am_gs; - skeytitle = qtn_apps_am_skey; - msktitle = qtn_msk_idle_am; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutApplicationManagerUidValue; - //viewid = KScutInstallationViewIdValue; - //longtitle = qtn_app_caption_string; - //shorttitle = qtn_app_caption_string; - skeytitle = qtn_apps_am_skey; - msktitle = qtn_msk_idle_am; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutApplicationShellUidValue; - viewid = 1; - //longtitle = ""; - //shorttitle = ""; - skeytitle = qtn_apps_menu_skey; - msktitle = qtn_msk_idle_menu; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutNavigatorUidValue; - //longtitle = qtn_apps_blid_list; - //shorttitle = qtn_apps_blid_grid; - skeytitle = qtn_apps_blid_skey; - msktitle = qtn_msk_idle_blid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutBluetoothUidValue; - //longtitle = qtn_apps_bluetooth_list; - //shorttitle = qtn_apps_bluetooth_grid; - skeytitle = qtn_apps_bluetooth_skey; - msktitle = qtn_msk_idle_bluetooth; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutBrowserUidValue; - //longtitle = qtn_apps_browserng_grid; - //shorttitle = qtn_apps_browserng_list; - skeytitle = qtn_apps_services_skey_new; - msktitle = qtn_msk_idle_services_new; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutCalculatorUidValue; - //longtitle = qtn_apps_calculator_list; - //shorttitle = qtn_apps_calculator_grid; - skeytitle = qtn_apps_calculator_skey; - msktitle = qtn_msk_idle_calculator; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutCalendarUidValue; - //longtitle = qtn_apps_calendar_list; - //shorttitle = qtn_apps_calendar_grid; - skeytitle = qtn_apps_calendar_skey; - msktitle = qtn_msk_idle_calendar; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutCamcorderUidValue; - //longtitle = qtn_apps_ccor_list; - //shorttitle = qtn_apps_ccor_grid; - skeytitle = qtn_apps_ccor_skey; - msktitle = qtn_msk_idle_ccor; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutChineseDictionaryUidValue; - //longtitle = qtn_apps_dict_list; - //shorttitle = qtn_apps_dict_grid; - skeytitle = qtn_apps_dict_skey; - msktitle = qtn_msk_idle_dict; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutClockUidValue; - //longtitle = qtn_apps_clock_list; - //shorttitle = qtn_apps_clock_grid; - skeytitle = qtn_apps_clock_skey; - msktitle = qtn_msk_idle_clock; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutConnectionManagerUidValue; - //longtitle = qtn_apps_cmon_list; - //shorttitle = qtn_apps_cmon_grid; - skeytitle = qtn_apps_cmon_skey; - msktitle = qtn_msk_idle_cmon; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutConverterUidValue; - //longtitle = qtn_cnv_app_caption; - //shorttitle = qtn_cnv_app_caption_short; - skeytitle = qtn_apps_converter_skey; - msktitle = qtn_msk_idle_converter; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutDeviceManagerUidValue; - //longtitle = qtn_apps_dm_list; - //shorttitle = qtn_apps_dm_grid; - skeytitle = qtn_apps_dm_skey; - msktitle = qtn_msk_idle_dm; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutDRMRightsManagerUidValue; - //longtitle = qtn_apps_drm_list; - //shorttitle = qtn_apps_drm_grid; - skeytitle = qtn_apps_drm_skey; - msktitle = qtn_msk_idle_drm; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutFaxModemUidValue; - //longtitle = qtn_apps_fax_modem_list; - //shorttitle = qtn_apps_fax_modem_grid; - skeytitle = qtn_apps_fax_modem_skey; - msktitle = qtn_msk_idle_fax_modem; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutFileManagerUidValue; - //longtitle = qtn_apps_fmgr_list; - //shorttitle = qtn_apps_fmgr_grid; - skeytitle = qtn_apps_fmgr_skey; - msktitle = qtn_msk_idle_fmgr; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutFMRadioUidValue; - //longtitle = qtn_apps_radio_list; - //shorttitle = qtn_apps_radio_grid; - skeytitle = qtn_apps_radio_skey; - msktitle = qtn_msk_idle_radio; - }, - AI_APP_TITLE_ITEM - { - appuid = KScutFMTXRadioUidValue; - //longtitle = qtn_apps_radio_list; - //shorttitle = qtn_apps_radio_grid; - skeytitle = qtn_fmtx_idle_sk; - msktitle = qtn_fmtx_idle_msk; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutGeneralSettingsUidValue; - //longtitle = qtn_apps_settings_list; - //shorttitle = qtn_apps_settings_grid; - skeytitle = qtn_apps_settings_skey; - msktitle = qtn_msk_idle_gs; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutControlPanelUidValue; - //longtitle = qtn_apps_controlpanel_list; - //shorttitle = qtn_apps_controlpanel_grid; - skeytitle = qtn_apps_controlpanel_skey; - msktitle = qtn_msk_idle_controlpanel; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutHelpUidValue; - //longtitle = qtn_apps_help_list; - //shorttitle = qtn_apps_help_grid; - skeytitle = qtn_apps_help_skey; - msktitle = qtn_msk_idle_help; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutIRUidValue; - //longtitle = qtn_apps_infrared_list; - //shorttitle = qtn_apps_infrared_grid; - skeytitle = qtn_apps_infrared_skey; - msktitle = qtn_msk_idle_infrared; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutInstantMessagingUidValue; - //longtitle = qtn_apps_instant_list; - //shorttitle = qtn_apps_instant_grid; - skeytitle = qtn_apps_instant_skey; - msktitle = qtn_msk_idle_instant; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutUserDictionaryUidValue; - //longtitle = qtn_apps_udict_list; - //shorttitle = qtn_apps_udict_grid; - skeytitle = qtn_apps_udict_skey; - msktitle = qtn_msk_idle_udict; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutLandmarksUidValue; - //longtitle = qtn_apps_lm_list; - //shorttitle = qtn_apps_lm_grid; - skeytitle = qtn_apps_lm_skey; - msktitle = qtn_msk_idle_lm; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutLogsUidValue; - //longtitle = qtn_apps_logs_list; - //shorttitle = qtn_apps_logs_grid; - skeytitle = qtn_apps_logs_skey; - msktitle = qtn_msk_idle_logs; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMediaGallery2UidValue; - //longtitle = qtn_apps_mg_list; - //shorttitle = qtn_apps_mg_grid; - skeytitle = qtn_apps_mg_skey; - msktitle = qtn_msk_idle_mg; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMediaPlayerUidValue; - //longtitle = qtn_apps_mp_list; - //shorttitle = qtn_apps_mp_grid; - skeytitle = qtn_apps_mp_skey; - msktitle = qtn_msk_idle_mp; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMemoryCardUidValue; - //longtitle = qtn_apps_memc_appl_list; - //shorttitle = qtn_apps_memc_appl_grid; - skeytitle = qtn_apps_mmc_skey; - msktitle = qtn_msk_idle_mmc; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMessagingCenterUidValue; - //longtitle = qtn_apps_messaging_list; - //shorttitle = qtn_apps_messaging_grid; - skeytitle = qtn_apps_messaging_skey; - msktitle = qtn_msk_idle_messaging; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMusicPlayerUidValue; - //longtitle = qtn_apps_mplayer_list; - //shorttitle = qtn_apps_mplayer_grid; - skeytitle = qtn_apps_mplayer_skey; - msktitle = qtn_msk_idle_mplayer; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutNotepadUidValue; - //longtitle = qtn_apps_notepad_list; - //shorttitle = qtn_apps_notepad_grid; - skeytitle = qtn_apps_notepad_skey; - msktitle = qtn_msk_idle_notepad; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPersonalisationUidValue; - //longtitle = qtn_apps_skins_list; - //shorttitle = qtn_apps_skins_grid; - skeytitle = qtn_apps_skins_skey; - msktitle = qtn_msk_idle_skins; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPhoneUidValue; - //longtitle = qtn_apps_phone_list; - //shorttitle = qtn_apps_phone_grid; - skeytitle = qtn_apps_phone_grid; - msktitle = qtn_apps_phone_grid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPhonebookUidValue; - //longtitle = qtn_apps_phonebook_list; - //shorttitle = qtn_apps_phonebook_grid; - skeytitle = qtn_apps_phonebook_skey; - msktitle = qtn_msk_idle_phonebook; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutProfilesUidValue; - //longtitle = qtn_apps_mode_list; - //shorttitle = qtn_apps_mode_grid; - skeytitle = qtn_apps_mode_skey; - msktitle = qtn_msk_idle_mode; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPocUidValue; - //longtitle = qtn_apps_ptt_list; - //shorttitle = qtn_apps_ptt_grid; - skeytitle = qtn_apps_ptt_skey; - msktitle = qtn_msk_idle_ptt; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutSearchUidValue; - //longtitle = qtn_apps_search_list; - //shorttitle = qtn_apps_search_grid; - skeytitle = qtn_apps_search_skey; - msktitle = qtn_msk_idle_search; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutSatUiUidValue; - //longtitle = qtn_apps_simapps_list; - //shorttitle = qtn_apps_simapps_grid; - skeytitle = qtn_apps_simapps_grid; - msktitle = qtn_apps_simapps_grid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutSpeedDialUidValue; - //longtitle = qtn_apps_sd_list; - //shorttitle = qtn_apps_sd_grid; - skeytitle = qtn_apps_sd_skey; - msktitle = qtn_msk_idle_sd; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutUSBUidValue; - //longtitle = qtn_apps_usb_list; - //shorttitle = qtn_apps_usb_grid; - skeytitle = qtn_apps_usb_skey; - msktitle = qtn_msk_idle_usb; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutVoiceCommandsUidValue; - //longtitle = qtn_apps_vc_list; - //shorttitle = qtn_apps_vc_grid; - skeytitle = qtn_apps_vc_skey; - msktitle = qtn_msk_idle_vc; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutVoiceMailboxUidValue; - //longtitle = qtn_apps_smsvo_list; - //shorttitle = qtn_apps_smsvo_grid; - skeytitle = qtn_apps_smsvo_skey; - msktitle = qtn_msk_idle_smsvo; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutVoIPUidValue; - //longtitle = qtn_apps_voip_list; - //shorttitle = qtn_apps_voip_grid; - skeytitle = qtn_apps_voip_skey; - msktitle = qtn_msk_idle_voip; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutVoiceRecorderUidValue; - //longtitle = qtn_vorec_app_menu_list; - //shorttitle = qtn_vorec_app_menu_grid; - skeytitle = qtn_apps_recorder_skey; - msktitle = qtn_msk_idle_recorder; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutSmlSyncUidValue; - //longtitle = qtn_apps_sml_list; - //shorttitle = qtn_apps_sml_grid; - skeytitle = qtn_apps_sml_grid; - msktitle = qtn_apps_sml_grid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPersonalisationUidValue; - viewid = KScutChangeThemeViewIdValue; - longtitle = qtn_apps_idle_skin_gs; - shorttitle = qtn_apps_idle_skin_skey; - skeytitle = qtn_apps_idle_skin_skey; - msktitle = qtn_msk_idle_skin; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutAmsEditorUidValue; - longtitle = qtn_apps_audio_msg_gs; - shorttitle = qtn_apps_audio_msg_skey; - skeytitle = qtn_apps_audio_msg_skey; - msktitle = qtn_msk_idle_audio_msg; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutEmailEditorUidValue; - longtitle = qtn_set_idle_skeys_email_editor; - shorttitle = qtn_apps_email_skey; - skeytitle = qtn_apps_email_skey; - msktitle = qtn_msk_idle_email; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutPostcardEditorUidValue; - longtitle = qtn_apps_mmspostcard_gs; - shorttitle = qtn_apps_mmspostcard_skey; - skeytitle = qtn_apps_mmspostcard_skey; - msktitle = qtn_msk_idle_mmspostcard; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutUnifiedEditorUidValue; - longtitle = qtn_set_idle_skey_new_msg; - shorttitle = qtn_idle_skey_new_msg; - skeytitle = qtn_idle_skey_new_msg; - msktitle = qtn_msk_idle_new_msg; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutEmailEditorUidValue; - viewid = KScutSyncMlEmailUidValue; - longtitle = qtn_apps_syncml_mail_gs; - shorttitle = qtn_apps_syncml_mail_skey; - skeytitle = qtn_apps_syncml_mail_skey; - msktitle = qtn_msk_idle_syncml_mail; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMessagingCenterUidValue; - viewid = KScutMessagingCenterUidValue; - longtitle = qtn_set_idle_skey_select_msg_type; - shorttitle = qtn_idle_skey_select_msg; - skeytitle = qtn_idle_skey_select_msg; - msktitle = qtn_msk_idle_select_msg; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutGeneralSettingsUidValue; - viewid = KScutConnectivityStatusViewIdValue; - longtitle = qtn_apps_connectivity_list; - shorttitle = qtn_apps_connectivity_skey; - skeytitle = qtn_apps_connectivity_skey; - msktitle = qtn_msk_idle_connectivity; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutVideoServicesUidValue; - skeytitle = qtn_apps_video_grid; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutMusicPlayerUidValue; - skeytitle = qtn_apps_mplayer_skey; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutFlashPlayerUidValue; - skeytitle = qtn_apps_fplayer_skey; - } - , - AI_APP_TITLE_ITEM - { - appuid = KScutExchangeMailUidValue; - skeytitle = qtn_apps_exchangemail_skey; - } - , - AI_APP_TITLE_ITEM - { - appuid = -1; - //longtitle = "not found"; - //shorttitle = "not found"; - skeytitle = "not found"; - msktitle = "not found"; - } - }; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutengine.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutengine.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1787 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in engine class -* -*/ - - -#include // For CCoeEnv -#include // For CRepository -#include // For RWsSession -#include // For TApaTaskList -#include // For CVwsSessionWrapper -#include // For TVwsViewId -#include // For RProperty -#include // For CnvUtfConverter -#include -#include -#include // For CActiveFavouritesDbNotifier -#include -#include -#include // for fast swap -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "caiscutengine.h" -#include "aiscutpluginprivatecrkeys.h" -#include "aiscutcontentmodel.h" -#include "caiscutplugin.h" -#include "caiscutshortcut.h" -#include "caiscutshortcutinfo.h" -#include "aidefaultshortcut.h" -#include "aiscutappuidparser.h" -#include "aiscutrepositorywatcher.h" -#include "aiscuttargetshutter.h" -#include "aiscutdefs.h" -#include "aiscutfactory.h" - -#include -#include "debug.h" -/** - * Timer delay for access check retry. Two seconds. - */ -const TInt KScutAccessCheckRetryDelay = 2000000; -const TUid KVoiceCallUidViewId = { 0x10282D81 }; -const TUid KVideoCallUid = { 0x101F8681 }; - -_LIT(KScutTextsResourceFileName, "aiscuttexts.rsc"); -_LIT8(KScutDirectOpen, "?open"); - -// ======== LOCAL FUNCTIONS ======== - -LOCAL_C TInt CompareKey(const TUint32& aLeft, const TUint32& aRight) -{ - TUint32 left = aLeft & (KScutBitMaskThemeDefault & KScutBitMaskLocked); - TUint32 right = aRight & (KScutBitMaskThemeDefault & KScutBitMaskLocked); - - if (left < right) - { - return -1; - } - else if (left > right) - { - return 1; - } - - return 0; -} - -static TInt IntFromDesc( const TDesC &aParam ) - { - TInt err = KErrArgument; - if (aParam.Length() > 0) - { - _LIT(KHexPrefix, "0x"); - const TInt prefixLen = 2; - - TRadix radix(EDecimal); - TPtrC ptr(aParam); - - if (aParam.Left(prefixLen).CompareC(KHexPrefix) == 0) - { - // Strip the '0x' prefix. - ptr.Set(aParam.Right(aParam.Length() - prefixLen)); - - radix = EHex; - } - - TLex lexer(ptr); - TUint32 id; - - err = lexer.Val(id, radix); - if ( err == KErrNone ) - { - return id; - } - else - { - return err; - } - } - return err; - } -// --------------------------------------------------------------------------- -// Timer callback. -// --------------------------------------------------------------------------- -// -TInt DelayedCheckCallBack(TAny* aEngine) -{ - if (aEngine) - { - static_cast(aEngine)->RetryAccessCheck(); - } - - return KErrNone; -} - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngine::CAiScutEngine(CAiScutPlugin& aPlugin) - : - iPlugin(aPlugin), - iResourceLoaderTexts(*CCoeEnv::Static()), - iResourceLoaderSendUi(*CCoeEnv::Static()) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngine::ConstructL() -{ - FeatureManager::InitializeLibL(); - - User::LeaveIfError(iApaSession.Connect()); - User::LeaveIfError(iBookmarkSess.Connect()); - User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); - - iVwsSession = CVwsSessionWrapper::NewL(); - iRepository = CRepository::NewL(KCRUidShortcutItems); - - iHiddenAppsRepository = CRepository::NewL(KCRUidMenu); - - // Create message server session because it may be needed during shortcut - // creation for checking mailbox access. - iMsvSession = CMsvSession::OpenAsObserverL(*this); - - iEnv = CCoeEnv::Static(); - - TParsePtrC driveParse(PathInfo::RomRootPath()); - TFileName resourceName(driveParse.Drive()); - TParse parse; - parse.Set(KScutTextsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); - resourceName.Append(parse.FullName()); - iResourceLoaderTexts.OpenL(resourceName); - - TFileName resourceName2(driveParse.Drive()); - TParse parse2; - parse2.Set(KSendNormResource, &KDC_RESOURCE_FILES_DIR, NULL); - resourceName2.Append(parse2.FullName()); - iResourceLoaderSendUi.OpenL(resourceName2); - - LoadAppTitleListL(); - - // Engine should still remain alive even though shortcut construction failed - // because LaunchByValue must still be possible. - TRAP_IGNORE(CreateShortcutsL()); - - // Close message server session for now. It's opened again in Resume if needed. - delete iMsvSession; - iMsvSession = NULL; - - iKeyEventObserver = AiUtility::CreatePSPropertyObserverL( - TCallBack(HandlePSCommand, this), - KUidSystemCategory, KPSUidShortcutCmd); - - iCallStateObserver = AiUtility::CreatePSPropertyObserverL( - TCallBack(CallStateChangeCallback, this), - KPSUidCtsyCallInformation, KCTsyCallState); - - iKeylockApi = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard ); - if ( !iKeylockApi->HasConfiguration() ) - { - delete iKeylockApi; - iKeylockApi = NULL; - } - CRepository* repository = CRepository::NewLC(TUid::Uid(KCRUidActiveIdleLV)); - - repository->Get(KAIFirstKeyLockKey, iFirstLockKey); - repository->Get(KAISecondKeyLockKey, iSecondLockKey); - repository->Get(KAIKeyLockTimeout, iDelayTimerDelay); - CleanupStack::PopAndDestroy(repository); - // convert micro to milliseconds - const TInt KUsInMs = 1000; - iDelayTimerDelay = KUsInMs * iDelayTimerDelay; - iDelayTimer = CPeriodic::NewL (CActive::EPriorityStandard ); -} - -TInt CAiScutEngine::DelayTimerCallBack (TAny *aSelf ) - { - CAiScutEngine* self = static_cast(aSelf ); - TInt err = KErrNone; - if (self ) - { - self->iDelayTimer->Cancel(); - TRAP(err, - self->HandleLaunchByIndexL( *(self->iDelayedLaunchCmd) ); - ); - - } - return err; - } - -void CAiScutEngine::DelayedLaunchByIndexL( const TDesC &aParam ) - { - delete iDelayedLaunchCmd; - iDelayedLaunchCmd = NULL; - iDelayedLaunchCmd = aParam.AllocL(); - iDelayTimer->Cancel(); - iDelayTimer->Start( iDelayTimerDelay, - iDelayTimerDelay, - TCallBack( DelayTimerCallBack, this )); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngine* CAiScutEngine::NewL(CAiScutPlugin& aPlugin) -{ - CAiScutEngine* self = new (ELeave) CAiScutEngine(aPlugin); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngine::~CAiScutEngine() -{ -#ifdef __WEB_WIDGETS - if( iWidgetRegistryConnected ) - { - iWidgetRegistry.Disconnect(); - } -#endif - delete iKeylockApi; - delete iSettingsNotifier; - delete iRepository; - - delete iHiddenAppsNotifier; - delete iHiddenAppsRepository; - - iHiddenApps.Close(); - - delete iAppNotifier; - delete iTimer; - delete iMsvSession; - delete iVwsSession; - delete iScutShutter; - - Release(iKeyEventObserver); - Release(iCallStateObserver); - - iShortcuts.ResetAndDestroy(); - iThemeShortcuts.ResetAndDestroy(); - iDefaultUsed.Close(); - - delete iBookmarkDbObserver; - iBookmarkDb.Close(); - iBookmarkSess.Close(); - - iApaSession.Close(); - - while(iAppTitleList.Count()) - { - delete iAppTitleList[0].iLongTitle; - delete iAppTitleList[0].iShortTitle; - delete iAppTitleList[0].iSkeyTitle; - delete iAppTitleList[0].iMskTitle; - iAppTitleList.Remove(0); - } - iAppTitleList.Close(); - - iResourceLoaderTexts.Close(); - iResourceLoaderSendUi.Close(); - - delete iDelayTimer; - delete iDelayedLaunchCmd; - iIcons.Close(); - FeatureManager::UnInitializeLib(); -} - -// --------------------------------------------------------------------------- -// From class MMsvSessionObserver. -// Handles an event from the message server. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleSessionEventL( - TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) -{ - switch (aEvent) - { - case EMsvEntriesCreated: - case EMsvEntriesDeleted: - case EMsvEntriesChanged: - if (iShortcuts.Count() > 0) - { - MergeShortcuts(EScutMailbox, ETrue); - CheckAccessAndPublish(EScutCheckMailbox, EFalse); - } - break; - - default: - break; - } -} - -// --------------------------------------------------------------------------- -// From class MApaAppListServObserver. -// Handles a change in the application list. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleAppListEvent(TInt /*aEvent*/) -{ - TRAP_IGNORE( CheckForThemeDefaultReinstalledL() ); - MergeShortcuts(EScutAnyType, ETrue); - CheckAccessAndPublish(EScutCheckApp, ETrue); -} - -// --------------------------------------------------------------------------- -// Resumes the engine. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::ResumeL(TBool aPublishAll, TAiTransitionReason /*aReason*/) -{ - // Merge shortcuts and start notifiers only if we have publishable shortcuts. - if (iShortcuts.Count() > 0) - { - if (!iSettingsNotifier) - { - iSettingsNotifier = CAiScutRepositoryWatcher::NewL( - KCRUidShortcutItems, - TCallBack(HandleShortcutsChanged, this), - iRepository); - } - - if (!iHiddenAppsNotifier) - { - iHiddenAppsNotifier = CAiScutRepositoryWatcher::NewL( - KCRUidMenu, - KMenuHideApplication, - CCenRepNotifyHandler::EStringKey, - TCallBack(HandleHiddenAppsChanged, this), - iHiddenAppsRepository); - } - } -#ifdef __WEB_WIDGETS - if( !iWidgetRegistryConnected ) - { - TInt cError = iWidgetRegistry.Connect(); - if( cError == KErrNone ) - { - iWidgetRegistryConnected = ETrue; - } - } -#endif - - GetHiddenAppsL(); - - MergeShortcutsL(EScutAnyType, EFalse); - - // Call state check must be done always because RSK "Back" - // must be published when theme is changed during phone call, too. - HandleCallStateChange(); - - CheckAccessAndPublish(EScutCheckAll, aPublishAll); - - if (iShortcuts.Count() > 0) - { - iSettingsNotifier->StartListeningL(); - - iHiddenAppsNotifier->StartListeningL(); - - if (!iAppNotifier) - { - iAppNotifier = CApaAppListNotifier::NewL(this, CActive::EPriorityStandard); - } - } -} - -// --------------------------------------------------------------------------- -// Suspends the engine. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::Suspend() -{ - delete iMsvSession; // This is to stop receiving message server events. - iMsvSession = NULL; - - delete iSettingsNotifier; - iSettingsNotifier = NULL; - - delete iHiddenAppsNotifier; - iHiddenAppsNotifier = NULL; - - delete iAppNotifier; - iAppNotifier = NULL; - - delete iTimer; - iTimer = NULL; - - delete iScutShutter; - iScutShutter = NULL; - - if (iBookmarkDbObserver) - { - iBookmarkDbObserver->Cancel(); - } - delete iBookmarkDbObserver; - iBookmarkDbObserver = NULL; -#ifdef __WEB_WIDGETS - if( iWidgetRegistryConnected ) - { - TInt cError = iWidgetRegistry.Disconnect(); - if( cError == KErrNone ) - { - iWidgetRegistryConnected = EFalse; - } - } -#endif -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::HandleShortcutsChanged(TAny* aPtr) -{ - __PRINTS("XAI: CAiScutEngine::HandleShortcutsChanged"); - CAiScutEngine* self = static_cast(aPtr); - - if (self) - { - self->MergeShortcuts(EScutAnyType, ETrue); - self->CheckAccessAndPublish(EScutCheckAll, EFalse); - } - - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::HandleHiddenAppsChanged(TAny* aPtr) -{ - CAiScutEngine* self = static_cast(aPtr); - - if (self) - { - TRAP_IGNORE(self->GetHiddenAppsL()); - self->MergeShortcuts(EScutAnyType, ETrue); - self->CheckAccessAndPublish(EScutCheckAll, EFalse); - } - - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsLockKey( TInt aScanCode, TScutLockKey aLockKey ) const - { - TBool returnValue = EFalse; - if ( iKeylockApi ) - { - TInt index = 0; - TUint32 priKey = 0; - TUint32 secKey = 0; - TInt err = KErrNone; - // Loop through all the combinations in order - // to find wether this key is part of the locking - // process or not (1st or 2nd key) - while( !returnValue ) - { - err = iKeylockApi->GetKeyCombination(index, priKey, secKey); - if ( err == KErrNone ) - { - switch( aLockKey ) - { - case EScutFirstLockKey: - returnValue = (priKey == aScanCode); - break; - case EScutSecondLockKey: - returnValue = (secKey == aScanCode); - break; - default: - returnValue = EFalse; - break; - } - } - else // no more combinations - { - break; - } - ++index; - } - return returnValue; - } - switch( aLockKey ) - { - case EScutFirstLockKey: - returnValue = iFirstLockKey == aScanCode; - break; - case EScutSecondLockKey: - returnValue = iSecondLockKey == aScanCode; - break; - default: - returnValue = EFalse; - break; - } - return returnValue; - } - - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsHidden(const TUid& aAppUid) const -{ - if (iHiddenApps.Find(aAppUid) == KErrNotFound) - { - return EFalse; - } - - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::IsHidden (0x%x) ETrue"), aAppUid); - return ETrue; -} - -// --------------------------------------------------------------------------- -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleAiEventL(TInt aEvent, const TDesC& aParam) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleAiEventL( %d, '%S' ) alive = %d"), aEvent, &aParam, iPlugin.IsAlive()); - - TUid appUid = KNullUid; - iFirstLockKeyPressed = EFalse; - iSoftkeyAppRunning = EFalse; - - if (aParam.Compare(KLeftSoftkey) == 0) - { - if ( IsLockKey( EStdKeyDevice0, EScutFirstLockKey) || IsLockKey( EStdKeyDevice0 , EScutSecondLockKey)) - { - // Raise the first lock key pressed flag - // only when this is raised, keylock skip causes scut launch - iFirstLockKeyPressed = ETrue; - appUid = SoftkeyUid(KLeftSoftkeyId); - } - } - - if (aParam.Compare(KRightSoftkey) == 0) - { - if ( IsLockKey( EStdKeyDevice1 , EScutFirstLockKey) || IsLockKey( EStdKeyDevice1 , EScutSecondLockKey)) - { - // Raise the first lock key pressed flag - // only when this is raised, keylock skip causes scut launch - iFirstLockKeyPressed = ETrue; - appUid = SoftkeyUid(KRightSoftkeyId); - } - } - - if (iFirstLockKeyPressed && appUid != KNullUid) - { - TApaTaskList taskList(iEnv->WsSession()); - TApaTask task(taskList.FindApp(appUid)); - - if (task.Exists()) - { - if (IsHiddenFromFSW(appUid)) - iSoftkeyAppRunning = EFalse; - else - iSoftkeyAppRunning = ETrue; - } - } - - if (IsDelayRequired(appUid)) - { - DelayedLaunchByIndexL( aParam ); - return; - } - - if( iActiveCall && aParam.Compare( KRightSoftkey ) == 0 ) - { - ActivateTopMostApp(); - return; - } - - switch( aEvent ) - { - case EAiScutEventLaunchByIndex: - HandleLaunchByIndexL(aParam); - break; - - case EAiScutEventLaunchByValue: - HandleLaunchByValueL(aParam); - break; - - case EAiScutEventShowSettings: - ShowSettingsL(aParam); - break; - - case EAiScutEventShowSetting: - ShowSettingL(aParam); - break; - - case EAiScutEventLaunchFastswap: - OpenFastSwap(); - break; - - case EAiScutEventLaunchByIndexAlternate: - HandleLaunchByIndexAlternateL(aParam); - break; - - default: - break; - } - -} - -// --------------------------------------------------------------------------- -// Called by the timer. Retries the access check for shortcuts. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::RetryAccessCheck() -{ - CheckAccessAndPublish(EScutCheckAll, iPublishAll); - - // One retry is enough. - iTimer->Cancel(); - delete iTimer; - iTimer = NULL; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsNonNative(const TUid& aUid) -{ - TBool ret = EFalse; - - const TUid KMidletAppType = { 0x10210E26 }; - TUid typeuid = KNullUid; - - if (KErrNone == iApaSession.GetAppType(typeuid, aUid)) - { - if (typeuid == KMidletAppType) - { - ret = ETrue; - } - } - -#ifdef __WEB_WIDGETS - if (IsWidget(aUid)) - { - ret = ETrue; - } -#endif - - return ret; -} - -#ifdef __WEB_WIDGETS -TBool CAiScutEngine::IsWidget(const TUid& aUid) -{ - if( iWidgetRegistryConnected ) - { - return iWidgetRegistry.IsWidget(aUid); - } - else - { - return EFalse; - } -} -#endif - -// --------------------------------------------------------------------------- -// Creates the default shortcuts. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::CreateShortcutsL() -{ - TInt scIndex = 0; - - iShortcuts.ResetAndDestroy(); - - RArray keys; - CleanupClosePushL(keys); - // Find the keys that define theme-default shortcut settings. - iRepository->FindL(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, keys); - - - TLinearOrder order(CompareKey); - keys.Sort(order); - - HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - if (iSettingsNotifier) - { - iSettingsNotifier->StopListening(); - } - if (iHiddenAppsNotifier) - { - iHiddenAppsNotifier->StopListening(); - } - - for (TInt i = 0; i < keys.Count(); ++i) - { - TUint32 key = keys[i]; - if (iRepository->Get(key, bufferPtr) == KErrNone) - { - // Strip off the default-setting-bit, it's not part of the shortcut id. - key &= KScutBitMaskThemeDefault; - - // Parse the icon from the URL and fetch the icon to our icon array - // The actual icon => shortcut matching and overriding is done in - // CheckAccessAndPublishL() just before publishing - iParser.Parse(bufferPtr); - TAiScutIcon icon = iParser.Icon(); - if ( icon.iType != EScutIconNone ) - { - AddOverrideIcon( icon ); - } - // Keys over 0x20000000 means that they are just icon overrides - if ( !(key & KScutFlagBitIconOverride ) ) - { - key &= KScutMaskAdditionalSetting; - // Ignore possible errors during shortcut construction - // and simply try to move on to the next shortcut. - CAiScutShortcut* shortcut = NULL; - TRAPD(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, bufferPtr, *this)); - if (err == KErrNone) - { - // If shortcut is not accessible, replace it with platform default. - TBool access = EFalse; - if (shortcut) - { - // Append theme default to our array, incase of uninstall/reinstall/mem card removal - // restoration is required. - CAiScutShortcutInfo* shortcutInfo = NULL; - TRAP_IGNORE(shortcutInfo = CAiScutShortcutInfo::NewL(key | KScutFlagBitThemeDefault, - bufferPtr)); - if ( shortcutInfo ) - { - iThemeShortcuts.Append(shortcutInfo); - } - - TScutDefault usedDefault = EScutDefaultToPlatform; - - TRAP_IGNORE(access = shortcut->CheckAccessL(EScutCheckAll)); - if (!access) - { - HBufC* target = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr targetPtr = target->Des(); - TUid dummy; - - // Get the default shortcut definition for index 'scIndex'. - // uid is ignored. - TAiDefaultShortcut::GetDefaultShortcut(key, dummy, targetPtr); - - delete shortcut; - shortcut = NULL; - TRAP(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, targetPtr, *this)); - - if (err == KErrNone) - { - // Add the bit that indicates this is a default shortcut setting. - key |= KScutFlagBitThemeDefault; - iRepository->Set(key, targetPtr); - - // Try to locate a icon override from the default - // definition - iParser.Parse( targetPtr ); - TAiScutIcon tIcon = iParser.Icon(); - if ( tIcon.iType != EScutIconNone ) - { - AddOverrideIcon( tIcon ); - } - } - CleanupStack::PopAndDestroy( target ); - } - else - { - usedDefault = EScutDefaultToTheme; - } - - scIndex++; - - if (shortcut) // This test ensures that the creation right above went well. - { - iDefaultUsed.Append(usedDefault); - err = iShortcuts.Append(shortcut); - - if (err != KErrNone) - { - delete shortcut; - shortcut = NULL; - } - } - } - } - } - } - } - - if (iSettingsNotifier) - { - iSettingsNotifier->StartListeningL(); - } - if (iHiddenAppsNotifier) - { - iHiddenAppsNotifier->StartListeningL(); - } - - CleanupStack::PopAndDestroy(buffer); - CleanupStack::PopAndDestroy(&keys); -} - -// --------------------------------------------------------------------------- -// Check whether theme default sc was reinstalled. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::CheckForThemeDefaultReinstalledL() -{ - HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - if (iSettingsNotifier) - { - iSettingsNotifier->StopListening(); - } - if (iHiddenAppsNotifier) - { - iHiddenAppsNotifier->StopListening(); - } - - TInt count = iThemeShortcuts.Count(); - for (TInt i = 0; (i < count) && - (i < iDefaultUsed.Count()) && - (i < iShortcuts.Count()); - ++i) - { - if (iDefaultUsed[i] == EScutDefaultToPlatform || - iDefaultUsed[i] == EScutUserDefined) - { - bufferPtr.Zero(); - CAiScutShortcut*& shortcut = iShortcuts[i]; - // Strip off the default-setting-bit, it's not part of the shortcut id. - TUint32 scutKey = iThemeShortcuts[i]->Id() & KScutBitMaskThemeDefault; - bufferPtr.Append(iThemeShortcuts[i]->Target()); - CAiScutShortcut* newScut = NULL; - TRAPD(err, newScut = AiScutFactory::CreateAiScutShortcutL(scutKey, bufferPtr, *this)); - if (err == KErrNone) - { - delete shortcut; - shortcut = NULL; - shortcut = newScut; - // Add the bit that indicates this is a default shortcut setting. - scutKey |= KScutFlagBitThemeDefault; - iRepository->Set(scutKey, bufferPtr); - } - iDefaultUsed[i] = EScutDefaultToTheme; - // Recheck access - shortcut->CheckAccessL(EScutCheckAll); - } - } - if (iSettingsNotifier) - { - iSettingsNotifier->StartListeningL(); - } - if (iHiddenAppsNotifier) - { - iHiddenAppsNotifier->StartListeningL(); - } - - CleanupStack::PopAndDestroy(buffer); -} - -// --------------------------------------------------------------------------- -// Merges the user defined shortcuts with the defaults and checks shortcut access. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::MergeShortcuts(TShortcutType aType, TBool aRecreateAll) -{ - TRAP_IGNORE(MergeShortcutsL(aType, aRecreateAll)); -} - -// --------------------------------------------------------------------------- -// Merges the user defined shortcuts with the defaults. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::MergeShortcutsL(TShortcutType aType, TBool aRecreateAll) -{ - RArray keys; - CleanupClosePushL(keys); - - // Find the keys that define user defined shortcut settings. - iRepository->FindL(KScutCenRepKeyUserDefined, KScutCenRepKeyMask, keys); - - HBufC* buffer = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - for (TInt i = 0; i < iShortcuts.Count(); ++i) - { - CAiScutShortcut* shortcut = iShortcuts[i]; - if (aType == EScutAnyType || shortcut->Type() == aType) - { - - TInt keyIndex = keys.Find(shortcut->Id()); - if (keyIndex != KErrNotFound) - { - // Set the new user target. - if (keys.Count() > keyIndex && keyIndex >= 0 && - iRepository->Get(keys[keyIndex], bufferPtr) == KErrNone) - { - iParser.Parse(bufferPtr); - TAiScutIcon icon = iParser.Icon(); - if ( icon.iType != EScutIconNone ) - { - AddOverrideIcon( icon ); - } - if ( aRecreateAll || - buffer->CompareC( shortcut->ActiveDefinition() ) != 0 ) - { - shortcut->DeleteUserTarget(); - shortcut->SetUserTarget(bufferPtr); - } - if (i < iDefaultUsed.Count()) - { - iDefaultUsed[i] = EScutUserDefined; - } - } - } - } - } - - CleanupStack::PopAndDestroy(buffer); - CleanupStack::PopAndDestroy(&keys); -} - -// --------------------------------------------------------------------------- -// Checks shortcut accessibility. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::CheckAccessAndPublish(TInt aCheckType, TBool aPublishAll) -{ - TRAPD(err, CheckAccessAndPublishL(aCheckType, aPublishAll)); - - if (err == KErrNotReady) - { - // Access check failed, create a timer to try again later. - iTimer = CPeriodic::New(CActive::EPriorityStandard); - iTimer->Start(KScutAccessCheckRetryDelay, KScutAccessCheckRetryDelay, - TCallBack(DelayedCheckCallBack)); - } -} - -// --------------------------------------------------------------------------- -// Tells each shortcut to check whether or not its target is accessible. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::CheckAccessAndPublishL(TInt aCheckType, TBool aPublishAll) -{ - __PRINTS("XAI: CheckAccessAndPublishL"); - if (!iMsvSession && IsMsvSessionNeeded()) - { - iMsvSession = CMsvSession::OpenAsObserverL(*this); - } - - if (!iBookmarkDbObserver && IsBookmarkObserverNeeded()) - { - iBookmarkDbObserver = - new (ELeave) CActiveFavouritesDbNotifier(iBookmarkDb, *this); - if (! iBookmarkDbObserver->IsActive()) - { - iBookmarkDbObserver->Start(); - } - } - - iPublishAll = aPublishAll; - - TInt count = iShortcuts.Count(); - for (TInt i = 0; i < count; ++i) - { - CAiScutShortcut*& shortcut = iShortcuts[i]; - - // Check shortcut access and publish it if its target has changed. - // When the plug-in is being resumed, all shortcuts are published. - // Non-visible and locked shortcuts are never published. - if ( !shortcut->CheckAccessL(aCheckType) ) - { - HBufC* target = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr targetPtr = target->Des(); - TUid dummy; - // Get the default shortcut definition from cenrep using key 'key'. - // uid is ignored. - TUint32 key = shortcut->Id(); - TAiDefaultShortcut::GetDefaultShortcut(key, dummy, targetPtr); - delete shortcut; - shortcut = NULL; - TRAPD(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, targetPtr, *this)); - if (err == KErrNone) - { - // Add the bit that indicates this is a default shortcut setting. - key |= KScutFlagBitThemeDefault; - iRepository->Set(key, targetPtr); - - // Try to locate a icon override from the default - // definition - iParser.Parse( targetPtr ); - TAiScutIcon tIcon = iParser.Icon(); - if ( tIcon.iType != EScutIconNone ) - { - AddOverrideIcon( tIcon ); - } - } - CleanupStack::PopAndDestroy( target ); - if (i < iDefaultUsed.Count()) - { - iDefaultUsed[i] = EScutDefaultToPlatform; - } - // Recheck access - shortcut->CheckAccessL(aCheckType); - } - - TBool targetChanged = shortcut->IsTargetChanged(); - TInt32 id = shortcut->Id(); - TBool nonVisible = (0 != (id & KScutFlagBitNonVisible)); - - if (aCheckType == EScutCheckBkm && shortcut->Type() == EScutBookmark) - { - targetChanged = ETrue; - } - - shortcut->SetToBePublished( - (targetChanged || iPublishAll) && - !nonVisible - ); - - // Assign overridden icons to shortcuts if needed - for ( TInt j = 0; j < iIcons.Count(); j++) - { - // Check that the appuid and type matches - if ( shortcut->AppUid() == iIcons[j].iAppUid && - shortcut->Type() == iIcons[j].iShortcutType ) - { - // We need to check also the view id / bkm id if present or otherwise all bookmarks - // app views would be overridden - if ( iIcons[j].iViewId.iUid <= 0 || - iIcons[j].iViewId == shortcut->AdditionalUid() ) - { - shortcut->SetIcon(iIcons[j]); - } - } - } - - __PRINT( __DBG_FORMAT( "XAI: id = 0x%x, type = %d, publish = %d"), - shortcut->Id(), shortcut->Type(), shortcut->NeedsToBePublished()); - } - - iPlugin.PublishShortcutsL(iShortcuts); -} - -// --------------------------------------------------------------------------- -// Finds the shortcut object with the given id. -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::FindShortcutIndex(TInt32 aId) -{ - for (TInt i = 0; i < iShortcuts.Count(); ++i) - { - if (iShortcuts[i]->Id() == aId) - { - return i; - } - } - - return KErrNotFound; -} - -// --------------------------------------------------------------------------- -// Handles the shortcut launch by index. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleLaunchByIndexL(const TDesC& aParam) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexL ('%S')"), &aParam); - if (aParam.Length() > 0) - { - _LIT(KHexPrefix, "0x"); - const TInt prefixLen = 2; - - TRadix radix(EDecimal); - TPtrC ptr(aParam); - - if (aParam.Left(prefixLen).CompareC(KHexPrefix) == 0) - { - // Strip the '0x' prefix. - ptr.Set(aParam.Right(aParam.Length() - prefixLen)); - - radix = EHex; - } - - TLex lexer(ptr); - TUint32 id; - if (lexer.Val(id, radix) == KErrNone) - { - TInt idx = FindShortcutIndex(id); - if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) - { - iShortcuts[idx]->LaunchL(); - } - } - } -} -// --------------------------------------------------------------------------- -// Handles the shortcut launch by index. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleLaunchByIndexAlternateL(const TDesC& aParam) -/** - * These are the cases at the moment that are handled here. - * 1) Appshell targeted => Fastswap opened - */ -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexAlternateL ('%S')"), &aParam); - TInt index = IntFromDesc( aParam ); - TInt idx = FindShortcutIndex( index ); - if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) - { - CAiScutShortcut *scut = iShortcuts[idx]; - // Open fastswap in case appshell was targeted with alternate launch - if ( scut->AppUid() == KScutAppShellUid ) - { - OpenFastSwap(); - return; - } - // add other special cases here - /*if ( index == EAiScutSoftKeyLeft ) - { - // do something - }*/ - } -} - -// --------------------------------------------------------------------------- -// Handles the shortcut launch by value. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleLaunchByValueL(const TDesC& aParam) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexL ('%S')"), &aParam); - - if (aParam.Length() > 0) - { - CAiScutShortcut* shortcut = AiScutFactory::CreateAiScutShortcutLC(0x0, aParam, *this); - shortcut->CheckAccessL(EScutCheckAll); - shortcut->LaunchL(); - CleanupStack::PopAndDestroy(shortcut); - } -} - -// --------------------------------------------------------------------------- -// Shows the plug-in settings dialog. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::ShowSettingsL(const TDesC& aParam) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::ShowSettingsL ('%S')"), &aParam); - - _LIT(KGeneralSettings, "localapp:0x100058EC?view=0x102750FC"); - - CAiScutShortcut* shortcut = CAiScutShortcut::NewLC(0x0, KGeneralSettings, *this); - shortcut->CheckAccessL(EScutCheckAll); - - if (aParam.Length() > 0) - { - HBufC8* param = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aParam); - CleanupStack::PushL(param); - - const TDesC8& msg(*param); - - shortcut->LaunchL(msg); - - CleanupStack::PopAndDestroy(param); - } - else - { - shortcut->LaunchL(KNullDesC8); - } - - - CleanupStack::PopAndDestroy(shortcut); -} - -// --------------------------------------------------------------------------- -// Shows the plug-in setting. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::ShowSettingL(const TDesC& aParam) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::ShowSettingL ('%S')"), &aParam); - - _LIT(KGeneralSettings, "localapp:0x100058EC?view=0x102750FC"); - - CAiScutShortcut* shortcut = CAiScutShortcut::NewLC(0x0, KGeneralSettings, *this); - shortcut->CheckAccessL(EScutCheckAll); - - if (aParam.Length() > 0) - { - HBufC8* param = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aParam); - CleanupStack::PushL(param); - - HBufC8* param2 = HBufC8::NewLC(param->Des().Length()+KScutDirectOpen.iTypeLength); - param2->Des().Copy(param->Des()); - param2->Des().Append(KScutDirectOpen); - const TDesC8& msg(*param2); - - shortcut->LaunchL(msg); - - CleanupStack::PopAndDestroy(param2); - CleanupStack::PopAndDestroy(param); - } - else - { - shortcut->LaunchL(KNullDesC8); - } - - - CleanupStack::PopAndDestroy(shortcut); -} - -// --------------------------------------------------------------------------- -// Opens the fastswap window -// --------------------------------------------------------------------------- -// -void CAiScutEngine::OpenFastSwap() -{ - RAknUiServer* uiServer = CAknSgcClient::AknSrv(); - if ( uiServer ) - { - uiServer->MakeTaskListVisible( ETrue ); - } -} - - - -// --------------------------------------------------------------------------- -// Handles PS commands from WSPlugin. -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::HandlePSCommand(TAny* aAny) -{ - CAiScutEngine* self = reinterpret_cast< CAiScutEngine* >(aAny); - TInt err = KErrNone; - if (self) - { - TRAP(err, self->DoHandlePSCommandL()); - } - - return err; -} - -// --------------------------------------------------------------------------- -// Handles call state changes. -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::CallStateChangeCallback(TAny* /*aAny*/) -{ - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TUid CAiScutEngine::SoftkeyUid(TUint32 aSoftkeyId) -{ - TUid uid = KNullUid; - - TInt idx = FindShortcutIndex(aSoftkeyId); - if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) - { - uid = iShortcuts[idx]->AppUid(); - - __PRINT( __DBG_FORMAT( "XAI: SoftkeyUid %d app uid = 0x%x"), idx, uid.iUid); - } - - return uid; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsDelayRequired(TUid aAppUid) -{ - // softkey delay is reuired for these applications because of problems - // in killing them immediatly after keylock activation. - if (aAppUid.iUid == KScutBrowserUidValue || - aAppUid.iUid == KScutOperatorMenuUidValue || - aAppUid.iUid == KScutVideoServicesUidValue || - IsNonNative( aAppUid ) - ) - { - return ETrue; - } - - return EFalse; -} - -// --------------------------------------------------------------------------- -// Handles PS commands from WSPlugin. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::DoHandlePSCommandL() -{ - TBuf command; - TUint32 lockKeyId = 0; - iKeyEventObserver->Get(command); - - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::DoHandlePSCommandL command = '%S'"), &command); - - TUid appUid = KNullUid; - - if (iFirstLockKey == EStdKeyDevice0) - { - appUid = SoftkeyUid(KLeftSoftkeyId); - lockKeyId = KLeftSoftkeyId; - } - - if (iFirstLockKey == EStdKeyDevice1) - { - appUid = SoftkeyUid(KRightSoftkeyId); - lockKeyId = KRightSoftkeyId; - } - - if (iFirstLockKeyPressed && command.Compare(KAiPSEnableKeyLock) == 0) - { - if (appUid != KNullUid) - { - TBool isDialog = EFalse; - TInt idx = 0; - delete iScutShutter; - iScutShutter = NULL; - - // In case new message shortcut in lockkey - // we need to dismiss the dialog - if ( lockKeyId > 0 ) - { - idx = FindShortcutIndex( lockKeyId ); - if (idx != KErrNotFound) - { - switch (iShortcuts[idx]->Type()) - { - case EScutNewMsgType: - isDialog = ETrue; - break; - default: - isDialog = EFalse; - break; - } - } - - } - iDelayTimer->Cancel(); - iScutShutter = CAiScutTargetShutter::NewL(iEnv, appUid, iSoftkeyAppRunning, isDialog); - iScutShutter->StartL(); - } - } - - if (command.Compare(KAiPSSkipKeyLock) == 0) - { - iDelayTimer->Cancel(); - return ; - } - else if (command.Compare(KAiPSKeyLockTimeout) == 0) - { - if (iFirstLockKeyPressed) - { - iFirstLockKeyPressed = EFalse; - - if (iFirstLockKey == EStdKeyDevice0) - { - if (IsDelayRequired(appUid)) - { - HandleLaunchByIndexL(KLeftSoftkey); - } - return ; - } - - if (iFirstLockKey == EStdKeyDevice1) - { - if (IsDelayRequired(appUid)) - { - HandleLaunchByIndexL(KRightSoftkey); - } - return ; - } - } - return ; - } - - if (FeatureManager::FeatureSupported(KFeatureIdKeypadNoVoiceKey) && - command.Compare(KAiPSSkipNameDialer) == 0) - { - HandleLaunchByIndexL(KRightSoftkey); - return ; - } - - HandleLaunchByValueL(command); -} - -// --------------------------------------------------------------------------- -// Handles call state changes. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleCallStateChange() -{ - TInt value = 0; - TInt err = iCallStateObserver->Get(value); - iActiveCall = (value > EPSCTsyCallStateNone) && err == KErrNone; - - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleCallStateChange = %d"), value); - __PRINT( __DBG_FORMAT( "XAI: iActiveCall = %d"), iActiveCall); - - for (TInt i = 0; i < iShortcuts.Count(); ++i) - { - iShortcuts[i]->SetCallState(iActiveCall); - } -} - -// --------------------------------------------------------------------------- -// Activates TopMost Application -// --------------------------------------------------------------------------- -// -void CAiScutEngine::ActivateTopMostApp() -{ - // Phone Topmost app as default - TInt idleAppUid = 0; - TInt topMostAppId = 0; - - RProperty::Get(KPSUidAiInformation, KActiveIdleUid, idleAppUid); - - RProperty property; - TInt err = property.Attach(KPSUidUikon, KUikVideoCallTopApp); - - if (err == KErrNone) - { - property.Get(topMostAppId); - } - - property.Close(); - - __PRINT( __DBG_FORMAT( "XAI: ActivateTopMostApp idle uid = 0x%x topmost = 0x%x"), idleAppUid, topMostAppId); - - TUid appId(TUid::Uid(topMostAppId)); - - if(appId == KVideoCallUid) - { - const TVwsViewId viewId(appId, appId); - err = iVwsSession->CreateActivateViewEvent(viewId, KNullUid, KNullDesC8()); - - __PRINT( __DBG_FORMAT( "XAI: CreateActivateViewEvent = %d"), err); - } - else - { - const TVwsViewId viewId(appId, KVoiceCallUidViewId); - err = iVwsSession->CreateActivateViewEvent(viewId, KVoiceCallUidViewId, KNullDesC8()); - - __PRINT( __DBG_FORMAT( "XAI: CreateActivateViewEvent = %d"), err); - } - -} - -// --------------------------------------------------------------------------- -// From class MFavouritesDbObserver. -// Handles database event. -// --------------------------------------------------------------------------- -// -void CAiScutEngine::HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleFavouritesDbEventL aEvent = %d"), aEvent); - - if (aEvent == RDbNotifier::ECommit) - { - MergeShortcuts(EScutBookmark, ETrue); - CheckAccessAndPublish(EScutCheckBkm, EFalse); - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsMsvSessionNeeded() -{ - TInt count = iShortcuts.Count(); - - for (TInt i = 0; i < count; ++i) - { - CAiScutShortcut* shortcut = iShortcuts[i]; - TShortcutType type = shortcut->Type(); - - if (type == EScutNewMessage || - type == EScutNewEmail || - type == EScutNewSyncMLMail || - type == EScutNewPostcard || - type == EScutNewAudioMsg || - type == EScutNewMsgType || - type == EScutMailbox) - { - return ETrue; - } - } - - return EFalse; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsBookmarkObserverNeeded() -{ - TInt count = iShortcuts.Count(); - - for (TInt i = 0; i < count; ++i) - { - CAiScutShortcut* shortcut = iShortcuts[i]; - if (shortcut->Type() == EScutBookmark) - { - return ETrue; - } - } - - return EFalse; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::GetAppTitle( - const TUid& aAppUid, const TUid& aViewId, TDes& aTitle, TAiScutAppTitleType aType) -{ - TBool ret = EFalse; - TInt count = iAppTitleList.Count(); - - for (TInt i = 0; i < count; i++) - { - TAiScutAppTitleEntry entry = iAppTitleList[i]; - - if (entry.iAppUid == aAppUid && entry.iViewId == aViewId) - { - switch (aType) - { - case EAiScutLongTitle: - if (entry.iLongTitle) - { - aTitle = *entry.iLongTitle; - ret = ETrue; - } - break; - - case EAiScutShortTitle: - if (entry.iShortTitle) - { - aTitle = *entry.iShortTitle; - ret = ETrue; - } - break; - - case EAiScutSkeyTitle: - if (entry.iSkeyTitle) - { - aTitle = *entry.iSkeyTitle; - ret = ETrue; - } - break; - - case EAiScutMskTitle: - if (entry.iMskTitle) - { - aTitle = *entry.iMskTitle; - ret = ETrue; - } - break; - default : - break; - } - - break; // break the for loop - } - } - - if (! ret) __PRINT( __DBG_FORMAT( "XAI: GetAppTitle NOT found for uid = 0x%x"), aAppUid); - - return ret; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngine::LoadAppTitleListL() -{ - TResourceReader reader; - iEnv->CreateResourceReaderLC(reader, R_SCUT_APP_TITLE_LIST); - - TInt items = reader.ReadInt16(); - - __PRINT( __DBG_FORMAT( "XAI: LoadAppTitleListL items = %d"), items); - - TUid appuid; - TUid viewid; - - for (TInt i = 0; i < items; i++) - { - appuid.iUid = reader.ReadInt32(); - viewid.iUid = reader.ReadInt32(); - - HBufC16* longTitle = reader.ReadHBufC16L(); - CleanupStack::PushL(longTitle); - - HBufC16* shortTitle = reader.ReadHBufC16L(); - CleanupStack::PushL(shortTitle); - - HBufC16* skeyTitle = reader.ReadHBufC16L(); - CleanupStack::PushL(skeyTitle); - - HBufC16* mskTitle = reader.ReadHBufC16L(); - CleanupStack::PushL(mskTitle); - - TAiScutAppTitleEntry entry; - - entry.iAppUid = appuid; - entry.iViewId = viewid; - entry.iLongTitle = longTitle; - entry.iShortTitle = shortTitle; - entry.iSkeyTitle = skeyTitle; - entry.iMskTitle = mskTitle; - - User::LeaveIfError(iAppTitleList.Append(entry)); - - // Title names are deleted in destructor. - CleanupStack::Pop(4, longTitle); - } - - CleanupStack::PopAndDestroy(); // reader -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngine::GetHiddenAppsL() -{ - HBufC* buffer = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - iHiddenAppsRepository->Get(KMenuHideApplication, bufferPtr); - - __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::GetHiddenAppsL '%S' "), buffer); - - iHiddenApps.Reset(); - TAiScutAppUidParser uidParser(bufferPtr, iHiddenApps); - uidParser.ParseL(); - - CleanupStack::PopAndDestroy(buffer); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngine::IsHiddenFromFSW( const TUid& aAppUid ) -{ - const TUid KPSUidUikon = { 0x101F8773 }; - const TUint32 KUikAppHiddenList = 0x00000010; - const TInt KMaxHiddenApps = 25; - - TBuf16 <2*KMaxHiddenApps> retrievedList; - TInt err = RProperty::Get( KPSUidUikon, KUikAppHiddenList, -retrievedList ); - TInt i = 0; - - TUint32 listValue; - while( i < KMaxHiddenApps && KErrNone == err ) - { - // 32-bit uid values are retrieved in two 16-bit parts - listValue = retrievedList[2*i] << 16; - listValue += retrievedList[2*i+1]; - - if ( listValue ) - { - TUid t ( KNullUid ); - t.iUid = listValue; - if( t == aAppUid ) - { - return ETrue; - } - } - else - { - err = KErrEof; - return EFalse; - } - i++; - } - return EFalse; -} -// --------------------------------------------------------------------------- -// Adds an override icon to iIcons array in case the same icon -// isn't there already -// --------------------------------------------------------------------------- -// -TInt CAiScutEngine::AddOverrideIcon( TAiScutIcon &aIcon ) - { - TBool foundExisting = EFalse; - - for ( TInt i = 0; i < iIcons.Count(); i++) - { - if ( aIcon.iAppUid == iIcons[i].iAppUid && - aIcon.iShortcutType == iIcons[i].iShortcutType && - aIcon.iViewId == iIcons[i].iViewId && - aIcon.iDestination == iIcons[i].iDestination ) - { - foundExisting = ETrue; - break; - } - } - if ( !foundExisting ) - { - return iIcons.Append( aIcon ); - } - return KErrNone; - } -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutengineext.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutengineext.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,326 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in engine extension -* -*/ - -#include -#include -#include -#include - -#include - -#include "caiscutengineext.h" -#include "caiscutextserver.h" -#include "taiscutparser.h" -#include "caiscutshortcut.h" -#include "caiscutplugin.h" -#include "aiscutcontentmodel.h" -#include "caiscutextdata.h" -#include "caiscutextdatamodel.h" - -// ======== LOCAL DEFINITIONS ======== - -namespace - { - // LOCAL CONSTANTS - /** - * Target id hex format - */ - _LIT( KTargetIdFormat, "0x%08x" ); - - /** - * Maximum length of target id - */ - const TInt KTargetIdMaxLength = 11; - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngineExt* CAiScutEngineExt::NewL( CAiScutPlugin& aPlugin ) - { - CAiScutEngineExt* self = new( ELeave ) CAiScutEngineExt( aPlugin ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngineExt::~CAiScutEngineExt() - { - delete iAiScutExtServer; - delete iExtDataModel; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutEngineExt::CAiScutEngineExt( CAiScutPlugin& aPlugin ) - : CAiScutEngine( aPlugin ) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::ConstructL() - { - CAiScutEngine::ConstructL(); - - iExtDataModel = CAiScutExtDataModel::NewL(); - iAiScutExtServer = new( ELeave ) CAiScutExtServer( *this, Env()->WsSession() ); - iAiScutExtServer->ConstructL(); - TRAPD( err, iAiScutExtServer->StartL( KAiScutExtServerName ) ); - - if( err != KErrNone && err != KErrAlreadyExists ) - { - User::Leave( err ); - } - - //Send EAiScutEventGainFocus to the leftmost shortcut in order to put - //its state machine in correct state - if( iShortcuts.Count() > 0 ) - { - static_cast< CAiScutShortcutExt* >( iShortcuts[ 0 ] )->HandleAIEventL( - EAiScutEventGainFocus ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::CheckAccessAndPublish( CAiScutShortcut& aShortcut ) - { - TRAPD( err, - RAiShortcutArray shortcutArray; - CleanupClosePushL( shortcutArray ); - shortcutArray.AppendL( &aShortcut ); - aShortcut.SetToBePublished( ETrue ); - iPlugin.PublishShortcutsL( shortcutArray ); - CleanupStack::PopAndDestroy( &shortcutArray ); - ); - - if( err != KErrNone ) - { - //Delegate publishing to the original engine - CAiScutEngine::CheckAccessAndPublish( EScutCheckAll, ETrue ); - } - } - -// --------------------------------------------------------------------------- -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleAiEventL( TInt aEvent, const TDesC& aParam ) - { - CAiScutShortcutExt* shortcut = FindShortcutById( aParam ); - if( shortcut ) - { - shortcut->HandleAIEventL( aEvent ); - } - CAiScutEngine::HandleAiEventL( aEvent, aParam ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::ResumeL( TBool aPublishAll, TAiTransitionReason aReason ) - { - TArray extDataArray = iExtDataModel->AiScutExtDataArray(); - const TInt count = extDataArray.Count(); - //Iterate extension data items and populate to matching shortcuts. - //Remove the items that are not used in any shortcut. - for( TInt i = 0; i < count; i++ ) - { - CAiScutExtData* extData = extDataArray[ i ]; - const TDesC& targetDefinition = extData->TargetDefinition(); - if( !PopulateExtData( targetDefinition, extData ) ) - { - iExtDataModel->RemoveAiScutExtData( targetDefinition ); - } - } - - TAiTransitionReason resumeReason = iPlugin.ResumeReason(); - const TInt shortcutCount = iShortcuts.Count(); - for( TInt i = 0; i < shortcutCount; i++ ) - { - CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > - ( iShortcuts[ i ] ); - shortcut->HandleResumed( resumeReason ); - } - - iAiScutExtServer->ResumeL( aReason ); - - CAiScutEngine::ResumeL( aPublishAll, aReason ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleSetPopupLineArrayL( const TDesC& aDefinition, - CDesCArray* aLineArray ) - { - CAiScutExtData* extData = iExtDataModel->SetPopupLineArrayL( - aDefinition, aLineArray ); - TBool shortcutsFound = PopulateExtData( - aDefinition, extData ); - if( !shortcutsFound ) - { - iExtDataModel->RemoveAiScutExtData( aDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleResetPopupLineArrayL( const TDesC& aDefinition ) - { - CAiScutExtData* extData = iExtDataModel->ResetPopupLineArray( aDefinition ); - TBool shortcutsFound = PopulateExtData( - aDefinition, extData ); - if( !shortcutsFound ) - { - iExtDataModel->RemoveAiScutExtData( aDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleSetIconL( const TDesC& aDefinition, CGulIcon* aIcon ) - { - CAiScutExtData* extData = iExtDataModel->SetIconL( aDefinition, aIcon ); - TBool shortcutsFound = PopulateExtData( - aDefinition, extData ); - if( !shortcutsFound ) - { - iExtDataModel->RemoveAiScutExtData( aDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleResetIconL( const TDesC& aDefinition ) - { - CAiScutExtData* extData = iExtDataModel->ResetIcon( aDefinition ); - TBool shortcutsFound = PopulateExtData( - aDefinition, extData ); - if( !shortcutsFound ) - { - iExtDataModel->RemoveAiScutExtData( aDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngineExt::HandleIsInShortcutsL( const TDesC& aDefinition ) const - { - const TInt shortcutCount = iShortcuts.Count(); - for( TInt i = 0; i < shortcutCount; i++ ) - { - CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > - ( iShortcuts[ i ] ); - TPtrC activeTargetDefinition = shortcut->ActiveTargetDefinition(); - if( activeTargetDefinition.CompareF( aDefinition ) == 0 ) - { - return ETrue; - } - } - - return EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutEngineExt::HandleIssuePutInShortcutsL( const TDesC& /*aDefinition*/ ) - { - CGSLauncher* l = CGSLauncher::NewLC(); - l->LaunchGSViewL ( TUid::Uid( AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN ), - KScutActiveIdleUid, - KNullDesC8 ); - CleanupStack::PopAndDestroy( l ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutEngineExt::PopulateExtData( const TDesC& aDefinition, - const MAiScutExtData* aAiScutExtData ) - { - //Iterate shortcuts and update matching ones with new extData - TBool shortcutsFound = EFalse; - const TInt shortcutCount = iShortcuts.Count(); - for( TInt i = 0; i < shortcutCount; i++ ) - { - CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > - ( iShortcuts[ i ] ); - TPtrC activeTargetDefinition = shortcut->ActiveTargetDefinition(); - if( activeTargetDefinition.CompareF( aDefinition ) == 0 ) - { - shortcut->SetAiScutExtData( aAiScutExtData ); - shortcutsFound = ETrue; - } - } - - return shortcutsFound; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutExt* CAiScutEngineExt::FindShortcutById( - const TDesC& aId ) const - { - const TInt shortcutCount = iShortcuts.Count(); - for( TInt i = 0; i < shortcutCount; i++ ) - { - CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > - ( iShortcuts[ i ] ); - - TBuf< KTargetIdMaxLength > id; - id.Format( KTargetIdFormat, shortcut->Id() ); - - if( id.CompareF( aId ) == 0 ) - { - return shortcut; - } - } - return NULL; - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutextdata.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutextdata.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in engine extension -* -*/ - - -#include "caiscutextdata.h" -#include -#include - -// ======== LOCAL DEFINITIONS ======== - -namespace - { - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtData* CAiScutExtData::NewL( const TDesC& aTargetDefinition ) - { - CAiScutExtData* self = CAiScutExtData::NewLC( aTargetDefinition ); - CleanupStack::Pop( self ); - return self; - } - -CAiScutExtData* CAiScutExtData::NewLC( const TDesC& aTargetDefinition ) - { - CAiScutExtData* self = new( ELeave ) CAiScutExtData; - CleanupStack::PushL( self ); - self->ConstructL( aTargetDefinition ); - return self; - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtData::~CAiScutExtData() - { - delete iIcon; - delete iPopupLineArray; - delete iTargetDefinition; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtData::CAiScutExtData() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtData::ConstructL( const TDesC& aTargetDefinition ) - { - iTargetDefinition = aTargetDefinition.AllocL(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -const TDesC& CAiScutExtData::TargetDefinition() const - { - return *iTargetDefinition; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtData::SwitchPopupLineArray( CDesCArray* aPopupLineArray ) - { - delete iPopupLineArray; - iPopupLineArray = aPopupLineArray; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtData::ResetPopupLineArray() - { - delete iPopupLineArray; - iPopupLineArray = NULL; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtData::SwitchIcon( CGulIcon* aIcon ) - { - delete iIcon; - iIcon = aIcon; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtData::ResetIcon() - { - delete iIcon; - iIcon = NULL; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -const MDesCArray* CAiScutExtData::PopupLineArray() const - { - return iPopupLineArray; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -const CGulIcon* CAiScutExtData::Icon() const - { - return iIcon; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -/* -CGulIcon* CAiScutExtData::DuplicateIconL() const - { - if( !iIcon ) - { - return NULL; - } - - CGulIcon* newIcon = CGulIcon::NewLC(); - - CFbsBitmap* iconBitmap = iIcon->Bitmap(); - if( iconBitmap && iconBitmap->Handle() != 0 ) - { - CFbsBitmap* newBitmap = new( ELeave ) CFbsBitmap(); - CleanupStack::PushL( newBitmap ); - User::LeaveIfError( newBitmap->Duplicate( iconBitmap->Handle() ) ); - CleanupStack::Pop( newBitmap ); - newIcon->SetBitmap( newBitmap ); - } - - CFbsBitmap* iconMask = iIcon->Mask(); - if( iconMask && iconMask->Handle() != 0 ) - { - CFbsBitmap* newMask = new( ELeave ) CFbsBitmap(); - CleanupStack::PushL( newMask ); - User::LeaveIfError( newMask->Duplicate( iconMask->Handle() ) ); - CleanupStack::Pop( newMask ); - newIcon->SetMask( newMask ); - } - - CleanupStack::Pop( newIcon ); - return newIcon; - } -*/ - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutextdatamodel.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutextdatamodel.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in extension data model -* -*/ - - -#include "caiscutextdatamodel.h" -#include "caiscutextdata.h" - -// ======== LOCAL DEFINITIONS ======== - -namespace - { - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtDataModel* CAiScutExtDataModel::NewL() - { - CAiScutExtDataModel* self = CAiScutExtDataModel::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -CAiScutExtDataModel* CAiScutExtDataModel::NewLC() - { - CAiScutExtDataModel* self = new( ELeave ) CAiScutExtDataModel; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtDataModel::~CAiScutExtDataModel() - { - iAiScutExtDataArray.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtDataModel::CAiScutExtDataModel() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtDataModel::ConstructL() - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtData* CAiScutExtDataModel::SetPopupLineArrayL( - const TDesC& aDefinition, CDesCArray* aLineArray ) - { - CAiScutExtData* extData = NULL; - TInt index = FindAiScutExtData( aDefinition ); - if( index != KErrNotFound ) - { - extData = iAiScutExtDataArray[ index ]; - } - else - { - extData = CreateAiScutExtDataL( aDefinition ); - } - - extData->SwitchPopupLineArray( aLineArray ); //Takes ownership - return extData; - } - -CAiScutExtData* CAiScutExtDataModel::ResetPopupLineArray( const TDesC& aDefinition ) - { - CAiScutExtData* extData = NULL; - TInt index = FindAiScutExtData( aDefinition ); - if( index != KErrNotFound ) - { - extData = iAiScutExtDataArray[ index ]; - if( extData->Icon() ) - { - extData->ResetPopupLineArray(); - } - else - { - iAiScutExtDataArray.Remove( index ); - delete extData; - extData = NULL; - } - } - return extData; - } - -CAiScutExtData* CAiScutExtDataModel::SetIconL( const TDesC& aDefinition, CGulIcon* aIcon ) - { - CAiScutExtData* extData = NULL; - TInt index = FindAiScutExtData( aDefinition ); - if( index != KErrNotFound ) - { - extData = iAiScutExtDataArray[ index ]; - } - else - { - extData = CreateAiScutExtDataL( aDefinition ); - } - - extData->SwitchIcon( aIcon ); //Takes ownership - return extData; - } - -CAiScutExtData* CAiScutExtDataModel::ResetIcon( const TDesC& aDefinition ) - { - CAiScutExtData* extData = NULL; - TInt index = FindAiScutExtData( aDefinition ); - if( index != KErrNotFound ) - { - extData = iAiScutExtDataArray[ index ]; - if( extData->PopupLineArray() ) - { - extData->ResetIcon(); - } - else - { - iAiScutExtDataArray.Remove( index ); - delete extData; - extData = NULL; - } - } - return extData; - } - -TArray CAiScutExtDataModel::AiScutExtDataArray() const - { - return iAiScutExtDataArray.Array(); - } - -void CAiScutExtDataModel::RemoveAiScutExtData( const TDesC& aDefinition ) - { - TInt index = FindAiScutExtData( aDefinition ); - if( index != KErrNotFound ) - { - CAiScutExtData* extData = iAiScutExtDataArray[ index ]; - iAiScutExtDataArray.Remove( index ); - delete extData; - } - } - -TInt CAiScutExtDataModel::FindAiScutExtData( const TDesC& aDefinition ) const - { - const TInt count = iAiScutExtDataArray.Count(); - for( TInt i = 0; i < count; i++ ) - { - if( iAiScutExtDataArray[ i ]->TargetDefinition().CompareF( aDefinition ) == 0 ) - { - return i; - } - } - return KErrNotFound; - } - -CAiScutExtData* CAiScutExtDataModel::CreateAiScutExtDataL( const TDesC& aDefinition ) - { - CAiScutExtData* extData = CAiScutExtData::NewLC( aDefinition ); - iAiScutExtDataArray.AppendL( extData ); //Takes ownership - CleanupStack::Pop( extData ); - return extData; - } -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutextserver.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutextserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,396 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension server class. -* -*/ - - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "caiscutextserver.h" -#include "caiscutextsession.h" -#include "taiscutparser.h" -#include "caiscutextserver.h" -#include "activeidle2domainpskeys.h" - - -// Amount of bytes the data buffer increases at a time. -const TInt KAppsListDataGranularity = 100; - -// The length of '0x' in front of a hex literal. -const TInt KTokenPrefix = 2; - -// Index to UID 3 -const TInt KUidIndex = 2; - -// Count of characters one UID occupies in CenRep (prefix + 8 digits + spacer) -const TInt KUidStorageLength = KTokenPrefix + 8 + 1; - -_LIT(KUidFormat, "0x%08X "); - -_LIT(KResource, "z:\\resource\\aiscutpluginres.rsc"); - -_LIT(KRomDrive, "z"); - - -CLinkParams::CLinkParams(CAiScutExtServer& aServer, HBufC* aTargetDefinition) - : iServer(aServer) - { - iTargetDefinition = aTargetDefinition; - } - -CLinkParams::~CLinkParams() - { - delete iTargetDefinition; - } - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtServer::CAiScutExtServer( MAiScutExtMessageHandler& aObserver, RWsSession& aWsSession ) - : CServer2( CActive::EPriorityStandard ), iObserver( aObserver ), iWsSession(aWsSession) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtServer::ConstructL() -{ - iIdle = CIdle::NewL( EPriorityStandard ); - - TFileName fileName( KResource ); - CEikonEnv* env = CEikonEnv::Static(); - BaflUtils::NearestLanguageFile( env->FsSession(), fileName ); - iResourceOffset = env->AddResourceFileL( fileName ); - - ReadAppListL(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtServer::~CAiScutExtServer() - { - if( iIdle ) - { - iIdle->Cancel(); - delete iIdle; - } - - CEikonEnv::Static()->DeleteResourceFile( iResourceOffset ); - - iShowUids.Close(); - iUids.Close(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CSession2* CAiScutExtServer::NewSessionL( - const TVersion& aVersion, const RMessage2& /*aMessage*/ ) const - { - TVersion version( - KAiScutExtServMajorVersionNumber, - KAiScutExtServMinorVersionNumber, - KAiScutExtServBuildVersionNumber ); - - if ( !User::QueryVersionSupported( version, aVersion ) ) - { - User::Leave( KErrNotSupported ); - } - CAiScutExtSession* session = new( ELeave ) CAiScutExtSession( iObserver ); - return session; -} - -// --------------------------------------------------------------------------- -// Read a list of application UIDs which we must not show the tip. -// --------------------------------------------------------------------------- -// -void CAiScutExtServer::ReadAppListL() - { - CRepository* repository = CRepository::NewL( KCRUidShortcutItems ); - CleanupStack::PushL( repository ); - - RBuf buffer; - buffer.CreateL( KAppsListDataGranularity ); - buffer.CleanupClosePushL(); - - TInt err = repository->Get( KAIxSPNoTipAppsList, buffer ); - while( err == KErrOverflow ) - { - buffer.ReAllocL( buffer.MaxLength() + KAppsListDataGranularity ); - err = repository->Get( KAIxSPNoTipAppsList, buffer ); - } - - // Handle error silently if reading from Central Repository fails. - if( err == KErrNone ) - { - // Parse application UIDs and put them to list. - TLex lex(buffer); - - while( !lex.Eos() ) - { - TPtrC token( lex.NextToken() ); - if( token.Length() < KTokenPrefix ) - { - break; - } - TLex lexUid( token.Right( token.Length() - KTokenPrefix ) ); - - TUint32 uid; - if( lexUid.Val( uid, EHex ) == KErrNone ) - { - iUids.AppendL( TUid::Uid( uid ) ); - } - } - } - - CleanupStack::PopAndDestroy(); // buffer - CleanupStack::PopAndDestroy( repository ); - } - -// --------------------------------------------------------------------------- -// Saves the list of applications UIDs. -// --------------------------------------------------------------------------- -// -void CAiScutExtServer::WriteAppListL() - { - CRepository* repository = CRepository::NewL( KCRUidShortcutItems ); - CleanupStack::PushL( repository ); - - RBuf buffer; - buffer.CreateL( iUids.Count() * KUidStorageLength ); - buffer.Zero(); - buffer.CleanupClosePushL(); - - TBuf uidString; - - for(TInt c = 0; c < iUids.Count(); c++) - { - uidString.Format( KUidFormat, iUids[c] ); - buffer.Append( uidString ); // Ignore error - } - - User::LeaveIfError( repository->Set( KAIxSPNoTipAppsList, buffer ) ); - - CleanupStack::PopAndDestroy(); // buffer - CleanupStack::PopAndDestroy( repository ); - } - -// --------------------------------------------------------------------------- -// Tests if the client has connected us before, i.e. determines if -// the tip message should be shown. -// --------------------------------------------------------------------------- -// -TBool CAiScutExtServer::HasConnectedBefore( TUid& aUid, const RMessage2& aMessage ) - { - // First test if the current theme supports the xSP feature - TInt isXspSupported = EPSAiXspNotSupported; - TInt err = RProperty::Get( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, - isXspSupported ); - - if( err != KErrNone || isXspSupported == EPSAiXspNotSupported) - { - // xSP is not supported so don't show the dialog. Also if we could not - // read the P&S key we won't show the dialog. - return ETrue; - } - - RThread threadClient; - - if( aMessage.Client( threadClient ) != KErrNone ) - { - // In case of error we report that the client has connected us - // before in order not to show the dialog. - return ETrue; - } - - RProcess processClient; - - if( threadClient.Process(processClient) != KErrNone ) - { - // Prevent dialog from showing in case of error. - return ETrue; - } - - // See if client application is in ROM - TFileName fileName = processClient.FileName(); - TPtr processDrive( fileName.LeftTPtr( KRomDrive().Length() ) ); - processDrive.LowerCase(); - - if( processDrive == KRomDrive() ) - { - // Don't show tip message for ROM clients. - return ETrue; - } - - TUidType uidType = processClient.Type(); - - // UID3 of the client process - TUid uid3( uidType[ KUidIndex ] ); - aUid = uid3; - - // See if the uid is already in the list - if( iUids.Find( uid3 ) != KErrNotFound ) - { - return ETrue; - } - - return EFalse; - } - -void CAiScutExtServer::ShowTipMessage( TUid aUid ) - { - if( iShowUids.Find( aUid ) == KErrNotFound ) - { - iShowUids.Append( aUid ); - iIdle->Cancel(); - iIdle->Start( TCallBack( CAiScutExtServer::IdleCallBack, this ) ); - } - } - -TInt CAiScutExtServer::IdleCallBack(TAny* aParam) - { - CAiScutExtServer* p = (CAiScutExtServer*) aParam; - - p->iIdle->Cancel(); - - if( p->iIsForeground ) - { - TRAP_IGNORE( p->DoShowTipMessageL() ); - } - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// Shows a dialog -// --------------------------------------------------------------------------- -// -void CAiScutExtServer::DoShowTipMessageL() - { - // Find out the name of the application - RApaLsSession als; - User::LeaveIfError( als.Connect() ); - CleanupClosePushL( als ); - - while( iShowUids.Count() > 0 && !iIsTipMessageVisible) - { - TUid uid = iShowUids[ 0 ]; - TApaAppInfo appInfo; - User::LeaveIfError( als.GetAppInfo( appInfo, uid ) ); - - // Prepare the parameters for the link function - HBufC* definitionBuf = HBufC::NewLC( KMaxDefinitionLength ); - TPtr definition( definitionBuf->Des() ); - definition.Format( KScutFormatApplication, uid ); - - TBool isInShortcuts = iObserver.HandleIsInShortcutsL( definition ); - - CLinkParams* params = new( ELeave) CLinkParams( *this, definitionBuf ); - CleanupStack::Pop( definitionBuf ); - CleanupStack::PushL( params ); - - TCallBack cb(CAiScutExtServer::LinkCallBack, params); - - // Read and format tip message from the resource file - HBufC* messageBuf = StringLoader::LoadLC( R_AI_SC_QUERY_MODIFY_GS, appInfo.iCaption ); - TPtr message( messageBuf->Des() ); - - // Don't show the tip if the application is already in shortcuts - if( !isInShortcuts ) - { - iIsTipMessageVisible = ETrue; - CAknMessageQueryDialog* note = CAknMessageQueryDialog::NewL( message ); - params->iNote = note; - - note->SetLink( cb ); - note->ExecuteLD( R_SCUT_XSPTIP_NOTE ); - iIsTipMessageVisible = EFalse; - } - - // Update the list so we don't show the tip message - // again for this application. - iUids.Append( uid ); // Ignore error - iShowUids.Remove( 0 ); - - // Save the list of uids to persistant memory. - WriteAppListL(); - - CleanupStack::PopAndDestroy( messageBuf ); - CleanupStack::PopAndDestroy( params ); - } - - CleanupStack::PopAndDestroy(); // als - } - -// --------------------------------------------------------------------------- -// Opens the shurtcuts settings view -// --------------------------------------------------------------------------- -// -TInt CAiScutExtServer::LinkCallBack(TAny* aParam) - { - CLinkParams* params = (CLinkParams*) aParam; - - TRAP_IGNORE( - params->iServer.iObserver.HandleIssuePutInShortcutsL( - params->iTargetDefinition->Des() ); - ); - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtServer::ResumeL( TAiTransitionReason aReason ) - { - switch( aReason ) - { - case EAiIdleForeground: - iIsForeground = ETrue; - DoShowTipMessageL(); - break; - - case EAiIdleBackground: - iIsForeground = EFalse; - break; - - default: - break; - } - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutextsession.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutextsession.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in xSP extension session class. -* -*/ - - -#include -#include -#include -#include - -#include - -#include "caiscutextsession.h" -#include "maiscutextmessagehandler.h" - -#include "caiscutextserver.h" - - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtSession::CAiScutExtSession( MAiScutExtMessageHandler& aObserver ) - : iObserver( aObserver ) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutExtSession::~CAiScutExtSession() - { - CAiScutExtServer* server = const_cast( - dynamic_cast( Server() ) ); - - if( iTargetDefinition && server ) - { - TRAP_IGNORE( - iObserver.HandleResetPopupLineArrayL( *iTargetDefinition ); - iObserver.HandleResetIconL( *iTargetDefinition ); - ); - } - - delete iTargetDefinition; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::ServiceL( const RMessage2& aMessage ) - { - CAiScutExtServer* server = const_cast( - dynamic_cast( Server() ) ); - - __ASSERT_ALWAYS( server, User::Leave( KErrCorrupt ) ); - - TUid uid; - if( !server->HasConnectedBefore(uid, aMessage) ) - { - server->ShowTipMessage( uid ); - } - - TRAPD( err, DispatchMessageL( aMessage ) ); - - if( !aMessage.IsNull() ) - { - aMessage.Complete( err ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::DispatchMessageL( const RMessage2& aMessage ) - { - switch ( aMessage.Function() ) - { - case EAiScutExtServSetTargetDefinition: - { - SetTargetDefinitionL( aMessage ); - break; - } - case EAiScutExtServSetPopupText: - { - SetPopupTextL( aMessage ); - break; - } - case EAiScutExtServResetPopupText: - { - ResetPopupTextL( aMessage ); - break; - } - case EAiScutExtServSetIcon: - { - SetIconL( aMessage ); - break; - } - case EAiScutExtServResetIcon: - { - ResetIconL( aMessage ); - break; - } - case EAiScutExtServIsInShortcuts: - { - IsInShortcutsL( aMessage ); - break; - } - case EAiScutExtServIssuePutInShortcuts: - { - IssuePutInShortcutsL( aMessage ); - break; - } - default: - { - User::Leave( KErrNotSupported ); - } - } - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::SetTargetDefinitionL( const RMessage2& aMessage ) - { - HBufC* targetStringBuf = HBufC::NewLC( aMessage.GetDesLengthL( 0 ) ); - TPtr targetString( targetStringBuf->Des() ); - aMessage.ReadL( 0, targetString, 0 ); - delete iTargetDefinition; - iTargetDefinition = targetStringBuf; - CleanupStack::Pop( targetStringBuf ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::SetPopupTextL( const RMessage2& aMessage ) - { - if( !iTargetDefinition ) - { - return; - } - HBufC8* marshalledLineArrayBuf = HBufC8::NewLC( - aMessage.GetDesLengthL( 0 ) ); - TPtr8 marshalledLineArray( marshalledLineArrayBuf->Des() ); - aMessage.ReadL( 0, marshalledLineArray, 0 ); - - RDesReadStream stream( marshalledLineArray ); - CleanupClosePushL( stream ); - - const TInt lineCount = stream.ReadUint8L(); - __ASSERT_ALWAYS( lineCount >= 0 && lineCount <= KMaxPopupTextLines, - User::Leave( KErrArgument ) ); - - CDesCArray* array = new( ELeave ) CDesCArrayFlat( - lineCount > 0 ? lineCount : 1 ); - CleanupStack::PushL( array ); - - for( TInt i = 0; i < lineCount; i++ ) - { - HBufC* lineBuf = HBufC::NewLC( stream, KMaxTInt ); - array->AppendL( *lineBuf ); - CleanupStack::PopAndDestroy( lineBuf ); - } - - iObserver.HandleSetPopupLineArrayL( *iTargetDefinition, array ); //Takes ownership of array - - CleanupStack::Pop( array ); - CleanupStack::PopAndDestroy( &stream ); - CleanupStack::PopAndDestroy( marshalledLineArrayBuf ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::ResetPopupTextL( const RMessage2& /*aMessage*/ ) - { - if( iTargetDefinition ) - { - iObserver.HandleResetPopupLineArrayL( *iTargetDefinition ); - } - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::SetIconL( const RMessage2& aMessage ) - { - if( !iTargetDefinition ) - { - return; - } - HBufC8* marshallBuf = HBufC8::NewLC( aMessage.GetDesLengthL( 0 ) ); - TPtr8 marshalledData( marshallBuf->Des() ); - aMessage.ReadL( 0, marshalledData, 0 ); - - RDesReadStream stream( marshalledData ); - CleanupClosePushL( stream ); - - CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap; - CleanupStack::PushL( bitmap ); - bitmap->InternalizeL( stream ); - - CFbsBitmap* mask = new( ELeave ) CFbsBitmap; - CleanupStack::PushL( mask ); - mask->InternalizeL( stream ); - - CGulIcon* icon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2, bitmap ); - CleanupStack::PushL( icon ); - - iObserver.HandleSetIconL( *iTargetDefinition, icon ); - - CleanupStack::Pop( icon ); - - CleanupStack::PopAndDestroy( &stream ); - CleanupStack::PopAndDestroy( marshallBuf ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::ResetIconL( const RMessage2& /*aMessage*/ ) - { - if( iTargetDefinition ) - { - iObserver.HandleResetIconL( *iTargetDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::IsInShortcutsL( const RMessage2& aMessage ) - { - if( iTargetDefinition ) - { - TBool isInShortcuts = iObserver.HandleIsInShortcutsL( *iTargetDefinition ); - - TPtr8 isInShortcutsDes( - reinterpret_cast< TUint8* >( &isInShortcuts ), - sizeof( isInShortcuts ), - sizeof( isInShortcuts ) ); - aMessage.WriteL( 0, isInShortcutsDes, 0 ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::IssuePutInShortcutsL( const RMessage2& /*aMessage*/ ) - { - if( iTargetDefinition ) - { - iObserver.HandleIssuePutInShortcutsL( *iTargetDefinition ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutExtSession::PanicClient( - const RMessage2& aMessage, TInt aPanicCode ) const - { - aMessage.Panic( KAiScutExtServerName, aPanicCode ); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutplugin.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,467 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plug-in main class -* -*/ - - -#include -#include - -#include -#include - -#include -#include "aiscutpluginprivatecrkeys.h" -#include "aiscutdefs.h" -#include "aiscutcontentmodel.h" -#include "caiscutplugin.h" -#include "caiscutengine.h" -#include "aiscutfactory.h" -#include "caiscutshortcut.h" - -#include "debug.h" - -const TImplementationProxy KImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY(KImplUidScutPlugin, CAiScutPlugin::NewL) -}; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutPlugin::CAiScutPlugin() -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::ConstructL() -{ - // Initialize the info which the fw uses to identify the plug-in. - // Fill in only the uid at this point, the fw will send this back with the - // name filled in later through SetPropertyL(). - iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; - - iContent = AiUtility::CreateContentItemArrayIteratorL(KAiScutContent); - iResources = AiUtility::CreateContentItemArrayIteratorL(KAiScutResources); - iEvents = AiUtility::CreateContentItemArrayIteratorL(KAiScutEvents); - - CRepository* repository = NULL; - TRAP_IGNORE(repository = CRepository::NewL(KCRUidShortcutItems)); - // No leaving code here since 'repository' is not in cleanup stack. - if (repository) - { - // A theme might not contain any publishable shortcuts at all, only - // locked ones. To take this into account we must always delete old - // theme-default settings to make sure the engine won't create any - // unwanted shortcut objects. Any errors that might happen during - // deletion are ignored to make sure the plug-in is kept alive. - TUint32 errorKey; - - repository->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); - } - delete repository; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutPlugin* CAiScutPlugin::NewL() -{ - CAiScutPlugin* self = new (ELeave) CAiScutPlugin; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutPlugin::~CAiScutPlugin() -{ - TRAP_IGNORE( DeleteDefaultShortcutsL() ); - Release(iContent); - Release(iResources); - Release(iEvents); - delete iEngine; - iObservers.Close(); -} - -// --------------------------------------------------------------------------- -// Publishes the given shortcut. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::PublishShortcutsL(RAiShortcutArray& aShortcuts) -{ - TInt err = KErrNone; - TInt observers = iObservers.Count(); - TInt shortcuts = aShortcuts.Count(); - - for (TInt i = 0; i < observers; ++i) - { - MAiContentObserver* observer = iObservers[i]; - TBool transactionStarted = EFalse; - TInt transactionId = reinterpret_cast(this); - err = observer->StartTransaction(transactionId); - - if (err != KErrNotSupported) - { - // The observer does not support transactions, check for real errors. - User::LeaveIfError(err); - transactionStarted = ETrue; - } - err = KErrAlreadyExists; - for (TInt j = 0; j < shortcuts; j++) - { - CAiScutShortcut* shortcut = aShortcuts[j]; - - if (shortcut->NeedsToBePublished()) - { - shortcut->Publish(*this, *observer); - err = KErrNone; - } - } - - if ( transactionStarted && err == KErrNone ) - { - User::LeaveIfError(observer->Commit(transactionId)); - } - else if ( transactionStarted ) - { - User::LeaveIfError(observer->CancelTransaction(transactionId)); - } - } -} - -// --------------------------------------------------------------------------- -// Is plug-in suspended or not. -// --------------------------------------------------------------------------- -// -TBool CAiScutPlugin::IsAlive() const -{ - return iAlive; -} - -// --------------------------------------------------------------------------- -// Resume reason -// --------------------------------------------------------------------------- -// -TAiTransitionReason CAiScutPlugin::ResumeReason() const - { - return iResumeReason; - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Resumes the plug-in. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::Resume(TAiTransitionReason aReason) -{ - TRAP_IGNORE(DoResumeL(aReason)); -} - -// --------------------------------------------------------------------------- -// Resumes the plug-in. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::DoResumeL(TAiTransitionReason aReason) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Resume reason %d alive = %d"), aReason, iAlive); - iResumeReason = aReason; - // Reload the engine in case general theme changed or - // the engine has been suspended. - if (aReason == EAiGeneralThemeChanged || !iAlive) - { - // if general theme changed, free engine so that is will be - // loaded again because shortcut icons must be re-created. - FreeEngine(); - } - - if (!iEngine) - { - iEngine = AiScutFactory::CreateAiScutEngineL(*this); - } - - iEngine->ResumeL( (iAlive == EFalse) || - ( - aReason != EAiBacklightOn && - aReason != EAiBacklightOff && - aReason != EAiIdleBackground && - aReason != EAiIdleForeground - ), - aReason - ); - - iAlive = ETrue; -} - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Suspends the plug-in. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::Suspend(TAiTransitionReason aReason) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Suspend reason %d"), aReason); - - if (iEngine) - { - iEngine->Suspend(); - } - - iAlive = EFalse; -} - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Frees the plug-in engine. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::Stop(TAiTransitionReason aReason) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Stop reason %d"), aReason); - - if ( aReason == EAiBackupRestoreStarted ) - { - Suspend( aReason ); - } - else - { - FreeEngine(); - } -} -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Adds the content observer / subscriber to plug-in. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::SubscribeL(MAiContentObserver& aObserver) -{ - iObservers.AppendL(&aObserver); -} - -void CAiScutPlugin::DeleteDefaultShortcutsL() - { - // Ignore any errors that might occur when deleting - // the default keys - TUint32 errorKey; - CRepository* cr = CRepository::NewL(KCRUidShortcutItems); - cr->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); - delete cr; - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Configures the plug-in. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::ConfigureL(RAiSettingsItemArray& aSettings) -{ - CRepository* repository = NULL; - - TRAPD(err, repository = CRepository::NewL(KCRUidShortcutItems)); - - if (err == KErrNotFound) - { - // CenRep file is missing from the image, this is a serious error. - User::Leave(err); - } - - // Write settings if repository was successfully opened. All other errors - // are ignored to ensure that the plug-in is up and running, even if - // crippled. - - // No leaving code here since 'repository' is not in cleanup stack. - if (repository) - { - repository->StartTransaction(CRepository::EConcurrentReadWriteTransaction); - - // A theme might not contain any publishable shortcuts at all, only - // locked ones. To take this into account we must always delete old - // theme-default settings to make sure the engine won't create any - // unwanted shortcut objects. Any errors that might happen during - // deletion are ignored to make sure the plug-in is kept alive. - TUint32 errorKey; - - repository->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); - - __PRINTS( "XAI: CAiScutPlugin::ConfigureL"); - - TInt count = aSettings.Count(); - if (count > 0) - { - // Write new shortcut definitions. - for (TInt i = 0; i < count; ++i) - { - MAiPluginSettings* settings = aSettings[ i ]; - - if( settings->AiPluginItemType() == EAiPluginSettingsItem ) - { - MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); - TUint32 key = item.Key(); // implicit cast from TInt32 to TUint32. - - __PRINT( __DBG_FORMAT( "XAI: %d. key = 0x%x"), i+1, key); - - // Add the bit that indicates this is a default shortcut setting. - key |= KScutFlagBitThemeDefault; - - // Ignore possible error and keep going. - repository->Create(key, item.Value()); - } - } - } - - TUint32 info = 0; - repository->CommitTransaction(info); - - delete repository; - repository = NULL; - - if (iEngine) - { - iEngine->CreateShortcutsL(); - iEngine->ResumeL( ETrue, EAiGeneralThemeChanged ); - } - } - - // We don't need to store the settings so clear the array. - aSettings.ResetAndDestroy(); -} - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher. -// Returns the extension interface. -// --------------------------------------------------------------------------- -// -TAny* CAiScutPlugin::Extension(TUid aUid) -{ - if (aUid == KExtensionUidProperty) - { - return static_cast(this); - } - else if (aUid == KExtensionUidEventHandler) - { - return static_cast(this); - } - else - { - return NULL; - } -} - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::HandleEvent(TInt aEvent, const TDesC& aParam) -{ - if (iEngine) - { - // We have no way of reporting errors to framework so just ignore them. - TRAP_IGNORE(iEngine->HandleAiEventL(aEvent, aParam)); - } -} - -// --------------------------------------------------------------------------- -// CAiScutPlugin::HasMenuItem -// -// --------------------------------------------------------------------------- -// -TBool CAiScutPlugin::HasMenuItem(const TDesC16& /*aMenuItem*/) - { - return EFalse; - } - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Returns a plug-in property. -// --------------------------------------------------------------------------- -// -TAny* CAiScutPlugin::GetPropertyL(TInt aProperty) -{ - switch (aProperty) - { - case EAiPublisherInfo: - return static_cast(&iInfo); - - case EAiPublisherContent: - return static_cast(iContent); - - case EAiPublisherResources: - return static_cast(iResources); - - case EAiPublisherEvents: - return static_cast(iEvents); - - default: - break; - } - - return NULL; -} - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Sets a plug-in property to optimize the content model. -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::SetPropertyL(TInt aProperty, TAny* aValue) - { - if( aProperty == EAiPublisherInfo ) - { - ASSERT( aValue ); - - const TAiPublisherInfo* info( - static_cast( aValue ) ); - - iInfo = *info; - } - } - -// --------------------------------------------------------------------------- -// -// -// --------------------------------------------------------------------------- -// -void CAiScutPlugin::FreeEngine() -{ - delete iEngine; - iEngine = NULL; - iAlive = EFalse; -} - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) -{ - aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); - return KImplementationTable; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettings.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettings.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,435 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut settings plug-in main class. -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // For RProperty -#include // For KPSUidActiveIdle2 - -#include -#include -#include - -#include "aiscutsettings.hrh" -#include "caiscutsettings.h" -#include "caiscutsettingsitem.h" -#include "caiscutsettingscontainer.h" -#include "caiscutsettingsmodel.h" -#include -#include "aiscutdefs.h" -#include - -const TUid KUidScutSettingsPlugin = -{ - AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN -}; - -_LIT(KScutSettingsResourceFileName, "aiscutsettingsres.rsc"); -_LIT(KScutTextsResourceFileName, "aiscuttexts.rsc"); -_LIT8(KScutDirectOpenTag, "?open"); - - -// ======== LOCAL FUNCTIONS ======== - - -static void ParseKeysL( const TDesC8& aCustomMessage, RArray& aKeys, TBool& aOpen ) - { - HBufC8* message = aCustomMessage.AllocLC(); - - TPtr8 ptr( message->Des() ); - - TInt pos; - TInt openPos; - TBool openTag=EFalse; - - do - { - pos = ptr.Locate( ',' ); - - if( pos != KErrNotFound ) - { - const TDesC8& str1 = ptr.Left( pos ); - const TDesC8& str2 = str1.Right( str1.Length() - 2 ); - - TUint32 value; - TLex8 lex( str2 ); - - if( lex.Val( value, EHex ) == KErrNone ) - { - aKeys.AppendL( value ); - } - - ptr = ptr.MidTPtr( pos + 1 ); - } - else - { - const TDesC8& str1 = ptr; - const TDesC8& str2 = str1.Right( str1.Length() - 2 ); - openPos = ptr.Find( KScutDirectOpenTag ); - TLex8 lex; - if( openPos != KErrNotFound ) - { - openTag=ETrue; - const TDesC8& str3 = str2.Left( openPos -2 ); - lex.Assign( str3 ); - } - else - { - lex.Assign( str2 ); - } - TUint32 value; - - - if( lex.Val( value, EHex ) == KErrNone ) - { - aKeys.AppendL( value ); - } - } - } - while( pos != KErrNotFound ); - - if( openTag && aKeys.Count() == 1 ) - { - aOpen = ETrue; - } - CleanupStack::PopAndDestroy(); - } -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettings::CAiScutSettings() : iResourceLoaderTexts(*iCoeEnv) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettings::ConstructL() -{ - FeatureManager::InitializeLibL(); - - TParsePtrC driveParse(PathInfo::RomRootPath()); - TFileName resourceName(driveParse.Drive()); - - // Find the resource file. - TParse parse; - parse.Set(KScutSettingsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); - resourceName.Append(parse.FullName()); - - // Open resource file. - iResourceLoader.OpenL(resourceName); - - resourceName.Copy(driveParse.Drive()); - parse.Set(KScutTextsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); - resourceName.Append(parse.FullName()); - - // Open resource file. - iResourceLoaderTexts.OpenL(resourceName); - - iModel = CAiScutSettingsModel::NewL(*this, iCoeEnv); - - iListBoxTimer = CIdle::NewL(CActive::EPriorityHigh); - - - BaseConstructL(R_SCUT_SETTINGS_VIEW); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettings* CAiScutSettings::NewL(TAny* /*aInitParams*/) -{ - CAiScutSettings* self = new (ELeave) CAiScutSettings; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettings::~CAiScutSettings() -{ - FeatureManager::UnInitializeLib(); - - if( iListBoxTimer ) - { - iListBoxTimer->Cancel(); - delete iListBoxTimer; - } - - iResourceLoader.Close(); - iResourceLoaderTexts.Close(); - - delete iModel; -} - -// --------------------------------------------------------------------------- -// From CAknView -// Returns view id. -// --------------------------------------------------------------------------- -// -TUid CAiScutSettings::Id() const -{ - return KUidScutSettingsPlugin; -} - -// --------------------------------------------------------------------------- -// From CAknView -// Handles commands. -// --------------------------------------------------------------------------- -// -void CAiScutSettings::HandleCommandL(TInt aCommand) -{ - switch (aCommand) - { - case EAiScutSettingsCmdChange: - Container()->HandleChangeCommandL(); - break; - - case EAknCmdHelp: - /* - TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); - TCoeContextName helpString; - helpString.Copy( KSET_HLP_HOME_SCREEN_SHORTCUTS ); - - CArrayFixFlat* array = - new (ELeave) CArrayFixFlat(1); - CleanupStack::PushL( array ); - array->AppendL( TCoeHelpContext( fwUid, helpString ) ); - HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession(), array ); - CleanupStack::Pop( array ); - */ - break; - - case EAknSoftkeyBack: - if (iAppUi->View(KGSMainViewUid)) - { - // if we are in GS activate parent plugin view (standby view)... - iAppUi->ActivateLocalViewL(KGSPrslnPluginUid); - } - else - { - iAppUi->ActivateLocalViewL(iPrevViewId.iViewUid); - } - break; - - case EAknSoftkeyExit: - iAppUi->HandleCommandL(EAknCmdExit); - break; - - default: - iAppUi->HandleCommandL(aCommand); - break; - } -} - -// ---------------------------------------------------------------------------- -// From CAknView -// First method called by the Avkon framwork -// ---------------------------------------------------------------------------- -// -void CAiScutSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) -{ -#ifdef MY_DEBUG - RDebug::Print(_L("XAI: CAiScutSettings::DoActivateL")); - RDebug::Print(_L("XAI: aCustomMessageId = 0x%08x"), aCustomMessageId.iUid); - RDebug::Print(_L("XAI: aPrevViewId = 0x%08x"), aPrevViewId.iAppUid.iUid); -#endif - - CEikButtonGroupContainer* cba = Cba(); - - if (cba) - { - if (aCustomMessageId == KScutActiveIdleUid) - { - cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_EXIT_CHANGE); - } - else - { - cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_BACK_CHANGE); - } - cba->DrawDeferred(); - } - - CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); - - TBool open=EFalse; - if( aCustomMessage != KNullDesC8 ) - { - RArray keys; - CleanupClosePushL( keys ); - - ParseKeysL( aCustomMessage, keys, open ); - - iModel->SetSettingsKeys( keys ); - - CleanupStack::PopAndDestroy(); - } - - iModel->UpdateSettingsContainerL(); - - if( open ) - { - /* Let idle timer do this job. */ - iListBoxTimer->Cancel(); - iListBoxTimer->Start(TCallBack(DoHandleListBoxSelectionL, this)); - } -} - -// ---------------------------------------------------------------------------- -// From CAknView -// Called by the Avkon view framework when closing. -// ---------------------------------------------------------------------------- -// -void CAiScutSettings::DoDeactivate() -{ - iModel->ActivateObservers(EFalse); - - // deletes iContainer. - CGSBaseView::DoDeactivate(); - - iModel->SetContainer(Container()); -} - -void CAiScutSettings::HandleForegroundEventL(TBool /*aForeground*/) - { - // No implementation required - } - -// ---------------------------------------------------------------------------- -// From MEikMenuObserver -// ---------------------------------------------------------------------------- -// -void CAiScutSettings::DynInitMenuPaneL( - TInt aResourceId, CEikMenuPane* aMenuPane) -{ - if (aMenuPane && aResourceId == R_SCUTSETTINGS_MENUPANE) - { - if (!FeatureManager::FeatureSupported(KFeatureIdHelp)) - { - // Disable help if not supported - aMenuPane->SetItemDimmed(EAknCmdHelp, ETrue); - } - if (iModel->MdcaCount() == 0) - { - aMenuPane->SetItemDimmed(EAiScutSettingsCmdChange, ETrue); - } - } -} - -// --------------------------------------------------------------------------- -// From CGSPluginInterface. 256 -// --------------------------------------------------------------------------- -// -void CAiScutSettings::GetCaptionL(TDes& aCaption) const -{ - iCoeEnv->ReadResourceL(aCaption, R_SCUT_SETTINGS_VIEW_CAPTION); -} - -// --------------------------------------------------------------------------- -// From CGSPluginInterface -// --------------------------------------------------------------------------- -// -TInt CAiScutSettings::PluginProviderCategory() const -{ - return KGSPluginProviderInternal; -} - -// --------------------------------------------------------------------------- -// From CGSPluginInterface -// --------------------------------------------------------------------------- -// -TBool CAiScutSettings::Visible() const -{ - return EFalse; -} - -// --------------------------------------------------------------------------- -// From CGSBaseView -// Returns view id. -// --------------------------------------------------------------------------- -// -CAiScutSettingsContainer* CAiScutSettings::Container() -{ - return static_cast(iContainer); -} - -// --------------------------------------------------------------------------- -// From CGSBaseView -// --------------------------------------------------------------------------- -// -void CAiScutSettings::NewContainerL() -{ - delete iContainer; - iContainer = NULL; - - iContainer = new (ELeave) CAiScutSettingsContainer(); - Container()->SetModel(iModel); - iModel->SetContainer(Container()); -} - -// --------------------------------------------------------------------------- -// From CGSBaseView -// --------------------------------------------------------------------------- -// -void CAiScutSettings::HandleListBoxSelectionL() -{ - Container()->HandleChangeCommandL(); -} - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// -TBool CAiScutSettings::Activated() const - { - return iContainer ? ETrue : EFalse; - } - -// ----------------------------------------------------------------------------- -// CActiveIdleState::DoUpdateSaSetting -// ----------------------------------------------------------------------------- -// -TInt CAiScutSettings::DoHandleListBoxSelectionL(TAny* aAny) - { - CAiScutSettings* self = static_cast(aAny); - if(self) - { - self->iListBoxTimer->Cancel(); - self->HandleListBoxSelectionL(); - } - return KErrNone; - } - - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingsapplist.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingsapplist.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1087 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Application list for settings listbox -* -*/ - - -#include // For KMsvRootIndexEntryIdValue -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "caiscutsettingsapplist.h" -#include "taiscutparser.h" -#include "caiscutsettingsitem.h" -#include "aiscutdefs.h" -#include - -#include "debug.h" - -using namespace Java; - - -const TInt KDriveAndColon = 2; //drive char and colon string length, e.g. "c:" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList::CAiScutSettingsAppList(CCoeEnv* aEnv, MAiScutListObserver& aObserver) - : CActive(CActive::EPriorityLow) // Background task priority. - // Higher priority would block the wait dialog. - , iEnv(aEnv) - , iObserver(aObserver) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::ConstructL() - { - User::LeaveIfError(iApaSession.Connect()); - iMsvSession = CMsvSession::OpenAsObserverL(*this); - - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList* CAiScutSettingsAppList::NewL(CCoeEnv* aEnv, - MAiScutListObserver& aObserver) - { - CAiScutSettingsAppList* self = new (ELeave) CAiScutSettingsAppList(aEnv, aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList::~CAiScutSettingsAppList() - { - if (IsActive()) - { - Cancel(); - } - - delete iAppNotifier; - delete iMsvSession; - iApaSession.Close(); - iListItems.ResetAndDestroy(); - iMailboxes.Close(); // Do not call ResetAndDestroy() to this. - } - -// --------------------------------------------------------------------------- -// From MDesCArray -// Returns the number of descriptor elements in a descriptor array. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::MdcaCount() const - { - return iListItems.Count(); - } - -// --------------------------------------------------------------------------- -// From MDesCArray -// Indexes into a descriptor array. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsAppList::MdcaPoint(TInt aIndex) const - { - if (aIndex < 0 || aIndex >= iListItems.Count()) - { - TPtrC ret(KNullDesC); - return ret; - } - return iListItems[aIndex]->Caption(); - } - -// --------------------------------------------------------------------------- -// From class MMsvSessionObserver. -// Handles an event from the message server. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::HandleSessionEventL( - TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) - { - TBool updated = ETrue; - TBool added = EFalse; - - switch (aEvent) - { - case EMsvEntriesCreated: - case EMsvEntriesDeleted: - case EMsvEntriesChanged: - if (iObserving) - { - CMsvEntry* rootEntry = GetRootEntryL(); - - CleanupStack::PushL(rootEntry); - TBuf<255> mailboxId; - - // Reset iMailboxes - for (TInt j = iMailboxes.Count() - 1; j >= 0; --j) - { - RemoveMailboxL(iMailboxes[j]->Params()); - } - - // Add all mailboxes - for (TInt i = rootEntry->Count() - 1; i >= 0; --i) - { - const TMsvEntry& tentry = (*rootEntry)[i]; - - if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) - { - mailboxId.Num(tentry.Id()); - AddMailboxL(tentry.iDetails, mailboxId); - } - } - - CleanupStack::PopAndDestroy(rootEntry); - } - - if (updated) - { - iObserver.HandleScutListEventL(MAiScutListObserver::EAppListUpdated, added); - } - break; - - default: - break; - } - } - -// --------------------------------------------------------------------------- -// From class MApaAppListServObserver. -// Handles a change in the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::HandleAppListEvent(TInt /*aEvent*/) - { - TRAP_IGNORE(UpdateAppListL()); - } - -// --------------------------------------------------------------------------- -// Starts the asynchronous application list initialization. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::StartL() - { - iListItems.ResetAndDestroy(); - - AddStaticItemsL(); - AddMailboxesL(); - AddExtraItemsFromCRL(); - - if (iApaSession.GetAllApps() == KErrNone && - iApaSession.AppCount(iTotalAppCount) == KErrNone) - { - CompleteSelf(); - } - } - -// --------------------------------------------------------------------------- -// Checks if the application list is ready to be shown. -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsAppList::IsReady() const - { - return iReady; - } - -// --------------------------------------------------------------------------- -// Tells the application list to start or stop observing for changes. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::SetObservingL(TBool aObserving) - { - delete iAppNotifier; - iAppNotifier = NULL; - - if (aObserving) - { - UpdateAppListL(); - - iAppNotifier = CApaAppListNotifier::NewL(this, CActive::EPriorityStandard); - } - - iObserving = aObserving; - } - -// --------------------------------------------------------------------------- -// Finds the index of the given settings item in the application list. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::FindIndex(CAiScutSettingsItem& aItem) - { - TInt index = KErrNotFound; - - TAiScutParser parser; - parser.Parse(aItem.Value()); - TPtrC params(parser.Get(EScutDefParamNameAndValue)); - - TUid uid = aItem.Uid(); - for (TInt i = iListItems.Count() - 1; i >= 0; --i) - { - CAppListItem* item = iListItems[i]; - if ( (item->Uid() == uid) && params.Compare(item->Params()) == 0) - { - index = i; - break; - } - // Url => compare the whole url not just the parameters - else if( item->Type() == EAiScutSettingTypeUrl ) - { - if ( parser.Get(EScutDefComplete).Compare(item->Params()) == 0 ) - { - index = i; - break; - } - } - } - - return index; - } - -// --------------------------------------------------------------------------- -// Returns target application data from the given index. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::GetDataByIndex(TInt aIndex, TUid& aUid, - TPtrC& aParams, TPtrC& aCaption, TAiScutSettingType& aType ) const - { - if (aIndex >= 0 && aIndex < iListItems.Count()) - { - CAppListItem* item = iListItems[aIndex]; - aUid = item->Uid(); - aType = item->Type(); - aParams.Set(item->Params()); - aCaption.Set(item->Caption()); - return KErrNone; - } - - return KErrNotFound; - } - -// --------------------------------------------------------------------------- -// From CActive -// Implements cancellation of an outstanding request. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// From CActive -// Performs one step of the app list initialization. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::RunL() - { - TApaAppInfo appInfo; - TInt err = GetNextValidApp(appInfo); - - switch (err) - { - case KErrNone: - AddApplicationL(appInfo); - CompleteSelf(); - break; - - case RApaLsSession::ENoMoreAppsInList: - iReady = ETrue; - iObserver.HandleScutListEventL(MAiScutListObserver::EAppListReady, EFalse); - break; - - //Indicates that an RApaLsSession member function was called before the session's - // application list is fully populated. - case RApaLsSession::EAppListInvalid: - StartL(); // Just try again. - break; - - default: - User::LeaveIfError(err); - break; - } - } - -// --------------------------------------------------------------------------- -// From CActive -// Handles an error situation. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::RunError(TInt aError) - { - return aError; - } - -// --------------------------------------------------------------------------- -// Completes own request status to make sure active scheduler calls RunL again. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::CompleteSelf() - { - if (!IsActive()) - { - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - SetActive(); - } - } - -// --------------------------------------------------------------------------- -// Adds an application to the list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddApplicationL(TApaAppInfo& aAppInfo) - { - TBool allowed = ETrue; - - // EasyVoIP is only added when VoIP is supported - if (aAppInfo.iUid == KScutEasyVoIPApplicationUid) - { - // Check VoIP variation status - TInt voipStatus = 0; - // For checking VoIP variation status - CRepository* repository = CRepository::NewL(KCRUidTelephonySettings); - repository->Get(KDynamicVoIP, voipStatus); - delete repository; - allowed = (voipStatus && FeatureManager::FeatureSupported(KFeatureIdCommonVoip)); - - __PRINTS( "XAI: CAiScutSettingsAppList::AddApplicationL"); - __PRINT( __DBG_FORMAT( "XAI: voipStatus = %d, allowed = %d"), voipStatus, allowed); - } - - // VoIP launcher is always invisible in shortcuts. - if (aAppInfo.iUid == KScutVoIPLauncherUid) - { - allowed = EFalse; - } - - if (iObserver.IsHidden(aAppInfo.iUid)) - { - allowed = EFalse; - } - - if (allowed) - { - CAppListItem* listItem = CAppListItem::NewLC(aAppInfo.iUid, aAppInfo.iCaption); - listItem->SetType( EAiScutSettingTypeApplication ); - TLinearOrder sortMethod(CAppListItem::CompareCaption); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - } - } - -// --------------------------------------------------------------------------- -// Adds the static list items to the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddStaticItemsL() - { - HBufC* caption = NULL; - CAppListItem* listItem = NULL; - TLinearOrder sortMethod(CAppListItem::CompareCaption); - - // Connectivity Status item - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_CONNECTIVITY_STATUS, iEnv); - listItem = CAppListItem::NewLC(KScutGeneralSettingsUid, *caption); - listItem->SetParamsL(KScutParamConnectivityView); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - - // New Message item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_MSG, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamNewMsg); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - - // New Email item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_EMAIL, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamNewEmail); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - -#ifdef __SYNCML_DS_EMAIL - // New SyncML mail item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_SYNCML_MAIL, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamNewSyncMLMail); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; -#endif - - if (FeatureManager::FeatureSupported(KFeatureIdMmsPostcard) - && IsInRom( KScutPostcardEditorUid ) ) - { - // New Postcard item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_POSTCARD, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamNewPostcard); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - } - - if (FeatureManager::FeatureSupported(KFeatureIdAudioMessaging)) - { - // New Audio Message item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_AUDIO_MSG, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamNewAudioMsg); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - } - - // Select Message type item. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_SELECT_MSG_TYPE, iEnv); - listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); - listItem->SetParamsL(KScutParamSelectMsgType); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - // Installation view. - caption = StringLoader::LoadLC(R_SCUT_SETTINGS_APPMNGR, iEnv); - listItem = CAppListItem::NewLC(KScutGeneralSettingsUid, *caption); - listItem->SetParamsL(KScutParamInstallationsView); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - caption = NULL; - listItem = NULL; - } - -// --------------------------------------------------------------------------- -// Adds extra list items to the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddExtraItemsL() - { - // No Effect item. - HBufC* caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NO_EFFECT, iEnv); - CAppListItem* listItem = CAppListItem::NewLC(KScutSettingsDllUid, *caption); - listItem->SetParamsL(KScutParamNoEffect); - listItem->SetType( EAiScutSettingTypeApplication ); - User::LeaveIfError(iListItems.Insert(listItem, 0)); // insert as first item. - CleanupStack::Pop(listItem); - CleanupStack::PopAndDestroy(caption); - } - -void CAiScutSettingsAppList::AddExtraItemsFromCRL() - { - CRepository *cr = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); - User::LeaveIfNull( cr ); - - CleanupStack::PushL( cr ); - - TUint32 crKey = KAIExtraShortcutsKeyRangeStart; - TBool moreSettings = ETrue; - TInt err = KErrNone; - TAiScutParser parser; - - HBufC* settingValue = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr settingValuePtr = settingValue->Des(); - - while( moreSettings ) - { - err = cr->Get( crKey++, settingValuePtr ); - if ( err == KErrNone && settingValue->Length() > 0 ) - { - CAppListItem* listItem = NULL; - parser.Parse( *settingValue ); - - // First try to find the custom title - HBufC* caption = HBufC::NewLC( settingValue->Length() ); - TPtr captionPtr = caption->Des(); - TInt err = parser.CustomTitle( captionPtr ); - TUid appUid = parser.Uid(); - - if ( err != KErrNone || caption->Length() <= 0 ) - { - CleanupStack::PopAndDestroy( caption ); - caption = NULL; - } - - if ( !caption ) - { - // Web address... - if ( parser.Type() == EScutWebAddress || parser.Type() == EScutUnknown ) - { - TUriParser parser; - TInt err = parser.Parse(*settingValue); - - if (err == KErrNone) - { - // Remove scheme from the url. - caption = parser.Extract(EUriHost).AllocLC(); - } - else - { - caption = settingValue->AllocLC(); - } - } - // ...application. Nothing else supported at the moment - else - { - TApaAppInfo appInfo; - err = iApaSession.GetAppInfo(appInfo, appUid); - if (err == KErrNone) - { - caption = appInfo.iCaption.AllocLC(); - } - } - } - if ( caption ) - { - listItem = CAppListItem::NewLC( KNullUid , *caption ); - listItem->SetParamsL( *settingValue ); - listItem->SetType( EAiScutSettingTypeUrl ); - TLinearOrder sortMethod(CAppListItem::CompareCaption); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop( listItem ); - CleanupStack::PopAndDestroy( caption ); - } - } - else - { - moreSettings = EFalse; - } - } - - - - CleanupStack::PopAndDestroy( settingValue ); - CleanupStack::PopAndDestroy( cr ); - } -// --------------------------------------------------------------------------- -// Removes extra list items from the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::RemoveExtraItemsL() - { - // No Effect item. - CAppListItem* listItem = iListItems[0]; - iListItems.Remove(0); - if (listItem) - { - delete listItem; - listItem = NULL; - } - } - -// --------------------------------------------------------------------------- -// Returns the root entry containing mailboxes. -// --------------------------------------------------------------------------- -// -CMsvEntry* CAiScutSettingsAppList::GetRootEntryL() - { - return iMsvSession->GetEntryL(KMsvRootIndexEntryIdValue); - } - -// --------------------------------------------------------------------------- -// Adds remote mailboxes to the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddMailboxesL() - { - CMsvEntry* rootEntry = GetRootEntryL(); - - CleanupStack::PushL(rootEntry); - TBuf<255> mailboxId; - - for (TInt i = rootEntry->Count() - 1; i >= 0; --i) - { - const TMsvEntry& tentry = (*rootEntry)[i]; - - if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) - { - mailboxId.Num(tentry.Id()); - AddMailboxL(tentry.iDetails, mailboxId); - } - } - - CleanupStack::PopAndDestroy(rootEntry); - } - -// --------------------------------------------------------------------------- -// Adds a mailbox to the list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddMailboxL(const TDesC& aMailbox, const TDesC& aMailboxId) -{ - CAppListItem* listItem = CAppListItem::NewLC(KScutMessagingUid, aMailbox); - - // Insert params containing mailbox id - HBufC* params = HBufC::NewLC(KScutParamMailbox().Length() + aMailboxId.Length()); - params->Des().Copy(KScutParamMailbox); - params->Des().Append(aMailboxId); - listItem->SetParamsL(*params); - listItem->SetType( EAiScutSettingTypeApplication ); - CleanupStack::PopAndDestroy(params); - - TLinearOrder sortMethod(CAppListItem::CompareCaption); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); - User::LeaveIfError(iMailboxes.Append(listItem)); - listItem = NULL; -} - -// --------------------------------------------------------------------------- -// Removes a mailbox from the list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::RemoveMailboxL(const TDesC& aMailboxParam) - { - for (TInt i = iListItems.Count() - 1; i >= 0; --i) - { - CAppListItem* listItem = iListItems[i]; - if (aMailboxParam.Compare(listItem->Params()) == 0) - { - // Also remove the mailbox from the mailbox array - for (TInt j = iMailboxes.Count() - 1; j >= 0; --j) - { - if (aMailboxParam.Compare(iMailboxes[j]->Params()) == 0) - { - iMailboxes.Remove(j); - } - } - - iListItems.Remove(i); - delete listItem; - listItem = NULL; - - break; - } - } - } - -// --------------------------------------------------------------------------- -// Gets the next valid application from application architecture server. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::GetNextValidApp(TApaAppInfo& aAppInfo) - { - TInt err = KErrNone; - TBool validAppFound = EFalse; - - while (!validAppFound) - { - TApaAppInfo appInfo; - err = iApaSession.GetNextApp(appInfo); - if (err == KErrNone) - { - TApaAppCapabilityBuf capBuf; - TApaAppCapability cap; - - if ((iApaSession.GetAppCapability(capBuf, appInfo.iUid) == KErrNone)) - { - cap = capBuf(); - - TInt screenNumber(0); - err = iApaSession.GetDefaultScreenNumber( screenNumber, appInfo.iUid ); - - if ((err == KErrNone) && (cap.iAppIsHidden == EFalse) && (screenNumber == 0)) - { - aAppInfo = appInfo; - validAppFound = ETrue; - } - } - } - else - { - return err; - } - } - - return err; - } - -// --------------------------------------------------------------------------- -// Updates the application list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::UpdateAppListL() - { - TBool updated = EFalse; - TBool added = EFalse; - - TInt totalAppCount = 0; - - if (iApaSession.AppCount(totalAppCount) == KErrNone) - { - if (totalAppCount < iTotalAppCount) - { - RemoveUninstalledAppFromListL(iTotalAppCount - totalAppCount); - updated = ETrue; - added = EFalse; - } - else if (totalAppCount > iTotalAppCount) - { - AddInstalledAppToListL(totalAppCount - iTotalAppCount); - updated = ETrue; - added = ETrue; - } - - iTotalAppCount = totalAppCount; - } - - if (updated) - { - iObserver.HandleScutListEventL(MAiScutListObserver::EAppListUpdated, added); - } - } - -// --------------------------------------------------------------------------- -// Figures out which application is missing from the list and adds it. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::AddInstalledAppToListL(TInt aCount) - { - TInt added = 0; - TApaAppInfo appInfo; - TInt err = GetNextValidApp(appInfo); - - while (err == KErrNone) - { - TBool found = EFalse; - - for (TInt i = iListItems.Count() - 1; i >= 0; --i) - { - if (iListItems[i]->Uid() == appInfo.iUid) - { - found = ETrue; - break; - } - } - - if (!found) - { - AddApplicationL(appInfo); - if (++added == aCount) - { - // Found all of them, no need to go further - return ; - } - } - - err = GetNextValidApp(appInfo); - } - - // create registry - CJavaRegistry* registry = CJavaRegistry::NewLC(); - - // get all uids stored in registry - RArray uids; - registry->GetRegistryEntryUidsL( uids ); - - CleanupClosePushL(uids); - - for (TInt javaIndex = 0; javaIndex < uids.Count(); ++javaIndex) - { - TInt found = EFalse; - for (TInt listIndex = 0; listIndex < iListItems.Count(); ++listIndex ) - { - if (iListItems[listIndex]->Uid() == uids[javaIndex]) - { - found = ETrue; - } - } - if (!found) - { - // get registry entry by uid (i.e. the first entry) - CJavaRegistryEntry* entry = - registry->RegistryEntryL( uids[javaIndex] ); - if( entry ) - { - CleanupStack::PushL(entry); - - // get entry properties (i.e. name) - const TDesC& name = entry->Name(); - TUid uid = entry->Uid(); - - CAppListItem* listItem = CAppListItem::NewLC(uid, name); - listItem->SetType( EAiScutSettingTypeApplication ); - TLinearOrder sortMethod(CAppListItem::CompareCaption); - if (entry->Type() >= EGeneralApplication) - { - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - ++added; - } - else - { - delete listItem; - } - CleanupStack::Pop(listItem); - - CleanupStack::PopAndDestroy(entry); - } - if (added == aCount) - { - break; - } - } - } - CleanupStack::PopAndDestroy(); // uids - CleanupStack::PopAndDestroy(registry); - } - -// --------------------------------------------------------------------------- -// Figures out which application should not be in the list and removes it. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::RemoveUninstalledAppFromListL(TInt aCount) - { - TInt removed = 0; - - for (TInt i = iListItems.Count() - 1; i >= 0; --i) - { - CAppListItem* listItem = iListItems[i]; - TApaAppInfo ignored; - if (iApaSession.GetAppInfo(ignored, listItem->Uid()) == KErrNotFound) - { - iListItems.Remove(i); - delete listItem; - listItem = NULL; - - if (++removed == aCount) - { - return ; - } - } - } - // create registry - CJavaRegistry* registry = CJavaRegistry::NewLC(); - // get all uids stored in registry - RArray uids; - registry->GetRegistryEntryUidsL( uids ); - - CleanupClosePushL(uids); - - for (TInt listIndex = iListItems.Count(); listIndex >= 0 ; --listIndex ) - { - TInt found = EFalse; - for (TInt javaIndex = 0; javaIndex < uids.Count(); ++javaIndex) - { - if (iListItems[listIndex]->Uid() == uids[javaIndex]) - { - found = ETrue; - } - } - if (!found) - { - // Item removed, remove from item list - CAppListItem* listItem = iListItems[listIndex]; - iListItems.Remove(listIndex); - delete listItem; - if (++removed == aCount) - { - break; - } - } - } - CleanupStack::PopAndDestroy(); // uids - CleanupStack::PopAndDestroy(registry); - } - -TBool CAiScutSettingsAppList::IsNonNative(const TUid& aUid) - { - TBool ret = EFalse; - - const TUid KMidletAppType = { 0x10210E26 }; - TUid typeuid = KNullUid; - - if (KErrNone == iApaSession.GetAppType(typeuid, aUid)) - { - if (typeuid == KMidletAppType) - { - ret = ETrue; - } - } - - return ret; - } - - -TBool CAiScutSettingsAppList::IsInRom( const TUid& aUid ) - { - TBool inROM = EFalse; - - TApaAppInfo appInfo; - if( iApaSession.GetAppInfo( appInfo, aUid ) == KErrNone ) - { - // Does the full path start with z: - if( appInfo.iFullName.FindC( - PathInfo::RomRootPath().Left( KDriveAndColon ) ) >= 0 ) - { - inROM = ETrue; - } - } - return inROM; - } - - -// --------------------------------------------------------------------------- -// Nested class to store individual application list items -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList::CAppListItem::CAppListItem(TUid aUid) : iUid(aUid) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::CAppListItem::ConstructL(const TDesC& aCaption) - { - iCaption = aCaption.AllocL(); - // Defaults to application - iType = EAiScutSettingTypeApplication; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList::CAppListItem* CAiScutSettingsAppList::CAppListItem::NewLC( - TUid aUid, const TDesC& aCaption) - { - CAppListItem* self = new (ELeave) CAppListItem(aUid); - CleanupStack::PushL(self); - self->ConstructL(aCaption); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList::CAppListItem::~CAppListItem() - { - delete iCaption; - delete iParams; - } - -// --------------------------------------------------------------------------- -// Compare method used to add the items to the list in sorted order. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsAppList::CAppListItem::CompareCaption(const CAppListItem& aFirst, - const CAppListItem& aSecond) - { - return aFirst.iCaption->Des().CompareC(*aSecond.iCaption); - } - -// --------------------------------------------------------------------------- -// Returns the item target application uid. -// --------------------------------------------------------------------------- -// -TUid CAiScutSettingsAppList::CAppListItem::Uid() const - { - return iUid; - } - -// --------------------------------------------------------------------------- -// Returns the item target application caption. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsAppList::CAppListItem::Caption() const - { - return TPtrC(*iCaption); - } - -// --------------------------------------------------------------------------- -// Returns the possible parameters for item target. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsAppList::CAppListItem::Params() const - { - TPtrC params; - if (iParams) - { - params.Set(*iParams); - } - return params; - } - -// --------------------------------------------------------------------------- -// Sets the parameters for the item target. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsAppList::CAppListItem::SetParamsL(const TDesC& aParams) - { - HBufC* newParams = aParams.AllocL(); - delete iParams; - iParams = newParams; - } - -TAiScutSettingType CAiScutSettingsAppList::CAppListItem::Type() const -{ - return iType; -} - -void CAiScutSettingsAppList::CAppListItem::SetType( TAiScutSettingType aType ) -{ - iType = aType; -} -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingsbkmlist.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingsbkmlist.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,307 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bookmark list for settings listbox -* -*/ - - -#include -#include // For CActiveFavouritesDbNotifier - -#include -#include - -#include "caiscutsettingsmodel.h" -#include "caiscutsettingsapplist.h" -#include "caiscutsettingsbkmlist.h" -#include "taiscutparser.h" -#include "caiscutsettingsitem.h" -#include "aiscutdefs.h" - -#include "debug.h" - - -_LIT( KText, "bkm=0x%x" ); -const TInt KTBUF16 = 16; - -// ======== MEMBER FUNCTIONS ======== - -CAiScutSettingsBkmList::CAiScutSettingsBkmList( - CCoeEnv* aEnv, - CAiScutSettingsModel* aModel, - MAiScutListObserver& aObserver - ) - : iEnv(aEnv) - , iModel(aModel) - , iObserver(aObserver) -{ -} - -void CAiScutSettingsBkmList::ConstructL() -{ -} - -CAiScutSettingsBkmList* CAiScutSettingsBkmList::NewL( - CCoeEnv* aEnv, - CAiScutSettingsModel* aModel, - MAiScutListObserver& aObserver) -{ - CAiScutSettingsBkmList* self = new (ELeave) CAiScutSettingsBkmList( - aEnv, aModel, aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -CAiScutSettingsBkmList::~CAiScutSettingsBkmList() -{ - iListItems.ResetAndDestroy(); - delete iBookmarkDbObserver; -} - -// --------------------------------------------------------------------------- -// From MDesCArray -// Returns the number of descriptor elements in a descriptor array. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsBkmList::MdcaCount() const -{ - return iListItems.Count(); -} - -// --------------------------------------------------------------------------- -// From MDesCArray -// Indexes into a descriptor array. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsBkmList::MdcaPoint(TInt aIndex) const -{ - if (aIndex < 0 || aIndex >= iListItems.Count()) - { - TPtrC ret(KNullDesC); - return ret; - } - return iListItems[aIndex]->Caption(); -} - -// --------------------------------------------------------------------------- -// Gets bookmark list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::GetBookmarkListL() -{ - iListItems.ResetAndDestroy(); - - iModel->ReadBookmarksL(); - - TInt count = iModel->BookmarkCount(); - - for (TInt i = count - 1; i >= 0; i--) // newest on top - { - CFavouritesItem* item = iModel->GetBookmark(i); - - TUid uid = TUid::Uid(item->Uid()); - TPtrC name = item->Name(); - - AddBookmarkL(uid, name); - } -} - -// --------------------------------------------------------------------------- -// Tells the bookmark list to start or stop observing for changes. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::SetObservingL(TBool aObserving) -{ - delete iBookmarkDbObserver; - iBookmarkDbObserver = NULL; - - if (aObserving) - { - - iBookmarkDbObserver = new (ELeave) CActiveFavouritesDbNotifier( - iModel->FavouritesDb(), *this); - iBookmarkDbObserver->Start(); - } - - iObserving = aObserving; -} - -// --------------------------------------------------------------------------- -// Finds the index of the given settings item in the bookmark list. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsBkmList::FindIndex(CAiScutSettingsItem& aItem) -{ - TInt index = KErrNotFound; - - TAiScutParser parser; - parser.Parse(aItem.Value()); - TUid uid = parser.ParseUid(parser.Get(EScutDefParamValue)); - - for (TInt i = iListItems.Count() - 1; i >= 0; --i) - { - if (iListItems[i]->Uid() == uid) - { - index = i; - break; - } - } - - return index; -} - -// --------------------------------------------------------------------------- -// Returns target bookmark data from the given index. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsBkmList::GetDataByIndex( - TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const -{ - if (aIndex >= 0 && aIndex < iListItems.Count()) - { - CBkmListItem* item = iListItems[aIndex]; - aParams.Set(item->Params()); - aCaption.Set(item->Caption()); - return KErrNone; - } - - return KErrNotFound; -} - -// --------------------------------------------------------------------------- -// Adds an bookmark to the list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::AddBookmarkL(TUid aUid, const TDesC& aCaption) -{ - CBkmListItem* listItem = CBkmListItem::NewLC(aUid, aCaption); - - TBuf buf; - buf.Format( KText, aUid.iUid ); - - listItem->SetParamsL(buf); - TLinearOrder sortMethod(CBkmListItem::CompareCaption); - User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); - CleanupStack::Pop(listItem); -} - -// --------------------------------------------------------------------------- -// Updates the bookmark list. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::UpdateBkmListL() -{ - GetBookmarkListL(); - iObserver.HandleScutListEventL(MAiScutListObserver::EBkmListUpdated, EFalse); -} - -// ----------------------------------------------------------------------------- -// From class MFavouritesDbObserver. -// Handles database event. -// ----------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent) -{ - __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsBkmList::HandleFavouritesDbEventL aEvent = %d"), aEvent); - - if (aEvent == RDbNotifier::ECommit) - { - UpdateBkmListL(); - } -} - -// --------------------------------------------------------------------------- -//Nested class to store individual bookmark list items -// --------------------------------------------------------------------------- -// -CAiScutSettingsBkmList::CBkmListItem::CBkmListItem(TUid aUid) : iUid(aUid) -{ -} - -void CAiScutSettingsBkmList::CBkmListItem::ConstructL(const TDesC& aCaption) -{ - iCaption = aCaption.AllocL(); -} - -CAiScutSettingsBkmList::CBkmListItem* CAiScutSettingsBkmList::CBkmListItem::NewLC( - TUid aUid, const TDesC& aCaption) -{ - CBkmListItem* self = new (ELeave) CBkmListItem(aUid); - CleanupStack::PushL(self); - self->ConstructL(aCaption); - return self; -} - -CAiScutSettingsBkmList::CBkmListItem::~CBkmListItem() -{ - delete iCaption; - delete iParams; -} - -// --------------------------------------------------------------------------- -// Compare method used to add the items to the list in sorted order. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsBkmList::CBkmListItem::CompareCaption(const CBkmListItem& aFirst, - const CBkmListItem& aSecond) -{ - return aFirst.iCaption->Des().CompareC(*aSecond.iCaption); -} - -// --------------------------------------------------------------------------- -// Returns the item target bookmark uid. -// --------------------------------------------------------------------------- -// -TUid CAiScutSettingsBkmList::CBkmListItem::Uid() const -{ - return iUid; -} - -// --------------------------------------------------------------------------- -// Returns the item target bookmark caption. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsBkmList::CBkmListItem::Caption() const -{ - return TPtrC(*iCaption); -} - -// --------------------------------------------------------------------------- -// Returns the possible parameters for item target. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsBkmList::CBkmListItem::Params() const -{ - TPtrC params; - if (iParams) - { - params.Set(*iParams); - } - return params; -} - -// --------------------------------------------------------------------------- -// Sets the parameters for the item target. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsBkmList::CBkmListItem::SetParamsL(const TDesC& aParams) -{ - HBufC* newParams = aParams.AllocL(); - delete iParams; - iParams = newParams; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingscontainer.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingscontainer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,488 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut settings plug-in container. -* -*/ - - -#include -#include -#include -#include -#include -#include -//#include -#include -#include -#include -#include - -#include -#include - -#include "caiscutsettingscontainer.h" -#include "caiscutsettingsmodel.h" -#include "caiscutsettingsbkmlist.h" -#include "caiscutsettingsitem.h" -#include "aiscutpluginprivatecrkeys.h" -#include "aiscutdefs.h" - -const TUid KUidAI = { 0x101F8701 }; // Active Standby Shortcuts help uid - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsContainer::CAiScutSettingsContainer() -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::ConstructL(const TRect& aRect) -{ - iListBox = new (ELeave) CAknSettingStyleListBox; - BaseConstructL(aRect, R_SCUT_SETTINGS_VIEW_TITLE, NULL); - - iOldType = EAiScutSettingTypeUndefined; - - CheckMiddleSoftkeyLabelL(); - - iModel->ActivateObservers(ETrue); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsContainer::~CAiScutSettingsContainer() -{ - HideWaitNoteDialog(); -} - -// --------------------------------------------------------------------------- -// Sets pointer to settings plug-in model. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::SetModel(CAiScutSettingsModel* aModel) -{ - iModel = aModel; -} - -// --------------------------------------------------------------------------- -// Chandles a setting change command. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::HandleChangeCommandL() -{ - if ( iChangeProcessInProgress ) - { - return; - } - TBool changed = EFalse; - TInt current = iListBox->CurrentItemIndex(); - CAiScutSettingsItem* item = iModel->Item(current); - if (!item) - { - return ; - } - - TUint32 key = item->Key(); - TBool locked = (0 != (key & KScutFlagBitLocked)); - - if (locked) - { - HBufC* text = iCoeEnv->AllocReadResourceLC(R_SCUT_SETTINGS_TXT_FIXED_ITEM); - CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue); - note->ExecuteLD(*text); - CleanupStack::PopAndDestroy(text); - } - else - { - TAiScutSettingType oldType = item->Type(); - TInt newType = oldType; - - CDesCArrayFlat* array = iCoeEnv->ReadDesC16ArrayResourceL( - R_SCUT_CHANGE_TO_PAGE_LBX); - CleanupStack::PushL(array); - - CAknListQueryDialog* dialog = new(ELeave)CAknListQueryDialog(&newType); - CleanupStack::PushL(dialog); - dialog->PrepareLC(R_SCUT_LISTQUERY_CHANGE_TO_PAGE); - CleanupStack::Pop(dialog); - dialog->SetItemTextArray(array); - dialog->SetOwnershipType(ELbmDoesNotOwnItemArray); - iChangeProcessInProgress = ETrue; - if (dialog->RunLD()) - { - item = iModel->Item(current); - if (newType == EAiScutSettingTypeUrl) - { - changed = HandleUrlChangeCommandL(*item, (newType != oldType)); - } - else if (newType == EAiScutSettingTypeBookmark) - { - changed = HandleBookmarkChangeCommandL(*item, (newType != oldType)); - } - else - { - changed = HandleAppListChangeCommandL(*item, (newType != oldType)); - } - if ( changed ) - { - ResetCurrentListL(current); - } - - } - iChangeProcessInProgress = EFalse; - CleanupStack::PopAndDestroy(array); - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsContainer::IsChangeDialogShowing() -{ - return (iAppListDialog || iBkmListDialog || iEditDialog); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::CloseChangeDialog() -{ - TKeyEvent keyEvent; - - keyEvent.iCode = EKeyEscape; - keyEvent.iScanCode = EStdKeyEscape; - keyEvent.iModifiers = 0; - keyEvent.iRepeats = 0; - - CCoeControl* dialog = NULL; - - if (iAppListDialog) - { - dialog = static_cast(iAppListDialog); - } - else if (iBkmListDialog) - { - dialog = static_cast(iBkmListDialog); - } - else if (iEditDialog) - { - dialog = static_cast(iEditDialog); - } - - if (dialog) - { - TRAP_IGNORE(dialog->OfferKeyEventL(keyEvent, EEventKey)); - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::ResetCurrentListL(TInt aIndex) -{ - if (iModel->MdcaCount() == 0) - { - iListBox->HandleItemRemovalL(); - } - else - { - iListBox->HandleItemAdditionL(); - } - - iListBox->SetCurrentItemIndex(aIndex); - - CheckMiddleSoftkeyLabelL(); -} - -// --------------------------------------------------------------------------- -// From CGSBaseContainer -// Constructs the settings listbox. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::ConstructListBoxL(TInt /*aResLbxId*/) -{ - iListBox->ConstructL(this, EAknListBoxSelectionList); - - // Set empty listbox's text. - HBufC* text = iCoeEnv->AllocReadResourceLC(R_SCUT_SETTINGS_TXT_ALL_FIXED); - iListBox->View()->SetListEmptyTextL(*text); - CleanupStack::PopAndDestroy(text); - - iListBox->Model()->SetItemTextArray(iModel); - iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); -} - -// --------------------------------------------------------------------------- -// Chandles a setting change command to select application from a list. -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsContainer::HandleAppListChangeCommandL(CAiScutSettingsItem& aItem, - TBool /*aNew*/) -{ - - TBool changed = EFalse; - - iChangeProcessStopped = EFalse; - - if (!iModel->AppList()->IsReady()) - { - ShowWaitNoteDialogL(); // Blocks until applist reports that it is ready. - } - // If wait note was "killed" then don't continue the change process - // If the process is not stopped here it could lead to situation where - // self is deleted before the ShowWaitNoteDialogL() returns - if ( iChangeProcessStopped ) - { - return EFalse; - } - - TUint32 key = aItem.Key(); - TBool optional = (0 != (key & KScutFlagBitOptionallyVisible)); - TBool scrollkey = (0 != ((key & 0xFFFF) < EAiScutSoftKeyLeft)); - - if (optional && scrollkey) - { - iModel->AppList()->AddExtraItemsL(); - } - - TInt index = iModel->AppList()->FindIndex(aItem); - TInt oldIndex = index; - - iAppListDialog = new (ELeave) CAknRadioButtonSettingPage( - R_SCUT_SETTINGS_APPLIST_PAGE, index, iModel->AppList()); - - iAppListDialog->SetSettingTextL(aItem.Title()); - iAppListDialog->ConstructL(); - - if (iAppListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && - index != oldIndex) - { - TUid uid; - TPtrC params; - TPtrC caption; - TAiScutSettingType type; - if (iModel->AppList()->GetDataByIndex(index, uid, params, caption, type) == KErrNone) - { - if ( type == EAiScutSettingTypeUrl ) - { - aItem.ChangeUrlL( params ); - } - else - { - aItem.ChangeApplicationL(uid, params, caption); - } - iModel->SaveItemL(aItem); - changed = ETrue; - } - } - - if (optional && scrollkey) - { - iModel->AppList()->RemoveExtraItemsL(); - } - - iAppListDialog = NULL; - return changed; -} - -// --------------------------------------------------------------------------- -// Chandles a setting change command to select bookmark from a list. -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsContainer::HandleBookmarkChangeCommandL(CAiScutSettingsItem& aItem, - TBool /*aNew*/) -{ - - TBool changed = EFalse; - iModel->BkmList()->GetBookmarkListL(); - TInt index = iModel->BkmList()->FindIndex(aItem); - TInt oldIndex = index; - - iBkmListDialog = new (ELeave) CAknRadioButtonSettingPage( - R_SCUT_SETTINGS_APPLIST_PAGE, index, iModel->BkmList()); - - iBkmListDialog->SetSettingTextL(aItem.Title()); - iBkmListDialog->ConstructL(); - - if (iBkmListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && - index != oldIndex) - { - TPtrC params; - TPtrC caption; - if (iModel->BkmList()->GetDataByIndex(index, params, caption) == KErrNone) - { - aItem.ChangeBookmarkL(params, caption); - iModel->SaveItemL(aItem); - changed = ETrue; - } - } - - iBkmListDialog = NULL; - return changed; -} - -// --------------------------------------------------------------------------- -// Chandles a setting change command to edit an URL. -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsContainer::HandleUrlChangeCommandL(CAiScutSettingsItem& aItem, - TBool aNew) -{ - TBool changed = EFalse; - HBufC* newUrl = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr urlPtr = newUrl->Des(); - - if (!aNew) - { - urlPtr.Copy(aItem.Value()); - } - - if (EditTextL(R_SCUT_TYPE_URL_PAGE , urlPtr)) - { - aItem.ChangeUrlL(urlPtr); - iModel->SaveItemL(aItem); - changed = ETrue; - } - - CleanupStack::PopAndDestroy(newUrl); - return changed; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsContainer::EditTextL(TInt aResId, TDes& aDes) -{ - TBool ret = EFalse; - - iEditDialog = new (ELeave) CAknTextSettingPage(aResId, aDes); - - if (iEditDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) - { - if (aDes.Length()) - { - ret = ETrue; - } - } - - iEditDialog = NULL; - - return ret; -} - -// --------------------------------------------------------------------------- -// Shows the wait note dialog. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::ShowWaitNoteDialogL() -{ - if (!iWaitDialog) - { - iWaitDialog = new (ELeave) CAknWaitDialog( - (reinterpret_cast (&iWaitDialog)), - ETrue // aVisibilityDelayOff - ); - iWaitDialog->ExecuteLD(R_SCUT_WAIT_NOTE); - } -} - -// --------------------------------------------------------------------------- -// Hides the wait note dialog. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::HideWaitNoteDialog() -{ - if (iWaitDialog) - { - TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog. - iWaitDialog = NULL; - } -} - -void CAiScutSettingsContainer::StopShortcutChangeProcess() -{ - iChangeProcessStopped = ETrue; - HideWaitNoteDialog(); - if ( IsChangeDialogShowing() ) - { - CloseChangeDialog(); - } -} - -// --------------------------------------------------------------------------- -// Gets Help -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::GetHelpContext(TCoeHelpContext& aContext) const -{ - aContext.iMajor = KUidAI; - //aContext.iContext = KSET_HLP_PERSONAL_SHORTCUTS; // This is specified in HRH file -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TKeyResponse CAiScutSettingsContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType) -{ - switch (aKeyEvent.iCode) - { - case EKeyUpArrow: - case EKeyDownArrow: - { - TKeyResponse resp = iListBox->OfferKeyEventL(aKeyEvent, aType); - return resp; - } - - case EKeyLeftArrow: - case EKeyRightArrow: - // Listbox takes all event even if it doesn't use them: - return EKeyWasNotConsumed; - - default: - break; - } - - // Now it's iListBox's job to process the key event - return iListBox->OfferKeyEventL(aKeyEvent, aType); -} - -// --------------------------------------------------------------------------- -// Checks if there is a need to update the middle softkey label. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsContainer::CheckMiddleSoftkeyLabelL() -{ - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if (cba) - { - cba->MakeCommandVisible(EAiScutSettingsCmdChange, (iModel->MdcaCount() != 0)); - } -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingsimplementationtable.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingsimplementationtable.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation table for shortcut settings plug-in -* -*/ - - -#include -#include - -#include "caiscutsettings.h" -#include - -/** Implementation table for shortcut settings plug-in */ -const TImplementationProxy KAiScutSettingsImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY( - AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN, CAiScutSettings::NewL) -}; - - -// --------------------------------------------------------------------------- -// Gate/factory function. -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) -{ - aTableCount = - sizeof(KAiScutSettingsImplementationTable) / - sizeof(TImplementationProxy); - return KAiScutSettingsImplementationTable; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingsitem.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingsitem.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,588 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for shortcut setting items -* -*/ - - - -#include -#include -#include // For KMsvRootIndexEntryIdValue -#include -#include // For TUriParser16 -#include -#include -#include "caiscutsettingsitem.h" -#include "caiscutsettingsmodel.h" -#include "aiscutpluginprivatecrkeys.h" -#include "taiscutparser.h" -#include "aiscutdefs.h" -#include "aiscutsettings.hrh" -#include "aidefaultshortcut.h" -#include "debug.h" - -const TInt KMaxBufSize = 250; -// ======== MEMBER FUNCTIONS ======== -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// - -CAiScutSettingsItem::CAiScutSettingsItem( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey) - : iModel(aModel) - , iIndex(aIndex) - , iKey(aKey) -{ -} -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsItem::ReadL(CRepository* aRepository) -{ - if( !aRepository ) - { - return; - } - - HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - // try user key first. - TUint32 key = iKey & KScutBitMaskThemeDefault; - TInt err = aRepository->Get(key, bufferPtr); - - if (err == KErrNone) - { - err = ParseValueL(bufferPtr); - } - - if (err == KErrNone) - { - iKey = key; - } - else - { - // if no user key try default key then. - key = iKey | KScutFlagBitThemeDefault; - err = aRepository->Get(key, bufferPtr); - if (err == KErrNone) - { - err = ParseValueL(bufferPtr); - } - - } - - if (err != KErrNone || - (iType == EAiScutSettingTypeApplication && iModel.IsHidden(iUid))) - { - HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufPtr = buf->Des(); - HBufC* caption = NULL; - - // Get the default shortcut uid for key 'key' - iType = EAiScutSettingTypeApplication; - TAiDefaultShortcut::GetDefaultShortcut(key, iUid, bufPtr); - - err = iModel.GetAppCaption(iUid, bufPtr); - if (err == KErrNone) - { - caption = bufPtr.AllocLC(); - CreateListBoxLineL(*caption); - CleanupStack::PopAndDestroy(caption); - } - - CleanupStack::PopAndDestroy(buf); - - } - - delete iValue; - iValue = NULL; - iValue = bufferPtr.AllocL(); - - CleanupStack::PopAndDestroy(buffer); - - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - TInt CAiScutSettingsItem::Save(CRepository* aRepository) - { - - if( !aRepository ) - { - return KErrGeneral; - } - - iKey = iKey & KScutBitMaskThemeDefault; - - TInt err = aRepository->Set(iKey, Value()); - - return err; - } - - - // --------------------------------------------------------------------------- - // Constructs a new settings item leaving it on the cleanup stack. - // --------------------------------------------------------------------------- - // - CAiScutSettingsItem* CAiScutSettingsItem::NewLC( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey) - { - CAiScutSettingsItem* self = new (ELeave) CAiScutSettingsItem( - aModel, aIndex, aKey); - - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - CAiScutSettingsItem* CAiScutSettingsItem::NewLC( - CAiScutSettingsModel& aModel, - TInt aIndex, - TUint32 aKey, - const TDesC& aValue) - { - CAiScutSettingsItem* self = new (ELeave) CAiScutSettingsItem( - aModel, aIndex, aKey); - - CleanupStack::PushL(self); - self->ConstructL(aValue); - return self; - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - void CAiScutSettingsItem::ConstructL() - { - - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - void CAiScutSettingsItem::ConstructL(const TDesC& aValue) - { - ParseValueL(aValue); - iValue = aValue.AllocL(); - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - CAiScutSettingsItem::~CAiScutSettingsItem() - { - delete iValue; - delete iListBoxLine; - } - - // --------------------------------------------------------------------------- - // - // --------------------------------------------------------------------------- - // - TInt CAiScutSettingsItem::ParseValueL(const TDesC& aValue) - { - HBufC* caption = NULL; - TInt err = KErrNone; - HBufC* buf = HBufC::NewLC(KMaxBufSize); - TPtr bufPtr = buf->Des(); - - TAiScutParser parser; - parser.Parse(aValue); - - TShortcutType type = parser.Type(); - - iUid = parser.Uid(); - iType = EAiScutSettingTypeApplication; - - switch (type) - { - case EScutApplication: - case EScutApplicationWithParams: - case EScutApplicationView: - case EScutLogsMissedCallsView: - case EScutLogsDialledCallsView: - case EScutLogsReceivedCallsView: - case EScutLogsMainView: - err = iModel.GetAppCaption(iUid, bufPtr); - if (err == KErrNone) - { - caption = bufPtr.AllocLC(); - } - break; - - case EScutNewMessage: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NEW_MSG, iModel.Env()); - break; - - case EScutNewEmail: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NEW_EMAIL, iModel.Env()); - break; - - #ifdef __SYNCML_DS_EMAIL - case EScutNewSyncMLMail: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NEW_SYNCML_MAIL, iModel.Env()); - break; - #endif - - case EScutNewPostcard: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NEW_POSTCARD, iModel.Env()); - break; - - case EScutNewAudioMsg: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NEW_AUDIO_MSG, iModel.Env()); - break; - - case EScutNewMsgType: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_SELECT_MSG_TYPE, iModel.Env()); - break; - - case EScutChangeTheme: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_CHANGE_THEME, iModel.Env()); - break; - - case EScutMailbox: - { - err = KErrNotFound; - // Parse the mailbox id from the definition - TLex lex(parser.Get(EScutDefParamValue)); - TInt mailboxId = KErrNone; - lex.Val(mailboxId); - - CMsvSession* msvSession = CMsvSession::OpenAsObserverL(*iModel.AppList()); - CleanupStack::PushL(msvSession); - - CMsvEntry* rootEntry = msvSession->GetEntryL(KMsvRootIndexEntryIdValue); - CleanupStack::PushL(rootEntry); - - // Searching the mailbox name - for (TInt i = rootEntry->Count() - 1; i >= 0; --i) - { - const TMsvEntry& tentry = (*rootEntry)[i]; - - if ((tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) && - tentry.Id() == mailboxId) - { - caption = tentry.iDetails.AllocL(); - err = KErrNone; - break; - } - } - CleanupStack::PopAndDestroy(rootEntry); - CleanupStack::PopAndDestroy(msvSession); - if ( caption ) - { - CleanupStack::PushL( caption ); - } - } - break; - - case EScutNoEffect: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_NO_EFFECT, iModel.Env()); - break; - - case EScutConnectivityStatusView: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_CONNECTIVITY_STATUS, iModel.Env()); - break; - - case EScutApplicationManagerView: - caption = StringLoader::LoadLC( - R_SCUT_SETTINGS_APPMNGR, iModel.Env()); - break; - - case EScutBookmark: - { - // aValue = "localapp:0x102750fb?bkm=0x12345678" - iUid = KScutSettingsDllUid; - iType = EAiScutSettingTypeBookmark; - TUid uid = parser.ParseUid(parser.Get(EScutDefParamValue)); - TRAP(err, iModel.GetBkmCaptionL(uid, bufPtr)); - if (err == KErrNone) - { - caption = bufPtr.AllocLC(); - - __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsItem bkm uid = 0x%x caption = '%S' "), - uid.iUid, caption); - } - } - break; - - case EScutWebAddress: - default: - // treat unknown shortcuts as typed urls. - iUid.iUid = 0; - iType = EAiScutSettingTypeUrl; - HBufC* tmp = HBufC::NewLC( aValue.Length() ); - TPtr tmpPtr = tmp->Des(); - TInt err = parser.CustomTitle( tmpPtr ); - - if ( err != KErrNone || tmp->Length() <= 0 ) - { - CleanupStack::PopAndDestroy( tmp ); - caption = aValue.AllocLC(); - } - else - { - caption = tmp; - } - break; - } - - if (caption) - { - CreateListBoxLineL(*caption); - CleanupStack::PopAndDestroy(caption); - } - - CleanupStack::PopAndDestroy(buf); - return err; - } - - // --------------------------------------------------------------------------- - // Changes the setting item target application. - // --------------------------------------------------------------------------- - // - void CAiScutSettingsItem::ChangeApplicationL(TUid aUid, const TDesC& aParams, - const TDesC& aCaption) - { - iUid = aUid; - iType = EAiScutSettingTypeApplication; - - HBufC* newValue = NULL; - TAiScutParser parser; - parser.ComposeL(newValue, iUid, aParams); - - delete iValue; - iValue = NULL; - iValue = newValue; - - CreateListBoxLineL(aCaption); - } - - // ----------------------------------------------------------------------------- - // Changes the setting item target bookmark. - // ----------------------------------------------------------------------------- - // - void CAiScutSettingsItem::ChangeBookmarkL(const TDesC& aParams, const TDesC& aCaption) - { - iUid = KScutSettingsDllUid; - iType = EAiScutSettingTypeBookmark; - - HBufC* newValue = NULL; - TAiScutParser parser; - parser.ComposeL(newValue, iUid, aParams); - - delete iValue; - iValue = NULL; - iValue = newValue; - - CreateListBoxLineL(aCaption); - } - - // ----------------------------------------------------------------------------- - // Changes the setting item target url. - // ----------------------------------------------------------------------------- - // - void CAiScutSettingsItem::ChangeUrlL(const TDesC& aUrl) - { - iUid.iUid = 0; - iType = EAiScutSettingTypeUrl; - - delete iValue; - iValue = NULL; - iValue = aUrl.AllocL(); - - CreateListBoxLineL(*iValue); - } - - // ----------------------------------------------------------------------------- - // Creates a formatted listbox line. - // ----------------------------------------------------------------------------- - // - void CAiScutSettingsItem::CreateListBoxLineL(const TDesC& aCaption) - { - HBufC* title = CreateItemTitleLC(); - - TPtrC caption; - caption.Set(aCaption); - - TUriParser parser; - TInt err = parser.Parse(aCaption); - if (err == KErrNone) - { - // Remove scheme from the url. - const TDesC& host = parser.Extract(EUriHost); - if (host.Length()) - { - caption.Set(host); - } - } - - // Format (" \t%S\t\t%S") without %S characters. - TInt formatLength = KSettingListboxLineFormat().Length(); - - HBufC* listBoxLine = - HBufC::NewLC(title->Length() + caption.Length() + formatLength); - - TPtr ptr = listBoxLine->Des(); - ptr.Format(KSettingListboxLineFormat, title, &caption); - - delete iListBoxLine; - iListBoxLine = NULL; - iListBoxLine = listBoxLine; - CleanupStack::Pop(listBoxLine); - - TInt titlePos = ptr.Find(*title); - if (titlePos < 0) - { - titlePos = 0; - } - iTitle.Set(ptr.Mid(titlePos, title->Length())); - - CleanupStack::PopAndDestroy(title); - } - - // ----------------------------------------------------------------------------- - // Creates a setting item title. - // ----------------------------------------------------------------------------- - // - HBufC* CAiScutSettingsItem::CreateItemTitleLC() - { - HBufC* title = NULL; - if (iKey & KScutFlagBitOptionallyVisible) - { - // Optionally visible shortcuts are either navigation keys or soft keys. - title = CreateOptionallyVisibleKeyTitleLC(); - } - - // Make sure something gets loaded and put to cleanup stack. - if (!title) - { - title = StringLoader::LoadLC( - R_SCUT_SETTINGS_TXT_LINKN, iIndex+1, iModel.Env()); - } - - __PRINT( __DBG_FORMAT( "XAI: CreateItemTitleLC %d key = 0x%x (0x%x) title = '%S' "), - iIndex+1, iKey, (iKey & 0xFFFF), title); - - return title; - } - - // ----------------------------------------------------------------------------- - // Creates a key title for an optionally visible shortcut. - // ----------------------------------------------------------------------------- - // - HBufC* CAiScutSettingsItem::CreateOptionallyVisibleKeyTitleLC() - { - HBufC* title = NULL; - TInt resourceId = 0; - - switch (iKey & 0xFFFF) - { - case EAiScutScrollKeyLeft: - resourceId = R_SCUT_SETTINGS_SCROLL_LEFT; - break; - - case EAiScutScrollKeyRight: - resourceId = R_SCUT_SETTINGS_SCROLL_RIGHT; - break; - - case EAiScutScrollKeyUp: - resourceId = R_SCUT_SETTINGS_SCROLL_UP; - break; - - case EAiScutScrollKeyDown: - resourceId = R_SCUT_SETTINGS_SCROLL_DOWN; - break; - - case EAiScutSelectionKey: - resourceId = R_SCUT_SETTINGS_SELECTION_KEY; - break; - - case EAiScutSoftKeyLeft: - resourceId = R_SCUT_SETTINGS_SOFTKEY_LEFT; - break; - - case EAiScutSoftKeyRight: - resourceId = R_SCUT_SETTINGS_SOFTKEY_RIGHT; - break; - - default: - resourceId = 0; - break; - } - - if (resourceId) - { - title = StringLoader::LoadLC(resourceId, iModel.Env()); - } - else - { - title = NULL; - } - - return title; - } - - // --------------------------------------------------------------------------- - // Returns the setting item value. - // --------------------------------------------------------------------------- - // - TPtrC CAiScutSettingsItem::Value() const - { - if(iValue) - { - return TPtrC( *iValue ); - } - return TPtrC(KNullDesC); - } - - // --------------------------------------------------------------------------- - // Returns the formatted listbox line descriptor. - // --------------------------------------------------------------------------- - // - TPtrC CAiScutSettingsItem::ListBoxLine() const - { - if(iListBoxLine) - { - return TPtrC( *iListBoxLine ); - } - return TPtrC(KNullDesC); - } -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutsettingsmodel.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutsettingsmodel.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,603 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shrortcut settings plug-in model. -* -*/ - - -#include -#include -#include - -#include "caiscutsettings.h" -#include "caiscutsettingsmodel.h" -#include "caiscutsettingscontainer.h" -#include "caiscutsettingsitem.h" -#include "aiscutpluginprivatecrkeys.h" -#include "aiscutdefs.h" -#include "aiscutappuidparser.h" -#include "aiscutrepositorywatcher.h" - -#include "debug.h" - -LOCAL_C TInt CompareKey(const TUint32& aLeft, const TUint32& aRight) -{ - TBool softkey1 = (0 != ((aLeft & 0xFFFF) >= EAiScutSoftKeyLeft)); - TBool softkey2 = (0 != ((aRight & 0xFFFF) >= EAiScutSoftKeyLeft)); - TUint32 left = aLeft & (KScutBitMaskThemeDefault & KScutBitMaskLocked); - TUint32 right = aRight & (KScutBitMaskThemeDefault & KScutBitMaskLocked); - - // Softkey shortcuts are always sorted to be smallest. - if (!(softkey1 && softkey2)) - { - if (softkey1) - { - return -1; - } - else if (softkey2) - { - return 1; - } - } - - if (left < right) - { - return -1; - } - else if (left > right) - { - return 1; - } - - return 0; -} - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsModel* CAiScutSettingsModel::NewL(CAiScutSettings& aPlugin, - CCoeEnv* aEnv) -{ - CAiScutSettingsModel* self = new (ELeave) CAiScutSettingsModel(aPlugin, aEnv); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsModel::CAiScutSettingsModel(CAiScutSettings& aPlugin, CCoeEnv* aEnv) - : iPlugin(aPlugin), iEnv(aEnv) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsModel::~CAiScutSettingsModel() -{ - ActivateObservers(EFalse); - - delete iSettingsNotifier; - delete iRepository; - - delete iHiddenAppsNotifier; - delete iHiddenAppsRepository; - - iHiddenApps.Close(); - - delete iAppList; - delete iBkmList; - - iSettings.ResetAndDestroy(); - iKeys.Reset(); - delete iFavItemList; - iBookmarkDb.Close(); - iBookmarkSess.Close(); - iApaSession.Close(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::ConstructL() -{ - User::LeaveIfError(iApaSession.Connect()); - User::LeaveIfError(iBookmarkSess.Connect()); - User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); - - iRepository = CRepository::NewL(KCRUidShortcutItems); - - iHiddenAppsRepository = CRepository::NewL(KCRUidMenu); - - // Create cenrep key observer for monitoring settings changes - // when theme is changed. - iSettingsNotifier = CAiScutRepositoryWatcher::NewL( - KCRUidShortcutItems, - TCallBack(HandleShortcutsChanged, this), - iRepository); - - iSettingsNotifier->StartListeningL(); - - iHiddenAppsNotifier = CAiScutRepositoryWatcher::NewL( - KCRUidMenu, - KMenuHideApplication, - CCenRepNotifyHandler::EStringKey, - TCallBack(HandleHiddenAppsChanged, this), - iHiddenAppsRepository); - - iHiddenAppsNotifier->StartListeningL(); - - GetHiddenAppsL(); - - iAppList = CAiScutSettingsAppList::NewL(iEnv, *this); - iAppList->StartL(); - - iBkmList = CAiScutSettingsBkmList::NewL(iEnv, this, *this); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::SetSettingsKeys(RArray& aKeys) - { - iKeys.Reset(); - - for( TInt i = 0; i < aKeys.Count(); i++ ) - { - TUint32 value( aKeys[i] ); - - iKeys.Append( value ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::UpdateSettingsL() -{ - if( !iPlugin.Activated() ) - { - return; - } - - iSettings.ResetAndDestroy(); - - TInt keyCount( iKeys.Count() ); - - if( keyCount > 0 ) - { - for( TInt i = 0; i < keyCount; i++ ) - { - CAiScutSettingsItem* setting = CAiScutSettingsItem::NewLC( - *this, i, iKeys[i] ); - - setting->ReadL( iRepository ); - - User::LeaveIfError( iSettings.Append( setting ) ); - CleanupStack::Pop( setting ); - } - - return; - } - - RArray defaultKeys; - CleanupClosePushL(defaultKeys); - - // Find the default keys and user defined keys. - iRepository->FindL( - KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, defaultKeys); - - TInt i; - TUint32 defaultKey; - TUint32 userKey; - TInt count; - TInt lockedKeys = 0; - TInt visibleKeys = 0; - - TLinearOrder order(CompareKey); - defaultKeys.Sort(order); - - count = defaultKeys.Count(); - for (i = 0; i < count; ++i) - { - defaultKey = defaultKeys[i]; - userKey = defaultKey & KScutBitMaskThemeDefault; - // We show only actual shortcuts - if ( (! ( defaultKey & KScutFlagBitIconOverride )) && - (! ( defaultKey & KScutFlagBitToolbarShortcut ))) - { - __PRINT( __DBG_FORMAT( "XAI: %d. key = 0x%x"), i+1, - (defaultKey & (KScutBitMaskThemeDefault & KScutBitMaskLocked))); - - if (!(userKey & KScutFlagBitOptionallyVisible)) - { - visibleKeys++; - } - - TBool locked = (0 != (userKey & KScutFlagBitLocked)); - - if (locked) - { - lockedKeys++; - } - else - { - CAiScutSettingsItem* setting = CAiScutSettingsItem::NewLC( - *this, visibleKeys-1, defaultKey); - - setting->ReadL(iRepository); - - User::LeaveIfError(iSettings.Append(setting)); - CleanupStack::Pop(setting); - } - } - - } - - __PRINT( __DBG_FORMAT("XAI: %d keys, %d locked"), count, lockedKeys); - - CleanupStack::PopAndDestroy(&defaultKeys); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::UpdateSettingsContainerL() -{ - if (iContainer) - { - if (iContainer->IsChangeDialogShowing()) - { - iContainer->CloseChangeDialog(); - } - } - - UpdateSettingsL(); - - if (iContainer) - { - iContainer->ResetCurrentListL(0); - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::GetHiddenAppsL() -{ - HBufC* buffer = HBufC::NewLC( - NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr bufferPtr = buffer->Des(); - - iHiddenAppsRepository->Get(KMenuHideApplication, bufferPtr); - - __PRINT( __DBG_FORMAT("XAI: CAiScutSettingsModel::GetHiddenAppsL '%S' "), buffer); - - iHiddenApps.Reset(); - TAiScutAppUidParser uidParser(bufferPtr, iHiddenApps); - uidParser.ParseL(); - - CleanupStack::PopAndDestroy(buffer); -} - -// --------------------------------------------------------------------------- -// From MDesCArray -// Returns the number of descriptor elements in a descriptor array. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::MdcaCount() const -{ - return iSettings.Count(); -} - -// --------------------------------------------------------------------------- -// From MDesCArray -// Indexes into a descriptor array. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutSettingsModel::MdcaPoint(TInt aIndex) const -{ - if (aIndex < 0 || aIndex >= iSettings.Count()) - { - TPtrC ret(KNullDesC); - return ret; - } - - return iSettings[aIndex]->ListBoxLine(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::HandleShortcutsChanged(TAny* aPtr) -{ - __PRINTS( "XAI: CAiScutSettingsModel::HandleShortcutsChanged"); - - if (aPtr) - { - CAiScutSettingsModel* self = static_cast(aPtr); - TRAP_IGNORE(self->UpdateSettingsContainerL()); - } - - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::HandleHiddenAppsChanged(TAny* aPtr) -{ - __PRINTS("XAI: CAiScutSettingsModel::HandleHiddenAppsChanged"); - - if (aPtr) - { - CAiScutSettingsModel* self = static_cast(aPtr); - - TRAP_IGNORE( - self->iAppList->StartL(); - self->GetHiddenAppsL(); - self->UpdateSettingsContainerL() ) // TRAP_IGNORE - } - - return KErrNone; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CAiScutSettingsModel::IsHidden(const TUid& aAppUid) const -{ - if (iHiddenApps.Find(aAppUid) == KErrNotFound) - { - return EFalse; - } - - __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::IsHidden (0x%x) ETrue"), aAppUid); - - return ETrue; -} - -// --------------------------------------------------------------------------- -// From MAiScutListObserver -// Callback for application list events. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::HandleScutListEventL(TScutListEvent aEvent, - TBool /*aAdded*/) -{ - switch (aEvent) - { - case MAiScutListObserver::EAppListReady: - if (iContainer) - { - iContainer->HideWaitNoteDialog(); - } - break; - - case MAiScutListObserver::EAppListUpdated: - case MAiScutListObserver::EBkmListUpdated: - UpdateSettingsContainerL(); - break; - - default: - break; - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::ActivateObservers(TBool aActivate) -{ - TRAP_IGNORE( - if (iAppList) - { - iAppList->SetObservingL(aActivate); - } - if (iBkmList) - { - iBkmList->SetObservingL(aActivate); - } - ) -} - -// --------------------------------------------------------------------------- -// Returns a setting item for the given index. -// --------------------------------------------------------------------------- -// -CAiScutSettingsItem* CAiScutSettingsModel::Item(TInt aIndex) const -{ - if (aIndex >= 0 && aIndex < iSettings.Count()) - { - return iSettings[aIndex]; - } - - return NULL; -} - -// --------------------------------------------------------------------------- -// Utility function to retrieve a bookmark caption from an uid. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::GetBkmCaptionL(const TUid aUid, TDes& aCaption) -{ - CFavouritesItem* favItem = CFavouritesItem::NewLC(); - TInt err = iBookmarkDb.Get(aUid.iUid, *favItem); - if (err == KErrNone) - { - aCaption.Copy(favItem->Name()); - } - - CleanupStack::PopAndDestroy(favItem); - - return err; -} - -// --------------------------------------------------------------------------- -// Utility function to retrieve an appliation caption from an uid. -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::GetAppCaption(const TUid aUid, TDes& aCaption) -{ - TInt err = KErrNone; - TApaAppInfo appInfo; - - err = iApaSession.GetAppInfo(appInfo, aUid); - if (err == KErrNone) - { - aCaption.Copy(appInfo.iCaption); - } - - return err; -} - -// --------------------------------------------------------------------------- -// Returns a pointer to the coe environment. -// --------------------------------------------------------------------------- -// -CCoeEnv* CAiScutSettingsModel::Env() -{ - return iEnv; -} - -// --------------------------------------------------------------------------- -// Handles saving a setting item to central repository. -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::SaveItemL(CAiScutSettingsItem& aItem) -{ - // Stop monitoring own settings changes. - iSettingsNotifier->StopListening(); - - TInt err = aItem.Save(iRepository); - - __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::SaveItemL key = 0x%x, err = %d"), - aItem.Key(), err); - UpdateSettingsL(); - iSettingsNotifier->StartListeningL(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutSettingsModel::SetContainer(CAiScutSettingsContainer* aContainer) -{ - iContainer = aContainer; -} - -// ----------------------------------------------------------------------------- -// Using the Favorites dB, get the bookmarked pages -// ----------------------------------------------------------------------------- -// -void CAiScutSettingsModel::ReadBookmarksL() -{ - // Get bookmarks - delete iFavItemList; - iFavItemList = NULL; - - iFavItemList = new (ELeave) CFavouritesItemList(); - TInt err = iBookmarkDb.GetAll( - *iFavItemList, KFavouritesNullUid, CFavouritesItem::EItem); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutSettingsModel::BookmarkCount() const -{ - if (iFavItemList) - { - return iFavItemList->Count(); - } - else - { - return 0; - } -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CFavouritesItem* CAiScutSettingsModel::GetBookmark(TInt aIndex) -{ - if (aIndex >= 0 && aIndex < iFavItemList->Count()) - { - - if (iFavItemList) - { - return iFavItemList->At(aIndex); - } - else - { - return NULL; - } - } - else - { - return NULL; - } -} - -// --------------------------------------------------------------------------- -// Returns reference to the bookmark database owned by the engine. -// --------------------------------------------------------------------------- -// -RFavouritesDb& CAiScutSettingsModel::FavouritesDb() -{ - return iBookmarkDb; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsAppList* CAiScutSettingsModel::AppList() -{ - return iAppList; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutSettingsBkmList* CAiScutSettingsModel::BkmList() -{ - return iBkmList; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutshortcut.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutshortcut.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,913 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for a shortcut. -* -*/ - - -#include -#include // For CGulIcon -#include // For CFbsBitmap -#include // For RProperty - -#include -#include "aiscutcontentmodel.h" -#include "caiscutshortcut.h" -#include "aiscutdefs.h" -#include "caiscuttargetapp.h" -#include "caiscuttargetbkm.h" -#include "caiscuttargethttp.h" -#include "caiscuttargetmessagingview.h" -#include "caiscuttargetnewmsg.h" -#include "caiscuttargetkeylock.h" -#include "caiscuttargetempty.h" -#include "aiscutpluginprivatecrkeys.h" - -#include "debug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut::CAiScutShortcut(TInt aId, CAiScutEngine& aEngine) - : CTimer( CActive::EPriorityLow ) - , iId(aId) - , iEngine(aEngine) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcut::ConstructL(const TDesC& aTarget) -{ - iDefaultTarget = CreateTargetL(aTarget, EFalse); - - if (!iDefaultTarget) - { - iDefaultTarget = CAiScutTargetEmpty::NewL(iEngine, EScutUnknown, aTarget); - } - CTimer::ConstructL(); - CActiveScheduler::Add( this ); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* CAiScutShortcut::NewLC(TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine) -{ - CAiScutShortcut* self = new (ELeave) CAiScutShortcut(aId, aEngine); - CleanupStack::PushL(self); - self->ConstructL(aTarget); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut* CAiScutShortcut::NewL(TInt aId, const TDesC& aTarget, - CAiScutEngine& aEngine) -{ - CAiScutShortcut* self = CAiScutShortcut::NewLC(aId, aTarget, aEngine); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcut::~CAiScutShortcut() -{ - Cancel(); - delete iDefaultTarget; - delete iUserTarget; - delete iRetiredTarget; -} - -// ----------------------------------------------------------------------------- -// Returns the shortcut id. -// ----------------------------------------------------------------------------- -// -TInt32 CAiScutShortcut::Id() const -{ - return iId; -} - -// ----------------------------------------------------------------------------- -// Publishes the shortcut content, non leaving version. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::Publish( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver) -{ - TRAPD(err, PublishL(aPlugin, aObserver)); - //Possible forcing done already so reset the flag - iForcePublish = EFalse; - if (err == KErrNone) - { - delete iRetiredTarget; - iRetiredTarget = NULL; - iLastPublishedTarget = iActiveTarget; - } - else - { - // Publish failed, roll back to previous content. - TInt transactionId = reinterpret_cast(this); - aObserver.CancelTransaction(transactionId); - - // Delete the new target and put the retired one back to work. - if (iRetiredTarget) - { - delete iUserTarget; - iUserTarget = iRetiredTarget; - iRetiredTarget = NULL; - } - - iActiveTarget = iLastPublishedTarget; - } - - -} - -// ----------------------------------------------------------------------------- -// Checks if the application or messaging view pointed to can be launched. -// ----------------------------------------------------------------------------- -// -TBool CAiScutShortcut::CheckAccessL(TInt aCheckType) -{ - TBool userTargetAccessible = EFalse; - - __PRINT( __DBG_FORMAT( "XAI: CAiScutShortcut::CheckAccessL( %d )"), aCheckType); - - // First try the user setting if it is defined. - if (iUserTarget && iUserTarget->IsAccessibleL(aCheckType)) - { - iActiveTarget = iUserTarget; - userTargetAccessible = ETrue; - } - - if (!userTargetAccessible) - { - - __PRINTS("XAI: *** user target NOT accessible ***"); - // User setting was not accessible or not defined, try the default. - if (iDefaultTarget->IsAccessibleL(aCheckType)) - { - iActiveTarget = iDefaultTarget; - } - else - { - // The default is not accessible either, the shortcut is empty. - iActiveTarget = NULL; - - __PRINTS( "XAI: *** default target NOT accessible ***"); - } - } - - if (iActiveTarget) - { - return ETrue; - } - else - { - return EFalse; - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CAiScutShortcut::IsTargetChanged() const -{ - // We need to publish if target changed during access checking. - return (iLastPublishedTarget != iActiveTarget); -} - -// ----------------------------------------------------------------------------- -// Changes the shortcut target to the user defined setting. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::SetUserTarget(const TDesC& aNewTarget) -{ - - TPtrC defaultTarget(iDefaultTarget->Definition()); - __PRINTS( "XAI: CAiScutShortcut::SetUserTarget"); - __PRINT( __DBG_FORMAT( "XAI: id = 0x%x"), iId); - __PRINT( __DBG_FORMAT( "XAI: default target = '%S'"), &defaultTarget); - __PRINT( __DBG_FORMAT("XAI: new target = '%S'"), &aNewTarget); - if (iUserTarget) - { - TPtrC userTarget(iUserTarget->Definition()); - __PRINT( __DBG_FORMAT("XAI: user target = '%S'"), &userTarget); - } - - - if (iUserTarget && (aNewTarget.CompareC(iUserTarget->Definition()) == 0)) - { - return; - } - - - // Creating the new target might leave, so it is done before the old target - // is deleted to ensure that the shortcut object remains in a consistent state - // in case of a leave. If target creation leaves, nothing has changed. - // - // As a side effect this means that the new target is allocated to a different - // memory address than the old one, the address of the old target will not be re-used - // by this target. That doesn't mean anything for the plug-in, but it helps the - // plug-in tester to notice premature target deletion, since the address will still - // contain 0xDEDEDEDE instead of the new target. - CAiScutTarget* tempTarget = NULL; - - TRAPD(err, tempTarget = CreateTargetL(aNewTarget, ETrue)); - - if (err == KErrNone) - { - DeleteUserTarget(); - iUserTarget = tempTarget; - } -} - -// ----------------------------------------------------------------------------- -// Deletes the user target. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::DeleteUserTarget() -{ - if (iUserTarget) - { - - __PRINTS("XAI: CAiScutShortcut::DeleteUserTarget"); - - if (iLastPublishedTarget == iUserTarget && !(iId & KScutFlagBitNonVisible)) - { - // Previous user target was the last published target so the Ai framework - // is still using the icon pointer. Deleting the target now would cause a - // KERN-EXEC 3 panic when the framework tries to access the deleted icon. - // The target must be kept alive until the new target has been successfully - // published and the framework is no longer using its icon. - // This is unnecessary for non-visible shortcuts because they are not published. - iRetiredTarget = iUserTarget; - iUserTarget = NULL; - - __PRINTS("XAI: iUserTarget = NULL"); - - } - - if (iActiveTarget == iUserTarget) - { - // Previous user target was the active target. We don't know if the new - // user target is accessible, so the shortcut is effectively empty until - // the access check has been run. - iActiveTarget = NULL; - } - - delete iUserTarget; - iUserTarget = NULL; - - __PRINTS( "XAI: delete iUserTarget"); - } -} - -// ----------------------------------------------------------------------------- -// Launches the shortcut. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::LaunchL() -{ - Cancel(); - RProperty::Set( - KPSUidAiInformation, - KActiveIdleLaunch, - EPSAiLaunchIsActive ); - - if (iActiveTarget) - { - TRAP_IGNORE( iActiveTarget->BeginEffectL() ); //start a full screen effect - iActiveTarget->LaunchL(); - } - - // When preparing for backup, the plugin is suspended and calling After() would - // cause a crash - if ( IsAdded() ) - { - After(1000000); - } -} - -// ----------------------------------------------------------------------------- -// Launches the shortcut. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::LaunchL(const TDesC8& aMessage) -{ - Cancel(); - RProperty::Set( - KPSUidAiInformation, - KActiveIdleLaunch, - EPSAiLaunchIsActive ); - - if (iActiveTarget) - { - TRAP_IGNORE( iActiveTarget->BeginEffectL() ); //start a full screen effect - iActiveTarget->LaunchL(aMessage); - } - - // When preparing for backup, the plugin is suspended and calling After() would - // cause a crash - if ( IsAdded() ) - { - After(1000000); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::SetToBePublished(TBool aFlag) -{ - if ( !iForcePublish ) - { - iNeedsToBePublished = aFlag; - } - else - { - iNeedsToBePublished = iForcePublish; - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -TBool CAiScutShortcut::NeedsToBePublished() -{ - return iNeedsToBePublished; -} - -// ----------------------------------------------------------------------------- -// Return shortcut type. -// ----------------------------------------------------------------------------- -// -TShortcutType CAiScutShortcut::Type() const -{ - if (iUserTarget) - { - return iUserTarget->Type(); - } - else - { - return iDefaultTarget->Type(); - } -} - -// --------------------------------------------------------------------------- -// Return application uid of this shortcut. -// --------------------------------------------------------------------------- -// -TUid CAiScutShortcut::AppUid() const -{ - if (iUserTarget) - { - return iUserTarget->AppUid(); - } - else - { - return iDefaultTarget->AppUid(); - } -} -void CAiScutShortcut::SetIcon(TAiScutIcon aIcon) - { - switch(aIcon.iDestination) - { - case EScutDestinationSoftkey: - SetSoftkeyIcon(aIcon); - break; - case EScutDestinationToolbar: - SetToolbarIcon(aIcon); - break; - case EScutDestinationNormal: - SetOverrideIcon(aIcon); - break; - default: - break; - } - } -void CAiScutShortcut::SetOverrideIcon(TAiScutIcon aIcon) -{ - if (iUserTarget) - { - iUserTarget->SetOverrideIcon(aIcon); - } - else - { - iDefaultTarget->SetOverrideIcon(aIcon); - } -} - -void CAiScutShortcut::SetSoftkeyIcon(TAiScutIcon aIcon) -{ - if (iUserTarget) - { - iUserTarget->SetSoftkeyIcon(aIcon); - } - else - { - iDefaultTarget->SetSoftkeyIcon(aIcon); - } -} - - -void CAiScutShortcut::SetToolbarIcon(TAiScutIcon aIcon) -{ - if (iUserTarget) - { - iUserTarget->SetToolbarIcon(aIcon); - } - else - { - iDefaultTarget->SetToolbarIcon(aIcon); - } -} - - -// ----------------------------------------------------------------------------- -// Creates a shortcut target object. -// ----------------------------------------------------------------------------- -// -CAiScutTarget* CAiScutShortcut::CreateTargetL( - const TDesC& aDefinition, TBool aCreateUserTarget) -{ - - __PRINTS("XAI: CAiScutShortcut::CreateTargetL"); - __PRINT( __DBG_FORMAT("XAI: id = 0x%x, target = '%S'"), iId, &aDefinition); - - CAiScutTarget* target = NULL; - TAiScutParser parser; - TInt err = parser.Parse(aDefinition); - - if (parser.IsValid()) - { - TShortcutType type = parser.Type(); - - switch (type) - { - case EScutApplication: - case EScutChangeTheme: - case EScutApplicationView: - case EScutApplicationWithParams: - case EScutLogsMissedCallsView: - case EScutLogsDialledCallsView: - case EScutLogsReceivedCallsView: - case EScutLogsMainView: - target = CAiScutTargetApp::NewL(iEngine, type, parser); - break; - - case EScutNewMsgType: - case EScutNewMessage: - case EScutNewEmail: -#ifdef __SYNCML_DS_EMAIL - case EScutNewSyncMLMail: -#endif - case EScutNewPostcard: - case EScutNewAudioMsg: - target = CAiScutTargetNewMsg::NewL(iEngine, type, parser); - break; - - case EScutMailbox: - target = CAiScutTargetMessagingView::NewL(iEngine, type, parser); - break; - - case EScutWebAddress: - target = CAiScutTargetHttp::NewL(iEngine, type, parser); - break; - - case EScutKeylock: - target = CAiScutTargetKeyLock::NewL(iEngine, type, aDefinition); - break; - - case EScutNoEffect: - target = CAiScutTargetEmpty::NewL(iEngine, type, aDefinition); - break; - - case EScutBookmark: - target = CAiScutTargetBkm::NewL(iEngine, type, parser); - break; - - case EScutConnectivityStatusView: - target = CAiScutTargetApp::NewL(iEngine, EScutApplicationView, parser); - break; - - case EScutApplicationManagerView: - target = CAiScutTargetApp::NewL(iEngine, EScutApplicationView, parser); - break; - - default: - break; - } - } - - if (!target && aCreateUserTarget) - { - // treat unknown user targets as web addresses. - target = CAiScutTargetHttp::NewL(iEngine, EScutWebAddress, parser); - } - - if (!target) - { - __PRINTS( "XAI: *** empty target ***"); - } - - - return target; -} - -// ----------------------------------------------------------------------------- -// Publishes the shortcut content, leaving version. -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::PublishL( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver) - { - TInt err = KErrNone; - TBool cbaIconPublished = EFalse; - - __PRINT( __DBG_FORMAT("XAI: CAiScutShortcut::PublishL 0x%x"), iId); - - // Publish caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutCaption].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishCaption( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutCaption].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT( "XAI: publish caption err = %d"), err); - } - - // Publish short caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutShortCaption].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishCaption( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutShortCaption].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT( "XAI: publish short caption err = %d"), err); - } - - /** softkeys **/ - // Publish short caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutSkIcon].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishIcon( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutSkIcon].id); - - if ( err == KErrNone ) - { - cbaIconPublished = ETrue; - } - if (err != KErrNone) - __PRINT( __DBG_FORMAT("XAI: publish icon err = %d"), err); - } - - // No CBA icon published so publish the caption - if ( !cbaIconPublished ) - { - // Publish sk caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutSkCaption].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishCaption( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutSkCaption].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT( "XAI: publish short caption err = %d"), err); - } - } - - /** end of softkeys **/ - - // Publish MSK caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutMskCaption].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishCaption( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutMskCaption].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT( "XAI: publish msk caption err = %d"), err); - } - - // Publish icon if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutIcon].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishIcon( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutIcon].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT("XAI: publish icon err = %d"), err); - } - - // Publish toolbar caption if the framework can handle it. - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutToolbarCaption].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishCaption( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutToolbarCaption].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT( "XAI: publish toolbar caption err = %d"), err); - } - - // Publish the toolbar icon if the framework can handle it - if (!aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentShortcutToolbarIcon].id, iId)) - { - err = KErrNotSupported; - } - else - { - err = PublishIcon( - aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutToolbarIcon].id); - - if (err != KErrNone) - __PRINT( __DBG_FORMAT("XAI: publish toolbar icon err = %d"), err); - } - } - -// ----------------------------------------------------------------------------- -// Publishes shortcut caption. -// ----------------------------------------------------------------------------- -// -TInt CAiScutShortcut::PublishCaption(MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver, TInt aCaptionContentId) const -{ - TInt err = KErrNone; - - if (iId == KRightSoftkeyId) - { - if (iActiveCall) - { - TInt backCaptionResId = KAiScutResources[EAiScutResourceBackCaption].id; - err = aObserver.Publish(aPlugin, aCaptionContentId, backCaptionResId, iId); - return err; - } - } - - if (!iActiveTarget) - { - // Publish the EmptyCaption resource id. - TInt emptyCaptionResId = KAiScutResources[EAiScutResourceEmptyCaption].id; - err = aObserver.Publish(aPlugin, aCaptionContentId, emptyCaptionResId, iId); - } - else - { - TPtrC captionDes; - TInt captionResId = 0; - TAiScutAppTitleType titleType = EAiScutLongTitle; - if (aCaptionContentId == KAiScutContent[EAiScutContentShortcutShortCaption].id || - aCaptionContentId == KAiScutContent[EAiScutContentShortcutSkCaption].id || - aCaptionContentId == KAiScutContent[EAiScutContentShortcutToolbarCaption].id) - { - titleType = EAiScutSkeyTitle; - } - else if (aCaptionContentId == KAiScutContent[EAiScutContentShortcutMskCaption].id) - { - titleType = EAiScutMskTitle; - } - - captionResId = iActiveTarget->GetCaption(captionDes, titleType); - - if (captionResId == 0) - { - // Publish descriptor. - err = aObserver.Publish(aPlugin, aCaptionContentId, captionDes, iId); - } - else if (captionResId > 0) - { - // Publish resource. - err = aObserver.Publish(aPlugin, aCaptionContentId, captionResId, iId); - - __PRINT( __DBG_FORMAT("XAI: publish resource = %d"), captionResId); - } - } - - return err; -} - -// ----------------------------------------------------------------------------- -// Publishes shortcut icon. -// ----------------------------------------------------------------------------- -// -TInt CAiScutShortcut::PublishIcon(MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver, TInt aIconContentId ) -{ - TInt emptyIconResId = KAiScutResources[EAiScutResourceEmptyIcon].id; - TInt err = KErrNone; - // In case of an active call cancel the SK icon publication - // to RSK - if ( iActiveCall && iId == KRightSoftkeyId ) - { - return KErrCancel; - } - if (!iActiveTarget) - { - // Publish the EmptyIcon resource id. - - __PRINT( __DBG_FORMAT( "XAI: PublishIcon publish empty #1 = %d"), emptyIconResId); - - err = aObserver.Publish(aPlugin, aIconContentId, emptyIconResId, iId); - } - else - { - CGulIcon* iconPtr = NULL; - TInt iconResId = 0; - // Normal icon - if (aIconContentId == KAiScutContent[EAiScutContentShortcutIcon].id) - { - iconResId = iActiveTarget->GetIcon(iconPtr); - } - // Soft key icon - else if ( aIconContentId == KAiScutContent[EAiScutContentShortcutSkIcon].id ) - { - iconResId = iActiveTarget->GetSoftkeyIcon(iconPtr); - } - else if ( aIconContentId == KAiScutContent[EAiScutContentShortcutToolbarIcon].id ) - { - iconResId = iActiveTarget->GetToolbarIcon(iconPtr); - } - - // No error, continue with the publish - if (iconResId == 0) - { - if (iconPtr) - { - // Publish pointer. - err = aObserver.PublishPtr(aPlugin, aIconContentId, iconPtr, iId); - - if( err != KErrNone ) - { - delete iconPtr; - } - } - else - { - // The target hasn't been able to initialize its icon, publish the empty icon. - - __PRINT( __DBG_FORMAT("XAI: PublishIcon publish empty #2 = %d"), emptyIconResId); - - err = aObserver.Publish(aPlugin, aIconContentId, emptyIconResId, iId); - } - } - // Publish by resource - else if (iconResId > 0) - { - // Publish resource. - - __PRINT( __DBG_FORMAT("XAI: PublishIcon publish resource = %d"), iconResId); - - err = aObserver.Publish(aPlugin, aIconContentId, iconResId, iId); - } - // < 0 error occurred, return it - else - { - err = iconResId; - } - } - - return err; -} - -// ----------------------------------------------------------------------------- -// Set call state -// ----------------------------------------------------------------------------- -// -void CAiScutShortcut::SetCallState(TBool aStatus) -{ - // Call state changed force the publish of RSK - if ( iActiveCall != aStatus ) - { - if ( iId == KRightSoftkeyId ) - { - iForcePublish = ETrue; - } - } - iActiveCall = aStatus; -} - -TPtrC CAiScutShortcut::ActiveDefinition() - { - if( iUserTarget ) - { - return iUserTarget->Definition(); - } - if( iDefaultTarget ) - { - return iDefaultTarget->Definition(); - } - return TPtrC(); - } - -// --------------------------------------------------------------------------- -// Return the possible additional id -// --------------------------------------------------------------------------- -// -TUid CAiScutShortcut::AdditionalUid() const - { - if( iUserTarget ) - { - return iUserTarget->AdditionalUid(); - } - if( iDefaultTarget ) - { - return iDefaultTarget->AdditionalUid(); - } - return TUid::Uid(-1); - } - -// --------------------------------------------------------------------------- -// CActive -// --------------------------------------------------------------------------- -// -TInt CAiScutShortcut::RunError(TInt /*aError*/) - { - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CActive -// --------------------------------------------------------------------------- -// -void CAiScutShortcut::DoCancel() - { - CTimer::DoCancel(); - RProperty::Set( - KPSUidAiInformation, - KActiveIdleLaunch, - EPSAiLaunchNotActive ); - } - -// --------------------------------------------------------------------------- -// CActive -// --------------------------------------------------------------------------- -// -void CAiScutShortcut::RunL() - { - RProperty::Set( - KPSUidAiInformation, - KActiveIdleLaunch, - EPSAiLaunchNotActive ); - } -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutshortcutext.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutshortcutext.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,419 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in shortcut extensions -* -*/ - - -#include -#include -#include -#include - -#include "caiscutshortcutext.h" -#include "aiscutcontentmodel.h" -#include "caiscuttarget.h" -#include "caiscutengineext.h" -#include "PopupFSM.h" -#include "cpopupeventhandler.h" -#include "maiscutextdata.h" -#include "activeidle2domainpskeys.h" - -#include "debug.h" - - -// P&S access policies -_LIT_SECURITY_POLICY_C1( KAiScutReadPolicy, ECapabilityReadDeviceData ); -_LIT_SECURITY_POLICY_C1( KAiScutWritePolicy, ECapabilityWriteDeviceData ); - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutExt* CAiScutShortcutExt::NewL( - TInt aId, const TDesC& aTarget, CAiScutEngine& aEngine ) - { - CAiScutShortcutExt* self = CAiScutShortcutExt::NewLC( - aId, aTarget, aEngine ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutExt* CAiScutShortcutExt::NewLC( - TInt aId, const TDesC& aTarget, CAiScutEngine& aEngine ) - { - CAiScutShortcutExt* self = new( ELeave ) CAiScutShortcutExt( - aId, aEngine ); - CleanupStack::PushL( self ); - self->ConstructL( aTarget ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutExt::~CAiScutShortcutExt() - { - delete iPopupEventHandler; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutExt::CAiScutShortcutExt( TInt aId, CAiScutEngine& aEngine ) - : CAiScutShortcut( aId, aEngine )//, - //iPublishLineArray( EFalse ) - { - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::ConstructL( const TDesC& aTarget ) - { - iPopupEventHandler = CPopupEventHandler::NewL( *this ); - CAiScutShortcut::ConstructL( aTarget ); - - RProperty::Define( - KPSUidAiInformation, - KActiveIdleThemeSupportsXsp, - RProperty::EInt, - KAiScutReadPolicy, - KAiScutWritePolicy ); - RProperty::Set( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, EPSAiXspNotSupported ); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TPtrC CAiScutShortcutExt::ActiveTargetDefinition() const - { - if( iActiveTarget ) - { - return iActiveTarget->Definition(); - } - return KNullDesC(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::HandleAIEventL( TInt aEvent ) - { - switch ( aEvent ) - { - case EAiScutEventLoseFocus: - { - iPopupEventHandler->PopupFSM().HandleLostFocus(); - break; - } - case EAiScutEventGainFocus: - { - iPopupEventHandler->PopupFSM().HandleGotFocus(); - break; - } - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::HandleResumed( TAiTransitionReason aResumeReason ) - { - switch( aResumeReason ) - { - case EAiIdleBackground: - { - iPopupEventHandler->PopupFSM().HandleBackground(); - break; - } - case EAiIdleForeground: - { - // Handleforeground() calls unnecessary publishes in case nothing - // has changed. - if ( iTextChanged || iIconChanged ) - { - iPopupEventHandler->PopupFSM().HandleForeground(); - } - break; - } - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::SetAiScutExtData( - const MAiScutExtData* aAiScutExtData ) - { - iAiScutExtData = aAiScutExtData; - - const MDesCArray* newPopupLineArray = - aAiScutExtData ? aAiScutExtData->PopupLineArray() : NULL; - const CGulIcon* newIcon = - aAiScutExtData ? aAiScutExtData->Icon() : NULL; - - if( iPreviousPopupLineArray != newPopupLineArray && - newPopupLineArray ) - { - iTextChanged = ETrue; - iPopupEventHandler->PopupFSM().HandleUpdate(); - } - else if( iPreviousPopupLineArray && !newPopupLineArray ) - { - iTextChanged = ETrue; - iPopupEventHandler->PopupFSM().HandleReset(); - } - - if( iPreviousIcon != newIcon ) - { - iIconChanged = ETrue; - CAiScutEngineExt& engine = static_cast< CAiScutEngineExt& > ( iEngine ); - engine.CheckAccessAndPublish( *this ); - } - - iPreviousPopupLineArray = newPopupLineArray; - iPreviousIcon = newIcon; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::PublishL( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver ) - { - if( iLastPublishedTarget && iActiveTarget && - iLastPublishedTarget->Definition() != iActiveTarget->Definition() ) - { - iAiScutExtData = NULL; - iPopupEventHandler->PopupFSM().HandleReset(); - } - - if( aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentPopupTextFirstLine].id, iId) && - aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentPopupTextSecondLine].id, iId) && - aObserver.CanPublish( - aPlugin, KAiScutContent[EAiScutContentPopupTextThirdLine].id, iId) ) - { - PublishPopupText( aPlugin, aObserver ); - RProperty::Set( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, EPSAiXspIsSupported ); - } - - CAiScutShortcut::PublishL( aPlugin, aObserver ); - iTextChanged = EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutShortcutExt::PublishCaption( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, - TInt aCaptionContentId ) const - { - if( iPopupEventHandler->PublishCaption() ) - { - if( !iPopupEventHandler->CaptionVisible() ) - { - return aObserver.Clean( aPlugin, aCaptionContentId, iId ); - } - else - { - return CAiScutShortcut::PublishCaption( - aPlugin, aObserver, aCaptionContentId ); - } - } - else - { - return CAiScutShortcut::PublishCaption( - aPlugin, aObserver, aCaptionContentId ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::PublishPopupText( - MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver ) const - { - if( iPopupEventHandler->PublishPopup() ) - { - TAiScutContentIds popupTextContentIds[] = - { - EAiScutContentPopupTextFirstLine, - EAiScutContentPopupTextSecondLine, - EAiScutContentPopupTextThirdLine - }; - const TInt idCount = - sizeof( popupTextContentIds ) / sizeof( TAiScutContentIds ); - - TInt err = KErrNone; - - //iLineArray is set or reset via xSP API. iPublishLineArray is controlled - //by state machine in iPopupEventHandler - if( iAiScutExtData && iAiScutExtData->PopupLineArray() && - iPopupEventHandler->PopupVisible() ) - { - //Publish caption line in popup text box - TPtrC captionDes; - TInt captionResId = iActiveTarget->GetCaption( captionDes, EAiScutLongTitle ); - - if ( captionResId == 0 ) - { - // Publish descriptor - err = aObserver.Publish( aPlugin, - KAiScutContent[ EAiScutContentPopupTextCaptionLine ].id, - captionDes, iId ); - if( err != KErrNone ) - { - __PRINT( __DBG_FORMAT( "XAI: publish Popup caption text err = %d" ), err ); - } - } - else if ( captionResId > 0 ) - { - // Publish resource - err = aObserver.Publish( aPlugin, - KAiScutContent[ EAiScutContentPopupTextCaptionLine ].id, - captionResId, iId ); - if( err != KErrNone ) - { - __PRINT( __DBG_FORMAT( "XAI: publish Popup caption text (resource) err = %d" ), err ); - } - } - - const MDesCArray& lineArray = *iAiScutExtData->PopupLineArray(); - TInt numberOfLines = lineArray.MdcaCount(); - //Iterate each popup text content and either publish or clean it - //depending on the number or lines in iLineArray - for( TInt i = 0; i < idCount; i++ ) - { - if( numberOfLines > i ) - { - err = aObserver.Publish( aPlugin, - KAiScutContent[ popupTextContentIds[ i ] ].id, - lineArray.MdcaPoint( i ), iId ); - if( err != KErrNone ) - { - __PRINT( __DBG_FORMAT( "XAI: publish Popup text err = %d" ), err ); - } - } - else - { - err = aObserver.Clean( aPlugin, - KAiScutContent[ popupTextContentIds[ i ] ].id, iId ); - if( err != KErrNone ) - { - __PRINT( __DBG_FORMAT( "XAI: clean Popup text err = %d" ), err ); - } - } - } - } - else - { - //Clean each popup text content - for( TInt i = 0; i < idCount; i++ ) - { - err = aObserver.Clean( aPlugin, - KAiScutContent[ popupTextContentIds[ i ] ].id, iId ); - if ( err != KErrNone ) - { - __PRINT( __DBG_FORMAT( "XAI: clean Popup text err = %d" ), err ); - } - } - } - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TInt CAiScutShortcutExt::PublishIcon( MAiPropertyExtension& aPlugin, - MAiContentObserver& aObserver, TInt aIconContentId ) - { - if( aIconContentId == KAiScutContent[EAiScutContentShortcutIcon].id && - iAiScutExtData && iAiScutExtData->Icon() ) - { - const CGulIcon& icon = *iAiScutExtData->Icon(); - CGulIcon* duplicatedIcon = NULL; - TRAP_IGNORE( - CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap(); - CleanupStack::PushL( bitmap ); - CFbsBitmap* mask = new( ELeave ) CFbsBitmap(); - CleanupStack::PushL( mask ); - - User::LeaveIfError( bitmap->Duplicate( icon.Bitmap()->Handle() ) ); - User::LeaveIfError( mask->Duplicate( icon.Mask()->Handle() ) ); - - duplicatedIcon = CGulIcon::NewL( bitmap, mask ); - - CleanupStack::Pop( 2, bitmap ); - ); - - if( duplicatedIcon ) - { - TInt err = aObserver.PublishPtr( aPlugin, - aIconContentId, duplicatedIcon, iId ); - if( err != KErrNone ) - { - delete duplicatedIcon; - } - return err; - } - } - - TInt err = CAiScutShortcut::PublishIcon( aPlugin, aObserver, aIconContentId ); - iIconChanged = EFalse; - return err; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutExt::IssuePublishShortcut() - { -// iPublishLineArray = aVisiblePopup; - CAiScutEngineExt& engine = static_cast< CAiScutEngineExt& >( iEngine ); - engine.CheckAccessAndPublish( *this ); - } - - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscutshortcutinfo.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscutshortcutinfo.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Small container for shortcut info. -* -*/ - - -#include "caiscutshortcutinfo.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutInfo::CAiScutShortcutInfo(TInt aId) - : iId(aId) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutShortcutInfo::ConstructL(const TDesC& aTarget) -{ - iTarget = aTarget.AllocL(); -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutInfo* CAiScutShortcutInfo::NewL(TInt aId, const TDesC& aTarget) -{ - CAiScutShortcutInfo* self = new(ELeave) CAiScutShortcutInfo(aId); - CleanupStack::PushL(self); - self->ConstructL(aTarget); - CleanupStack::Pop(self); - return self; -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutShortcutInfo::~CAiScutShortcutInfo() -{ - delete iTarget; -} - -// ----------------------------------------------------------------------------- -// Returns the shortcut id. -// ----------------------------------------------------------------------------- -// -TInt32 CAiScutShortcutInfo::Id() const -{ - return iId; -} - -// ----------------------------------------------------------------------------- -// Returns the shortcut target string. -// ----------------------------------------------------------------------------- -// -const TDesC& CAiScutShortcutInfo::Target() - { - if( iTarget ) - return *iTarget; - else - return KNullDesC; - } - -// Eof diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttarget.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttarget.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,243 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for shortcut target -* -*/ - - -#include "caiscutengine.h" -#include "caiscuttarget.h" -#include -#include // For AknsUtils -#include -#include -#include -#include // For CAknTaskList -#include // For CApaWindowGroupName -#include // For Transition effect -#include -#include - -// ======== MEMBER FUNCTIONS ======== -_LIT(KFileLoadDir,"z:\\resource\\"); -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTarget::CAiScutTarget(CAiScutEngine& aEngine, TShortcutType aType) - : iEngine(aEngine) - , iType(aType) -{ -} - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTarget::~CAiScutTarget() -{ - -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTarget::GetCaption(TPtrC& /*aDes*/, TAiScutAppTitleType /*aTitleType*/) const -{ - // Default implementation. - return KErrNotSupported; -} - -TUid CAiScutTarget::AdditionalUid() const - { - return TUid::Uid(-1); - } - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTarget::GetIcon(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon ) const -{ - TInt err = KErrNotSupported; - - if ( aIconToLoad.iType == EScutIconSkin ) - { - TRAP(err, LoadIconFromSkinL(aIconToLoad, aIcon)); - } - else if ( aIconToLoad.iType == EScutIconMif ) - { - TRAP(err, LoadIconFromFileL(aIconToLoad, aIcon)); - } - else if ( aIconToLoad.iType == EScutIconMbm ) - { - TRAP(err, LoadIconFromFileL(aIconToLoad, aIcon)); - } - - return err; -} - -TInt CAiScutTarget::GetIcon(CGulIcon*& aIcon) const - { - return GetIcon(iOverrideIcon, aIcon); - } - -TInt CAiScutTarget::GetSoftkeyIcon(CGulIcon*& aIcon) const - { - return GetIcon(iSoftkeyIcon, aIcon); - } - -TInt CAiScutTarget::GetToolbarIcon(CGulIcon*& aIcon) const - { - return GetIcon(iToolbarIcon, aIcon); - } - -void CAiScutTarget::SetOverrideIcon(TAiScutIcon aIcon) - { - iOverrideIcon = aIcon; - } - -void CAiScutTarget::SetSoftkeyIcon(TAiScutIcon aIcon) - { - iSoftkeyIcon = aIcon; - } - -void CAiScutTarget::SetToolbarIcon(TAiScutIcon aIcon) - { - iToolbarIcon = aIcon; - } - -void CAiScutTarget::LoadIconFromSkinL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* bitmapMask = NULL; - - // With colour group support - if ( aIconToLoad.iColourGroup >= EAknsCIQsnTextColorsCG1 && - aIconToLoad.iColourGroup <= EAknsCIQsnTextColorsCG62) - { - - AknsUtils::CreateColorIconLC( - AknsUtils::SkinInstance(), - aIconToLoad.iSkinId, - KAknsIIDQsnTextColors, - aIconToLoad.iColourGroup, - bitmap, - bitmapMask, - KNullDesC, /* no backup */ - 0, /* no backup */ - 0, /* no backup */ - KRgbBlack ); - - if ( bitmap ) - { - aIcon = CGulIcon::NewL( bitmap, bitmapMask ); - } - CleanupStack::Pop( 2 ); // bitmap, bitmapMask - } - // no colour group support - else - { - aIcon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), aIconToLoad.iSkinId, KNullDesC, 0, 0 ); - } - if ( !aIcon ) - { - User::Leave( KErrNotFound ); - } - } - -void CAiScutTarget::LoadIconFromFileL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* bitmapMask = NULL; - TFileName actualPath; - TInt iconIndexStart = 0; - - if ( aIconToLoad.iType == EScutIconMif ) - { - iconIndexStart = KMifIdFirst; - } - actualPath.Append(KFileLoadDir); - actualPath.Append(aIconToLoad.iPath); - - RFs fs; fs.Connect(); - if ( aIconToLoad.iIconId < 0 || !BaflUtils::FileExists(fs, actualPath)) - { - fs.Close(); - User::Leave( KErrNotFound ); - } - fs.Close(); - // Mask is next after bitmap - AknIconUtils::CreateIconLC(bitmap,bitmapMask, actualPath, - aIconToLoad.iIconId+iconIndexStart, aIconToLoad.iIconId+iconIndexStart+1); - - - aIcon = CGulIcon::NewL(bitmap, bitmapMask); - - CleanupStack::Pop(bitmapMask); - CleanupStack::Pop(bitmap); - - if ( !aIcon ) - { - User::Leave( KErrNotFound ); - } - - } - -// --------------------------------------------------------------------------- -// Returns the shortcut target type. -// --------------------------------------------------------------------------- -// -TShortcutType CAiScutTarget::Type() const -{ - return iType; -} - -// --------------------------------------------------------------------------- -// Determines which effect should be shown, and starts it. -// --------------------------------------------------------------------------- -// -void CAiScutTarget::BeginEffectL() - { - RWsSession& aWs = iEngine.Env()->WsSession(); - TUid appUid = AppUid(); - TInt effectType = AknTransEffect::EApplicationStart; - CAknTaskList* taskList = CAknTaskList::NewL( aWs ); - TApaTask task = taskList->FindRootApp( appUid ); - delete taskList; - - if ( task.Exists() ) - { - TBool inHiddenList = iEngine.IsHiddenFromFSW(appUid); - CApaWindowGroupName* wgName = CApaWindowGroupName::NewL( aWs, task.WgId() ); - wgName->SetAppUid( appUid ); - const TBool isHidden = wgName->Hidden() || inHiddenList; - delete wgName; - - if (!isHidden) - { - effectType = AknTransEffect::EApplicationStartSwitchRect; - } - - //start a full screen effect - GfxTransEffect::BeginFullScreen( effectType, - TRect(0,0,0,0), - AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( appUid, - AknTransEffect::TParameter::EActivateExplicitContinue ) ); - } - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetapp.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetapp.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,633 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for application shortcut target -* -*/ - - -#include // For CCoeEnv -#include // For RWsSession -#include -#include -#include // For CApaCommandLine -#include // For TApaTaskList -#include // For CApaWindowGroupName -#include // For CGulIcon -#include // For AknsUtils -#include // For CAknTaskList -#include // For Transition effect -#include -#include // For CVwsSessionWrapper -#include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif - -#include -#include -#include -#include -#include - -#include -//#include -#include - -#include - -#include "aiscutcontentmodel.h" -#include "caiscuttargetapp.h" -#include "caiscutengine.h" - -#include -#include "debug.h" - -#include - -const TInt KIconSizeArray = 4; - -// ======== MEMBER FUNCTIONS ================================================= - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetApp::CAiScutTargetApp( - CAiScutEngine& aEngine, TShortcutType aType, const TUid aUid) - : CAiScutTarget(aEngine, aType) - , iAppUid(aUid) - { - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetApp::ConstructL(const TAiScutParser& aParser) - { - iDefinition = aParser.Get(EScutDefComplete).AllocL(); - - iViewUid.iUid = -1; - - switch (Type()) - { - case EScutApplicationView: - case EScutChangeTheme: - if (iAppUid == KScutAppShellUid) - { - iViewUid.iUid = 1; // activate always appshell main view. - } - else - { - iViewUid = TAiScutParser::ParseUid(aParser.Get(EScutDefParamValue)); - } - break; - - case EScutLogsMissedCallsView: - iMsg = TPtrC8(KLogsMissedCallsView).AllocL(); - break; - - case EScutLogsDialledCallsView: - iMsg = TPtrC8(KLogsDialledCallsView).AllocL(); - break; - - case EScutLogsReceivedCallsView: - iMsg = TPtrC8(KLogsReceivedCallsView).AllocL(); - break; - - case EScutLogsMainView: - iMsg = TPtrC8(KLogsMainView).AllocL(); - break; - - case EScutApplicationWithParams: - { - TPtrC ptr = aParser.Get(EScutDefParamNameAndValue); - iMsg = EscapeUtils::ConvertFromUnicodeToUtf8L(ptr); - break; - } - - default: - break; - } - - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetApp* CAiScutTargetApp::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) - { - CAiScutTargetApp* self = - new (ELeave) CAiScutTargetApp(aEngine, aType, aParser.Uid()); - - CleanupStack::PushL(self); - self->ConstructL(aParser); - - CleanupStack::Pop(self); - - return self; - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetApp::~CAiScutTargetApp() - { - delete iCaption; - delete iShortCaption; - delete iMsg; - delete iDefinition; - } - - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetApp::Definition() const - { - return iDefinition ? TPtrC(*iDefinition) : TPtrC(); - } - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetApp::GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const - { - TRAP_IGNORE(GetCaptionL(aTitleType)); - - if (aTitleType == EAiScutSkeyTitle) - { - aDes.Set(iShortCaption ? *iShortCaption : KNullDesC()); - } - else - { - aDes.Set(iCaption ? *iCaption : KNullDesC()); - } - - return 0; - } - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -void CAiScutTargetApp::GetCaptionL(TAiScutAppTitleType aTitleType) const - { - TApaAppInfo appInfo; - - // Use lazy evaluation, create the caption only when it is first needed. - if (aTitleType == EAiScutSkeyTitle) - { - if( !iShortCaption ) - { - iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); - iShortCaption = appInfo.iShortCaption.AllocL(); - } - } - else - { - if (!iCaption) - { - iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); - iCaption = appInfo.iCaption.AllocL(); - } - } - } - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetApp::GetIcon(CGulIcon*& aIcon) const - { - // First try to make the override icon - // if not successful then do it ourself - if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) - { - TRAP_IGNORE(CreateAppIconL(aIcon)); - } - - - return 0; - } - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon for toolbar. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetApp::GetToolbarIcon(CGulIcon*& aIcon) const - { - if ( CAiScutTarget::GetToolbarIcon(aIcon) != KErrNone) - { - TRAP_IGNORE(CreateAppIconL(aIcon)); - } - - return 0; - } - -// --------------------------------------------------------------------------- -// Creates the application icon. -// --------------------------------------------------------------------------- -// - -void CAiScutTargetApp::CreateAppIconL(CGulIcon*& aIcon) const - { - // To make sure we won't end up with a partially created icon, we first create - // a temporary icon and take it into use only when it is propertly initialized. - CGulIcon* tempIcon = NULL; - TInt err = KErrNone; - - // If no scalable icon support is available then the icon is constructed the "old way" - // java icon separately from the native icon. If the support is available then the - // java icon is constructed the same way the native icon is constructed. - - const TBool isNonNative = iEngine.IsNonNative(iAppUid); - - // First try to create a normal non-native icon - if (isNonNative) - { - TRAP(err, - tempIcon = CreateNonNativeIconL() - ); - // Just to be sure - if (err != KErrNone) - { - tempIcon = NULL; - } - } - // No icon yet so either native icon or non-native SVG icon. - if (!tempIcon) - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - if ((iAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId) - || (iAppUid == KScutGeneralSettingsUid && (iViewUid == KScutInstallationViewId - || iViewUid == KScutConnectivityViewId)) - ) - { - tempIcon = CreateSubstituteIconL(skin, iAppUid, iViewUid); - } - else - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknsUtils::CreateAppIconLC(skin, iAppUid, EAknsAppIconTypeList, bitmap, mask); - if (bitmap) - { - tempIcon = CGulIcon::NewL(bitmap, mask); - CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number - // because the order in which they are pushed in is undefined. - } - - } - - } - - aIcon = tempIcon; - } - - -CGulIcon* CAiScutTargetApp::CreateSubstituteIconL( MAknsSkinInstance* aSkin, TUid aAppUid, TUid iViewUid ) const - { - CGulIcon* tempIcon = NULL; - TParse* parse = new (ELeave) TParse; - CleanupStack::PushL(parse); - parse->Set(KBitmapFile, &KDC_APP_BITMAP_DIR, NULL); - HBufC* fileName = parse->FullName().AllocLC(); - TPtr fileNamePtr = fileName->Des(); - - //change idle theme - if (aAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId) - { - tempIcon = AknsUtils::CreateGulIconL( - aSkin, - KAknsIIDQgnPropPslnAiSub, - fileNamePtr, - EMbmAiscutpluginQgn_prop_psln_ai_sub, - EMbmAiscutpluginQgn_prop_psln_ai_sub_mask); - } - //appmngr - else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutInstallationViewId) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknsUtils::CreateAppIconLC(aSkin, KScutAppMngrUid, EAknsAppIconTypeList, bitmap, mask); - - // The icon may reside in cache so we need to exclude in order - // for updated icons to be loaded properly. - AknIconUtils::ExcludeFromCache( bitmap ); - if (bitmap) - { - tempIcon = CGulIcon::NewL(bitmap, mask); - CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number - // because the order in which they are pushed in is undefined. - } - } - //connectivity view - else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutConnectivityViewId) - { - tempIcon = AknsUtils::CreateGulIconL( - aSkin, - KAknsIIDQgnPropAiShortcut, - fileNamePtr, - EMbmAiscutpluginQgn_prop_cp_conn_shortcut, - EMbmAiscutpluginQgn_prop_cp_conn_shortcut_mask); - } - else - { - //never should go here! - } - - CleanupStack::PopAndDestroy(2, parse); // fileName, parse - return tempIcon; - } - -// --------------------------------------------------------------------------- -// Creates the NonNative application icon. -// --------------------------------------------------------------------------- -// - -CGulIcon* CAiScutTargetApp::CreateNonNativeIconL() const - { - CApaMaskedBitmap* maskedbitmap = CApaMaskedBitmap::NewLC(); - - CArrayFixFlat* sizesArray = new (ELeave) CArrayFixFlat(KIconSizeArray); - CleanupStack::PushL(sizesArray); - - TInt err = iEngine.ApaSession().GetAppIconSizes(iAppUid, *sizesArray); - - // If there is no error and there is something in array - // use first icon size and get an icon. - if (!err && sizesArray->Count()) - { - err = iEngine.ApaSession().GetAppIcon(iAppUid, sizesArray->At(0), *maskedbitmap); - } - - // If there was an error, delete every allocated object and leave. - if (err) - { - CleanupStack::PopAndDestroy(sizesArray); - CleanupStack::PopAndDestroy(maskedbitmap); - User::Leave(err); - } - - CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(bitmap); - CFbsBitmap* mask = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(mask); - - User::LeaveIfError(bitmap->Duplicate(maskedbitmap->Handle())); - User::LeaveIfError(mask->Duplicate(maskedbitmap->Mask()->Handle())); - - CGulIcon* icon = CGulIcon::NewL(bitmap, mask); - //icon->SetBitmapsOwnedExternally(ETrue); - - CleanupStack::Pop(mask); - CleanupStack::Pop(bitmap); - - CleanupStack::PopAndDestroy(sizesArray); - CleanupStack::PopAndDestroy(maskedbitmap); - - return icon; - } - -// --------------------------------------------------------------------------- -// Checks if the target application is accessible. -// --------------------------------------------------------------------------- -// -TBool CAiScutTargetApp::IsAccessibleL(TInt /*aCheckType*/) - { - if (iAppUid == KNullUid || iEngine.IsHidden(iAppUid)) - { - return EFalse; - } - - TApaAppInfo appInfo; - TInt ret = iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); - - if (ret == RApaLsSession::EAppListInvalid) - { - // Application list not fully populated yet. Leave with KErrNotReady so - // the engine can trap it and start the timer to check accessiblity later. - User::Leave(KErrNotReady); - } - - return (ret == KErrNone); - } - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetApp::LaunchL() - { - LaunchL( KNullDesC8 ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetApp::LaunchL( const TDesC8& aCustomMessage ) - { - __PRINTS( "XAI: CAiScutShortcut::LaunchL"); - __PRINT( __DBG_FORMAT("XAI: type = %d"), Type()); - - if (iAppUid != KNullUid) - { - - // Some special cases - // --------------------------------- - if( Type() == EScutApplicationView && - iAppUid == KScutGeneralSettingsUid ) - { - CGSLauncher* l = CGSLauncher::NewLC(); - l->LaunchGSViewL ( iViewUid, - KScutActiveIdleUid, - aCustomMessage ); - CleanupStack::PopAndDestroy( l ); - - return; - } - else if ( ( ( Type() == EScutChangeTheme) && ( iAppUid == KScutPersonalisationUid ) ) || // For AI2 Themes - ( iAppUid == KScutDiallerUid ) ) // Dialer - { - const TVwsViewId viewId(iAppUid, iViewUid); - TUid msgId = KScutGeneralSettingsUid; - - if( iAppUid == KScutDiallerUid ) - { - msgId = KScutDiallerViewCommand; - RProperty::Set(KPSUidAiInformation, KActiveIdleState, EPSAiNumberEntry ); - } - - TInt err = iEngine.VwsSession()->CreateActivateViewEvent( viewId, msgId, aCustomMessage ); - - return; - } - - TBool exists = EFalse; - - CAknTaskList* taskList = CAknTaskList::NewL(iEngine.Env()->WsSession()); - TApaTask task(taskList->FindRootApp(iAppUid)); - delete taskList; - - exists = task.Exists(); - - // If not found, try again little harder - // ---------------------------------------- - if (!exists) - { - RWsSession wsSession = iEngine.Env()->WsSession(); - task.SetWgId(0); // Set task to non-existant task - TInt wgId=0; - CApaWindowGroupName::FindByAppUid(iAppUid, wsSession, wgId); - - if (wgId != KErrNotFound) - { - exists = ETrue; - task.SetWgId(wgId); - } - } - - // Actual reactivatio / starting - // ----------------------------- - if (exists) // Found, reactivate - { - if (iMsg && iMsg->Length()) - { - task.SendMessage(KNullUid, *iMsg); - } - if ( iAppUid == KScutAppShellUid ) // AppShell effect is an exception - { - //start different fullscreen effect when launching appshell - GfxTransEffect::BeginFullScreen( AknTransEffect::EApplicationActivate , - TRect(0,0,0,0), - AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( iAppUid, - AknTransEffect::TParameter::EActivateExplicitContinue ) ); - } - - if( iAppUid == KScutAppShellUid ) // Appshell starting is an exception - { - task.SendMessage( KUidApaMessageSwitchOpenFile , KNullDesC8 ); - } - else - { - // If message was sent, don't try to bring task to foreground as task will do it itself - if ( !( (iAppUid == KScutLogsUid) && (iMsg && iMsg->Length() > 0)) ) - { - CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToForeground); - } - } - } - else // Not exists, starting - { - TApaAppInfo appInfo; - - if (iEngine.ApaSession().GetAppInfo(appInfo, iAppUid) == KErrNone) - { - if (FeatureManager::FeatureSupported(KFeatureIdCommonVoip) && - (iAppUid == KScutEasyVoIPApplicationUid) ) - { - SetEasyVoIPShortcutStartL(); - } - - CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); - cmdLine->SetExecutableNameL(appInfo.iFullName); - if (iMsg && iMsg->Length()) - { - cmdLine->SetCommandL(EApaCommandRun); - cmdLine->SetTailEndL(*iMsg); - } - if (iBackground) - { - cmdLine->SetCommandL(EApaCommandBackground); - } - if ( iAppUid == KScutVoiceDialUid ) - { - cmdLine ->SetCommandL( EApaCommandRunWithoutViews ); - } - - TInt err = iEngine.ApaSession().StartApp(*cmdLine); - - - __PRINT( __DBG_FORMAT("XAI: StartApp err = %d"), err); - - User::LeaveIfError(err); - - CleanupStack::PopAndDestroy(cmdLine); - } - } - } - } - - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetApp::AppUid() const - { - -#ifdef __WEB_WIDGETS - // for widgets return widgetapp uid. - if (iEngine.IsWidget(iAppUid)) - { - return KUidWidgetUi; - } -#endif - - return iAppUid; - } - -// --------------------------------------------------------------------------- -// Return the view id -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetApp::AdditionalUid() const - { - return iViewUid; - } - -// --------------------------------------------------------------------------- -// CScShortcutNativeApp::SetEasyVoIPShortcutStartL() -// -// Performs Central Repository shortcut set for EasyVoIP application. -// --------------------------------------------------------------------------- -// -void CAiScutTargetApp::SetEasyVoIPShortcutStartL() const - { - CRepository* repository = CRepository::NewL(KUidEasyVoIPRepository); - CleanupStack::PushL(repository); - - // Set shortcut start for EasyVoIP application. - TInt error = repository->Set(KEasyVoIPShortcutStartup, 1); - User::LeaveIfError(error); - - CleanupStack::PopAndDestroy(repository); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetbkm.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetbkm.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for bookmark shortcut target -* -*/ - - -#include // For CCoeEnv -#include // For RWsSession -#include // For TApaTaskList -#include // For CGulIcon -#include // For AknsUtils -#include - -#include "aiscutcontentmodel.h" -#include "caiscuttargetbkm.h" -#include "caiscutengine.h" -#include - -#include "debug.h" - - - -_LIT16(KParam, "1 "); -const TInt KTBUF16 = 16; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetBkm::CAiScutTargetBkm(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetBkm::ConstructL(const TAiScutParser& aParser) -{ - iDefinition = aParser.Get(EScutDefComplete).AllocL(); - iBkmUid = aParser.ParseUid(aParser.Get(EScutDefParamValue)); -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetBkm* CAiScutTargetBkm::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) -{ - CAiScutTargetBkm* self = new (ELeave) CAiScutTargetBkm(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aParser); - CleanupStack::Pop(self); - - return self; -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetBkm::~CAiScutTargetBkm() -{ - delete iCaption; - delete iDefinition; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetBkm::Definition() const -{ - return iDefinition ? TPtrC(*iDefinition) : TPtrC(); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetBkm::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const -{ - // Use lazy evaluation, create the caption only when it is first needed. - if (!iCaption) - { - // Get the caption. - TRAP_IGNORE(GetCaptionL()); - } - - aDes.Set(iCaption ? *iCaption : KNullDesC()); - - return 0; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -void CAiScutTargetBkm::GetCaptionL() const -{ - RFavouritesDb& db = iEngine.FavouritesDb(); - - CFavouritesItem* favItem = CFavouritesItem::NewLC(); - TInt err = db.Get(iBkmUid.iUid, *favItem); - iCaption = favItem->Name().AllocL(); - - CleanupStack::PopAndDestroy(favItem); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetBkm::GetIcon(CGulIcon*& aIcon) const -{ - if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) - { - - CGulIcon* tempIcon = NULL; - - TFileName pluginIconFile(KDC_APP_BITMAP_DIR); - pluginIconFile.Append(KBitmapFile); - - TRAP_IGNORE( - tempIcon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnPropAiShortcut, - pluginIconFile, - EMbmAiscutpluginQgn_menu_url, - EMbmAiscutpluginQgn_menu_url_mask - ) - ); - - aIcon = tempIcon; - } - - return 0; -} - -// ----------------------------------------------------------------------------- -// Checks if the target bookmark is accessible. -// ----------------------------------------------------------------------------- -// -TBool CAiScutTargetBkm::IsAccessibleL(TInt /*aCheckType*/) -{ - if (iBkmUid == KNullUid) - { - return EFalse; - } - - // Search bookmark from favourites. - RFavouritesDb& db = iEngine.FavouritesDb(); - - TBool exists = EFalse; - TInt err = db.ItemExists(iBkmUid.iUid, exists); - if (err != KErrNone) - { - exists = EFalse; - } - - return exists; -} - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CAiScutTargetBkm::LaunchL() -{ -/* -1. Start/Continue the browser and nothing is specified (the default case) Parameter = -2. Start/Continue the browser specifying a Bookmark Parameter = "1"+""+"" -3. Start/Continue the browser specifying a Saved deck Parameter = "2"+""+"" -4. Start/Continue the browser specifying a URL Parameter = "4"+""+"" -5. Start/Continue the browser specifying a URL and an Access Point Parameter = "4"+""+""+""+"" -6. Start/Continue the browser with the start page. - (Used when starting the browser with a long press of "0" in the - Idle state of the phone. Parameter = "5" -7. Start/Continue the browser specifying a Bookmark folder Parameter = "6"+""+"" -*/ - - TApaTaskList taskList(iEngine.Env()->WsSession()); - TApaTask task = taskList.FindApp(KScutBrowserUid); - - - TBuf param(KParam); - param.AppendNum(iBkmUid.iUid); - - __PRINT( __DBG_FORMAT("XAI: CAiScutTargetBkm::LaunchL '%S' "), ¶m); - - if (task.Exists()) - { - HBufC8* param8 = HBufC8::NewLC(param.Length()); - param8->Des().Copy(param); - task.SendMessage(KNullUid, *param8); // Uid is not used. - CleanupStack::PopAndDestroy(param8); - } - else - { - TThreadId id; - User::LeaveIfError(iEngine.ApaSession().StartDocument( - param, KScutBrowserUid, id)); - } -} - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetBkm::AppUid() const -{ - return KScutBrowserUid; -} - -// --------------------------------------------------------------------------- -// Return the bkm id -// --------------------------------------------------------------------------- -TUid CAiScutTargetBkm::AdditionalUid() const - { - return iBkmUid; - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetempty.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetempty.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for empty target. -* -*/ - - -#include "caiscuttargetempty.h" - -// ---------------------------------------------------------------------------- -// CAiScutEmpty::CAiScutEmpty -// ---------------------------------------------------------------------------- -// -CAiScutTargetEmpty::CAiScutTargetEmpty(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - -// ---------------------------------------------------------------------------- -// CAiScutEmpty::ConstructL -// ---------------------------------------------------------------------------- -// -void CAiScutTargetEmpty::ConstructL(const TDesC& aTarget) -{ - iDefinition = aTarget.AllocL(); -} - -// ---------------------------------------------------------------------------- -// CAiScutEmpty::NewL -// ---------------------------------------------------------------------------- -// -CAiScutTargetEmpty* CAiScutTargetEmpty::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget) -{ - CAiScutTargetEmpty* self = new (ELeave) CAiScutTargetEmpty(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aTarget); - CleanupStack::Pop(self); - - return self; -} - -// ---------------------------------------------------------------------------- -// CAiScutEmpty::~CAiScutEmpty -// ---------------------------------------------------------------------------- -// -CAiScutTargetEmpty::~CAiScutTargetEmpty() -{ - delete iDefinition; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetEmpty::Definition() const -{ - return iDefinition ? TPtrC(*iDefinition) : TPtrC(); -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetEmpty::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const -{ - aDes.Set(KNullDesC()); - return 0; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetEmpty::GetIcon(CGulIcon*& aIcon) const -{ - aIcon = NULL; - return 0; -} - -// ----------------------------------------------------------------------------- -// Checks if the target is accessible -// ----------------------------------------------------------------------------- -// -TBool CAiScutTargetEmpty::IsAccessibleL(TInt /*aCheckType*/) -{ - return (iType != EScutUnknown); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CAiScutTargetEmpty::LaunchL() -{ -} - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetEmpty::AppUid() const -{ - return KNullUid; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargethttp.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargethttp.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for http shortcut target -* -*/ - - -#include // For CCoeEnv -#include // For RWsSession -#include // For TApaTaskList -#include // For CGulIcon -#include // For AknsUtils -#include - -#include "caiscuttargethttp.h" -#include "caiscutengine.h" -#include - -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetHttp::CAiScutTargetHttp(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetHttp::ConstructL(const TAiScutParser& aParser) -{ - iDefinition = aParser.Get( EScutDefComplete ).AllocL(); - iChecksum = TUid::Uid( aParser.ChecksumForString( *iDefinition) ); - - // Get the possible custom title string from the parser - iCaption = HBufC::NewL( iDefinition->Length() ); - TPtr captionPtr = iCaption->Des(); - TInt err = aParser.CustomTitle( captionPtr ); - - if ( err != KErrNone || iCaption->Length() <= 0 ) - { - delete iCaption; - iCaption = NULL; - } - TPtr defPtr = iDefinition->Des(); - // we need to strip the possible icon definitions away from - // the URL as they are not part of it. - aParser.RemoveExtraDefinitionsL( defPtr ); -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetHttp* CAiScutTargetHttp::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) -{ - CAiScutTargetHttp* self = new (ELeave) CAiScutTargetHttp(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aParser); - CleanupStack::Pop(self); - - return self; -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetHttp::~CAiScutTargetHttp() -{ - delete iDefinition; - delete iCaption; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetHttp::Definition() const -{ - return iDefinition ? TPtrC(*iDefinition) : TPtrC(); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetHttp::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const -{ - // Custom title is fetched when constructing. If no custom - // title then use part of the URL as title - if ( !iCaption ) - { - TUriParser parser; - TInt err = parser.Parse(*iDefinition); - - if (err == KErrNone) - { - // Remove scheme from the url. - iCaption = parser.Extract(EUriHost).Alloc(); - } - else - { - iCaption = iDefinition->Alloc(); - } - } - - aDes.Set(*iCaption); - - return 0; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetHttp::GetIcon(CGulIcon*& aIcon) const -{ - - if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) - { - CGulIcon* tempIcon = NULL; - - TFileName pluginIconFile(KDC_APP_BITMAP_DIR); - pluginIconFile.Append(KBitmapFile); - - TRAP_IGNORE( - tempIcon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnPropAiShortcut, - pluginIconFile, - EMbmAiscutpluginQgn_menu_url, - EMbmAiscutpluginQgn_menu_url_mask - ) - ); - - aIcon = tempIcon; - } - return 0; -} - - -// --------------------------------------------------------------------------- -// Checks if the shortcut target is accessible. -// --------------------------------------------------------------------------- -// -TBool CAiScutTargetHttp::IsAccessibleL(TInt /*aCheckType*/) -{ - return (iDefinition->Length() > 0); -} - - -// ----------------------------------------------------------------------------- -// Launches the browser -// ----------------------------------------------------------------------------- -// -void CAiScutTargetHttp::LaunchL() -{ - // Store the http address directly in the browser parameter format. - // For example "4 http://www.nokia.com". 4 = open an url. - HBufC* param = HBufC::NewLC(iDefinition->Length() + KOpenUrlParam().Length()); - param->Des().Copy(KOpenUrlParam()); - param->Des().Append(*iDefinition); - - __PRINT( __DBG_FORMAT("XAI: CAiScutTargetHttp::LaunchL '%S' "), param); - - TApaTaskList taskList(iEngine.Env()->WsSession()); - TApaTask task = taskList.FindApp(KScutBrowserUid); - - if (task.Exists()) - { - HBufC8* param8 = HBufC8::NewLC(param->Length()); - param8->Des().Copy(*param); - task.SendMessage(KNullUid, *param8); // Uid is not used. - CleanupStack::PopAndDestroy(param8); - } - else - { - TThreadId id; - User::LeaveIfError(iEngine.ApaSession().StartDocument( - *param, KScutBrowserUid, id)); - } - - CleanupStack::PopAndDestroy(param); -} - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetHttp::AppUid() const -{ - return KScutBrowserUid; -} - -TUid CAiScutTargetHttp::AdditionalUid() const -{ - return iChecksum; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetkeylock.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetkeylock.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for key lock -* -*/ - - -#include "caiscuttargetkeylock.h" -#include - -// Amount of attempts to try to connect to server. -const TInt KTriesToConnectServer(3); - -// Delay between retries to connect. -const TInt KTimeBeforeRetryingServerConnection(50000); - -// ---------------------------------------------------------------------------- -// CAiScutKeyLock::CAiScutKeyLock -// ---------------------------------------------------------------------------- -// -CAiScutTargetKeyLock::CAiScutTargetKeyLock(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - -// ---------------------------------------------------------------------------- -// CAiScutKeyLock::ConstructL -// ---------------------------------------------------------------------------- -// -void CAiScutTargetKeyLock::ConstructL(const TDesC& aTarget) -{ - iDefinition = aTarget.AllocL(); - - TInt err(KErrGeneral); - TInt thisTry(0); - - // Try connect successfully with server limited a number of times - err = iKeyLock.Connect(); - while ((err != KErrNone) && (thisTry++ < KTriesToConnectServer)) - { - User::After(KTimeBeforeRetryingServerConnection); - err = iKeyLock.Connect(); - } - User::LeaveIfError(err); - -} - -// ---------------------------------------------------------------------------- -// CAiScutKeyLock::NewL -// ---------------------------------------------------------------------------- -// -CAiScutTargetKeyLock* CAiScutTargetKeyLock::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget) -{ - CAiScutTargetKeyLock* self = new (ELeave) CAiScutTargetKeyLock(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aTarget); - CleanupStack::Pop(self); - - return self; -} - -// ---------------------------------------------------------------------------- -// CAiScutKeyLock::~CAiScutKeyLock -// ---------------------------------------------------------------------------- -// -CAiScutTargetKeyLock::~CAiScutTargetKeyLock() -{ - delete iDefinition; - iKeyLock.Close(); -} - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetKeyLock::Definition() const -{ - return iDefinition ? TPtrC(*iDefinition) : TPtrC(); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetKeyLock::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const -{ - aDes.Set(KNullDesC()); - return 0; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetKeyLock::GetIcon(CGulIcon*& aIcon) const -{ - aIcon = NULL; - return 0; -} - - -// ----------------------------------------------------------------------------- -// Checks if the target is accessible -// ----------------------------------------------------------------------------- -// -TBool CAiScutTargetKeyLock::IsAccessibleL(TInt /*aCheckType*/) -{ - return ETrue; -} - - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CAiScutTargetKeyLock::LaunchL() -{ - EnableKeyLock(); -} - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetKeyLock::AppUid() const -{ - return KNullUid; -} - - -// ---------------------------------------------------------------------------- -// CAiScutTargetKeyLock::EnableKeyLock -// ---------------------------------------------------------------------------- -// -void CAiScutTargetKeyLock::EnableKeyLock() -{ - iKeyLock.EnableKeyLock(); -} - - -// ---------------------------------------------------------------------------- -// CAiScutTargetKeyLock::IsKeyLockEnabled -// ---------------------------------------------------------------------------- -// -TBool CAiScutTargetKeyLock::IsKeyLockEnabled() -{ - return iKeyLock.IsKeyLockEnabled(); -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetmessagingview.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetmessagingview.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for messaging view shortcut target -* -*/ - - -#include // For KMsvRootIndexEntryIdValue -#include // For CGulIcon -#include -#include // For CVwsSessionWrapper -#include // For AknsUtils -#include -#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#endif - -#include "caiscuttargetmessagingview.h" -#include "caiscutengine.h" -#include - -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetMessagingView::CAiScutTargetMessagingView(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetMessagingView::ConstructL(const TAiScutParser& aParser) -{ - iDefinition = aParser.Get(EScutDefComplete).AllocL(); - // Updates the view name also - FindViewIdL(); -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetMessagingView* CAiScutTargetMessagingView::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) -{ - CAiScutTargetMessagingView* self = new (ELeave) CAiScutTargetMessagingView(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aParser); - CleanupStack::Pop(self); - - return self; -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetMessagingView::~CAiScutTargetMessagingView() -{ - delete iDefinition; - delete iViewName; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetMessagingView::Definition() const -{ - return TPtrC(*iDefinition); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetMessagingView::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const -{ - aDes.Set(*iViewName); - return 0; -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetMessagingView::GetIcon(CGulIcon*& aIcon) const -{ - if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) - { - TRAP_IGNORE(GetIconL(aIcon)); - } - - return 0; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -void CAiScutTargetMessagingView::GetIconL(CGulIcon*& aIcon) const -{ - CGulIcon* tempIcon = NULL; - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsUtils::CreateAppIconLC(skin, KScutMessagingUid, EAknsAppIconTypeList, bitmap, mask); - - tempIcon = CGulIcon::NewL(bitmap, mask); - - CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number - // because the order in which they are pushed in is undefined. - - //Do not need to sets the bitmap and mask to be owned externally - - aIcon = tempIcon; -} - - -// --------------------------------------------------------------------------- -// Checks if the shortcut target is accessible. -// --------------------------------------------------------------------------- -// -TBool CAiScutTargetMessagingView::IsAccessibleL(TInt /*aCheckType*/) -{ - return FindViewIdL() != KErrNotFound; -} - - -// --------------------------------------------------------------------------- -// Launches a remote mailbox. -// --------------------------------------------------------------------------- -// -void CAiScutTargetMessagingView::LaunchL() -{ - TMsvId id(FindViewIdL()); - if (id != KErrNotFound) - { - const TVwsViewId viewId(KScutMessagingUid, KScutRemoteMailboxViewId); - iEngine.VwsSession()->CreateActivateViewEvent(viewId, TUid::Uid(id), KNullDesC8()); - } -} - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetMessagingView::AppUid() const -{ - return KScutMessagingUid; -} - - -// --------------------------------------------------------------------------- -// Tries to find a view id. -// --------------------------------------------------------------------------- -// -TMsvId CAiScutTargetMessagingView::FindViewIdL() - { - TMsvId id(KErrNotFound); - - TInt mailboxId = KErrNone; - TAiScutParser parser; - parser.Parse(*iDefinition); - TLex lex(parser.Get(EScutDefParamValue)); - lex.Val(mailboxId); - - if (iEngine.MsvSession()) - { - // KErrNotReady is the only allowed leave code. Engine will trap it and start a timer - // to check access later. Other possible leaves emitted by the message server are - // substituted with KErrNotReady. - CMsvEntry* rootEntry = NULL; - TRAPD(err, rootEntry = iEngine.MsvSession()->GetEntryL(KMsvRootIndexEntryIdValue)); - if (err != KErrNone) - { - User::Leave(KErrNotReady); - } - - if(rootEntry) - { - // No leaving code here since rootEntry is not in cleanup stack. - for (TInt i = rootEntry->Count(); --i >= 0;) - { - const TMsvEntry& tentry = (*rootEntry)[i]; - - __PRINT( __DBG_FORMAT("XAI: CAiScutTargetMessagingView::FindViewIdL id = 0x%x '%S'"), - tentry.Id(), &tentry.iDetails); - if ((tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) && - tentry.Id() == mailboxId) - { - id = tentry.Id(); - delete iViewName; - iViewName = NULL; - iViewName = tentry.iDetails.AllocL(); - break; - } - } - - delete rootEntry; - rootEntry = NULL; - - } - } - - return id; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/caiscuttargetnewmsg.cpp --- a/idlefw/plugins/shortcutplugin/src/caiscuttargetnewmsg.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for new message shortcut target -* -*/ - - -#include // For CSendUi -#include // For settings not ok - error dialog -#include // For CGulIcon -#include -#include // For finding out available email account counts -#include // For AknsUtils - -#include - -#include -#include // For error note -#include -#include - -#include "aiscutcontentmodel.h" -#include "caiscuttargetnewmsg.h" -#include "caiscutengine.h" -#include -#include -#include -#include -#include - -#include "debug.h" - -using namespace conn; -const TInt KMaxBufSize = 256; - -// Status keys adopted from FileManager to be used when checking file backup status -const TUid KPSUidFileManagerStatus = { 0x101F84EB }; // File Manager SID -const TUint32 KFileManagerBkupStatus = 0x00000001; - -enum TFileManagerBkupStatusType - { - EFileManagerBkupStatusUnset = 0x00000000, - EFileManagerBkupStatusBackup = 0x00000001, - EFileManagerBkupStatusRestore = 0x00000002 - }; - -TBool PhoneIsInBackupOrRestoreMode() - { - TBool backupOrRestore = EFalse; - - TInt status( EFileManagerBkupStatusUnset ); - TInt err( RProperty::Get( KPSUidFileManagerStatus, KFileManagerBkupStatus, status ) ); - if ( status == EFileManagerBkupStatusBackup ) - { - backupOrRestore = ETrue; - return backupOrRestore; - } - - // Get the back-up restore key, return EFalse if we can't get the key - TInt keyVal = 0; - const TInt error = RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal ); - if( error ) - { - return backupOrRestore; - } - - const conn::TBURPartType partType = static_cast< conn::TBURPartType >( keyVal & conn::KBURPartTypeMask ); - if (keyVal != 0) - { - switch(partType) - { - case EBURUnset: - case EBURNormal: - break; - case EBURBackupFull: - case EBURBackupPartial: - case EBURRestoreFull: - case EBURRestorePartial: - backupOrRestore = ETrue; - break; - } - } - // - - return backupOrRestore; - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetNewMsg::CAiScutTargetNewMsg(CAiScutEngine& aEngine, TShortcutType aType) - : CAiScutTarget(aEngine, aType) -{ -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CAiScutTargetNewMsg::ConstructL(const TAiScutParser& aParser) -{ - iDefinition = aParser.Get(EScutDefComplete).AllocL(); - - iAppUid = KNullUid; - iViewUid.iUid = -1; - - switch (aParser.Type()) - { - case EScutNewMessage: - iMtm = KSenduiMtmUniMessageUid; - iAppUid.iUid = KScutUnifiedEditorUidValue; - break; - - case EScutNewEmail: - iMtm = KSenduiMtmSmtpUid; - iAppUid.iUid = KScutEmailEditorUidValue; - break; - -#ifdef __SYNCML_DS_EMAIL - case EScutNewSyncMLMail: - iMtm = KSenduiMtmSyncMLEmailUid; - iAppUid.iUid = KScutEmailEditorUidValue; // check that these uids are in sync with aiscuttexts.rss - iViewUid.iUid = KScutSyncMlEmailUidValue; - break; -#endif - - case EScutNewPostcard: - iMtm = KSenduiMtmPostcardUid; - iAppUid.iUid = KScutPostcardEditorUidValue; - break; - - case EScutNewAudioMsg: - iMtm = KSenduiMtmAudioMessageUid; - iAppUid.iUid = KScutAmsEditorUidValue; - break; - - case EScutNewMsgType: - iAppUid.iUid = KScutMessagingCenterUidValue; // check that these uids are in sync with aiscuttexts.rss - iViewUid.iUid = KScutMessagingCenterUidValue; - // fallthrough - default: - iMtm = KNullUid; - break; - } -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetNewMsg* CAiScutTargetNewMsg::NewL( - CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) -{ - CAiScutTargetNewMsg* self = new (ELeave) CAiScutTargetNewMsg(aEngine, aType); - - CleanupStack::PushL(self); - self->ConstructL(aParser); - CleanupStack::Pop(self); - - return self; -} - - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CAiScutTargetNewMsg::~CAiScutTargetNewMsg() -{ - delete iCaption; - delete iShortCaption; - delete iDefinition; - -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut definition string. -// --------------------------------------------------------------------------- -// -TPtrC CAiScutTargetNewMsg::Definition() const -{ - return TPtrC(*iDefinition); -} - - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetNewMsg::GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const -{ - TRAP_IGNORE(GetCaptionL(aTitleType)); - - if (aTitleType == EAiScutSkeyTitle) - { - aDes.Set(iShortCaption ? *iShortCaption : KNullDesC()); - } - else - { - aDes.Set(iCaption ? *iCaption : KNullDesC()); - } - - return 0; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target caption. -// --------------------------------------------------------------------------- -// -void CAiScutTargetNewMsg::GetCaptionL(TAiScutAppTitleType aTitleType) const -{ - HBufC* titlePtr = HBufC::NewLC(KMaxBufSize); - TPtr titlePtrP = titlePtr->Des(); - - - // Use lazy evaluation, create the caption only when it is first needed. - if (aTitleType == EAiScutSkeyTitle) - { - if (!iShortCaption) - { - if (iEngine.GetAppTitle(iAppUid, iViewUid, titlePtrP, aTitleType)) - { - iShortCaption = titlePtrP.AllocL(); - } - } - } - else - { - if (!iCaption) - { - if (iEngine.GetAppTitle(iAppUid, iViewUid, titlePtrP, aTitleType)) - { - iCaption = titlePtrP.AllocL(); - } - } - } - - CleanupStack::PopAndDestroy(titlePtr); -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -TInt CAiScutTargetNewMsg::GetIcon(CGulIcon*& aIcon) const -{ - if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) - { - TRAP_IGNORE(GetIconL(aIcon)); - } - - - return 0; -} - -// --------------------------------------------------------------------------- -// Returns the shortcut target icon. -// --------------------------------------------------------------------------- -// -void CAiScutTargetNewMsg::GetIconL(CGulIcon*& aIcon) const -{ - - CGulIcon* tempIcon = NULL; - TBool useAppIcon = ETrue; - TInt iconId = 0; - TInt maskId = 0; - - if (iMtm == KNullUid) - { - useAppIcon = EFalse; - iconId = EMbmAiscutpluginQgn_menu_mce_sel_mes; - maskId = EMbmAiscutpluginQgn_menu_mce_sel_mes_mask; - } -#ifdef __SYNCML_DS_EMAIL - else if (iMtm.iUid == KSenduiMtmSyncMLEmailUidValue) - { - useAppIcon = EFalse; - iconId = EMbmAiscutpluginQgn_menu_mce_syncmail; - maskId = EMbmAiscutpluginQgn_menu_mce_syncmail_mask; - } -#endif - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - if (useAppIcon) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknsUtils::CreateAppIconLC(skin, iAppUid, EAknsAppIconTypeList, bitmap, mask); - tempIcon = CGulIcon::NewL(bitmap, mask); - CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number - // because the order in which they are pushed in is undefined. - } - else - { - TFileName pluginIconFile(KDC_APP_BITMAP_DIR); - pluginIconFile.Append(KBitmapFile); - - tempIcon = AknsUtils::CreateGulIconL( - skin, - KAknsIIDQgnPropAiShortcut, - pluginIconFile, - iconId, - maskId - ); - } - - //Do not need to sets the bitmap and mask to be owned externally - - - aIcon = tempIcon; -} - - -// ----------------------------------------------------------------------------- -// Checks if the shortcut target is accessible. -// ----------------------------------------------------------------------------- -// -TBool CAiScutTargetNewMsg::IsAccessibleL(TInt /*aCheckType*/) -{ - return ETrue; -} - - -// ----------------------------------------------------------------------------- -// Launches the message editor to send an Sms, Mms or Email message. -// ----------------------------------------------------------------------------- -// -void CAiScutTargetNewMsg::LaunchL() - { - if( PhoneIsInBackupOrRestoreMode() ) - { - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - - HBufC* prompt = StringLoader::LoadLC( R_QTN_AI_SCUT_OPERATION_DISABLED ); - - note->SetSoftkeys( R_AVKON_SOFTKEYS_OK_EMPTY ); - note->ShowNoteL( EAknGlobalInformationNote, *prompt ); - - CleanupStack::PopAndDestroy( prompt ); - CleanupStack::PopAndDestroy( note ); - return; - } - - CSendUi* sendUi = CSendUi::NewLC(); - - if (iMtm == KNullUid) - { - TSendingCapabilities capabs(0, 0, TSendingCapabilities::ESupportsEditor); - - TUid uid = sendUi->ShowTypedQueryL(CSendUi::EWriteMenu, NULL, capabs, NULL, KNullDesC); - if (uid != KNullUid) - { - sendUi->ServiceCapabilitiesL(uid, capabs); - sendUi->CreateAndSendMessageL(uid, NULL, KNullUid, EFalse); // launch standalone - } - } - else - { - if( iMtm == KSenduiMtmSmtpUid ) // pop, imap, smtp - { - RArray popAccounts; - RArray imapAccounts; - RArray smtpAccounts; - CEmailAccounts* emailAccounts = CEmailAccounts::NewLC(); - // check that mailbox exists or else display error message - emailAccounts->GetPopAccountsL(popAccounts); - emailAccounts->GetImapAccountsL(imapAccounts); - emailAccounts->GetSmtpAccountsL(smtpAccounts); - CleanupStack::PopAndDestroy(emailAccounts); - - if( iMtm == KSenduiMtmSmtpUid && - (popAccounts.Count() + imapAccounts.Count() + smtpAccounts.Count() ) > 0 ) - { - sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone - } - else - { - ShowErrorNote(); - } - popAccounts.Reset(); - imapAccounts.Reset(); - smtpAccounts.Reset(); - } - else if ( iMtm == KSenduiMtmSyncMLEmailUid ) // syncml - { - CMsvEntrySelection* sel = - MsvUiServiceUtilities::GetListOfAccountsWithMTML( *(iEngine.MsvSession()), iMtm ); - TInt accounts = sel->Count(); - delete sel; - if ( accounts > 0 ) - { - sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone - } - else - { - ShowErrorNote(); - } - } - else - { - sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone - } - - } - CleanupStack::PopAndDestroy(sendUi); -} - -void CAiScutTargetNewMsg::ShowErrorNote() - { - TRAP_IGNORE( - // Display global error note. - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - HBufC* prompt = StringLoader::LoadLC( R_SENDUI_SETTINGS_NOT_OK ); - note->ShowNoteL( EAknGlobalErrorNote, *prompt ); - CleanupStack::PopAndDestroy( prompt ); - CleanupStack::PopAndDestroy( note ); - ); // end TRAP_IGNORE - } - -// --------------------------------------------------------------------------- -// Return application uid this target launches. -// --------------------------------------------------------------------------- -// -TUid CAiScutTargetNewMsg::AppUid() const -{ - return iAppUid; -} - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/cpopupeventhandler.cpp --- a/idlefw/plugins/shortcutplugin/src/cpopupeventhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,238 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut plug-in Popup event handler class -* -*/ - - -#include "cpopupeventhandler.h" -#include "PopupFSM.h" -#include "mpopupeventhandleractions.h" - -/** - * Timeout timer values - */ -const TInt KTimeoutShort = 900000; //900 ms -const TInt KTimeoutLong = 6000000; //6 sec - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CPopupEventHandler* CPopupEventHandler::NewL( - MPopupEventHandlerActions& aPopupEventHandlerActions ) - { - CPopupEventHandler* self = CPopupEventHandler::NewLC( aPopupEventHandlerActions ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CPopupEventHandler* CPopupEventHandler::NewLC( - MPopupEventHandlerActions& aPopupEventHandlerActions ) - { - CPopupEventHandler* self = new( ELeave ) CPopupEventHandler( - aPopupEventHandlerActions ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CPopupEventHandler::~CPopupEventHandler() - { - Cancel(); - iTimer.Close(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -CPopupEventHandler::CPopupEventHandler( - MPopupEventHandlerActions& aPopupEventHandlerActions ) - : CActive( EPriorityStandard ), - iPopupEventHandlerActions( aPopupEventHandlerActions ), - iPopupFSM( *this ), - iPublishPopup( ETrue ), - iPublishCaption( ETrue ), - iCaptionVisible( ETrue ) - { - } - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::ConstructL() - { - User::LeaveIfError( iTimer.CreateLocal() ); - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TPopupFSM& CPopupEventHandler::PopupFSM() - { - return iPopupFSM; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CPopupEventHandler::PublishPopup() const - { - return iPublishPopup; - } - -TBool CPopupEventHandler::PopupVisible() const - { - return iPopupVisible; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TBool CPopupEventHandler::PublishCaption() const - { - return iPublishCaption; - } - -TBool CPopupEventHandler::CaptionVisible() const - { - return iCaptionVisible; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::DoCancel() - { - iTimer.Cancel(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::RunL() - { - iPopupFSM.HandleRequestCompleted(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::CompleteSelf() - { - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::CancelRequest() - { - Cancel(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::StartShortTimer() - { - Cancel(); // Cancel previous request by calling iTimer.Cancel() - iTimer.After( iStatus, KTimeoutShort ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::StartLongTimer() - { - Cancel(); // Cancel previous request by calling iTimer.Cancel() - iTimer.After( iStatus, KTimeoutLong ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::IssuePublishPopup() - { - iPublishPopup = ETrue; - iPopupVisible = ETrue; - iPopupEventHandlerActions.IssuePublishShortcut(); - iPublishPopup = EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::IssueCleanPopup() - { - iPublishPopup = ETrue; - iPopupVisible = EFalse; - iPopupEventHandlerActions.IssuePublishShortcut(); - iPublishPopup = EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::IssuePublishCaption() - { - iPublishCaption = ETrue; - iCaptionVisible = ETrue; - iPopupEventHandlerActions.IssuePublishShortcut(); - iPublishCaption = EFalse; - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CPopupEventHandler::IssueCleanCaption() - { - iPublishCaption = ETrue; - iCaptionVisible = EFalse; - iPopupEventHandlerActions.IssuePublishShortcut(); - iPublishCaption = EFalse; - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/shortcutplugin/src/taiscutparser.cpp --- a/idlefw/plugins/shortcutplugin/src/taiscutparser.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,816 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Shortcut definition parser -* -*/ - - -#include "taiscutparser.h" -#include "aiscutdefs.h" - -#include "debug.h" - - -// ======== LOCAL FUNCTIONS ======== -/** - * Extract a value with the given name from a URI query string. - * For example a query string of ?view=1234&iconid=3;5&foo=bar - * and we wanted iconid from that string. Function places the 3;5 - * into aValue and if needed deletes the "iconid=3;5&" string from the - * query string. - * - * @param aQueryString The querystring - * @param aParameterName The name of the parameter to find - * @param aValue Where to place the value - * @param aRemoveNameAndValue ETrue to remove the name=value from the querystring - * @return KErrNone on succesful extraction. KErrNotFound if the parameter was not found -*/ -TInt ExtractValueFromQueryString( TDes &aQueryString, const TDesC &aParameterName, - TDes &aValue, TBool aRemoveNameAndValue ) - { - TInt err = KErrNone; - HBufC *tempBuffer = aQueryString.Alloc(); - if ( !tempBuffer ) - { - return KErrNoMemory; - } - - TPtr temp = tempBuffer->Des(); - - TInt foundStartPos = 0; - TInt foundStopPos = 0; - foundStartPos = aQueryString.FindC(aParameterName); - if ( foundStartPos != KErrNotFound ) - { - // remove the beginning of the string from temp, so no additional &-marks are found - // at the start of string - temp.Delete(0,foundStartPos); - - foundStopPos = temp.Locate(KParamNextSeparator); - // stop either at the eos or at the next & mark - foundStopPos = (foundStopPos != KErrNotFound ) ? (foundStopPos): (temp.Length() ); - // start after the = separator and stop either on eos or at & mark - TInt from = (aParameterName.Length() + 1); - TInt length = foundStopPos - from; - - // Get just the value part - if ( aValue.MaxLength() >= length ) - { - aValue = temp.Mid( from, length ); - } - else // Can't place the value to aValue string - { - err = KErrNoMemory; - } - - if ( err == KErrNone && aRemoveNameAndValue ) - { - // Delete the aParameterName=aValue string from the querystring - // If eos reached then we need to delete the & before us also - // Don't try to delete if this is an only parameter - if ( foundStopPos == temp.Length() && foundStartPos > 0 ) - { - aQueryString.Delete(foundStartPos - 1, (foundStopPos + 1)); - } - else - { - aQueryString.Delete(foundStartPos, (foundStopPos + 1)); - } - } - } - else - { - err = KErrNotFound; - } - - delete tempBuffer; - return err; - } - -/** - * Tests if string ends with given pattern - * - * @param aString input string - * @param aPattern test pattern - * @return ETrue if string ends with given pattern. - */ -TBool EndsWith( const TDesC& aString, const TDesC& aPattern ) - { - TBuf<10> temp(aString.Right(aPattern.Length())); - return ( aString.Right( aPattern.Length() ) == aPattern ); - } - -/** - * Resolves skin item id from pattern majorId;minorId;colourGroupId. - * The colourGroupId in the syntax is optional, and if no value found then - * aColourValue will be -1 - * - * @param aPath skin item id string - * @param aItemId skin item id to fill - * @param aColourValue colour value to fill. - * - * @return ETrue if id was succesfully parsed. - */ -TBool ResolveSkinItemId( const TDesC& aPath, TAknsItemID& aItemId, TInt& aColourValue ) - { - // Syntax: major;minor;colourgroup - aColourValue = -1; - - // Initialize lexer - TLex lex( aPath ); - lex.SkipSpace(); - - TInt majorId( 0 ); - TInt minorId( 0 ); - - // Resolve major id - TInt error = lex.Val( majorId ); - - // Resolve minor id - if ( lex.Eos()) - return KErrNotFound; - - lex.Inc(); - error |= lex.Val( minorId ); - - // initilize skin item id object - aItemId.Set( majorId, minorId ); - - if ( lex.Eos()) - return KErrNotFound; - lex.Inc(); - - TInt colorError = lex.Val( aColourValue ); - if ( colorError != KErrNone || aColourValue < 0) - { - aColourValue = -1; - } - - // Check error - return ( error == KErrNone ); - - } - -/** -* Resolves filename and id from syntax -* filename.ext;id. If the syntax is incorrect -* aId is -1 and filename zeroed and EFalse is returned -* MIF and MBM supported. -* -* @param aPath The path to extract the data from -* @param aId Id to fill -* @param aFilename Filename to fill -* @return ETrue if id and path was succesfully parsed. -*/ -TBool ResolveFileIdAndPath( const TDesC& aPath, TInt& aId, TDes& aFilename ) -{ - // Syntax: filename.ext;index - // Supported: MIF, MBM - TInt pos = aPath.FindF( KScutSkinItemSeparator ); - aFilename.Zero(); - if( pos != KErrNotFound ) - { - aFilename = (aPath.Left(pos)); - - if ( ( !EndsWith(aFilename, KScutMIFExtension ) ) && - ( !EndsWith(aFilename, KScutMBMExtension ) ) ) - { - aFilename.Zero(); - return EFalse; - } - - TLex lex(aPath.Mid(pos+1)); - TInt error = lex.Val(aId); - if ( error != KErrNone ) - { - aId = -1; - return EFalse; - } - return ETrue; - } - return EFalse; -} - -TInt CreateChecksumFromString( const TDesC& aString ) - { - TInt checksum = 0; - - for ( TInt i = 0; i < aString.Length(); i++ ) - { - checksum += aString[i] * ( i + 1); - } - return checksum; - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -TAiScutParser::TAiScutParser() : iType(EScutUnknown), iUid(KNullUid) -{ -} - - -// ----------------------------------------------------------------------------- -// Static utility function to parse an uid from the given descriptor. -// ----------------------------------------------------------------------------- -// -TUid TAiScutParser::ParseUid(const TDesC& aDesC) -{ - TRadix radix(EDecimal); - - // Check if the number is in hexadecimal format. - _LIT(KHexPrefix, "0x"); - const TInt prefixLen = 2; - TPtrC ptr(aDesC); - - if (ptr.Left(prefixLen).CompareC(KHexPrefix) == 0) - { - // Strip the '0x' prefix. - ptr.Set(ptr.Right(ptr.Length() - prefixLen)); - - radix = EHex; - } - - // Do the actual parsing. - TUint uint; - TUid uid(KNullUid); - TLex lexer(ptr); - TInt err = lexer.Val(uint, radix); - if (err == KErrNone) - { - uid.iUid = uint; - } - - return uid; -} - - -// --------------------------------------------------------------------------- -// Parses a shortcut definition. -// --------------------------------------------------------------------------- -// -TInt TAiScutParser::Parse(const TDesC& aDefinition) -{ - iType = EScutUnknown; - iDefinition.Set(aDefinition); - - // Default values for the icon - iIcon.iIconId = KErrNotFound; - iIcon.iPath.Zero(); - iIcon.iSkinId.iMajor = -1; - iIcon.iSkinId.iMinor = -1; - iIcon.iColourGroup = -1; - - iIcon.iType = EScutIconNone; - iIcon.iDestination = EScutDestinationNormal; - iIcon.iShortcutType = EScutUnknown; - iIcon.iAppUid = TUid::Uid(0); - iIcon.iViewId = TUid::Uid(0); - - TInt err = iUriParser.Parse(aDefinition); - if (err != KErrNone) - { - return err; - } - - TPtrC scheme(iUriParser.Extract(EUriScheme)); - - if (scheme.Length() == 0 || - scheme.Compare(KScutURISchemeHttp) == 0 || - scheme.Compare(KScutURISchemeHttps) == 0) - { - ParseParams(); - iType = EScutWebAddress; - - if ( iIcon.iType != EScutIconNone ) - { - // create a checksum for unique identifying - TInt checksum = CreateChecksumFromString( aDefinition ); - iIcon.iViewId = TUid::Uid( checksum ); - iIcon.iShortcutType = iType; - iIcon.iAppUid = KScutBrowserUid; - } - err = KErrNone; - } - else if (scheme.Compare(KScutURISchemeLocalApp) == 0) - { - iType = EScutApplication; - - if (!ParseAlias()) - { - iUid = ParseUid(iUriParser.Extract(EUriPath)); - } - - if (iUid == KScutAppShellUid) - { - // appshell shortcut is always of type app view. - iType = EScutApplicationView; - } - - // ParseParams() parses params from an URL. If it encounters - // iconid, iconmifpath or cba parameter from the URL, then it - // places the values to iIcon and removes the parameters from - // the URL. It also extract the additional viewid if needed. - // For example bookmarks and apps with views use them. - - ParseParams(); - // Icon found so apply the appuid and type to icon. - if ( iIcon.iType != EScutIconNone ) - { - iIcon.iShortcutType = iType; - - // If we are dealing with messaging icons then the - // appuid needs to be changed in order to match it against - // the shortcuts appuid - switch( iType ) - { - case EScutNewMessage: - iIcon.iAppUid.iUid = KScutUnifiedEditorUidValue; - break; - - case EScutNewEmail: - iIcon.iAppUid.iUid = KScutEmailEditorUidValue; - break; - - #ifdef __SYNCML_DS_EMAIL - case EScutNewSyncMLMail: - iIcon.iAppUid.iUid = KScutEmailEditorUidValue; - iIcon.iViewId.iUid = KScutSyncMlEmailUidValue; - break; - #endif - - case EScutNewPostcard: - iIcon.iAppUid.iUid = KScutPostcardEditorUidValue; - break; - - case EScutNewAudioMsg: - iIcon.iAppUid.iUid = KScutAmsEditorUidValue; - break; - - case EScutNewMsgType: - iIcon.iAppUid.iUid = KScutMessagingCenterUidValue; - iIcon.iViewId.iUid = KScutMessagingCenterUidValue; - break; - - default: - iIcon.iAppUid = iUid; - break; - - } - - } - err = KErrNone; - } - else - { - err = KErrCorrupt; - } - - __PRINTS( "XAI: TAiScutParser::Parse"); - __PRINT( __DBG_FORMAT( "XAI: type = %d, definition = '%S', err = %d"), iType, &aDefinition, err); - return err; -} - - -// --------------------------------------------------------------------------- -// Checks if the shortcut definition was valid. -// --------------------------------------------------------------------------- -// -TBool TAiScutParser::IsValid() const -{ - return iType != EScutUnknown; -} - - -// ----------------------------------------------------------------------------- -// Returns the shortcut target type. -// ----------------------------------------------------------------------------- -// -TShortcutType TAiScutParser::Type() const -{ - return iType; -} - - -// ----------------------------------------------------------------------------- -// Returns the shortcut target uid. Used for application shortcuts. -// ----------------------------------------------------------------------------- -// -TUid TAiScutParser::Uid() const -{ - return iUid; -} - - -TAiScutIcon TAiScutParser::Icon() const - { - return iIcon; - } -// ----------------------------------------------------------------------------- -// Returns a shortcut definition component value. -// ----------------------------------------------------------------------------- -// -TPtrC TAiScutParser::Get(TScutDefComponent aComponent) const -{ - TPtrC componentValue; - - switch (aComponent) - { - case EScutDefScheme: - componentValue.Set(iUriParser.Extract(EUriScheme)); - break; - - case EScutDefTarget: - componentValue.Set(iUriParser.Extract(EUriPath)); - break; - - case EScutDefParamName: - componentValue.Set(iParamName); - break; - - case EScutDefParamValue: - componentValue.Set(iParamValue); - break; - - case EScutDefParamNameAndValue: - componentValue.Set(iUriParser.Extract(EUriQuery)); - break; - - case EScutDefComplete: - componentValue.Set(iDefinition); - break; - - default: - break; - } - - return componentValue; -} - - -// --------------------------------------------------------------------------- -// Composes a shortcut definition string from given parameters. -// --------------------------------------------------------------------------- -// -void TAiScutParser::ComposeL(HBufC*& aDes, const TUid aUid, - const TDesC& aParamName, const TDesC& aParamValue) -{ - HBufC* temp = HBufC::NewLC(KMaxDefinitionLength); - TPtr ptr = temp->Des(); - - if (aParamName.Length() && aParamValue.Length()) - { - ptr.Format(KScutFormatApplicationWithParams, aUid.iUid, &aParamName, &aParamValue); - } - else - { - ptr.Format(KScutFormatApplication, aUid.iUid); - } - - aDes = temp->AllocL(); - CleanupStack::PopAndDestroy(temp); -} - - -// --------------------------------------------------------------------------- -// Composes a shortcut definition string from given parameters. -// --------------------------------------------------------------------------- -// -void TAiScutParser::ComposeL(HBufC*& aDes, const TUid aUid, - const TDesC& aParamString) -{ - HBufC* temp = HBufC::NewLC(KMaxDefinitionLength); - TPtr ptr = temp->Des(); - - if (aParamString.Length()) - { - ptr.Format(KScutFormatApplicationWithParamString, aUid.iUid, &aParamString); - } - else - { - ptr.Format(KScutFormatApplication, aUid.iUid); - } - - aDes = temp->AllocL(); - CleanupStack::PopAndDestroy(temp); -} - - -// --------------------------------------------------------------------------- -// Checks if an alias was used in shortcut definition and parses an uid from it. -// --------------------------------------------------------------------------- -// -TBool TAiScutParser::ParseAlias() -{ - TPtrC ptr(iUriParser.Extract(EUriPath)); - - // "localapp:msg?..." is an alias for messaging application. - if (ptr.CompareC(KScutTargetAliasMessaging) == 0) - { - iUid = KScutMessagingUid; - return ETrue; - } - // "localapp:keylock?..." is an alias for keylock - else if (ptr.CompareC(KScutTargetAliasKeylock) == 0) - { - iUid = KScutKeyLockUid; - return ETrue; - } - - // "localapp:voicedial..." is an alias for voicedial - else if (ptr.CompareC(KScutTargetAliasVoiceDial) == 0) - { - iUid = KScutVoiceDialUid; - return ETrue; - } - - // "localapp:logs?..." is an alias for logs - else if (ptr.CompareC(KScutTargetAliasLogs) == 0) - { - iUid = KScutLogsUid; - return ETrue; - } - else - { - return EFalse; - } -} - - -// --------------------------------------------------------------------------- -// Parses the possible application shortcut parameters. -// --------------------------------------------------------------------------- -// -void TAiScutParser::ParseParams() -{ - TPtrC params(iUriParser.Extract(EUriQuery)); - - if (params.Length() > 0) - { - HBufC *tempParams = params.Alloc(); - // value can't be longer than the params - // but in some cases it can be equally long - HBufC *value = HBufC::New(params.Length()); - - // low memory or similar situation so cannot do anything - if ( !value || !tempParams ) - { - return; - } - - TPtr valuePtr = value->Des(); - TPtr tempParamsPtr = tempParams->Des(); - - TBool addonFound = EFalse; - TInt err = KErrNone; - - // First extract the CBA - err = ExtractValueFromQueryString(tempParamsPtr,KScutParamNameCBAIcon,valuePtr, ETrue); - if ( err == KErrNone ) - { - iIcon.iDestination = EScutDestinationSoftkey; - } - // Then the toolbar - - err = ExtractValueFromQueryString(tempParamsPtr,KScutParamNameToolbarIcon,valuePtr, ETrue); - - if ( err == KErrNone ) - { - iIcon.iDestination = EScutDestinationToolbar; - } - - // then extract the iconskinid - err = ExtractValueFromQueryString(tempParamsPtr, - KScutParamNameIconSkinId,valuePtr, ETrue); - if ( err == KErrNone && - ResolveSkinItemId(valuePtr,iIcon.iSkinId,iIcon.iColourGroup)) - { - iIcon.iType = EScutIconSkin; - addonFound = ETrue; - } - // Then extract the iconmifpath - // Iconmifpath extraction left here for backward compatibility - valuePtr.Zero(); - err = ExtractValueFromQueryString(tempParamsPtr, - KScutParamNameIconMifPath,valuePtr, ETrue); - if ( err == KErrNone && - ResolveFileIdAndPath(valuePtr,iIcon.iIconId,iIcon.iPath) ) - { - iIcon.iType = EScutIconMif; - addonFound = ETrue; - } - - // Then extract the iconpath. - valuePtr.Zero(); - err = ExtractValueFromQueryString(tempParamsPtr, - KScutParamNameIconPath,valuePtr, ETrue); - if ( err == KErrNone && - ResolveFileIdAndPath(valuePtr,iIcon.iIconId,iIcon.iPath) ) - { - if ( EndsWith(iIcon.iPath, KScutMIFExtension )) - { - iIcon.iType = EScutIconMif; - } - else if ( EndsWith(iIcon.iPath, KScutMBMExtension )) - { - iIcon.iType = EScutIconMbm; - } - addonFound = ETrue; - } - - // Use the new params string where the addons - // have been removed - if( addonFound ) - { - params.Set(tempParamsPtr); - // no need to process anything because there are no - // parameters left after our addons have been taken out - if ( params.Length() <= 0) - { - delete value; - delete tempParams; - return; - } - } - - delete value; - - iType = EScutApplicationWithParams; - - const TInt valueSeparatorPos = params.Locate(KParamValueSeparator); - - if (valueSeparatorPos >= 0) - { - iParamName.Set(params.Left(valueSeparatorPos)); - } - if (valueSeparatorPos >= 0) - { - iParamValue.Set(params.Mid(valueSeparatorPos + 1)); - } - if (valueSeparatorPos == -1) - { - iParamName.Set(params); - } - - if (iParamName.CompareC(KScutParamNameView) == 0) - { - iType = EScutApplicationView; - - if (iUid == KScutPersonalisationUid) - { - TUid uid = ParseUid(iParamValue); - if (uid == KScutChangeThemeViewId) - { - iType = EScutChangeTheme; - } - iIcon.iViewId = uid; - } - - if (iUid == KScutLogsUid) - { - if (iParamValue.CompareC(KScutParamValueMissedCalls) == 0) - { - iType = EScutLogsMissedCallsView; - } - else if (iParamValue.CompareC(KScutParamValueDialledCalls) == 0) - { - iType = EScutLogsDialledCallsView; - } - else if (iParamValue.CompareC(KScutParamValueReceivedCalls) == 0) - { - iType = EScutLogsReceivedCallsView; - } - else if (iParamValue.CompareC(KScutParamValueMainView) == 0) - { - iType = EScutLogsMainView; - } - } - - if (iUid == KScutGeneralSettingsUid) - { - if (ParseUid(iParamValue) == KScutParamValueConnectivityView) - { - iType = EScutConnectivityStatusView; - } - else if (ParseUid(iParamValue) == KScutInstallationViewId) - { - iType = EScutApplicationManagerView; - } - } - - - } - else if (iUid == KScutMessagingUid) - { - if (iParamName.CompareC(KScutParamNameNew) == 0) - { - if (iParamValue.CompareC(KScutParamValueMsg) == 0) - { - iType = EScutNewMessage; - } - else if (iParamValue.CompareC(KScutParamValueEmail) == 0) - { - iType = EScutNewEmail; - } -#ifdef __SYNCML_DS_EMAIL - else if (iParamValue.CompareC(KScutParamValueSyncMLMail) == 0) - { - iType = EScutNewSyncMLMail; - } -#endif - else if (iParamValue.CompareC(KScutParamValuePostcard) == 0) - { - iType = EScutNewPostcard; - } - else if (iParamValue.CompareC(KScutParamValueAudioMsg) == 0) - { - iType = EScutNewAudioMsg; - } - else - { - iType = EScutNewMsgType; - } - } - else if (iParamName.CompareC(KScutParamNameMailbox) == 0) - { - iType = EScutMailbox; - } - } - else if (iUid == KScutKeyLockUid) - { - iType = EScutKeylock; - } - else if (iUid == KScutSettingsDllUid || iUid == KScutBrowserUid) - { - if (iParamName.CompareC(KScutParamNameBookmark) == 0) - { - iType = EScutBookmark; - iIcon.iViewId = ParseUid(iParamValue); - } - else if (iParamName.CompareC(KScutParamNoEffect) == 0) - { - iType = EScutNoEffect; - } - } - delete tempParams; - } -} - -TInt TAiScutParser::ChecksumForString( const TDesC& aDefinition) const - { - return CreateChecksumFromString( aDefinition ); - } - -TInt TAiScutParser::CustomTitle( TDes& aTarget ) const - { - TPtrC params(iUriParser.Extract(EUriQuery)); - HBufC *tempParams = params.Alloc(); - if ( !tempParams ) - { - return KErrNoMemory; - } - - TPtr tempParamsPtr = tempParams->Des(); - - TInt err = ExtractValueFromQueryString(tempParamsPtr, - KScutParamNameCustomTitle, aTarget, EFalse); - - delete tempParams; - return err; - } - -void TAiScutParser::RemoveExtraDefinitionsL( TDes &aString ) const - { - HBufC *temp = HBufC::NewL( aString.Length( )); - TPtr tempPtr = temp->Des(); - ExtractValueFromQueryString(aString, - KScutParamNameCBAIcon, tempPtr, ETrue); - - ExtractValueFromQueryString(aString, - KScutParamNameIconSkinId,tempPtr, ETrue); - - ExtractValueFromQueryString(aString, - KScutParamNameIconMifPath,tempPtr, ETrue); - - ExtractValueFromQueryString(aString, - KScutParamNameCustomTitle, tempPtr, ETrue); - ExtractValueFromQueryString(aString, - KScutParamNameIconPath, tempPtr, ETrue); - delete temp; - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/data/wrtdataplugin.rss --- a/idlefw/plugins/wrtdataplugin/data/wrtdataplugin.rss Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/data/wrtdataplugin.rss Wed May 12 13:36:47 2010 +0300 @@ -18,9 +18,9 @@ // INCLUDES #include +#include #include "wrtdatapluginuids.hrh" - // ----------------------------------------------------------------------------- // @@ -42,7 +42,7 @@ INTERFACE_INFO { // UID of interface that is implemented - interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + interface_uid = HS_UID_ECOM_INTERFACE_CONTENTPUBLISHER; implementations = { diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp --- a/idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp Wed May 12 13:36:47 2010 +0300 @@ -53,9 +53,13 @@ LIBRARY estor.lib LIBRARY apgrfx.lib -// End of File +// Debugging dependencies +LIBRARY flogger.lib + SOURCEPATH ../src - SOURCE wrtdataplugin.cpp SOURCE wrtdata.cpp SOURCE wrtdataobserver.cpp + +// End of File + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/inc/wrtdata.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdata.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdata.h Wed May 12 13:36:47 2010 +0300 @@ -19,294 +19,232 @@ #ifndef WRTDATA_H #define WRTDATA_H -// INCLUDE FILES +// System includes #include #include + +// User includes +#include #include "wrtdatapluginconst.h" -#include "aicontentpublisher.h" -// FORWARD DECLARATIONS +// Forward declarations class MLiwInterface; class CLiwServiceHandler; class CWrtDataObserver; class CWrtDataPlugin; +class MAiCpsCommandBuffer; -// CLASS DECLARATION /** * @ingroup group_wrtdataplugin * * Wrt data * - * @since S60 v3.2 + * @since S60 5.2 */ -class CWrtData : public CBase - { +NONSHARABLE_CLASS( CWrtData ) : public CBase + { +public: + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CWrtData* NewL( CWrtDataPlugin* aPlugin ); + + /* + * Destructor + */ + ~CWrtData(); - public: - - /** - * Part of the two phased construction - * - * @param aPlugin refrence of the plugin - * @return none - */ - static CWrtData* NewL(CWrtDataPlugin* aPlugin); - - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtData(); - - public : - - /** - * Configures the subscriber and data to subscribe. - * - * @param aConfigurations Information about the subscriber - * and the data to subscribe. - * @return void - */ - void ConfigureL(RAiSettingsItemArray& aConfigurations); - - /** - * Checks is this menu item is supported by the publisher - * - * @param aMenuItem menu item name. - * @return boolean (ETrue/EFalse) - */ - TBool HasMenuItem(const TDesC16& aMenuItem ); +private : - /** - * Register to CPS for all (add/delete/update/execute) action - * - * @param none - * @return void - */ - void RegisterL(); - - /** - * Update the publisher status - * - * @param None - * @return void - */ - void UpdatePublisherStatusL(); - - /** - * Publish updated data for all the items in the widget - * - * @param aObserver to publish data - * @return void - */ - void PublishDefaultImageL( MAiContentObserver* aObserver ); - - /** - * Publish the updated data - * - * @param aObserver to publish data - * @param aDataMap data map - * @return void - */ - void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); - - /** - * Called by the observer to refresh the changed content - * - * @param aContentId content Id. - * @param aOperation operation (add/delete/update/execute). - * @param aDataMap data map. - * @return void - */ - void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap ); - - /** - * Tigger for execution of a action for a specific content id. - * - * @param aObjectId object Id. - * @param aTrigger name of the trigger. - * @return void - */ - void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); + /** + * Default Constructor + * + */ + CWrtData(); + + /** + * Part of the two phased construction + * + * @param aPlugin reference of the plugin + * @return void + */ + void ConstructL(CWrtDataPlugin* aPlugin); + +public : + // new functions + + /** + * Configures the subscriber and data to subscribe. + * + * @param aConfigurations Information about the subscriber + * and the data to subscribe. + * @return void + */ + void ConfigureL(RAiSettingsItemArray& aConfigurations); - /** - * Is the pugin is active to publish the data. - * - * @param None - * @return boolean (ETrue/EFalse). - */ - TBool IsPluginActive(); + /** + * Register to CPS for all (add/delete/update/execute) action + * + * @param none + * @return void + */ + void RegisterL(); + + /** + * Update the publisher status + * + * @param None + * @return void + */ + void UpdatePublisherStatusL(); + + /** + * Publish initial data for all the items in the widget + * + * @param aObserver to publish data + * @return void + */ + void PublishInitialDataL( MAiContentObserver* aObserver ); - /** - * Activate the publisher - * - * @param None - * @return void - */ - void ActivateL(); - - /** - * Resume the publisher - * - * @param None - * @return void - */ - void ResumeL(); - - /** - * Suspend the publisher - * - * @param None - * @return void - */ - void SuspendL(); - - /** - * Deactivate the publisher - * - * @param None - * @return void - */ - void DeActivateL(); - - /** - * InActiveL - * - * @param None - * @return void - */ - void InActiveL(); - - /** - * OnLineL - * - * @param None - * @return void - */ - void OnLineL(); - - /** - * OffLineL - * - * @param None - * @return void - */ - void OffLineL(); + /** + * Publish updated data for all the items in the widget + * + * @param aObserver to publish data + * @return void + */ + void PublishDefaultImageL( MAiContentObserver* aObserver ); + + /** + * Publish the updated data + * + * @param aObserver to publish data + * @param aDataMap data map + * @return void + */ + void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); + + /** + * Called by the observer to refresh the changed content + * + * @param aContentId content Id. + * @param aOperation operation (add/delete/update/execute). + * @param aDataMap data map. + * @return void + */ + void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap ); + + /** + * Tigger for execution of a action for a specific content id. + * + * @param aObjectId object Id. + * @param aTrigger name of the trigger. + * @return void + */ + void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); - private : + /** + * Is the pugin is active to publish the data. + * + * @param None + * @return boolean (ETrue/EFalse). + */ + TBool IsPluginActive(); + + /** + * Notify the status to the publisher + * + * @param aStatus new status of the publisher + * @return void + */ + void NotifyPublisherL(const TDesC8& aStatus); + + /** + * Sets property value. + * + * @since S60 5.2 + * @param aAny - contains pointer to command buffer. + * @param aNameSpace - plugin name space id + */ + void SetCommandBuffer(TAny* aAny, const TDesC8& aNameSpace); - /** - * Default Constructor - * - */ - CWrtData(); - - /** - * Part of the two phased construction - * - * @param aPlugin reference of the plugin - * @return void - */ - void ConstructL(CWrtDataPlugin* aPlugin); - - /** - * Createts the filter map - * - * @return filter map - */ - CLiwDefaultMap* CreateFilterLC( ); - - /** - * Execute the command to get the data from CPS - * - * @param aInFilter input filter for the command - * @param aOutDataMap output data map - * @param aRegistry type of registry (publisher/cp_data) - * @return void - */ - void ExecuteCommandL(CLiwDefaultMap* aInFilter, - CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); - +private: + // new functions + + /** + * Createts the filter map + * + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC( ); + + /** + * Execute the command to get the data from CPS + * + * @param aInFilter input filter for the command + * @param aOutDataMap output data map + * @param aRegistry type of registry (publisher/cp_data) + * @return void + */ + void ExecuteCommandL(CLiwDefaultMap* aInFilter, + CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); + + /** + * Gets the widgent name and uid + * + * @param aName - widget name + * @param aAppUID - widget uid + * @return void + */ + void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ); + + /** + * Resolves the Uid from the string + * + * @param aUidDes - uid in string + * @param aUid - uid + * @return ETure/EFalse + */ + TBool ResolveUid(const TDesC& aUidDes, TUid& aUid ); + + /** + * Creates icon from the uid + * + * @param aHandle - icon handle + * @param aMaskHandle - mask handle + * @param aAppUid - application uid + * @return ETure/EFalse + */ + void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ); - /** - * Change the publisher status - * - * @param aStatus new status of the publisher - * @return void - */ - void ChangePublisherStatusL(const TDesC& aStatus); - - /** - * Gets the menu item from the publisher - * - * @param none - * @return void - */ - void GetMenuItemsL(); - - /** - * Gets the widgent name and uid - * - * @param aName - widget name - * @param aAppUID - widget uid - * @return void - */ - void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID ); - - /** - * Resolves the Uid from the string - * - * @param aUidDes - uid in string - * @param aUid - uid - * @return ETure/EFalse - */ - TBool ResolveUid(const TDesC& aUidDes, TUid& aUid ); - - /** - * Creates icon from the uid - * - * @param aHandle - icon handle - * @param aMaskHandle - mask handle - * @param aAppUid - application uid - * @return ETure/EFalse - */ - void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ); - - private : - - // Subscriber interface - // own - MLiwInterface* iInterface; - - // Data Observer to CPS - // Own - CWrtDataObserver* iObserver; - - // Service handler - // Own - CLiwServiceHandler* iServiceHandler; - - // Command name in configuration Array - HBufC8* iCommandName; - - // Reference of the wrt data plugin - // Not owned - CWrtDataPlugin* iPlugin; - - // Menu item names - // Own - RPointerArray iMenuItems; - - // Trigger names for the menu items - // Own - RPointerArray iMenuTriggers; - - // Widgets content id. - // Own - HBufC* iContentId; - + /** + * Resend the the current plugin status to publisher + * + * @param aActionsList new list of status for the publisher + * @return void + */ + void ReSendNotificationL(CLiwDefaultList* aActionsList); + +private : + // data + TBuf iPluginId; + /** CPS Command Buffer Interface, Not Owned */ + MAiCpsCommandBuffer* iCpsExecute; + /** Subscriber interface, Not owned */ + MLiwInterface* iInterface; + /** Service handler, Not owned */ + CLiwServiceHandler* iServiceHandler; + /** Data Observer to CPS, owned */ + CWrtDataObserver* iObserver; + /** Reference of the wrt data plugin, not owned */ + CWrtDataPlugin* iPlugin; + /** Content id, owned */ + HBufC* iContentId; + /** Widget's UID */ + TUid iAppUid; }; #endif /*WRTDATA_H*/ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h Wed May 12 13:36:47 2010 +0300 @@ -19,108 +19,112 @@ #ifndef WRTDATAOBSERVER_H #define WRTDATAOBSERVER_H -// INCLUDE FILES +// System includes #include -// FORWARD DECLARATIONS +// User includes + +// Forward declarations class CWrtData; -// CLASS DECLARATION /** - * @ingroup group_wrtdataplugin + * @ingroup group_wrtdataplugin + * + * Wrt data observer * - * Wrt data observer - * - * @since S60 v3.2 + * @since S60 5.2 */ -class CWrtDataObserver : public CBase, public MLiwNotifyCallback +NONSHARABLE_CLASS( CWrtDataObserver ) : public CBase, + public MLiwNotifyCallback { - public: +public: + // constructor and destructor - /** - * Part of the two phased constuction - * - * @param aInterface reference of the interface - * @param aData reference of the wrt data object - * @return none - */ - static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData ); + /** + * Part of the two phased constuction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return none + */ + static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData ); - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtDataObserver(); + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtDataObserver(); - private : +private: + // constructors - /** - * Constructor - * - * @param none - * @return none - */ - CWrtDataObserver(); - - /** - * Part of the two phased construction - * - * @param aInterface reference of the interface - * @param aData reference of the wrt data object - * @return void - */ - void ConstructL( MLiwInterface* aInterface, CWrtData* aData ); + /** + * Constructor + * + * @param none + * @return none + */ + CWrtDataObserver(); + + /** + * Part of the two phased construction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return void + */ + void ConstructL( MLiwInterface* aInterface, CWrtData* aData ); - public: //from MLiwNotifyCallbackc - - /** - * Handles notifications caused by an asynchronous Execute*CmdL call - * or an event. - * - * @param aCmdId The service command associated to the event. - * @param aEventId occurred event, see LiwCommon.hrh. - * @param aEventParamList Event parameters, if any, as defined per - * each event. - * @param aInParamList Input parameters, if any, given in the - * related HandleCommmandL. - * @return Error code for the call back. - */ - virtual TInt HandleNotifyL( - TInt aCmdId, - TInt /*aEventId*/, - CLiwGenericParamList& aEventParamList, - const CLiwGenericParamList& /*aInParamList*/); - - public: +public: + //from MLiwNotifyCallbackc - /** - * Registers to CPS for add, delete , update and execute notifications - * @aFilter - filter for input parameter list - * @return void. - */ - void RegisterL( CLiwDefaultMap* aFilter ); + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId occurred event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the call back. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/); + +public: + // new functions - /** - * Cancel all the registered notifications. - * @return void. - */ - void ReleaseL(); - - private: - - // Reference of - // Not owned - MLiwInterface* iInterface; + /** + * Registers to CPS for add, delete , update and execute notifications + * @aFilter - filter for input parameter list + * @return void. + */ + void RegisterL( CLiwDefaultMap* aFilter ); + + /** + * Cancel all the registered notifications. + * @return void. + */ + void ReleaseL(); - // Reference of the wrt data - // Not owned - CWrtData* iData; +private: + // data - // Call back error code - TInt iError; - + /** Interface Reference, not owned */ + MLiwInterface* iInterface; + // Reference of the wrt data, not owned */ + CWrtData* iData; + /** Call back error code */ + TInt iError; }; -#endif /*WRTDATAOBSERVER_H*/ +#endif // WRTDATAOBSERVER_H + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Wed May 12 13:36:47 2010 +0300 @@ -19,22 +19,19 @@ #ifndef WRTDATAPLUGIN_H #define WRTDATAPLUGIN_H -#include -#include +// System includes + +// User includes +#include #include -#include -// FORWARD DECLARATIONS +// Forward declarations class MAiContentObserver; class MAiContentItemIterator; -class MAiPSPropertyObserver; class CWrtData; -class CDesC16Array; class CGulIcon; class CLiwDefaultMap; - -// CLASS DECLARATION /** * @ingroup group_wrtdataplugin * @@ -42,400 +39,308 @@ * * @since S60 v3.2 */ -class CWrtDataPlugin : public CAiContentPublisher, - public MAiPropertyExtension, - public MAiEventHandlerExtension - - { - - public : - /** - * Plugin's network state. - */ - enum TPluginNetworkStatus - { - EUnknown, - EOffline, - EOnline - }; - - /** - * Plugin's state. - */ - enum TPluginStates - { - ENone, - EResume, - ESuspend, - EInActive, - }; - - /** - * Content Items - */ - enum TContentItem - { - EDefaultImage, - EDefaultText, - EImage1 - }; - - public: +NONSHARABLE_CLASS( CWrtDataPlugin ) : public CHsContentPublisher + { +public: + // type definitions + + /** + * Plugin's network state. + */ + enum TPluginNetworkStatus + { + EUnknown, + EOffline, + EOnline + }; + + /** + * Plugin's state. + */ + enum TPluginStates + { + ENone, + EResume, + ESuspend + }; - /** - * Part of the two phased constuction - * - * @param none - * @return none - */ - static CWrtDataPlugin* NewL(); - - /** - * Destructor - * - * @param none - * @return none - */ - ~CWrtDataPlugin(); - - public: // from base class CAiContentPublisher + /** + * Content Items + */ + enum TContentItem + { + EDefaultImage, + EDefaultText, + EImage1 + }; - /** - * From CAiContentPublisher - * The method is called by the framework to request the plug-in free all - * memory and CPU resources and close all its open files, e.g. the plug-in - * should unload its engines due backup operation. The method transits the - * plug-in to "Idle" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Stop( TAiTransitionReason aReason ); +public: + // constructor and destructor + + static CWrtDataPlugin* NewL(); + + ~CWrtDataPlugin(); + +private: + // constructors - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * allowed to consume CPU resources, e.g plug-in is able to run timers, - * perform asynchronous operations, etc. The method transits the plug-in - * to "Alive" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Resume( TAiTransitionReason aReason ); + /** + * C++ constructor + */ + CWrtDataPlugin(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +public: + // from CHsContentPublisher - /** - * From CAiContentPublisher - * The method is called by the framework to instruct plug-in that it is - * not allowed to consume CPU resources, e.g plug-in MUST stop each - * timers, cancel outstanding asynchronous operations, etc. The method - * transits the plug-in to "Suspendend" state. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void Suspend( TAiTransitionReason aReason ); + /** + * @see CHsContentPublisher + */ + void Start( TStartReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Stop( TStopReason aReason ); + + /** + * @see CHsContentPublisher + */ + void Resume( TResumeReason aReason ); - /** - * From CAiContentPublisher - * Adds the content observer / subscriber to plug-in. The plug-in MUST - * maintain a registry of subscribers and send notification to all them - * whenever the plug-in changes state or new content available. - * - * @param aObserver content observer to register. - * @return void - */ - void SubscribeL( MAiContentObserver& aObserver ); - - /** - * From CAiContentPublisher - * Configures the plug-in. - * Plug-ins take ownership of the settings array, so it must either - * store it in a member or free it. Framework has put the array in cleanup - * stack so the plugin shouldn't do that. - * If this leaves, the plug-in will be destroyed by AI FW. - * Plug-in must support LaunchByValue-event even if normal shortcuts don't - * work. The only allowed serious enough leave is KErrNotFound from CenRep. - * - * @param aSettings setting items defined in the UI definition. - * @return void - */ - void ConfigureL( RAiSettingsItemArray& aSettings ); - - /** - * From CAiContentPublisher - * Returns interface extension. In Series 60 3.1 only event & property - * extensions are supported. See MAiEventExtension & MAiPropertyExtension - * interfaces. - * - * @param aUid - UID of the extension interface to access. - * @return the extension interface. Actual type depends on the passed aUid - * argument. - */ - TAny* Extension( TUid aUid ); + /** + * @see CHsContentPublisher + */ + void Suspend( TSuspendReason aReason ); + + /** + * @see CHsContentPublisher + */ + void SetOnline(); + + /** + * @see CHsContentPublisher + */ + void SetOffline(); - // from base class MAiPropertyExtension + /** + * @see CHsContentPublisher + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * @see CHsContentPublisher + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * @see CHsContentPublisher + */ + void SetProperty( TProperty aProperty, TAny* aAny ); + + /** + * @see CHsContentPublisher + */ + TAny* GetProperty( TProperty aProperty ); - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - TAny* GetPropertyL( TInt aProperty ); + /** + * @see CHsContentPublisher + */ + void HandleEvent( const TDesC& aEventName, const TDesC& aParam ); + +public: + + /** + * Gets the id of a content + * + * @param aObjectId image or text id + * @return id of the content + */ + TInt GetIdL( TDesC16& aObjectId ); - /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - void SetPropertyL( TInt aProperty, TAny* aValue ); - - // from base class MAiEventHandlerExtension - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * @param aEvent - unique identifier of event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where is mapped by the framework to unique - * identifier supplied in aEvent, are provided to - * plug-in as-is in the descriptor. - * @since S60 3.2 - */ - void HandleEvent(TInt aEvent, const TDesC& aParam); - - /** - * From MAiEventHandlerExtension - * Invoked by the framework when plug-in must handle an event. - * - * @param aEventName - name of the event from plug-in content model. - * @param aParam - parameters associated with event. Each UI Definition - * declares events in the format: (), - * where mapping to unique identifier supplied by event - * is failed by the frame work then the and - * are provided to plug-in as-is in the descriptor. - */ - void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + /** + * Gets the type of a specific content + * + * @param aObjectId image or text id + * @param aType type + * @return void + */ + void GetTypeL( TDesC16& aObjectId, TDes16& aType ); - /** - * Invoked by the framework for querying if plugin has menu item - * - * @param aMenuItem menu item name. - * @return ETrue if plugin has specific menu item, EFalse otherwise - */ - TBool HasMenuItem(const TDesC16& aMenuItem); - - public : // New functions + /** + * RefereshL a specific image of text in the widget + * + * @param aOperation operation performed + * @param aDataMap data map + * @return void + */ + void RefreshL( TDesC16& aOperation, CLiwDefaultMap* aDataMap ); + + /** + * Is plugin active to publish the data + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsActive() const; - /** - * Gets the id of a content - * - * @param aObjectId image or text id - * @return id of the content - */ - TInt GetIdL(TDesC16& aObjectId); - - /** - * Gets the type of a specific content - * - * @param aObjectId image or text id - * @param aType type - * @return void - */ - void GetTypeL( TDesC16& aObjectId, TDes16& aType ); - - /** - * RefereshL a specific image of text in the widget - * - * @param aOperation operation performed - * @param aDataMap data map - * @return void - */ - void RefreshL(TDesC16& aOperation, CLiwDefaultMap* aDataMap ); - - /** - * Is plugin active to publish the data - * - * @param void - * @return boolean (ETrue/EFalse) - */ - TBool IsActive(); - - /** - * Publish a specific text of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aContentValue content value - * @return void - */ - void PublishTextL(MAiContentObserver* aObserver, - TInt aContentId, const TDesC16& aContentValue); + /** + * Publish a specific text of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aContentValue content value + * @return void + */ + void PublishTextL( MAiContentObserver* aObserver, + TInt aContentId, const TDesC16& aContentValue ); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aHandle image handle + * @param aMaskHandle handle of the mask image + * @return void + */ + void PublishImageL( MAiContentObserver* aObserver, + TContentItem aContentId, TInt aHandle, TInt aMaskHandle ); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aPath image path / skin id pattern / mif id Pattern + * @return void + */ + void PublishImageL( MAiContentObserver* aObserver, + TContentItem aContentId, const TDesC16& aPath ); - /** - * Publish a specific image of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aHandle image handle - * @param aMaskHandle handle of the mask image - * @return void - */ - void PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, TInt aHandle, TInt aMaskHandle); + /** + * Cleans a data from the widget + * + * @param aObserver observer + * @param aContentId content model id + * @return void + */ + void Clean( MAiContentObserver* aObserver, + TInt aContentId ); + + /** + * Shows the loading icon animation + * + * @param aObserver observer + * @return void + */ + void ShowLoadingIcon( MAiContentObserver* aObserver ); + + /** + * Hides the loading icon animation + * + * @param aObserver observer + * @return void + */ + void HideLoadingIcon( MAiContentObserver* aObserver ); + + /** + * CWrtData getter + * @return Pointer to CWrtData + */ + CWrtData* Data() const; + + /* + * Plugin's network status getter + * @return Pointer to Harvester status observer + */ + TPluginNetworkStatus NetworkStatus() const; - /** - * Publish a specific image of the widget - * - * @param aObserver observer - * @param aContentId content model id - * @param aPath image path / skin id pattern / mif id Pattern - * @return void - */ - void PublishImageL(MAiContentObserver* aObserver, - TContentItem aContentId, const TDesC16& aPath ); - - /** - * Cleans a data from the widget - * - * @param aObserver observer - * @param aContentId content model id - * @return void - */ - void Clean(MAiContentObserver* aObserver, - TInt aContentId ); - - /** - * Shows the loading icon animation - * - * @param aObserver observer - * @return void - */ - void ShowLoadingIcon(MAiContentObserver* aObserver); - - /** - * Hides the loading icon animation - * - * @param aObserver observer - * @return void - */ - void HideLoadingIcon(MAiContentObserver* aObserver); + /** + * Creates initial data republishing timer if needed and starts it + */ + void StartTimer(); - /** - * CWrtData getter - * @return Pointer to CWrtData - */ - inline CWrtData* Data() const - { - return iData; - } - - /* - * Plugin's network status getter - * @return Pointer to Harvester status observer - */ - inline TPluginNetworkStatus NetworkStatus() const - { - return iNetworkStatus; - } +private: + // new functions - private: - - /** - * Constructor - * - * @param none - * @return none - */ - CWrtDataPlugin(); - - /** - * Part of the two phased construction - * - * @param void - * @return void - */ - void ConstructL(); - - /** - * Publishes widget's texts and images - * - * @param void - * @return void - */ - void PublishL(); - - /** - * Resume the plug-in. - * - * @param aReason reason for state change, see TAiTransitionChange. - * @return void - */ - void DoResumeL(TAiTransitionReason aReason); + /** + * Publishes widget's initial texts and images + * + * @param void + * @return void + */ + void PublishInitialDataL(); - /** - * Resolves skin item id and Mif id from pattern - * skin( () - * mif( ) - * - * @param aPath skin pattern / mif pattern value - * @param aItemId skin item id - * @param aMifId mif id - * @param aMaskId mask id - * @param aFilename mif file name - * @return boolean (ETrue/EFalse) - */ - TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, - TInt& aMifId, TInt& aMaskId, TDes& aFilename ); - - private: // data - - // Iterator for plugin content - // Own - MAiContentItemIterator* iContent; - - // Array of content observers - // Own - RPointerArray iObservers; - - // Information about the content publisher (this plug-in) - TAiPublisherInfo iInfo; - - // Number of data in the content model. - TInt iDataCount; - - // Dynamic content model - // Own - TAiContentItem* iContentModel; - - // Reference array for Published text - // Own - RPointerArray iDataArray; - - // Service API Data Subscriber. - // Own - CWrtData* iData; - - // References array for published images - // Own - RArray iIconArray; - - // Plugin's network status - TPluginNetworkStatus iNetworkStatus; - - // Is Homescreen foreground. - TBool iHSForeGround; - - // Is KeyLockON. - TBool iKeyLockOn; - - // Plugin state - TPluginStates iPluginState; + /** + * Resolves skin item id and Mif id from pattern + * skin( () + * mif( ) + * + * @param aPath skin pattern / mif pattern value + * @param aItemId skin item id + * @param aMifId mif id + * @param aMaskId mask id + * @param aFilename mif file name + * @return boolean (ETrue/EFalse) + */ + TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& aMifId, TInt& aMaskId, TDes& aFilename ); + + /** + * Cancels transaction in case of leave + * + * @param aObserver Transaction target + */ + static void CancelTransaction( TAny* aObserver ); + + /** + * Cancels initial data republishing timer + */ + void CancelTimer(); + + /** + * Stops and deletes initial data republishing timer. + */ + void StopTimer(); + + /** + * Timeout callback from timer. Used if publishing of initial data has failed. + * + * @param aPtr Contains pointer to instance of this class + */ + static TInt Timeout( TAny* aPtr ); + + +private: + // data + + /** Iterator for plugin content, owned */ + MAiContentItemIterator* iContent; + /** Array of content observers, owned */ + RPointerArray< MAiContentObserver > iObservers; + /** Number of data in the content model */ + TInt iDataCount; + /** Dynamic content model, owned */ + TAiContentItem* iContentModel; + /** Reference array for Published text, owned */ + RPointerArray< HBufC > iDataArray; + /** Service API Data Subscriber, owned */ + CWrtData* iData; + /* References array for published images, owned */ + RArray< CGulIcon* > iIconArray; + /** Plugin's network status */ + TPluginNetworkStatus iNetworkStatus; + /** Plugin state */ + TPluginStates iPluginState; + /** File server session handle, owned */ + RFs iRfs; + /** Timer for initial data republishing, owned */ + CPeriodic* iTimer; }; #endif // WRTDATAPLUGIN_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h Wed May 12 13:36:47 2010 +0300 @@ -61,8 +61,6 @@ _LIT8( KContentType, "content_type" ); _LIT8( KContentId, "content_id" ); _LIT8( KResults, "results"); -_LIT8( KMenuItems, "menuitems"); -_LIT( KMenuItem16, "menuitem"); _LIT( KAll, "all"); _LIT8( KOperation, "operation" ); _LIT8( KFLAG, "flag"); @@ -73,13 +71,12 @@ _LIT( KOperationExecute, "execute" ); _LIT( KAddUpdateDelete, "add:update:delete" ); -_LIT( KDeActive, "deactive"); -_LIT( KActive, "active"); -_LIT( KSuspend , "suspend"); -_LIT( KResume, "resume"); -_LIT( KOnLine, "online"); -_LIT( KOffLine, "offline"); -_LIT( KInActive, "inactive"); +_LIT8( KDeActive, "deactive"); +_LIT8( KActive, "active"); +_LIT8( KSuspend , "suspend"); +_LIT8( KResume, "resume"); +_LIT8( KOnLine, "online"); +_LIT8( KOffLine, "offline"); // reserved extension for retrieving mask handle _LIT8( KImageMask, "image1_mask"); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/inc/wrtdatapluginuids.hrh --- a/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginuids.hrh Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginuids.hrh Wed May 12 13:36:47 2010 +0300 @@ -20,8 +20,6 @@ #ifndef WRTDATAPLUGINUIDS_HRH #define WRTDATAPLUGINUIDS_HRH -#include - /** * Ecom dll uid for AI Data plug-in. */ diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/src/wrtdata.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Wed May 12 13:36:47 2010 +0300 @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include "wrtdata.h" #include "wrtdatapluginconst.h" @@ -50,6 +51,7 @@ // --------------------------------------------------------------------------- // CWrtData::CWrtData() + : iAppUid( KNullUid ) { } @@ -60,7 +62,6 @@ void CWrtData::ConstructL(CWrtDataPlugin* aPlugin) { iPlugin = aPlugin; - iCommandName = HBufC8::NewL( KWRTContentValueMaxLength ); } // --------------------------------------------------------------------------- @@ -70,36 +71,20 @@ // CWrtData::~CWrtData() { - if( iCommandName ) - { - delete iCommandName; - iCommandName = NULL; - } if(iObserver) - { - TRAP_IGNORE(iObserver->ReleaseL() ); + { delete iObserver; iObserver = NULL; } - if( iInterface ) - { - iInterface->Close(); - iInterface = NULL; - } - if( iServiceHandler ) - { - iServiceHandler->Reset(); - delete iServiceHandler; - iServiceHandler = NULL; - } if ( iContentId ) { delete iContentId; iContentId = NULL; } - iMenuItems.ResetAndDestroy(); - iMenuTriggers.ResetAndDestroy(); // not owned + iInterface = NULL; + iServiceHandler = NULL; + iCpsExecute = NULL; iPlugin = NULL; } @@ -109,111 +94,25 @@ // void CWrtData::ConfigureL(RAiSettingsItemArray& aConfigurations ) { - HBufC8* serviceName = HBufC8::NewLC( KWRTContentValueMaxLength ); - HBufC8* interfaceName = HBufC8::NewLC( KWRTContentValueMaxLength ); - - // Interface name - RCriteriaArray criteriaArray; - TInt count = aConfigurations.Count(); - - for(TInt i = 0;iAiPluginConfigurationItem(); // if owner is plugin then it (key,value) is for plugin configurations items - if(confItem.Owner() == KPlugin()) + if(confItem.Owner() == KPlugin() && confItem.Name() == KPubData()) { - if(confItem.Name() == KService()) - { - serviceName->Des().Copy(confItem.Value()); - } - else if( confItem.Name() == KInterface() ) - { - interfaceName->Des().Copy(confItem.Value()); - } - else if( confItem.Name() == KCommand() ) - { - iCommandName->Des().Copy(confItem.Value()); - } - else if( confItem.Name() == KMenuItem16() ) - { - iMenuItems.AppendL( confItem.Value().AllocL() ); - } - else if( confItem.Name() == KPubData() ) - { - iContentId = confItem.Value().AllocL(); - } - } + iContentId = confItem.Value().AllocL(); + } } - - if( !( serviceName->Des().Length() >= 0 && interfaceName->Des().Length() >= 0 - && iCommandName->Des().Length() >= 0 ) ) + if( iContentId->Des().Length() == 0 ) { // No service to offer without plugin configurations User::Leave( KErrNotSupported ); } - - iServiceHandler = CLiwServiceHandler::NewL(); - - // for convenience keep pointers to Service Handler param lists - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - - CLiwCriteriaItem* criteriaItem = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, *interfaceName , *serviceName ); - criteriaItem->SetServiceClass( TUid::Uid( KLiwClassBase ) ); - criteriaArray.AppendL( criteriaItem ); - - - // attach Liw criteria - iServiceHandler->AttachL( criteriaArray ); - iServiceHandler->ExecuteServiceCmdL( *criteriaItem, *inParamList, *outParamList ); - - CleanupStack::PopAndDestroy(criteriaItem); - criteriaArray.Reset(); - - // extract CPS interface from output params - TInt pos( 0 ); - outParamList->FindFirst( pos, *interfaceName ); - if( pos != KErrNotFound ) - { - //iInterface is MLiwInterface* - iInterface = (*outParamList)[pos].Value().AsInterface(); - User::LeaveIfNull( iInterface ); - } - else - { - User::Leave( KErrNotFound ); - } - inParamList->Reset(); - outParamList->Reset(); - CleanupStack::PopAndDestroy( interfaceName ); - CleanupStack::PopAndDestroy( serviceName ); - - //Gets the menu items from the publisher registry - GetMenuItemsL(); - iObserver = CWrtDataObserver::NewL( iInterface, this ); } // --------------------------------------------------------------------------- -// CWrtData::HasMenuItem -// --------------------------------------------------------------------------- -// -TBool CWrtData::HasMenuItem(const TDesC16& aMenuItem ) - { - TBool found = EFalse; - for (TInt i = 0; i < iMenuItems.Count(); i++ ) - { - if( aMenuItem == iMenuItems[i] ) - { - found = ETrue; - break; - } - } - return found; - } - -// --------------------------------------------------------------------------- // CWrtData::RegisterL // --------------------------------------------------------------------------- // @@ -232,23 +131,58 @@ void CWrtData::UpdatePublisherStatusL() { // Resent the plugin status to publisher - ActivateL(); + CLiwDefaultList* actions= CLiwDefaultList::NewLC(); + actions->AppendL( TLiwVariant( KActive )); if ( iPlugin->IsActive() ) { - ResumeL(); + actions->AppendL( TLiwVariant( KResume ) ); } else { - SuspendL(); + actions->AppendL( TLiwVariant( KSuspend )); } // forward the network status if it uses. if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) { - OnLineL(); + actions->AppendL( TLiwVariant( KOnLine )); } else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) { - OffLineL(); + actions->AppendL( TLiwVariant( KOffLine)); + } + + ReSendNotificationL( actions ); + CleanupStack::PopAndDestroy( actions ); + } + +// --------------------------------------------------------------------------- +// CWrtData::PublishInitialDataL +// --------------------------------------------------------------------------- +// +void CWrtData::PublishInitialDataL( MAiContentObserver* aObserver ) + { + // Show loading animation + iPlugin->ShowLoadingIcon( aObserver ); + + TBuf appName; + TBuf appUidStr; + GetWidgetNameAndUidL( appName, appUidStr ); + + // Publish widget's name + if ( appName.Length() > 0 ) + { + iPlugin->PublishTextL( aObserver, CWrtDataPlugin::EDefaultText, appName ); + } + + // Publish widget's apparc image. This might fail if there is application + // list population ongoing in AppFW and then we have to try again later + if ( ResolveUid ( appUidStr, iAppUid ) ) + { + TRAPD( err, PublishDefaultImageL( aObserver ) ); + if ( KErrNone != err ) + { + iPlugin->StartTimer(); + } } } @@ -258,64 +192,18 @@ // void CWrtData::PublishDefaultImageL( MAiContentObserver* aObserver ) { - TBuf appUidStr; - TBuf appName; - GetWidgetNameAndUidL( appName, appUidStr ); - - TUid appUid; - if ( ResolveUid (appUidStr, appUid ) ) - { -#ifdef WRT_PREDEFINED_IMAGE - RFs rfs; - User::LeaveIfError( rfs.Connect() ); + // Publish widget's apparc image + TInt handle = KErrNotFound; + TInt mask = KErrNotFound; + // create icon from application UID + CreateIconFromUidL( handle, mask, iAppUid ); + // Publish apparc image + iPlugin->PublishImageL( aObserver, + CWrtDataPlugin::EDefaultImage, + handle, + mask ); + } - TFileName privatePath; - rfs.PrivatePath(privatePath); - privatePath.Insert(0,KDrive); - privatePath.Append( KImgFolder ); - - appUidStr.Copy( appUid.Name()); - appUidStr.Delete(0,1); - appUidStr.Delete( appUidStr.Length() -1, 1); - privatePath.Append (appUidStr ); - privatePath.Append ( KJPEG ); - if ( BaflUtils::FileExists(rfs,privatePath) ) - { - // Publish predefined jpeg image - iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EImage1,privatePath); - } - else - { - privatePath.Delete( privatePath.Length() - 4 , 4); - privatePath.Append( KPNG ); - if ( BaflUtils::FileExists(rfs,privatePath) ) - { - // Publish predefined image - iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EImage1,privatePath); - } - else - { -#endif - TInt handle = KErrNotFound; - TInt mask = KErrNotFound; - CreateIconFromUidL( handle, mask, appUid ); - // Publish widget apparc image - iPlugin->PublishImageL( aObserver, CWrtDataPlugin::EDefaultImage,handle,mask); - if ( appName.Length() > 0) - { - // Publish Widget Name - iPlugin->PublishTextL( aObserver, CWrtDataPlugin::EDefaultText, appName); - } -#ifdef WRT_PREDEFINED_IMAGE - } - } - rfs.Close(); -#endif - } - - // Show loading animation - iPlugin->ShowLoadingIcon(aObserver); - } // --------------------------------------------------------------------------- // CWrtData::PublishL @@ -382,7 +270,9 @@ CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - CLiwDefaultMap* filter = NULL; + + // use the first item configuration to create the filter + CLiwDefaultMap* filter = CreateFilterLC(); triggerName->Des().Copy(aTrigger); if ( aObjectId == KPubData ) @@ -393,37 +283,10 @@ TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); inParamList->AppendL( cptype ); cptype.Reset(); - // use the first item configuration to create the filter - filter = CreateFilterLC(); } else { - if ( aObjectId == KMenuItem16 ) - { - TInt pos = KErrNotFound; - for (TInt i = 0; i < iMenuItems.Count(); i++) - { - if ( aTrigger == iMenuItems[i] ) - { - pos = i; - break; - } - } - if( pos == KErrNotFound ) - { - // No such menu items - CleanupStack::PopAndDestroy( triggerName ); - return; - } - triggerName->Des().Copy( iMenuTriggers[pos]->Des() ); - filter = CreateFilterLC(); - } - else - { - //Create filter criteria for requested entries in form of LIW map: - filter = CreateFilterLC(); - } - //append type to inparam list + //append type to inparam list TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); inParamList->AppendL( cptype ); cptype.Reset(); @@ -435,13 +298,11 @@ inParamList->AppendL( item ); iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList ); + item.Reset(); CleanupStack::PopAndDestroy( filter ); CleanupStack::PopAndDestroy( triggerName ); - item.Reset(); - + outParamList->Reset(); inParamList->Reset(); - outParamList->Reset(); - } // --------------------------------------------------------------------------- @@ -454,69 +315,6 @@ } // --------------------------------------------------------------------------- -// CWrtData::ActivateL -// --------------------------------------------------------------------------- -// -void CWrtData::ActivateL() - { - ChangePublisherStatusL( KActive ); - } - -// --------------------------------------------------------------------------- -// CWrtData::ResumeL -// --------------------------------------------------------------------------- -// -void CWrtData::ResumeL() - { - ChangePublisherStatusL( KResume ); - } - -// --------------------------------------------------------------------------- -// CWrtData::SuspendL -// --------------------------------------------------------------------------- -// -void CWrtData::SuspendL() - { - ChangePublisherStatusL( KSuspend ); - } - -// --------------------------------------------------------------------------- -// CWrtData::DeActivateL -// --------------------------------------------------------------------------- -// -void CWrtData::DeActivateL() - { - ChangePublisherStatusL( KDeActive ); - } - -// --------------------------------------------------------------------------- -// CWrtData::InActiveL -// --------------------------------------------------------------------------- -// -void CWrtData::InActiveL() - { - ChangePublisherStatusL( KInActive ); - } - -// --------------------------------------------------------------------------- -// CWrtData::OnLineL -// --------------------------------------------------------------------------- -// -void CWrtData::OnLineL() - { - ChangePublisherStatusL( KOnLine ); - } - -// --------------------------------------------------------------------------- -// CWrtData::offLineL -// --------------------------------------------------------------------------- -// -void CWrtData::OffLineL() - { - ChangePublisherStatusL( KOffLine ); - } - -// --------------------------------------------------------------------------- // CWrtData::CreateFilterL // --------------------------------------------------------------------------- // @@ -548,7 +346,7 @@ // execute service.It is assumed that iInterface is already initiatedd if(iInterface) { - iInterface->ExecuteCmdL( *iCommandName, *inParamList, *outParamList); + iInterface->ExecuteCmdL( KGetList, *inParamList, *outParamList); } else { @@ -588,94 +386,21 @@ } // --------------------------------------------------------------------------- -// CWrtData::PublisherStatusL -// --------------------------------------------------------------------------- -// -void CWrtData::ChangePublisherStatusL(const TDesC& aStatus) - { - if( iContentId == NULL ) - { - return; - } - HBufC8* triggerName = HBufC8::NewLC(KWRTContentNameMaxLength); - triggerName->Des().Copy(aStatus); - - CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); - CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); - - TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); - inParamList->AppendL( type ); - - CLiwDefaultMap* filter = CreateFilterLC(); - filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); - - TLiwGenericParam item( KFilter, TLiwVariant( filter )); - inParamList->AppendL( item ); - - if(iInterface) - { - iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); - } - else - { - User::Leave( KErrNotSupported ); - } - CleanupStack::PopAndDestroy( filter ); - - inParamList->Reset(); - outParamList->Reset(); - CleanupStack::PopAndDestroy( triggerName ); - } - -// --------------------------------------------------------------------------- -// CWrtData::GetMenuItemsL +// NotifyPublisherL // --------------------------------------------------------------------------- // -void CWrtData::GetMenuItemsL() - { - if(iInterface) - { - CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap* filter = CreateFilterLC( ); - //append filter to input param - ExecuteCommandL( filter, outDataMap, KPubData ); - CleanupStack::PopAndDestroy( filter ); - - TLiwVariant variant; - TInt pos = outDataMap->FindL( KMenuItems, variant ) ; - - if ( pos ) - { - CLiwDefaultMap *menuMap = CLiwDefaultMap::NewLC(); - variant.Get( *menuMap ); - for ( TInt i = 0; i < menuMap->Count(); i++) - { - menuMap->FindL(menuMap->AtL(i), variant ); - HBufC8* value = HBufC8::NewL( KWRTContentValueMaxLength ); - CleanupStack::PushL( value ); - TPtr8 valPtr = value->Des(); - variant.Get( valPtr); - if ( valPtr.Length() > 0 ) - { - iMenuTriggers.AppendL( value ); - CleanupStack::Pop( value ); - HBufC16* triggerName = HBufC16::NewLC( KWRTContentNameMaxLength ); - triggerName->Des().Copy( menuMap->AtL(i) ); - iMenuItems.AppendL( triggerName ); - CleanupStack::Pop( triggerName ); - } - else - { - CleanupStack::PopAndDestroy( value ); - } - variant.Reset(); - } - CleanupStack::PopAndDestroy( menuMap ); - } - variant.Reset(); - CleanupStack::PopAndDestroy( outDataMap ); - } - } +void CWrtData::NotifyPublisherL(const TDesC8& aStatus) + { + if( iCpsExecute == NULL ) + { + User::Leave( KErrNotSupported ); + } + + CLiwDefaultMap* filter = CreateFilterLC(); + // Add execute command triggers. Idle framework will execute + iCpsExecute->AddCommand( iPluginId, KPubData, filter, aStatus ); + CleanupStack::PopAndDestroy( filter ); + } // --------------------------------------------------------------------------- // CWrtData::GetWidgetNameAndUidL @@ -750,14 +475,14 @@ } } } - return (error == KErrNone ); + return ( error == KErrNone ); } // --------------------------------------------------------------------------- // CWrtData::CreateIconFromUidL // --------------------------------------------------------------------------- // -void CWrtData::CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ) +void CWrtData::CreateIconFromUidL( TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid ) { RApaLsSession lsSession; User::LeaveIfError( lsSession.Connect() ); @@ -765,33 +490,79 @@ CArrayFixFlat* sizeArray = new(ELeave) CArrayFixFlat( 5 ); CleanupStack::PushL( sizeArray ); - if ( KErrNone == lsSession.GetAppIconSizes(aAppUid, *sizeArray) ) + + User::LeaveIfError( lsSession.GetAppIconSizes( aAppUid, *sizeArray ) ); + + if ( sizeArray->Count() ) { - if ( sizeArray->Count() ) + // There are other icon sizes + TInt idx = 0; + TInt size( sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight ); + for ( TInt i = 1; i < sizeArray->Count(); i++ ) { - // There are other icon sizes - TInt idx = 0; - TInt size( sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight ); - for ( TInt i = 1; i < sizeArray->Count(); i++ ) + if ( ( sizeArray->At(i).iWidth * sizeArray->At(i).iHeight ) > size ) { - if ( ( sizeArray->At(i).iWidth * sizeArray->At(i).iHeight ) > size ) - { - idx = i; - size = sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight; - } + idx = i; + size = sizeArray->At(idx).iWidth * sizeArray->At(idx).iHeight; } + } - CApaMaskedBitmap* appBitMap = CApaMaskedBitmap::NewLC(); - if ( KErrNone == lsSession.GetAppIcon( aAppUid, sizeArray->At(idx), - *appBitMap ) ) - { - aHandle = appBitMap->Handle(); - aMaskHandle = appBitMap->Mask()->Handle(); - } - CleanupStack::PopAndDestroy( appBitMap ); - } + CApaMaskedBitmap* appBitMap = CApaMaskedBitmap::NewLC(); + User::LeaveIfError( lsSession.GetAppIcon( aAppUid, sizeArray->At(idx), *appBitMap ) ); + aHandle = appBitMap->Handle(); + aMaskHandle = appBitMap->Mask()->Handle(); + CleanupStack::PopAndDestroy( appBitMap ); } + CleanupStack::PopAndDestroy( sizeArray ); CleanupStack::PopAndDestroy( &lsSession ); } + +// --------------------------------------------------------------------------- +// ReSendNotificationL +// --------------------------------------------------------------------------- +// +void CWrtData::ReSendNotificationL(CLiwDefaultList* aActionsList) + { + if( iInterface == NULL ) + { + User::Leave( KErrNotSupported ); + } + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC(); + // add list of action triggers to execute + filter->InsertL(KActionTrigger, TLiwVariant(aActionsList) ); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); + CleanupStack::PopAndDestroy( filter ); + outParamList->Reset(); + inParamList->Reset(); + + } + +// --------------------------------------------------------------------------- +// SetCommandBuffer +// --------------------------------------------------------------------------- +// +void CWrtData::SetCommandBuffer(TAny* aAny, const TDesC8& aNameSpace ) + { + iPluginId.Copy(aNameSpace); + iCpsExecute = reinterpret_cast ( aAny ); + if ( iCpsExecute ) + { + iInterface = iCpsExecute->CpsInterface(); + iServiceHandler = iCpsExecute->ServiceHandler(); + } + } + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -55,8 +55,7 @@ // --------------------------------------------------------------------------- // CWrtDataObserver::CWrtDataObserver () - { - + { } // --------------------------------------------------------------------------- @@ -65,7 +64,8 @@ // CWrtDataObserver ::~CWrtDataObserver () { - TRAP_IGNORE( ReleaseL()); + TRAP_IGNORE( ReleaseL() ); + iInterface = NULL; iData = NULL; } @@ -191,7 +191,7 @@ // Sing off to notification // --------------------------------------------------------------------------- // -void CWrtDataObserver ::ReleaseL() +void CWrtDataObserver::ReleaseL() { if( iInterface ) { @@ -212,3 +212,5 @@ CleanupStack::PopAndDestroy( inParamList ); } } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Wed May 12 13:36:47 2010 +0300 @@ -11,21 +11,14 @@ * * Contributors: * -* Description: -* Profile plug-in publisher -* +* Description: WRT data plug-in publisher +* */ - - -// INCLUDE FILES +// System includes #include #include -#include -#include -#include #include -#include #include #include #include @@ -33,25 +26,37 @@ #include #include #include + +// User includes +#include +#include +#include +#include +#include #include +#include #include "wrtdatapluginconst.h" #include "wrtdatapluginuids.hrh" #include "wrtdataplugin.h" #include "wrtdata.h" -// CONST CLASS VARIABLES +// Constants const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY( KImplUidDataPlugin, CWrtDataPlugin::NewL ) }; +const TInt KTryAgainDelay( 3000000 ); // 3 sec + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- -// Constructs and returns an application object. +// ImplementationGroupProxy +// // --------------------------------------------------------------------------- // -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount ) +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) { aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); @@ -59,10 +64,10 @@ } // ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::NewL() +// +// ---------------------------------------------------------------------------- // CWrtDataPlugin* CWrtDataPlugin::NewL() { @@ -73,27 +78,26 @@ return self; } -// --------------------------------------------------------------------------- -// Default constructor -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::CWrtDataPlugin() +// +// ---------------------------------------------------------------------------- // CWrtDataPlugin::CWrtDataPlugin() + : iNetworkStatus( EUnknown ), iPluginState( ENone ) { } -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::ConstructL() +// +// ---------------------------------------------------------------------------- // void CWrtDataPlugin::ConstructL() - { - iInfo.iUid.iUid = WRTDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; - iPluginState = ENone; - iHSForeGround = EFalse; - iKeyLockOn = EFalse; - iNetworkStatus = EUnknown; - iData = CWrtData::NewL(this); - + { + User::LeaveIfError( iRfs.Connect() ); + + iData = CWrtData::NewL( this ); } // --------------------------------------------------------------------------- @@ -103,15 +107,13 @@ // CWrtDataPlugin::~CWrtDataPlugin() { - // deactivate the publishers - if( iData ) + if ( iTimer ) { - if ( iPluginState != EInActive ) - { - TRAP_IGNORE(iData->DeActivateL()); - } - delete iData; + iTimer->Cancel(); + delete iTimer; } + + delete iData; iObservers.Close(); Release( iContent ); iDataArray.ResetAndDestroy(); @@ -125,71 +127,105 @@ delete []iContentModel; } iIconArray.Reset(); + + iRfs.Close(); } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is requested to unload its engines due backup operation -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::Start +// +// ---------------------------------------------------------------------------- // -void CWrtDataPlugin::Stop( TAiTransitionReason aReason ) +void CWrtDataPlugin::Start( TStartReason aReason ) { - if( iPluginState == EResume ) + if( aReason == ESystemStartup || + aReason == EPluginStartup ) { - Suspend( aReason ); + // Publish the initial data + TRAP_IGNORE( PublishInitialDataL() ); + } + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::Stop +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::Stop( TStopReason aReason ) + { + if( aReason == EPluginShutdown || + aReason == ESystemShutdown ) + { + TRAP_IGNORE(iData->NotifyPublisherL( KDeActive )); } } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::Resume // -void CWrtDataPlugin::Resume( TAiTransitionReason aReason ) - { - TRAP_IGNORE( DoResumeL( aReason ) ); - } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-in is instructed that it is not allowed to consume CPU resources -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // -void CWrtDataPlugin::Suspend( TAiTransitionReason aReason ) +void CWrtDataPlugin::Resume( TResumeReason aReason ) { - switch( aReason ) + if ( aReason == EForeground ) { - case EAiKeylockDisabled: - case EAiKeylockEnabled: - { - // handled in resume - break; - } - default : - { - iPluginState = ESuspend; - TRAP_IGNORE ( iData->SuspendL() ); - } - } + iPluginState = EResume; + + TRAP_IGNORE( iData->NotifyPublisherL( KResume )); + } + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::Suspend +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::Suspend( TSuspendReason aReason ) + { + if ( aReason == EBackground ) + { + iPluginState = ESuspend; + + TRAP_IGNORE ( iData->NotifyPublisherL( KSuspend )); + } } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// The plug-in MUST maintain a registry of subscribers and send -// notification to all of them whenever the state changes or new content -// is available -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::SetOnline +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::SetOnline() + { + iNetworkStatus = EOnline; + TRAP_IGNORE( iData->NotifyPublisherL( KOnLine )); + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::SetOffline +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::SetOffline() + { + iNetworkStatus = EOffline; + TRAP_IGNORE( iData->NotifyPublisherL( KOffLine )); + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::SubscribeL +// +// ---------------------------------------------------------------------------- // void CWrtDataPlugin::SubscribeL( MAiContentObserver& aObserver ) - { + { iObservers.AppendL( &aObserver ); } - -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Plug-ins take ownership of the settings array, so it must either -// store it in a member or free it. -// --------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::ConfigureL +// +// ---------------------------------------------------------------------------- // void CWrtDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) { @@ -202,35 +238,37 @@ RAiSettingsItemArray contentItemsArr; RAiSettingsItemArray configurationItemsArr; - RAiSettingsItemArray settingItemsArr; + TInt count( aSettings.Count() ); - TInt count = aSettings.Count(); - for(TInt i = 0; i < count; i++ ) + for ( TInt i = 0; i < count; i++ ) { - MAiPluginSettings* pluginSetting = aSettings[i]; - if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) + MAiPluginSettings* setting( aSettings[i] ); + + if( setting->AiPluginItemType() == EAiPluginContentItem ) { - contentItemsArr.Append(pluginSetting); + contentItemsArr.Append( setting ); } - else if( pluginSetting->AiPluginItemType() == EAiPluginConfigurationItem ) + else if( setting->AiPluginItemType() == EAiPluginConfigurationItem ) { - configurationItemsArr.Append(pluginSetting); - } - else - { - settingItemsArr.Append(pluginSetting); + configurationItemsArr.Append( setting ); } } iDataCount = contentItemsArr.Count(); - if(iDataCount > 0 ) + + if ( iDataCount > 0 ) { // Create the content Model - HBufC16* contentId = HBufC16::NewLC( KAiContentIdMaxLength + KAiPluginNameMaxLength ); + HBufC16* contentId = HBufC16::NewLC( + KAiContentIdMaxLength + KAiPluginNameMaxLength ); + iContentModel = new TAiContentItem[iDataCount]; - for(TInt i = 0; i < iDataCount; i++) + + for( TInt i = 0; i < iDataCount; i++ ) { - MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); + MAiPluginContentItem& contentItem( + contentItemsArr[i]->AiPluginContentItem() ); + iContentModel[i].id = i; if( contentItem.Type() == KText() ) { @@ -238,151 +276,120 @@ iContentModel[i].type = KAiContentTypeText; } if( contentItem.Type() == KImage() || - contentItem.Type() == KAnimation() ) + contentItem.Type() == KAnimation() ) { // image iContentModel[i].type = KAiContentTypeBitmap; } - contentId->Des().Copy(contentItem.Name()); - contentId->Des().Delete(0, contentId->Des().LocateReverse(KPluginNameSeprator) +1); + contentId->Des().Copy( contentItem.Name() ); + contentId->Des().Delete( 0, + contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); - TInt sizeOfContentId = contentId->Des().Size()+sizeof(wchar_t); - iContentModel[i].cid = static_cast( User::Alloc( sizeOfContentId ) ); - Mem::Copy((TAny*)iContentModel[i].cid, contentId->Des().PtrZ(), sizeOfContentId); + TInt sizeOfContentId( contentId->Des().Size()+sizeof( wchar_t ) ); - contentId->Des().Delete( 0, contentId->Des().Length()); + iContentModel[i].cid = + static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); + + Mem::Copy( ( TAny* )iContentModel[i].cid, + contentId->Des().PtrZ(), sizeOfContentId ); + + contentId->Des().Delete( 0, contentId->Des().Length() ); } CleanupStack::PopAndDestroy( contentId ); - iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); + iContent = AiUtility::CreateContentItemArrayIteratorL( + iContentModel, iDataCount ); + // Configurations - iData->ConfigureL(configurationItemsArr); + iData->ConfigureL( configurationItemsArr ); iPluginState = ESuspend; + // Register for notifications iData->RegisterL(); // Activate the publisher - iData->ActivateL(); + iData->NotifyPublisherL( KActive ); } - settingItemsArr.Reset(); contentItemsArr.Reset(); configurationItemsArr.Reset(); - // We own the array so destroy it + // We own the array so destroy it aSettings.ResetAndDestroy(); - // publish the initial data - PublishL(); + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::SetProperty +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::SetProperty( TProperty aProperty, TAny* aAny ) + { + if (aProperty == ECpsCmdBuffer ) + { + iData->SetCommandBuffer( aAny, PublisherInfo().Namespace() ); + } + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::GetProperty +// +// ---------------------------------------------------------------------------- +// +TAny* CWrtDataPlugin::GetProperty( TProperty aProperty ) + { + if ( aProperty == EPublisherContent ) + { + return static_cast< MAiContentItemIterator* >( iContent ); + } + + return NULL; } -// --------------------------------------------------------------------------- -// From class CAiContentPublisher -// Returns the extension interface. Actual type depends on the passed -// aUid argument. -// --------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::HandleEvent +// +// ---------------------------------------------------------------------------- +// +void CWrtDataPlugin::HandleEvent( const TDesC& aEventName, + const TDesC& aParam ) + { + TRAP_IGNORE( iData->ExecuteActionL( aEventName , aParam ) ); + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::IsActive +// +// ---------------------------------------------------------------------------- // -TAny* CWrtDataPlugin::Extension( TUid aUid ) - { - if ( aUid == KExtensionUidProperty ) - { - return static_cast( this ); - } - else if (aUid == KExtensionUidEventHandler) - { - return static_cast( this ); - } - else - { - return NULL; - } +TBool CWrtDataPlugin::IsActive() const + { + return iPluginState == EResume; + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::Data +// +// ---------------------------------------------------------------------------- +// +CWrtData* CWrtDataPlugin::Data() const + { + return iData; + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::NetworkStatus +// +// ---------------------------------------------------------------------------- +// +CWrtDataPlugin::TPluginNetworkStatus CWrtDataPlugin::NetworkStatus() const + { + return iNetworkStatus; } // --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Read property of publisher plug-in. -// --------------------------------------------------------------------------- -// -TAny* CWrtDataPlugin::GetPropertyL( TInt aProperty ) - { - TAny* property = NULL; - - switch ( aProperty ) - { - case EAiPublisherInfo: - { - property = static_cast( &iInfo ); - break; - } - - case EAiPublisherContent: - { - property = static_cast( iContent ); - break; - } - default: - break; - } - - return property; - } - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Write property value to optimize the content model. -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - { - switch ( aProperty ) - { - case EAiPublisherInfo: - { - if( aValue ) - { - const TAiPublisherInfo* info = static_cast( aValue ); - iInfo.iName.Copy( info->iName ); - iInfo.iNamespace.Copy( info->iNamespace ); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) - { - // This is not as there is no event id to retrieve in this dynamic plugin. - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Handles an event sent by the AI framework. -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) - { - // We have no way of reporting errors to framework so just ignore them. - TRAP_IGNORE(iData->ExecuteActionL( aEventName , aParam ) ); - } - -// --------------------------------------------------------------------------- -// From class MAiEventHandlerExtension. -// Invoked by the framework for querying if plugin has menu item -// --------------------------------------------------------------------------- -// -TBool CWrtDataPlugin::HasMenuItem( const TDesC16& aMenuItem ) - { - return iData->HasMenuItem ( aMenuItem ); - } - -// --------------------------------------------------------------------------- +// CWrtDataPlugin::GetIdL // Gets the id of a content // --------------------------------------------------------------------------- // @@ -405,6 +412,7 @@ // --------------------------------------------------------------------------- +// CWrtDataPlugin::GetTypeL // Gets type of a content // --------------------------------------------------------------------------- // @@ -431,11 +439,16 @@ } // --------------------------------------------------------------------------- -//Refresh a specific image of text in the widget +//Refresh a specific image or text in the widget // --------------------------------------------------------------------------- // void CWrtDataPlugin::RefreshL( TDesC16& aOperation, CLiwDefaultMap* aDataMap ) { + __PRINTS("*** CWrtDataPlugin::RefreshL ***"); + + __PRINT( __DBG_FORMAT( "* Publisher name: %S, uid: 0x%x, operation: %S" ), + &PublisherInfo().Name(), PublisherInfo().Uid().iUid, &aOperation ); + TInt observers( iObservers.Count() ); TInt transactionId = reinterpret_cast( this ); @@ -464,15 +477,8 @@ // Release memory of the published icons iIconArray.Reset(); } - } - -// --------------------------------------------------------------------------- -// Is plugin active to publish the data -// --------------------------------------------------------------------------- -// -TBool CWrtDataPlugin::IsActive() - { - return (iPluginState == EResume ); + + __PRINTS("*** CWrtDataPlugin::RefreshL - done ***"); } // --------------------------------------------------------------------------- @@ -577,23 +583,21 @@ } } else // Interpret as File path - { - RFs rfs; - User::LeaveIfError( rfs.Connect() ); - RFile* iconFile = new (ELeave) RFile(); - err = iconFile->Open( rfs, aPath, EFileShareReadersOnly | EFileRead ); + { + RFile iconFile; + + err = iconFile.Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); + if( err == KErrNone ) { - aObserver->Publish( *this, aContentId, *iconFile, aContentId ); + aObserver->Publish( *this, aContentId, iconFile, aContentId ); } else { aObserver->Clean( *this, aContentId, aContentId ); } - iconFile->Close(); - delete iconFile; - iconFile = NULL; - rfs.Close(); + + iconFile.Close(); } } } @@ -665,13 +669,16 @@ void CWrtDataPlugin::HideLoadingIcon(MAiContentObserver* aObserver) { aObserver->SetProperty( *this, KElement , KDisplay , KHide ); + + // Do not try to publish initial data anymore + StopTimer(); } // --------------------------------------------------------------------------- // Publishes widget's texts and images // --------------------------------------------------------------------------- // -void CWrtDataPlugin::PublishL() +void CWrtDataPlugin::PublishInitialDataL() { TInt observers( iObservers.Count() ); TInt transactionId = reinterpret_cast( this ); @@ -679,13 +686,17 @@ for ( int i = 0; i < observers; i++ ) { MAiContentObserver* observer = iObservers[i]; - + + CleanupStack::PushL( TCleanupItem( CancelTransaction, observer ) ); + if ( observer->StartTransaction( transactionId ) == KErrNone ) {// Publish default data - iData->PublishDefaultImageL(observer); + iData->PublishInitialDataL(observer); observer->Commit( transactionId ); } + CleanupStack::Pop( observer ); + // Release memory of the published text iDataArray.ResetAndDestroy(); // Release memory of the published icons @@ -695,100 +706,6 @@ } // --------------------------------------------------------------------------- -// From class CAiContentPublisher -// framework instructs plug-in that it is allowed to consume CPU resources -// --------------------------------------------------------------------------- -// -void CWrtDataPlugin::DoResumeL( TAiTransitionReason aReason ) - { - //update in startup phase and idle is on foreground. - switch ( aReason ) - { - case EAiIdleOnLine: - { - iNetworkStatus = EOnline; - iData->OnLineL(); - break; - } - case EAiIdleOffLine: - { - iNetworkStatus = EOffline; - iData->OffLineL(); - break; - } - case EAiIdlePageSwitch: - { - if ( iPluginState == EResume ) - { - iData->SuspendL(); - } - iPluginState = EInActive; - iData->InActiveL(); - } - break; - case EAiSystemStartup: - case EAiIdleForeground: - { - iHSForeGround = ETrue; - } - case EAiBacklightOn: - { - if ( iPluginState == ESuspend && !iKeyLockOn ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockDisabled: - { - iKeyLockOn = EFalse; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == ESuspend ) - { - iPluginState = EResume; - iData->ResumeL(); - } - break; - } - case EAiKeylockEnabled: - { - iKeyLockOn = ETrue; - // Key lock events considered only if HS is in foreground - if ( iHSForeGround && iPluginState == EResume ) - { - iPluginState = ESuspend ; - iData->SuspendL(); - } - break; - } - case EAiScreenLayoutChanged: - { - // ignore events - break; - } - case EAiGeneralThemeChanged: - { - // ignore event - break; - } - case EAiIdleBackground: - { - iHSForeGround = EFalse; - } - default : - { - if ( iPluginState == EResume ) - { - iPluginState = ESuspend; - iData->SuspendL(); - } - break; - } - } - } - -// --------------------------------------------------------------------------- // ResolveSkinItemId // --------------------------------------------------------------------------- // @@ -866,3 +783,120 @@ } return (error == KErrNone ); } + +// --------------------------------------------------------------------------- +// Cleanup callback for cancelling a transactions in case of leave +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::CancelTransaction( TAny* aObserver ) + { + if ( aObserver ) + { + MAiContentObserver* obs = reinterpret_cast< MAiContentObserver*>( aObserver ); + TInt transactionId = reinterpret_cast( aObserver ); + obs->CancelTransaction( transactionId ); + } + } + +// --------------------------------------------------------------------------- +// Create and start republish timer +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::StartTimer() + { + TRAP_IGNORE( + if ( !iTimer ) + { + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + + if ( !iTimer->IsActive() ) + { + TTimeIntervalMicroSeconds32 delay( KTryAgainDelay ); + iTimer->Start( delay, delay, TCallBack( Timeout, this ) ); + } + ); + } + +// --------------------------------------------------------------------------- +// Cancel republish timer +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::CancelTimer() + { + if ( iTimer ) + { + iTimer->Cancel(); + } + } + +// --------------------------------------------------------------------------- +// Stop and delete republish timer +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::StopTimer() + { + if ( iTimer ) + { + iTimer->Cancel(); + delete iTimer; + iTimer = NULL; + } + } + +// --------------------------------------------------------------------------- +// Initial data republish callback +// --------------------------------------------------------------------------- +// +TInt CWrtDataPlugin::Timeout( TAny* aPtr ) + { + CWrtDataPlugin* self = static_cast( aPtr ); + + // Cancel timer before publishing + self->CancelTimer(); + + TInt observers( self->iObservers.Count() ); + TInt transactionId = reinterpret_cast( self ); + TBool success( ETrue ); + + // Publish for each observer + for ( int i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = self->iObservers[i]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + { + // Publish default image + TRAPD( err, self->iData->PublishDefaultImageL( observer ) ); + if ( KErrNone != err ) + { + observer->CancelTransaction( transactionId ); + success = EFalse; + } + else + { + // + observer->Commit( transactionId ); + } + } + } + + // Start timer again if there is error in publishing + if ( !success ) + { + self->StartTimer(); + } + else + { + self->StopTimer(); + } + + // Release memory of the published icons + self->iIconArray.Reset(); + + return KErrNone; + } + + + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/group/aiwsplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/group/aiwsplugin.mmp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is project specification for idle window server plug- +* in. The plug-in provides service for routing of numeric key +* events to Phone application and activation of key lock. +* +*/ + +#include + +TARGET aiwsplugin.dll +TARGETTYPE ANI +UID 0x10003B22 0x10207206 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../inc +USERINCLUDE ../../../inc/common +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE aiwspluginanimdll.cpp +SOURCE aiwspluginanim.cpp +SOURCE modifierkeytracker.cpp +// SOURCE keylockhandler.cpp +// SOURCE keylockstates.cpp +// SOURCE keypadsettings.cpp +SOURCE numerickeyhandler.cpp +// SOURCE logslaunchhandler.cpp +// SOURCE sindlaunchhandler.cpp +// SOURCE keyhandlertimer.cpp +SOURCE panic.cpp + + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib +LIBRARY centralrepository.lib +LIBRARY flogger.lib + +LIBRARY featmgr.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY ptiengine.lib +LIBRARY keylockpolicyapi.lib + +LIBRARY aiutils.lib + +LIBRARY serviceprovidersettings.lib + +// End of File diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/group/bld.inf Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The build information file of WS Plugin +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/aiwsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiwsplugin.iby) + +PRJ_MMPFILES +aiwsplugin.mmp + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/keyhandlertimer.h --- a/idlefw/plugins/wsplugin/inc/keyhandlertimer.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Key handler timer for Active Idle WS Plug-in. -* -*/ - -#ifndef C_AIWSPLUGIN_KEYHANDLERTIMER_H -#define C_AIWSPLUGIN_KEYHANDLERTIMER_H - -#include - -namespace AiWsPlugin { - -/** - * Handler timer interface. - */ -class MHandlerTimer - { -public: - virtual void TimerDone() = 0; - }; - -/** - * @ingroup group_wsplugin - * - * Logs app launch handler for Active Idle WS Plug-in. - */ -class CKeyHandlerTimer : - public CTimer - { -public: - -// Construction - - static CKeyHandlerTimer* NewL( MHandlerTimer* aHandler ); - - static CKeyHandlerTimer* NewLC( MHandlerTimer* aHandler ); - - ~CKeyHandlerTimer(); - -// new methods - - void StopTimer(); - - TBool IsActive(); - -protected: // From CActive - - void RunL(); - - TInt RunError( TInt aError ); - -private: - -// Construction - - CKeyHandlerTimer( MHandlerTimer* aHandler ); - - void ConstructL(); - -private: // data - - /// Pointer to handler timer. Not owned. - MHandlerTimer* iHandler; - }; - -} // namespace AiWsPlugin - - -#endif // C_AIWSPLUGIN_KEYHANDLERTIMER_H \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/keylockcontrol.h --- a/idlefw/plugins/wsplugin/inc/keylockcontrol.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock handler settings class and control interface for -* Active Idle WS Plug-in. -* -*/ - - -#ifndef M_AIWSPLUGIN_KEYLOCKCONTROL_H -#define M_AIWSPLUGIN_KEYLOCKCONTROL_H - -#include -class TRawEvent; - -namespace AiWsPlugin { - -class TKeypadSettings; -class TKeylockState; - -/** - * @ingroup group_wsplugin - * - * Callback interface for CKeyLockHandler internal states. - */ -class MKeyLockHandlerControl - { -public: - - virtual const TKeypadSettings& Settings() const = 0; - - virtual void StartTimeoutTimer( TInt aTimeout = -1 ) = 0; - - virtual void StopTimeoutTimer() = 0; - - virtual void ActivateKeypadLock() = 0; - - virtual void CancelKeypadLock() = 0; - - virtual void KeypadLockTimeout() = 0; - - virtual void SetNextState( const TKeylockState& aState ) = 0; - - virtual void ActivateNextState() = 0; - - virtual void SetLastLockKeyScanCode( TInt aScanCode ) = 0; - - virtual TInt LastLockKeyScanCode() const = 0; - - virtual TBool HasFocus() = 0; - - virtual TBool TimeoutTimerActive() = 0; - - virtual TBool IsFirstLockKey( TInt aScanCode ) = 0; - - virtual TBool IsSecondLockKey( TInt aScanCode ) = 0; - - -protected: - /** - * Protected dtor prevents deletion through this interface. - */ - ~MKeyLockHandlerControl() { } - }; - -} // namespace AiWsPlugin - -#endif // M_AIWSPLUGIN_KEYLOCKCONTROL_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/keylockhandler.h --- a/idlefw/plugins/wsplugin/inc/keylockhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock handler for Active Idle WS Plug-in. -* -*/ - - -#ifndef C_AIWSPLUGIN_KEYLOCKHANDLER_H -#define C_AIWSPLUGIN_KEYLOCKHANDLER_H - -#include "eventhandler.h" -#include "keylockcontrol.h" -#include "keypadsettings.h" -#include "keyhandlertimer.h" - -class CKeyLockPolicyApi; -namespace AiWsPlugin { - -class TKeylockState; - -/** - * @ingroup group_wsplugin - * - * Keylock handler for Active Idle WS Plug-in. - * - * Monitors key presses that activate keyboard lock on the device. - * - * @since S60 3.2 - */ -class CKeyLockHandler : - public CEventHandler, - public MKeyLockHandlerControl, - public MHandlerTimer - { -public: - - static CKeyLockHandler* NewLC(); - - ~CKeyLockHandler(); - -// from MHandlerTimer - - void TimerDone(); - -private: - -// from base class CEventHandler - - void SetUiStateQuery( MUiState& aUiState ); - - void FocusChanged( TBool aState ); - - TBool OfferRawEvent(const TRawEvent& aRawEvent); - -// from base class MKeyLockHandlerControl - - const TKeypadSettings& Settings() const; - - void StartTimeoutTimer( TInt aTimeout ); - - void StopTimeoutTimer(); - - void ActivateKeypadLock(); - - void CancelKeypadLock(); - - void KeypadLockTimeout(); - - void SetNextState( const TKeylockState& aState ); - - void ActivateNextState(); - - void SetLastLockKeyScanCode( TInt aScanCode ); - - TInt LastLockKeyScanCode() const; - - TBool HasFocus(); - - TBool TimeoutTimerActive(); - -// construction - - CKeyLockHandler(); - - void ConstructL(); - - static TInt TimerElapsed( TAny* aSelf ); - - TBool IsFirstLockKey( TInt aScanCode ); - - TBool IsSecondLockKey( TInt aScanCode ); - -private: // data - /** - * Current state of this object. - * Not owned. - */ - const TKeylockState* iCurrentState; - - /** - * Next state of this object. - * Not owned. - */ - const TKeylockState* iNextState; - - /** - * Timeout timer for keypad lock. - * Own. - */ - CPeriodic* iKeypadLockTimer; - - /** - * Key lock settings. - */ - TKeypadSettings iSettings; - - /** - * Last value of SetLastLockKeyScanCode( TInt aScanCode). - */ - TInt iLastLockKeyScanCode; - - /** - * Pointer to ui state. - * Not owned. - */ - MUiState* iUiState; - - /** - * For checking keylock buttons - * Own - */ - CKeyLockPolicyApi *iKeylockApi; - }; - -} // namespace AiWsPlugin - - -#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/keylockstates.h --- a/idlefw/plugins/wsplugin/inc/keylockstates.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock handler states for Active Idle WS Plug-in. -* -*/ - - -#ifndef T_AIWSPLUGIN_KEYLOCKSTATES_H -#define T_AIWSPLUGIN_KEYLOCKSTATES_H - -#include -class TRawEvent; - -namespace AiWsPlugin { - -class MKeyLockHandlerControl; - -/** - * @ingroup group_wsplugin - * - * Internal state structure for class CKeyLockHandler. - * The states are behaviour-only and thus consist of just function pointers. - */ -class TKeylockState - { -public: - /** - * Returns the state machine's initial startup state. - */ - static const TKeylockState& StartupState(); - - /** - * Returns this state's default succeeding state. - */ - inline const TKeylockState& DefaultNextState() const - { return (*iDefaultNextState)(); } - - /** - * Handles Active Idle focus changes. - * - * @param aControl Key lock control interface. - * @param aState current focus state. See CWindowAnim::FocusChaned. - */ - inline void FocusChanged( MKeyLockHandlerControl& aControl, TBool aState ) const - { (*iFocusChanged)( aControl, aState ); } - - /** - * Handles raw Window Server events. - * - * @param aControl Key lock control interface. - * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent. - * @return true if the event was consumed by the state, false otherwise. - */ - inline TBool OfferRawEvent - ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) const - { return (*iOfferRawEvent)( aControl, aRawEvent ); } - - /** - * Handles key lock timeout timer elapsed event. - * - * @param aControl Key lock control interface. - */ - inline void TimerElapsed( MKeyLockHandlerControl& aControl ) const - { (*iTimerElapsed)( aControl ); } - -// Public function pointers - - /** - * Pointer to state function that returns this state's default succeeding state. - */ - const TKeylockState& (*iDefaultNextState)(); - - /** - * Pointer to state function which handles Active Idle focus changes. - * - * @param aControl Key lock control interface. - * @param aState current focus state. See CWindowAnim::FocusChaned. - */ - void (*iFocusChanged)( MKeyLockHandlerControl& aControl, TBool aState ); - - /** - * Pointer to state function which handles raw Window Server events. - * - * @param aControl Key lock control interface. - * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent. - * @return true if the event was consumed by the state, false otherwise. - */ - TBool (*iOfferRawEvent)( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ); - - /** - * Pointer to state function which handles key lock timeout timer elapsed - * event. - * - * @param aControl Key lock control interface. - */ - void (*iTimerElapsed)( MKeyLockHandlerControl& aControl ); - }; - -} // namespace AiWsPlugin - -#endif // T_AIWSPLUGIN_KEYLOCKSTATES_H - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/keypadsettings.h --- a/idlefw/plugins/wsplugin/inc/keypadsettings.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keypad settings class for Active Idle WS Plug-in. -* -*/ - - -#ifndef T_AIWSPLUGIN_KEYPADSETTINGS_H -#define T_AIWSPLUGIN_KEYPADSETTINGS_H - -#include -class TRawEvent; - -namespace AiWsPlugin { - -/** - * @ingroup group_wsplugin - * - * Internal class for keypad settings. - */ -class TKeypadSettings - { -public: - /** - * Initializes this object from settings repository. - */ - void ReadFromRepositoryL(); - - /** - * Returns true if aScanCode matches the first lock key. - */ - TBool IsFirstLockKey( TInt aScanCode ) const; - - /** - * Returns true if aScanCode matches the second lock key. - */ - TBool IsSecondLockKey( TInt aScanCode ) const; - - /** - * Returns the key lock timeout in microseconds. - */ - TTimeIntervalMicroSeconds32 KeylockTimeout() const; - - /** - * Returns true if aScanCode matches the SIND key. - */ - TBool IsSINDKey( TInt aScanCode ) const; - - /** - * Returns the key lock timeout in microseconds. - */ - TTimeIntervalMicroSeconds32 KeySINDTimeout() const; - - TInt16 MapNkpScanCodeToChar( TInt aScanCode ); - -private: // data - /** - * Scan code of first keypad lock key. - */ - TInt16 iFirstLockKeyScanCode; - - /** - * Character code (if any) that matches iFirstLockKeyScanCode. - */ - TInt16 iFirstLockKeyChar; - - /** - * Scan code of second keypad lock key. - */ - TInt16 iSecondLockKeyScanCode; - - /** - * Character code (if any) that matches iSecondLockKeyChar. - */ - TInt16 iSecondLockKeyChar; - - /** - * Scan code of optional second keypad lock key. - */ - TInt16 iSecondLockKeyScanCode2; - - /** - * Character code (if any) that matches iSecondLockKeyChar2. - */ - TInt16 iSecondLockKeyChar2; - - /** - * Keypad lock timeout in microseconds. - */ - TTimeIntervalMicroSeconds32 iKeylockTimeout; - - /** - * Scan code of SIND keypad key. - */ - TInt16 iSINDKeyScanCode; - - /** - * Character code (if any) that matches iSINDKeyScanCode. - */ - TInt16 iSINDKeyScanChar; - - /** - * Keypad SIND timeout in microseconds. - */ - TTimeIntervalMicroSeconds32 iKeySINDTimeout; - - }; - -} // namespace AiWsPlugin - -#endif // T_AIWSPLUGIN_KEYPADETTINGS_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/logslaunchhandler.h --- a/idlefw/plugins/wsplugin/inc/logslaunchhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logs app launch handler for Active Idle WS Plug-in. -* -*/ - - -#ifndef C_AIWSPLUGIN_LOGSLAUNCHANDLER_H -#define C_AIWSPLUGIN_LOGSLAUNCHANDLER_H - -#include "eventhandler.h" -#include "keyhandlertimer.h" - -namespace AiWsPlugin { - -/** - * @ingroup group_wsplugin - * - * Logs app launch handler for Active Idle WS Plug-in. - */ -class CLogsLaunchHandler : - public CEventHandler, - public MHandlerTimer - { -public: - - static CLogsLaunchHandler* NewLC(); - - ~CLogsLaunchHandler(); - -private: - -// from base class CEventHandler - - void SetUiStateQuery( MUiState& aUiState ); - - void FocusChanged( TBool aState ); - - TBool OfferRawEvent(const TRawEvent& aRawEvent); - -// from MHandlerTimer - - void TimerDone(); - -// Construction - - CLogsLaunchHandler(); - - void ConstructL(); - -private: // data - - /// Pointer to state. Not owned. - MUiState* iUiState; - - /// Timer for long key down event. Owned. - CKeyHandlerTimer* iTimer; - }; - -} // namespace AiWsPlugin - - -#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/numerickeyhandler.h --- a/idlefw/plugins/wsplugin/inc/numerickeyhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wsplugin/inc/numerickeyhandler.h Wed May 12 13:36:47 2010 +0300 @@ -44,7 +44,8 @@ public CEventHandler, private MCenRepNotifyHandlerCallback { -public: +public: + /** * Creates a new instance of this class. * @@ -83,6 +84,12 @@ void SetQwertyMode( TInt aValue ); void SetInputLanguage( TInt aValue ); + + TBool AllowAlphaNumericMode() const; + + TBool VoIPSupported() const; + + TBool EasyDialingEnabled() const; // from base class MCenRepNotifyHandlerCallback @@ -118,6 +125,13 @@ /// Input language indicator. TInt iInputLanguage; + +private: + // friend classes + +#ifdef _AIWSPLUGIN_UNIT_TEST + friend class UT_NumericKeyHandler; +#endif }; } // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/inc/sindlaunchhandler.h --- a/idlefw/plugins/wsplugin/inc/sindlaunchhandler.h Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: SIND launch handler for Active Idle WS Plug-in. -* -*/ - - -#ifndef C_AIWSPLUGIN_SINDLAUNCHANDLER_H -#define C_AIWSPLUGIN_SINDLAUNCHANDLER_H - -#include "eventhandler.h" -#include "keyhandlertimer.h" - -#include - -namespace AiWsPlugin { - -/** - * @ingroup group_wsplugin - * - * Logs app launch handler for Active Idle WS Plug-in. - */ -class CSINDLaunchHandler : - public CEventHandler, - public MHandlerTimer - { -public: - -// Construction - - static CSINDLaunchHandler* NewLC(); - - ~CSINDLaunchHandler(); - -// from base class CEventHandler - - void SetUiStateQuery( MUiState& aUiState ); - - void FocusChanged( TBool aState ); - - TBool OfferRawEvent(const TRawEvent& aRawEvent); - -// from MHandlerTimer - - void TimerDone(); - -private: - -// Construction - - CSINDLaunchHandler(); - - void ConstructL(); - -// New methods - - void SkipVoiceDial(); - -private: // data - - /// Pointer to state. Not owned. - MUiState* iUiState; - - /// Timer for long key down event. Owned. - CKeyHandlerTimer* iTimer; - - /// Flag for SIND key down - TBool iSINDKeyDown; - - /// Flag for SIND launched - TBool iSINDLaunched; - }; - -} // namespace AiWsPlugin - - -#endif // C_AIWSPLUGIN_SINDLAUNCHANDLER_H \ No newline at end of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/aiwspluginanim.cpp --- a/idlefw/plugins/wsplugin/src/aiwspluginanim.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wsplugin/src/aiwspluginanim.cpp Wed May 12 13:36:47 2010 +0300 @@ -16,47 +16,81 @@ */ +// System includes +#include + +// User includes #include "aiwspluginanim.h" #include "aiwspluginanimdef.h" -#include "keylockhandler.h" #include "numerickeyhandler.h" -#include "logslaunchhandler.h" -#include "sindlaunchhandler.h" -#include using namespace AiWsPlugin; +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::CAiWsPluginAnim +// +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::CAiWsPluginAnim() { } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::~CAiWsPluginAnim +// +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::~CAiWsPluginAnim() { iEventHandlers.ResetAndDestroy(); + if ( iFunctions ) { iFunctions->GetRawEvents( EFalse ); } + FeatureManager::UnInitializeLib(); } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::CommandReplyL +// +// --------------------------------------------------------------------------- +// TInt CAiWsPluginAnim::CommandReplyL( TInt /*aOpcode*/, TAny* /*aArgs*/ ) { return KErrNone; } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::Command +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::Command( TInt /*aOpcode*/, TAny* /*aArgs*/ ) { } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::Animate +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::Animate( TDateTime* /*aDateTime*/ ) { } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::AddEventHandlerAndPopL +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::AddEventHandlerAndPopL( CEventHandler* aEventHandler ) { - if( aEventHandler ) + if ( aEventHandler ) { aEventHandler->SetUiStateQuery( *this ); iEventHandlers.AppendL( aEventHandler ); @@ -64,55 +98,75 @@ } } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::ConstructL +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::ConstructL( TAny* aArgs, TBool aHasFocus ) { - FeatureManager::InitializeLibL(); - - iFunctions->GetRawEvents( ETrue ); - if( !aArgs ) + if ( !aArgs ) { User::Leave( KErrArgument ); } - iWgInfo = *( static_cast(aArgs) ); + + FeatureManager::InitializeLibL(); - AddEventHandlerAndPopL( CKeyLockHandler::NewLC() ); - - MAnimGeneralFunctionsWindowExtension* ext = reinterpret_cast - ( iFunctions->ExtendedInterface( - MAnimGeneralFunctions::EWindowExtensionInterface ) ); - AddEventHandlerAndPopL( CNumericKeyHandler::NewLC( iWgInfo.iTargetWgId, ext ) ); + iFunctions->GetRawEvents( ETrue ); + + iWgInfo = *( static_cast< TAiWsPluginAnimInitData* >( aArgs ) ); + + // AddEventHandlerAndPopL( CKeyLockHandler::NewLC() ); + + MAnimGeneralFunctionsWindowExtension* ext = + reinterpret_cast + ( iFunctions->ExtendedInterface( + MAnimGeneralFunctions::EWindowExtensionInterface ) ); + + AddEventHandlerAndPopL( + CNumericKeyHandler::NewLC( iWgInfo.iTargetWgId, ext ) ); - AddEventHandlerAndPopL( CLogsLaunchHandler::NewLC() ); - -/* Leave this commented code here for now.. 2.5.2007, unclear if needed still in some config. - if ( FeatureManager::FeatureSupported( KFeatureIdKeypadNoVoiceKey ) ) - { - AddEventHandlerAndPopL( CSINDLaunchHandler::NewLC() ); - } -*/ // Update initial focus status FocusChanged( aHasFocus ); } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::Redraw +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::Redraw() { } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::FocusChanged +// +// --------------------------------------------------------------------------- +// void CAiWsPluginAnim::FocusChanged( TBool aState ) { iAiFocused = aState; - const TInt handlerCount = iEventHandlers.Count(); - for( TInt i = 0; i < handlerCount; ++i ) + + const TInt count( iEventHandlers.Count() ); + + for ( TInt i = 0; i < count; ++i ) { iEventHandlers[i]->FocusChanged( aState ); } } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::OfferRawEvent +// +// --------------------------------------------------------------------------- +// TBool CAiWsPluginAnim::OfferRawEvent( const TRawEvent& aRawEvent ) { // Forward event to all event handlers - const TInt handlerCount = iEventHandlers.Count(); - for( TInt i = 0; i < handlerCount; ++i ) + const TInt count( iEventHandlers.Count() ); + + for ( TInt i = 0; i < count; ++i ) { // All other are made to return EFalse // Except wait for 2ndkeyup and 2ndkeydown of keylock states. @@ -127,14 +181,25 @@ return EFalse; } - + +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::Modifiers +// +// --------------------------------------------------------------------------- +// TUint CAiWsPluginAnim::Modifiers() const { return iModifierTracker.Status(); } +// --------------------------------------------------------------------------- +// CAiWsPluginAnim::HasFocus +// +// --------------------------------------------------------------------------- +// TBool CAiWsPluginAnim::HasFocus() const { return iAiFocused; } +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/keyhandlertimer.cpp --- a/idlefw/plugins/wsplugin/src/keyhandlertimer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Key handler timer for Active Idle WS Plug-in. -* -*/ - - -#include - -#include "keyhandlertimer.h" -#include "sindlaunchhandler.h" - -namespace AiWsPlugin { - -CKeyHandlerTimer::CKeyHandlerTimer( MHandlerTimer* aHandler ) - : CTimer( CTimer::EPriorityStandard ) - { - iHandler = aHandler; - } - -void CKeyHandlerTimer::ConstructL() - { - CTimer::ConstructL(); - CActiveScheduler::Add( this ); - } - -CKeyHandlerTimer* CKeyHandlerTimer::NewL( MHandlerTimer* aHandler ) - { - CKeyHandlerTimer* self = CKeyHandlerTimer::NewLC( aHandler ); - CleanupStack::Pop( self ); - return self; - } - - -CKeyHandlerTimer* CKeyHandlerTimer::NewLC( MHandlerTimer* aHandler ) - { - CKeyHandlerTimer* self = new(ELeave) CKeyHandlerTimer( aHandler ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CKeyHandlerTimer::~CKeyHandlerTimer() - { - Cancel(); - } - -void CKeyHandlerTimer::RunL() - { - if( iHandler ) - { - iHandler->TimerDone(); - } - } - -TInt CKeyHandlerTimer::RunError( TInt /*aError*/ ) - { - return 0; - } - -TBool CKeyHandlerTimer::IsActive() - { - return CActive::IsActive(); - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/keylockhandler.cpp --- a/idlefw/plugins/wsplugin/src/keylockhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock handler implementation for Active Idle WS Plug-in -* -*/ - - -#include "keylockhandler.h" -#include "keyhandlertimer.h" -#include "keylockstates.h" -#include "aiwspluginanimdef.h" -#include "uistate.h" - -#include -#include -#include - -#include "debug.h" - -namespace AiWsPlugin { - -CKeyLockHandler::CKeyLockHandler() : - // Initialize to start-up state - iCurrentState( &TKeylockState::StartupState() ), - iNextState( &iCurrentState->iDefaultNextState() ) - { - } - -void CKeyLockHandler::ConstructL() - { - // Read capability: ReadDeviceData. - _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); - // Write capability: WriteDeviceData. - _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); - - // Initialize Shortcut Plug-in command API - RProperty::Define( - KUidSystemCategory, - KPSUidShortcutCmd, - RProperty::EText, - KReadDevicePolicy, - KWriteDevicePolicy - ); - - iSettings.ReadFromRepositoryL(); - iKeypadLockTimer = CPeriodic::NewL( CActive::EPriorityUserInput ); - iKeylockApi = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard ); - if ( !iKeylockApi->HasConfiguration() ) - { - delete iKeylockApi; - iKeylockApi = NULL; - } - } - -CKeyLockHandler* CKeyLockHandler::NewLC() - { - CKeyLockHandler* self = new( ELeave ) CKeyLockHandler; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CKeyLockHandler::~CKeyLockHandler() - { - delete iKeypadLockTimer; - delete iKeylockApi; - } - -void CKeyLockHandler::SetUiStateQuery( MUiState& aUiState ) - { - iUiState = &aUiState; - } - -TBool CKeyLockHandler::HasFocus() - { - return iUiState->HasFocus(); - } - -TBool CKeyLockHandler::TimeoutTimerActive() - { - return iKeypadLockTimer->IsActive(); - } - -void CKeyLockHandler::FocusChanged( TBool aState ) - { - iCurrentState->FocusChanged( *this, aState ); - } - -TBool CKeyLockHandler::OfferRawEvent(const TRawEvent& aRawEvent) - { - return iCurrentState->OfferRawEvent( *this, aRawEvent ); - } - -TBool CKeyLockHandler::IsFirstLockKey( TInt aScanCode ) - { - if ( iKeylockApi ) - { - TKeyEvent event; - event.iModifiers = 0; - event.iCode = 0; - event.iRepeats = 0; - event.iScanCode = aScanCode; - // Keylock API return ETrue on handlekeyeventL only if the whole key - // sequence has been inputted (1st + 2nd key pressed) - TRAP_IGNORE(iKeylockApi->HandleKeyEventL( event,EEventKeyDown )); - return iKeylockApi->PrimaryKeyPressed(); - } - else - { - return Settings().IsFirstLockKey( aScanCode ); - } - } - -TBool CKeyLockHandler::IsSecondLockKey( TInt aScanCode ) - { - TBool returnValue = EFalse; - if ( iKeylockApi ) - { - TKeyEvent event; - event.iModifiers = 0; - event.iCode = 0; - event.iRepeats = 0; - event.iScanCode = aScanCode; - TRAP_IGNORE(returnValue = iKeylockApi->HandleKeyEventL( event,EEventKeyDown )); - return returnValue; - } - else - { - return Settings().IsSecondLockKey( aScanCode ); - } - } - -const TKeypadSettings& CKeyLockHandler::Settings() const - { - return iSettings; - } - -void CKeyLockHandler::StartTimeoutTimer( TInt aTimeout ) - { - __PRINTS( "AiWsPlugin: CKeyLockHandler::StartTimeoutTimer()" ); - - iKeypadLockTimer->Cancel(); - if( aTimeout < 0 ) - { - iKeypadLockTimer->Start( - iSettings.KeylockTimeout(), iSettings.KeylockTimeout(), - TCallBack( &CKeyLockHandler::TimerElapsed, this ) ); - } - else - { - iKeypadLockTimer->Start( - aTimeout, aTimeout, - TCallBack( &CKeyLockHandler::TimerElapsed, this ) ); - } - } - -void CKeyLockHandler::StopTimeoutTimer() - { - __PRINTS( "AiWsPlugin: CKeyLockHandler::StopTimeoutTimer()" ); - iKeypadLockTimer->Cancel(); - } - -void CKeyLockHandler::ActivateKeypadLock() - { - __PRINTS( "AiWsPlugin: CKeyLockHandler::ActivateKeypadLock()" ); - StopTimeoutTimer(); - // Use Shortcut Plug-in API to set the keylock - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSEnableKeyLock ); - } - -void CKeyLockHandler::CancelKeypadLock() - { - __PRINTS( "AiWsPlugin: CKeyLockHandler::CancelKeypadLock()" ); - StopTimeoutTimer(); - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSSkipKeyLock ); - } - -void CKeyLockHandler::KeypadLockTimeout() - { - __PRINTS( "AiWsPlugin: CKeyLockHandler::CancelKeypadLock()" ); - StopTimeoutTimer(); - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSKeyLockTimeout ); - } - -void CKeyLockHandler::SetNextState( const TKeylockState& aState ) - { - iNextState = &aState; - } - -void CKeyLockHandler::ActivateNextState() - { - iCurrentState = iNextState; - iNextState = &(*iCurrentState->iDefaultNextState)(); - } - -void CKeyLockHandler::SetLastLockKeyScanCode( TInt aScanCode ) - { - iLastLockKeyScanCode = aScanCode; - } - -TInt CKeyLockHandler::LastLockKeyScanCode() const - { - return iLastLockKeyScanCode; - } - -TInt CKeyLockHandler::TimerElapsed(TAny* aSelf) - { - CKeyLockHandler* self = static_cast(aSelf); - if( self ) - { - self->iCurrentState->TimerElapsed( *self ); - } - return KErrNone; - } - -void CKeyLockHandler::TimerDone() - { - - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/keylockstates.cpp --- a/idlefw/plugins/wsplugin/src/keylockstates.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,346 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keylock states implementation for Active Idle WS Plug-in -* -*/ - - -#include "keylockstates.h" -#include "keylockcontrol.h" -#include "keypadsettings.h" -#include "panic.h" -#include "activeidle2domainpskeys.h" - -#include -#include - -#include "debug.h" - - -namespace AiWsPlugin { - -const TInt KTenMilliSecondsInu = 10 * 1000; - -/** - * Helper macro for declaring internal state classes for CKeyLockHandler. - */ -#define AI_DECLARE_KEYLOCK_STATE(StateCls) \ - class StateCls { \ - public: \ - static const TKeylockState KState; \ - static const TKeylockState& DefaultNextState(); \ - static void FocusChanged( MKeyLockHandlerControl& aControl, TBool aState ); \ - static TBool OfferRawEvent( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ); \ - static void TimerElapsed( MKeyLockHandlerControl& aControl ); \ - } - -/** - * Inactive state class for CKeyLockHandler. - */ -AI_DECLARE_KEYLOCK_STATE(TKeylockStateInactive); - -/** - * Active state class for CKeyLockHandler. - */ -AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForFirstKeyDown); - -/** - * Keylock sequence in progress state class for CKeyLockHandler. - */ -AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForSecondKeyDown); - -/** - * Keylock sequence finalizer state class for CKeyLockHandler. - */ -AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForSecondKeyUp); - -/** - * Helper macro for defining key lock state function tables. - */ -#define AI_DEFINE_KEYLOCK_STATE_FT(StateCls) \ - const TKeylockState StateCls::KState = { \ - &StateCls::DefaultNextState, \ - &StateCls::FocusChanged, \ - &StateCls::OfferRawEvent, \ - &StateCls::TimerElapsed } - -/// Defines function table for key lock inactive state -AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateInactive); - -/// Defines function table for key lock active state -AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForFirstKeyDown); - -/// Defines function table for key lock in progress state -AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForSecondKeyDown); - -/// Defines function table for key lock finalizing state -AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForSecondKeyUp); - -// TKeyLockState -const TKeylockState& TKeylockState::StartupState() - { - return TKeylockStateInactive::KState; - } - -// TKeylockStateInactive -const TKeylockState& TKeylockStateInactive::DefaultNextState() - { - return TKeylockStateWaitForFirstKeyDown::KState; - } - -void TKeylockStateInactive::FocusChanged - ( MKeyLockHandlerControl& aControl, TBool aState ) - { - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateInactive::FocusChanged(%d)"), aState ); - if ( aState ) - { - // Gained focus, switch to active state - aControl.ActivateNextState(); - } - } - -TBool TKeylockStateInactive::OfferRawEvent - ( MKeyLockHandlerControl& /*aControl*/, const TRawEvent& /*aRawEvent*/ ) - { - return EFalse; - } - -void TKeylockStateInactive::TimerElapsed - ( MKeyLockHandlerControl& aControl ) - { - // Illegal event in this state - aControl.KeypadLockTimeout(); -#ifndef NDEBUG - //Panic( EPanicInvalidKeylockEvent ); -#endif - } - -// TKeylockStateWaitForFirstLockKeyDown -const TKeylockState& TKeylockStateWaitForFirstKeyDown::DefaultNextState() - { - return TKeylockStateWaitForSecondKeyDown::KState; - } - -void TKeylockStateWaitForFirstKeyDown::FocusChanged - ( MKeyLockHandlerControl& aControl, TBool aState ) - { - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForFirstKeyDown::FocusChanged(%d)"), aState ); - if ( !aState ) - { - if( !aControl.TimeoutTimerActive() ) - { - // Lost focus, switch to inactive state - aControl.SetNextState( TKeylockStateInactive::KState ); - aControl.ActivateNextState(); - } - } - } - -TBool TKeylockStateWaitForFirstKeyDown::OfferRawEvent - ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) - { - switch ( aRawEvent.Type() ) - { - case TRawEvent::EKeyDown: - { - const TInt scanCode = aRawEvent.ScanCode(); - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForFirstKeyDown::OfferRawEvent(EKeyDown,ScanCode=%d)" ), scanCode ); - if ( aControl.IsFirstLockKey( scanCode ) && aControl.HasFocus() ) - { - // First lock key was pressed down - aControl.SetLastLockKeyScanCode( scanCode ); - // (Re)activate the keylock timeout timer - aControl.StartTimeoutTimer(KTenMilliSecondsInu); - } - } - } - - // Never consume the event to enable its processing if keylock - // is not activated within the timeout - return EFalse; - } - -void TKeylockStateWaitForFirstKeyDown::TimerElapsed - ( MKeyLockHandlerControl& aControl ) - { - TInt value = EPSAiNotDisplayingMenuOrDialog; - TInt err = RProperty::Get( - KPSUidAiInformation, - KActiveIdlePopupState, - value ); - - if( value == EPSAiNotDisplayingMenuOrDialog && err == KErrNone ) - { - // (Re)activate the keylock timeout timer - aControl.StartTimeoutTimer(); - // Switch to wait for second lock key down (see constructor of this state) - aControl.ActivateNextState(); - } - else - { - if( aControl.HasFocus() ) - { - aControl.StopTimeoutTimer(); - } - else - { - // Lost focus, switch to inactive state - aControl.SetNextState( TKeylockStateInactive::KState ); - aControl.ActivateNextState(); - } - } - // Illegal event in this state -#ifndef NDEBUG - //Panic( EPanicInvalidKeylockEvent ); -#endif - } - -// TKeylockStateWaitForSecondKeyDown -const TKeylockState& TKeylockStateWaitForSecondKeyDown::DefaultNextState() - { - // Assume the keylock sequence is cancelled - return TKeylockStateWaitForFirstKeyDown::KState; - } - -void TKeylockStateWaitForSecondKeyDown::FocusChanged - ( MKeyLockHandlerControl& aControl, TBool aState ) - { - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyDown::FocusChanged(%d)"), aState ); - if ( aState ) - { - // Gained focus: return to active state if keylock sequence is cancelled - aControl.SetNextState( TKeylockStateWaitForFirstKeyDown::KState ); - } - else - { - // Lost focus: return to inactive state if keylock sequence is cancelled - aControl.SetNextState( TKeylockStateInactive::KState ); - } - } - -TBool TKeylockStateWaitForSecondKeyDown::OfferRawEvent - ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) - { - TBool consumedEvent = EFalse; - - switch ( aRawEvent.Type() ) - { - case TRawEvent::EKeyDown: - { - const TInt scanCode = aRawEvent.ScanCode(); - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyDown::OfferRawEvent(EKeyDown,ScanCode=%d)" ), scanCode ); - if ( aControl.IsSecondLockKey( scanCode ) ) - { - // Second lock key was pressed down. Cancel keylock timer - // and switch to wait for key up event. - aControl.StopTimeoutTimer(); - aControl.SetLastLockKeyScanCode( scanCode ); - aControl.SetNextState( TKeylockStateWaitForSecondKeyUp::KState ); - aControl.ActivateNextState(); - consumedEvent = ETrue; - } - else - { - // Some other key than second lock key was pressed while - // keylock timer was running. Cancel the keylock sequence and - // switch to previous state. (Depending on focus status, - // see TKeylockStateWaitForFirstKeyDown::FocusChanged.) - aControl.CancelKeypadLock(); - aControl.ActivateNextState(); - consumedEvent = EFalse; - } - break; - } - } - - return consumedEvent; - } - -void TKeylockStateWaitForSecondKeyDown::TimerElapsed - ( MKeyLockHandlerControl& aControl ) - { - __PRINTS( "AiWsPlugin: TKeylockStateWaitForSecondKeyDown::TimerElapsed()" ); - aControl.KeypadLockTimeout(); - aControl.ActivateNextState(); - } - -// TKeylockStateWaitForSecondKeyUp -const TKeylockState& TKeylockStateWaitForSecondKeyUp::DefaultNextState() - { - // Idle must currently have focus so return to active state from this state - return TKeylockStateWaitForFirstKeyDown::KState; - } - -void TKeylockStateWaitForSecondKeyUp::FocusChanged - ( MKeyLockHandlerControl& aControl, TBool aState ) - { - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyUp::FocusChanged(%d)"), aState ); - if ( aState ) - { - // Gained focus: return to active state if keylock sequence is cancelled - aControl.SetNextState( - TKeylockStateWaitForFirstKeyDown::KState ); - } - else - { - // Lost focus: return to inactive state if keylock sequence is cancelled - aControl.SetNextState( TKeylockStateInactive::KState ); - } - } - -TBool TKeylockStateWaitForSecondKeyUp::OfferRawEvent - ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) - { - TBool consumedEvent = EFalse; - - switch ( aRawEvent.Type() ) - { - case TRawEvent::EKeyUp: - { - const TInt scanCode = aRawEvent.ScanCode(); - __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyUp::OfferRawEvent(EKeyUp,ScanCode=%d)" ), scanCode ); - if ( scanCode == aControl.LastLockKeyScanCode() ) - { - // Second lock key was released. Activate the keypad lock and - // switch back to initial state. (Depending on focus status, - // see TKeylockStateWaitForSecondKeyUp::FocusChanged.) - aControl.ActivateKeypadLock(); - aControl.ActivateNextState(); - } - // Consume all key events until the keylock sequence is finalized - consumedEvent = ETrue; - break; - } - - case TRawEvent::EKeyDown: - { - // Consume all key events until the keylock sequence is finalized - consumedEvent = ETrue; - break; - } - } - - return consumedEvent; - } - -void TKeylockStateWaitForSecondKeyUp::TimerElapsed - ( MKeyLockHandlerControl& /*aControl*/ ) - { - // Illegal event in this state -#ifndef NDEBUG - //Panic( EPanicInvalidKeylockEvent ); -#endif - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/keypadsettings.cpp --- a/idlefw/plugins/wsplugin/src/keypadsettings.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Keypad settings implmentation for Active Idle WS Plug-in. -* -*/ - - -#include "keypadsettings.h" - -#include -#include -#include - -#include - -#include "debug.h" - -namespace AiWsPlugin { - - -/** - * Maps selected numeric keypad scan codes to character. - * - * @param aScanCode scan code for which to find a character mapping. - * @return character mapping for aScanCode or -1 if no mapping is found. - */ -TInt16 TKeypadSettings::MapNkpScanCodeToChar( TInt aScanCode ) - { - TInt16 result; - switch( aScanCode ) - { - case EStdKeyHash: result = '#'; break; - case EStdKeyMinus: result = '-'; break; - case EStdKeyNkpAsterisk: result = '*'; break; - case EStdKeyNkpMinus: result = '-'; break; - case EStdKeyNkpPlus: result = '+'; break; - case EStdKeyNkp1: result = '1'; break; - case EStdKeyNkp2: result = '2'; break; - case EStdKeyNkp3: result = '3'; break; - case EStdKeyNkp4: result = '4'; break; - case EStdKeyNkp5: result = '5'; break; - case EStdKeyNkp6: result = '6'; break; - case EStdKeyNkp7: result = '7'; break; - case EStdKeyNkp8: result = '8'; break; - case EStdKeyNkp9: result = '9'; break; - case EStdKeyNkp0: result = '0'; break; - default: result = -1; break; - } - return result; - } - -void TKeypadSettings::ReadFromRepositoryL() - { - CRepository* repository = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); - TInt value; - - // KAIFirstKeyLockKey - User::LeaveIfError( repository->Get( KAIFirstKeyLockKey, value ) ); - iFirstLockKeyScanCode = TInt16( value ); - iFirstLockKeyChar = MapNkpScanCodeToChar( value ); - __PRINT( - __DBG_FORMAT("AiWsPlugin: KAIFirstKeyLockKey = %d, ch=%d"), - TInt(iFirstLockKeyScanCode), TInt(iFirstLockKeyChar) ); - - // KAISecondKeyLockKey - User::LeaveIfError( repository->Get( KAISecondKeyLockKey, value ) ); - iSecondLockKeyScanCode = TInt16( value ); - iSecondLockKeyChar = MapNkpScanCodeToChar( value ); - __PRINT( - __DBG_FORMAT("AiWsPlugin: KAISecondKeyLockKey = %d, ch=%d"), - TInt(iSecondLockKeyScanCode), TInt(iSecondLockKeyChar) ); - - // KAISecondKeyLockKey2 - User::LeaveIfError( repository->Get( KAISecondKeyLockKey2, value ) ); - iSecondLockKeyScanCode2 = TInt16( value ); - iSecondLockKeyChar2 = MapNkpScanCodeToChar( value ); - __PRINT( - __DBG_FORMAT("AiWsPlugin: KAISecondKeyLockKey2 = %d, ch=%d"), - TInt(iSecondLockKeyScanCode2), TInt(iSecondLockKeyChar2) ); - - // KAIKeyLockTimeout - User::LeaveIfError( repository->Get( KAIKeyLockTimeout, value ) ); - __PRINT( __DBG_FORMAT("AiWsPlugin: KAIKeyLockTimeout=%d ms"), value ); - // Convert timeout from milliseconds to microseconds - const TInt KUsInMs = 1000; - iKeylockTimeout = KUsInMs * value; - - // KAISINDKey - User::LeaveIfError( repository->Get( KAIVoiceDialLaunchKey, value ) ); - iSINDKeyScanCode = TInt16( value ); - iSINDKeyScanChar = MapNkpScanCodeToChar( value ); - __PRINT( - __DBG_FORMAT("AiWsPlugin: iSINDKey = %d, ch=%d"), - TInt(iSINDKeyScanCode), TInt(iSINDKeyScanChar) ); - - // KAISINDKeyTimeout - User::LeaveIfError( repository->Get( KAIVoiceDialKeyTimeout, value ) ); - __PRINT( __DBG_FORMAT("AiWsPlugin: KAISINDKeyTimeout=%d ms"), value ); - // Convert timeout from milliseconds to microseconds - iKeySINDTimeout = KUsInMs * value; - - CleanupStack::PopAndDestroy( repository ); - } - -TBool TKeypadSettings::IsFirstLockKey( TInt aScanCode ) const - { - return ( aScanCode == iFirstLockKeyScanCode || aScanCode == iFirstLockKeyChar ); - } - -TBool TKeypadSettings::IsSecondLockKey( TInt aScanCode ) const - { - return ( - ( aScanCode == iSecondLockKeyScanCode || aScanCode == iSecondLockKeyChar ) || - ( aScanCode == iSecondLockKeyScanCode2 || aScanCode == iSecondLockKeyChar2 ) ); - } - -TTimeIntervalMicroSeconds32 TKeypadSettings::KeylockTimeout() const - { - return iKeylockTimeout; - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/logslaunchhandler.cpp --- a/idlefw/plugins/wsplugin/src/logslaunchhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Logs app launch handler for Active Idle WS Plug-in. -* -*/ - - -#include "logslaunchhandler.h" -#include "uistate.h" -#include -#include -#include -#include -#include - -namespace AiWsPlugin { - - -CLogsLaunchHandler::CLogsLaunchHandler() - { - } - -void CLogsLaunchHandler::ConstructL() - { - // Read capability: ReadDeviceData. - _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); - // Write capability: WriteDeviceData. - _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); - - // Initialize Shortcut Plug-in command API - RProperty::Define( - KUidSystemCategory, - KPSUidShortcutCmd, - RProperty::EText, - KReadDevicePolicy, - KWriteDevicePolicy - ); - - iTimer = CKeyHandlerTimer::NewL( this ); - } - -CLogsLaunchHandler* CLogsLaunchHandler::NewLC() - { - CLogsLaunchHandler* self = new(ELeave) CLogsLaunchHandler; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CLogsLaunchHandler::~CLogsLaunchHandler() - { - if ( iTimer) - { - iTimer->Cancel(); - delete iTimer; - } - } - -void CLogsLaunchHandler::SetUiStateQuery( MUiState& aUiState ) - { - iUiState = &aUiState; - } - -void CLogsLaunchHandler::FocusChanged( TBool /*aState*/ ) - { - // Focus status is queried from iUiState - } - -TBool CLogsLaunchHandler::OfferRawEvent(const TRawEvent& aRawEvent) - { - TInt reactOnSendKey = 1; - TInt err = RProperty::Get( KPSUidAiInformation, KActiveIdleActOnSendKey, reactOnSendKey ); - if ( err != KErrNone ) - { - reactOnSendKey = 1; - } - - TBool consumed = EFalse; - - if ( reactOnSendKey ) - { - switch( aRawEvent.Type() ) - { - case TRawEvent::EKeyDown: - { - if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyYes ) - { - const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); - iTimer->Cancel(); - iTimer->After(KLongKeyPress); - consumed = ETrue; - } - break; - } - case TRawEvent::EKeyUp: - { - if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyYes && iTimer->IsActive() ) - { - iTimer->Cancel(); - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSLaunchLogs ); - consumed = ETrue; - } - break; - } - } - } - - return consumed; - } - -void CLogsLaunchHandler::TimerDone() - { - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSLaunchNameDialer ); - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/numerickeyhandler.cpp --- a/idlefw/plugins/wsplugin/src/numerickeyhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/plugins/wsplugin/src/numerickeyhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -24,6 +24,10 @@ #include #include +#include +#include +#include + #include #include #include @@ -153,11 +157,11 @@ TBool CNumericKeyHandler::CheckPostToTarget(const TRawEvent& aRawEvent ) const { const TInt scanCode = aRawEvent.ScanCode(); + const TUint modifiers = iUiState->Modifiers(); if ( iQwertyMode ) { - // Don't pass the check if shift is pressed. - const TUint modifiers = iUiState->Modifiers(); + // Don't pass the check if shift is pressed. if(( modifiers & EModifierShift ) == 0 ) { TInt numericKeysCount = iNumericKeys.Count(); @@ -190,7 +194,15 @@ } } } - return EFalse; + + // Homescreen should open dialer also with alpha characters, if dialer is in + // mode that accepts alpha characters into number entry (ou1cimx1#299396) + + const TInt KPhoneKeyStart = 33; + const TInt KPhoneKeyEnd = 127; + + return ( ( AllowAlphaNumericMode() ) && ( ( scanCode >= KPhoneKeyStart && + scanCode <= KPhoneKeyEnd ) || modifiers & EModifierSpecial ) ); } @@ -296,15 +308,73 @@ iInputLanguage = aValue; } +/** + * Check alpha numeric mode. + */ +TBool CNumericKeyHandler::AllowAlphaNumericMode() const + { + return ( EasyDialingEnabled() || VoIPSupported() ); + } + +/** + * Check if voip supported. + */ +TBool CNumericKeyHandler::VoIPSupported() const + { + TBool voipSupported( EFalse ); + CSPSettings* serviceProviderSettings( NULL ); + + TRAP_IGNORE( serviceProviderSettings = CSPSettings::NewL() ); + + if ( serviceProviderSettings ) + { + voipSupported = serviceProviderSettings->IsFeatureSupported( + ESupportInternetCallFeature ); + + delete serviceProviderSettings; + } + + return voipSupported; + } + +/** + * Check if easy dialing enabled. + */ +TBool CNumericKeyHandler::EasyDialingEnabled() const + { + TBool easyDialingEnabled( EFalse ); + if ( FeatureManager::FeatureSupported( + KFeatureIdProductIncludesHomeScreenEasyDialing ) ) + { + CRepository* cenrep( NULL ); + TInt easyDialingSetting; + + TRAP_IGNORE( cenrep = CRepository::NewL( KCRUidEasyDialSettings ) ); + + if ( cenrep ) + { + TInt err = cenrep->Get( KEasyDialing, easyDialingSetting ); + if ( !err && easyDialingSetting ) + { + easyDialingEnabled = ETrue; + } + + delete cenrep; + } + } + + return easyDialingEnabled; + } + void CNumericKeyHandler::HandleNotifyGeneric(TUint32 aKey) - { - if( aKey == KAknFepInputTxtLang ) - { - TInt newValue = iInputLanguage; - iInputLanguageRepository->Get( KAknFepInputTxtLang, newValue ); - HandleInputLanguageChanged( newValue ); - } - } + { + if( aKey == KAknFepInputTxtLang ) + { + TInt newValue = iInputLanguage; + iInputLanguageRepository->Get( KAknFepInputTxtLang, newValue ); + HandleInputLanguageChanged( newValue ); + } + } void CNumericKeyHandler::HandleNotifyError (TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/) diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/plugins/wsplugin/src/sindlaunchhandler.cpp --- a/idlefw/plugins/wsplugin/src/sindlaunchhandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: SIND app launch handler for Active Idle WS Plug-in. -* -*/ - - -#include "sindlaunchhandler.h" -#include "keyhandlertimer.h" -#include "uistate.h" -#include -#include -#include -#include - -//#define AI_ENABLE_RD_LOGGING -#define AI_RD_LOG_TO_DEBUG_OUTPUT - -#include "debug.h" - -namespace AiWsPlugin { - - -CSINDLaunchHandler::CSINDLaunchHandler() - { - } - -void CSINDLaunchHandler::ConstructL() - { - // Read capability: ReadDeviceData. - _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); - // Write capability: WriteDeviceData. - _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); - - // Initialize Shortcut Plug-in command API - RProperty::Define( - KUidSystemCategory, - KPSUidShortcutCmd, - RProperty::EText, - KReadDevicePolicy, - KWriteDevicePolicy - ); - - iTimer = CKeyHandlerTimer::NewL( this ); - - iSINDKeyDown = EFalse; - } - -CSINDLaunchHandler* CSINDLaunchHandler::NewLC() - { - CSINDLaunchHandler* self = new(ELeave) CSINDLaunchHandler; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CSINDLaunchHandler::~CSINDLaunchHandler() - { - delete iTimer; - } - -void CSINDLaunchHandler::SetUiStateQuery( MUiState& aUiState ) - { - iUiState = &aUiState; - } - -void CSINDLaunchHandler::FocusChanged( TBool /*aState*/ ) - { - // Focus status is queried from iUiState - } - -TBool CSINDLaunchHandler::OfferRawEvent(const TRawEvent& aRawEvent) - { - switch( aRawEvent.Type() ) - { - case TRawEvent::EKeyDown: - { - if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyDevice1 ) - { - __PRINTS( "XAI: CSINDLaunchHandler: SIND key down, start timer"); - const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); - iTimer->Cancel(); - iTimer->After(KLongKeyPress); - iSINDLaunched = EFalse; - iSINDKeyDown = ETrue; - } - else if( iUiState->HasFocus() && iSINDKeyDown ) - { - __PRINTS( "XAI: CSINDLaunchHandler: SIND key down, other key pressed, cancel timer"); - iTimer->Cancel(); - SkipVoiceDial(); - } - break; - } - case TRawEvent::EKeyUp: - { - if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyDevice1 && !iSINDLaunched && iTimer->IsActive() ) - { - __PRINTS( "XAI: SIND key up, cancel timer"); - iTimer->Cancel(); - SkipVoiceDial(); - } - break; - } - } - return EFalse; - } - -void CSINDLaunchHandler::SkipVoiceDial() - { - __PRINTS( "XAI: CSINDLaunchHandler::SkipVoiceDial()"); - // Handle skip scenario only if voice dial ui hasn't been launched - if( !iSINDLaunched ) - { - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSSkipNameDialer ); - } - iSINDKeyDown = EFalse; - } - -void CSINDLaunchHandler::TimerDone() - { - __PRINTS( "XAI: CSINDLaunchHandler::TimerDone()"); - __PRINTS( "XAI: Start Voice Dial UI"); - RProperty::Set( - KUidSystemCategory, - KPSUidShortcutCmd, - KAiPSLaunchNameDialer ); - iSINDLaunched = ETrue; - iSINDKeyDown = EFalse; - } - -} // namespace AiWsPlugin diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/rom/idlefw.iby --- a/idlefw/rom/idlefw.iby Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/rom/idlefw.iby Wed May 12 13:36:47 2010 +0300 @@ -29,7 +29,4 @@ file=ABI_DIR\BUILD_DIR\aiidleint.dll SHARED_LIB_DIR\aiidleint.dll file=ABI_DIR\BUILD_DIR\aifw.dll SHARED_LIB_DIR\aifw.dll -// Content publishing plug-ins -ECOM_PLUGIN( aidevstaplg.dll, aidevstaplg.rsc ) - #endif // ACTIVEIDLE3_IBY diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/rom/idlefw_resources.iby --- a/idlefw/rom/idlefw_resources.iby Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/rom/idlefw_resources.iby Wed May 12 13:36:47 2010 +0300 @@ -25,9 +25,6 @@ data=DATAZ_\APP_RESOURCE_DIR\homescreen.rsc APP_RESOURCE_DIR\homescreen.rsc -// Content publishing plug-in resources -data=DATAZ_\APP_RESOURCE_DIR\aidevstaplgres.rsc APP_RESOURCE_DIR\aidevstaplgres.rsc - #endif // RD_CUSTOMIZABLE_AI #endif // ACTIVEIDLE3_RESOURCES_IBY diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aibackuprestorestatusobserver.cpp --- a/idlefw/src/framework/aibackuprestorestatusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Backup/restore status observer for AI2 -* -*/ - - -#include -#include -#include "aistatemanager.h" -#include "aibackuprestorestatusobserver.h" -#include "aifwpanic.h" -#include "debug.h" - -const TUint KAI2BackupMask( conn::KBURPartTypeMask ^ conn::EBURNormal ); - -CAiBackupRestoreStatusObserver::CAiBackupRestoreStatusObserver() - { - } - -CAiBackupRestoreStatusObserver::~CAiBackupRestoreStatusObserver() - { - } - -CAiBackupRestoreStatusObserver* CAiBackupRestoreStatusObserver::NewL( - MAiStateManager* aStateManager ) - { - CAiBackupRestoreStatusObserver* self = new (ELeave) CAiBackupRestoreStatusObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiBackupRestoreStatusObserver::ConstructL( MAiStateManager* aStateManager ) - { - BaseConstructL( TCallBack( HandleBackupOperationEvent, this ), - KUidSystemCategory, - conn::KUidBackupRestoreKey, - aStateManager ); - } - -TAiStateChanges CAiBackupRestoreStatusObserver::Status() - { - TInt value = 0; - TInt err = iObserver->Get( value ); - if( ( value & KAI2BackupMask ) && - ( err == KErrNone ) ) // any type of backup or restore operation - { - return ESMAIBackupOn; - } - else - { - return ESMAIBackupOff; - } - } - -TInt CAiBackupRestoreStatusObserver::HandleBackupOperationEvent( TAny* aPtr ) - { - // see \epoc32\include\connect\sbdefs.h for enum descriptions - CAiBackupRestoreStatusObserver* self = - static_cast( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - TInt value = 0; - TInt err = self->iObserver->Get( value ); - - if( ( value & KAI2BackupMask ) && - ( err == KErrNone ) ) // any type of backup or restore operation - { - __PRINTS("XAI: Backup = ON"); - self->iStateManager->ReportStateChange( ESMAIBackupOn ); - } - else // aValue == conn::EBURUnset || aValue & conn::EBURNormal - { - // back operation finished -> return to previous state - __PRINTS("XAI: Backup = OFF"); - self->iStateManager->ReportStateChange( ESMAIBackupOff ); - } - return KErrNone; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aicallstatusobserver.cpp --- a/idlefw/src/framework/aicallstatusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Call status observer for AI2 -* -*/ - - -#include -#include -#include "aicallstatusobserver.h" -#include "aistatemanager.h" -#include "aifwpanic.h" -#include "debug.h" - -CAiCallStatusObserver::CAiCallStatusObserver() - { - } - -CAiCallStatusObserver::~CAiCallStatusObserver() - { - } - -CAiCallStatusObserver* CAiCallStatusObserver::NewL( MAiStateManager* aStateManager ) - { - CAiCallStatusObserver* self = new (ELeave) CAiCallStatusObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiCallStatusObserver::ConstructL( MAiStateManager* aStateManager ) - { - BaseConstructL( TCallBack( HandleCallStateChange, this ), - KPSUidCtsyCallInformation, - KCTsyCallState, - aStateManager ); - } - -TAiStateChanges CAiCallStatusObserver::Status() - { - TInt value = 0; - TInt err = iObserver->Get( value ); - if( ( value > EPSCTsyCallStateNone ) && - ( err == KErrNone ) ) - { - return ESMAIInCall; - } - else - { - return ESMAINoCall; - } - } - -TInt CAiCallStatusObserver::HandleCallStateChange( TAny* aPtr ) - { - CAiCallStatusObserver* self = reinterpret_cast< CAiCallStatusObserver* >( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - TInt value = 0; - TInt err = self->iObserver->Get( value ); - - if( ( value > EPSCTsyCallStateNone ) && - ( err == KErrNone ) ) - { - __PRINTS("XAI: Call = ON"); - self->iStateManager->ReportStateChange( ESMAIInCall ); - } - else - { - __PRINTS("XAI: Call = OFF"); - self->iStateManager->ReportStateChange( ESMAINoCall ); - } - return KErrNone; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aicontentpluginmanager.cpp --- a/idlefw/src/framework/aicontentpluginmanager.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,391 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Content plugin error manager class -* -*/ - - -#include -#include -#include -#include - -#include -#include - -#include "aicontentpluginmanager.h" -#include "aipluginstatemanager.h" -#include "aifweventhandler.h" -#include "aicontentpublisher.h" -#include "aipropertyextension.h" -#include -#include "aieventhandlerextension.h" -#include "aiuicontroller.h" -#include "aiconsts.h" -#include "debug.h" - -// CONSTANTS -const TInt KAILenOfParenthesis( 2 ); - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::NewL() -// ---------------------------------------------------------------------------- -// -CAiContentPluginManager* CAiContentPluginManager::NewL() - { - CAiContentPluginManager* self = new ( ELeave ) CAiContentPluginManager(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::ConstructL() -// ---------------------------------------------------------------------------- -// -void CAiContentPluginManager::ConstructL() - { - iPluginFactory = CAiPluginFactory::NewL( iPlugins, *this ); - - iStateManager = CAiPluginStateManager::NewL(); - - iPluginFactory->AddLifecycleObserverL( *iStateManager ); - - iPluginTool = AiUtility::CreatePluginToolL(); - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::~CAiContentPluginManager() -// ---------------------------------------------------------------------------- -// -CAiContentPluginManager::~CAiContentPluginManager() - { - iPlugins.ResetAndDestroy(); - - delete iPluginFactory; - delete iStateManager; - - Release( iPluginTool ); - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::CAiContentPluginManager() -// ---------------------------------------------------------------------------- -// -CAiContentPluginManager::CAiContentPluginManager() - { - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::HandlePluginEvent() -// ---------------------------------------------------------------------------- -// -void CAiContentPluginManager::HandlePluginEvent( const TDesC& aParam ) - { - const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); - - if( separatorPos == KErrNotFound ) - { - return; - } - - // Extract plugin name - TPtrC pluginName( aParam.Left( separatorPos ) ); - - // Extract event and parameter string - TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); - - // Find parameter string position - const TInt paramsPos( - eventNameAndParams.Locate( KEventParameterSeparator ) ); - - // Extract event name - TPtrC eventName( paramsPos < 0 ? eventNameAndParams : - eventNameAndParams.Left( paramsPos ) ); - - // Calculate actual parameter string length by ignoring parenthesis - TInt paramsLength( - eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); - - // Extract paramenters - TPtrC param( paramsPos < 0 ? KNullDesC() : - eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); - - // Resolve plugin - CAiContentPublisher* target = NULL; - - __TIME( "FW: Lookup plug-in by name", - - TRAP_IGNORE( target = iPluginFactory->PluginByNameL( pluginName ) ); - - ); - - __PRINT( __DBG_FORMAT( - "\t[I]\t Event: %S to plug-in by addr 0x%x" ), &aParam, target ); - - if( target ) - { - // Resolve plugin specific event id - TInt eventId( KErrNotFound ); - - TRAP_IGNORE( GetIdL( *target, EAiPublisherEvents, eventName, eventId ) ); - - // Forward event to plugin - MAiEventHandlerExtension* ext( - iPluginTool->EventHandlerExt( *target ) ); - - if( ext ) - { - if( eventId != KErrNotFound ) - { - ext->HandleEvent( eventId, param ); - } - else - { - ext->HandleEvent( eventName, param ); - } - } - } - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::HandlePluginEventL() -// ---------------------------------------------------------------------------- -// -void CAiContentPluginManager::HandlePluginEventL( - const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ) - { - // Resolve plugin - CAiContentPublisher* target( - iPluginFactory->PluginByInfoL( aPublisherInfo ) ); - - if( target ) - { - const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); - - // Extract event and parameter string - TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); - - // Find parameter string position - const TInt paramsPos( - eventNameAndParams.Locate( KEventParameterSeparator ) ); - - // Extract event name - TPtrC eventName( paramsPos < 0 ? - eventNameAndParams : eventNameAndParams.Left( paramsPos ) ); - - // Calculate actual parameter string length by ignoring parenthesis - TInt paramsLength( - eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); - - // Extract paramenters - TPtrC param( paramsPos < 0 ? KNullDesC() : - eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); - - // Resolve plugin specific event id - TInt eventId( KErrNotFound ); - - GetIdL( *target, EAiPublisherEvents, eventName, eventId ); - - // Forward event to plugin - MAiEventHandlerExtension* ext( - iPluginTool->EventHandlerExt( *target ) ); - - if( ext ) - { - if( eventId != KErrNotFound ) - { - ext->HandleEvent( eventId, param ); - } - else - { - ext->HandleEvent( eventName, param ); - } - } - } - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::HasMenuItemL() -// ---------------------------------------------------------------------------- -// -TBool CAiContentPluginManager::HasMenuItemL( - const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ) - { - // Resolve plugin - CAiContentPublisher* target( - iPluginFactory->PluginByInfoL( aPublisherInfo ) ); - - if( target ) - { - // Forward query to plugin - MAiEventHandlerExtension* ext( - iPluginTool->EventHandlerExt( *target ) ); - - if ( ext ) - { - return ext->HasMenuItem( aMenuItem ); - } - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::RefreshContentL() -// ---------------------------------------------------------------------------- -// -TBool CAiContentPluginManager::RefreshContent( const TDesC& aContentCid ) - { - TRAPD( error, RefreshContentL( aContentCid ) ); - - return ( error == KErrNone ); - } - -// ---------------------------------------------------------------------------- -// CAiFw::ProcessOnlineState() -// ---------------------------------------------------------------------------- -// -void CAiContentPluginManager::ProcessOnlineState( TBool aOnline ) - { - _LIT( KOnlineOffline, "online_offline" ); - - for( TInt i = 0; i < iPlugins.Count(); i++ ) - { - MAiEventHandlerExtension* ext( - iPluginTool->EventHandlerExt( *iPlugins[i] ) ); - - // If plugin understands online/offline run state change - if( ext && ext->HasMenuItem( KOnlineOffline ) ) - { - if( aOnline ) - { - iStateManager->ProcessOnlineState( *iPlugins[i] ); - } - else - { - iStateManager->ProcessOfflineState( *iPlugins[i] ); - } - } - } - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::StateManager() -// ---------------------------------------------------------------------------- -// -CAiPluginStateManager& CAiContentPluginManager::StateManager() const - { - return *iStateManager; - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::PluginFactory() -// ---------------------------------------------------------------------------- -// -CAiPluginFactory& CAiContentPluginManager::PluginFactory() const - { - return *iPluginFactory; - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::GetIdL() -// ---------------------------------------------------------------------------- -// -void CAiContentPluginManager::GetIdL( CAiContentPublisher& aContentPublisher, - TAiPublisherProperty aProperty, const TDesC& aName, TInt& aId ) - { - MAiContentItemIterator* iterator = - iPluginTool->ContentItemIteratorL( aContentPublisher, aProperty ); - - if( iterator ) - { - const TAiContentItem& ci( iterator->ItemL( aName ) ); - aId = ci.id; - } - else - { - aId = KErrNotFound; - } - } - -// ---------------------------------------------------------------------------- -// CAiContentPluginManager::RefreshContentL() -// ---------------------------------------------------------------------------- -// -TInt CAiContentPluginManager::RefreshContentL( const TDesC& aContentCid ) - { - TInt retval( KErrNotFound ); - - // Look up plug-in and content item and delegate to plug-in's - // MAiContentRequest implementation. - - // Find plugin name - TInt pos( aContentCid.Locate( KPluginEventSeparator ) ); - - if( pos == KErrNotFound ) - { - return retval; - } - - TPtrC pluginName( aContentCid.Left( pos ) ); - - CAiContentPublisher* plugin( iPluginFactory->PluginByNameL( pluginName ) ); - - if( !plugin ) - { - return retval; - } - - MAiPropertyExtension* ext( iPluginTool->PropertyExt( *plugin ) ); - - if( !ext ) - { - return retval; - } - - // Extract content id - TPtrC cid( aContentCid.Mid( ++pos ) ); - TInt id( 0 ); - - MAiContentRequest* handler( NULL ); - - TRAPD( error, GetIdL( *plugin, EAiPublisherContent, cid, id ) ); - - if ( !error ) - { - handler = static_cast< MAiContentRequest* >( - ext->GetPropertyL( EAiContentRequest ) ); - } - else - { - GetIdL( *plugin, EAiPublisherResources, cid, id ); - - handler = static_cast< MAiContentRequest* >( - ext->GetPropertyL( EAiResourceRequest ) ); - } - - // Forward event to plugin - if( handler && handler->RefreshContent( id ) ) - { - retval = KErrNone; - } - - return retval; - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aicpscommandbuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aicpscommandbuffer.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,316 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cps command buffer +* +*/ + + +// System includes +#include +#include +#include + +// User includes +#include "caicpscommandbuffer.h" +#include "aicpsexecuteparam.h" +#include + +// Constants +_LIT8( KCPSConfigurationIf, "IContentPublishing" ); +_LIT8( KCPS, "Service.ContentPublishing" ); +_LIT8( KExecuteAction, "ExecuteAction" ); +_LIT8( KExecuteMultipleActions, "ExecuteMultipleActions" ); +_LIT8( KFilters, "filters" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::CAiCpsCommandBuffer +// +// --------------------------------------------------------------------------- +// +CAiCpsCommandBuffer::CAiCpsCommandBuffer() + { + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::ConstructL +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::NewL +// +// --------------------------------------------------------------------------- +// +CAiCpsCommandBuffer* CAiCpsCommandBuffer::NewL() + { + CAiCpsCommandBuffer* self = CAiCpsCommandBuffer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::NewLC +// +// --------------------------------------------------------------------------- +// +CAiCpsCommandBuffer* CAiCpsCommandBuffer::NewLC() + { + CAiCpsCommandBuffer* self = new ( ELeave ) CAiCpsCommandBuffer; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::~CAiCpsCommandBuffer +// +// --------------------------------------------------------------------------- +// +CAiCpsCommandBuffer::~CAiCpsCommandBuffer() + { + // Flush any pending commands + Flush(); + + if ( iCpsInterface ) + { + // Close interface + iCpsInterface->Close(); + } + + TRAP_IGNORE( DetachL() ); + + delete iCpsService; + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::DetachL +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::DetachL() + { + if ( iServiceHandler && iCpsService ) + { + // Detach services from the handler + RCriteriaArray list; + CleanupClosePushL( list ); + + list.AppendL( iCpsService ); + + iServiceHandler->DetachL( list ); + + CleanupStack::PopAndDestroy( &list ); + } + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::GetCPSInterfaceL +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::GetCPSInterfaceL() + { + if ( iCpsInterface ) + { + return; + } + + RCriteriaArray interestList; + CleanupClosePushL( interestList ); + + CLiwServiceHandler* serviceHandler = CLiwServiceHandler::NewL(); + CleanupStack::PushL( serviceHandler ); + + // Attach to CPS: + CLiwCriteriaItem* cpsService = CLiwCriteriaItem::NewL( 1, KCPSConfigurationIf, KCPS ); + CleanupStack::PushL( cpsService ); + + cpsService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + interestList.AppendL( cpsService ); + serviceHandler->AttachL( interestList ); + + CLiwGenericParamList& inParamList( serviceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( serviceHandler->OutParamListL() ); + + serviceHandler->ExecuteServiceCmdL( + *cpsService, + inParamList, + outParamList ); + + TInt pos( 0 ); + + outParamList.FindFirst( pos, KCPSConfigurationIf ); + + if ( pos != KErrNotFound ) + { + iCpsInterface = (outParamList)[pos].Value().AsInterface(); + inParamList.Reset(); + outParamList.Reset(); + } + else + { + inParamList.Reset(); + outParamList.Reset(); + User::Leave( KErrNotFound ); + } + + CleanupStack::Pop( cpsService ); + iCpsService = cpsService; + + CleanupStack::Pop( serviceHandler ); + iServiceHandler = serviceHandler; + + CleanupStack::PopAndDestroy( &interestList ); + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::AddCommand +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::AddCommand( const TDesC& aPluginId, + const TDesC& aType, CLiwDefaultMap* aFilter, + const TDesC8& aAction ) + { + __PRINTS( "CAiCpsCommandBuffer::AddCommand, start" ); + + TRAP_IGNORE( DoAddCommandL( aPluginId, aType, aFilter, aAction ) ); + + __PRINTS( "CAiCpsCommandBuffer::AddCommand - done" ); + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::ServiceHandler +// +// --------------------------------------------------------------------------- +// +CLiwServiceHandler* CAiCpsCommandBuffer::ServiceHandler() const + { + return iServiceHandler; + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::CpsInterface +// +// --------------------------------------------------------------------------- +// +MLiwInterface* CAiCpsCommandBuffer::CpsInterface() const + { + return iCpsInterface; + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::DoAddCommandL +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::DoAddCommandL( const TDesC& aPluginId, + const TDesC& aType, CLiwDefaultMap* aFilter, + const TDesC8& aAction ) + { + TInt found( KErrNotFound ); + + for ( TInt i = 0; i < iPlugins.Count(); i++ ) + { + if ( aPluginId == iPlugins[i]->PluginId() ) + { + found = i; + break; + } + } + + if ( found != KErrNotFound ) + { + iPlugins[found]->AddActionL( aAction ); + } + else + { + CAiCpsExecuteParam* param = CAiCpsExecuteParam::NewLC(); + param->SetPluginIdL( aPluginId ); + param->SetRegistryTypeL( aType ); + param->SetFilterL( aFilter ); + param->AddActionL( aAction ); + iPlugins.AppendL( param ); + CleanupStack::Pop( param ); + } + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::Flush +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::Flush() + { + __PRINTS( "CAiCpsCommandBuffer::Flush, start" ); + + if ( iPlugins.Count() > 0 ) + { + TRAP_IGNORE( DoFlushL() ); + } + + __PRINTS( "CAiCpsCommandBuffer::Flush - done" ); + } + +// --------------------------------------------------------------------------- +// CAiCpsCommandBuffer::DoFlushL +// +// --------------------------------------------------------------------------- +// +void CAiCpsCommandBuffer::DoFlushL() + { + if ( !iCpsInterface ) + { + GetCPSInterfaceL(); + } + + if ( iCpsInterface ) + { + __PRINTS( "CAiCpsCommandBuffer::DoFlush : Execute" ); + + TInt pluginCount( iPlugins.Count() ); + + CLiwDefaultList* pluginCmdList = CLiwDefaultList::NewLC(); + + for ( TInt i = 0; i < pluginCount; i++ ) + { + CLiwDefaultMap* inParamMap = iPlugins[i]->InParamMapLC(); + pluginCmdList->AppendL( inParamMap ); + CleanupStack::PopAndDestroy( inParamMap ); + } + + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewLC(); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewLC(); + + TLiwGenericParam item( KFilters, TLiwVariant ( pluginCmdList ) ); + inParamList->AppendL( item ); + + iCpsInterface->ExecuteCmdL( KExecuteMultipleActions, *inParamList, *outParamList); + + CleanupStack::PopAndDestroy( 3, pluginCmdList ); // outparamList, inParamList + + iPlugins.ResetAndDestroy(); + } + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aicpsexecuteparam.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aicpsexecuteparam.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CPS Execute parameter object +* +*/ + + +// System includes + +// User includes +#include +#include +#include +#include "aicpsexecuteparam.h" + +// Constants +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KPluginId, "plugin_id"); +_LIT8( KType, "type"); +_LIT8( KFilter, "filter" ); +_LIT8( KActionTrigger, "action_trigger" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::CAiCpsExecuteParam +// +// --------------------------------------------------------------------------- +// +CAiCpsExecuteParam::CAiCpsExecuteParam() + { + + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::ConstructL +// +// --------------------------------------------------------------------------- +// +void CAiCpsExecuteParam::ConstructL( ) + { + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::NewL +// +// --------------------------------------------------------------------------- +// +CAiCpsExecuteParam* CAiCpsExecuteParam::NewL() + { + CAiCpsExecuteParam* self = CAiCpsExecuteParam::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::NewLC +// +// --------------------------------------------------------------------------- +// +CAiCpsExecuteParam* CAiCpsExecuteParam::NewLC() + { + CAiCpsExecuteParam* self = new ( ELeave ) CAiCpsExecuteParam; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::~CAiCpsExecuteParam +// +// --------------------------------------------------------------------------- +// +CAiCpsExecuteParam::~CAiCpsExecuteParam() + { + delete iPluginId; + delete iRegistryType; + delete iPublisher; + delete iContentType; + delete iContentId; + iActions.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::PluginId +// +// --------------------------------------------------------------------------- +// +const TDesC& CAiCpsExecuteParam::PluginId() const + { + return *iPluginId; + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::InParamMapLC +// +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CAiCpsExecuteParam::InParamMapLC() + { + CLiwDefaultMap* inParamMap = CLiwDefaultMap::NewLC(); + inParamMap->InsertL( KType, TLiwVariant( *iRegistryType )); + + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant(iPublisher )); + filter->InsertL( KContentId, TLiwVariant(iContentId )); + filter->InsertL( KContentType, TLiwVariant(iContentType )); + + CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC(); + for ( TInt i=0; i< iActions.Count(); i++) + { + actionsToLaunch->AppendL( TLiwVariant( *iActions[i])); + } + filter->InsertL(KActionTrigger, TLiwVariant(actionsToLaunch) ); + inParamMap->InsertL( KFilter, TLiwVariant( filter )); + + CleanupStack::PopAndDestroy( actionsToLaunch ); + CleanupStack::PopAndDestroy( filter ); + return inParamMap; + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::SetFilterL +// +// --------------------------------------------------------------------------- +// +void CAiCpsExecuteParam::SetFilterL(CLiwDefaultMap* aMap) + { + delete iPublisher; + delete iContentType; + delete iContentId; + iPublisher = NULL; + iContentType = NULL; + iContentId = NULL; + + TLiwVariant variant; + variant.PushL(); + + if ( aMap->FindL(KPublisherId, variant )) + { + iPublisher = variant.AsDes().AllocL(); + } + + variant.Reset(); + if ( aMap->FindL(KContentType, variant )) + { + iContentType= variant.AsDes().AllocL(); + } + + variant.Reset(); + if ( aMap->FindL(KContentId, variant )) + { + iContentId= variant.AsDes().AllocL(); + } + + variant.Reset(); + CleanupStack::PopAndDestroy( &variant ); + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::SetRegistryTypeL +// +// --------------------------------------------------------------------------- +// +void CAiCpsExecuteParam::SetRegistryTypeL(const TDesC& aRegistryType) + { + delete iRegistryType; + iRegistryType = NULL; + iRegistryType = aRegistryType.AllocL(); + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::SetPluginIdL +// +// --------------------------------------------------------------------------- +// +void CAiCpsExecuteParam::SetPluginIdL(const TDesC& aPluginId) + { + delete iPluginId; + iPluginId = NULL; + iPluginId = aPluginId.AllocL(); + } + +// --------------------------------------------------------------------------- +// CAiCpsExecuteParam::AddActionL +// +// --------------------------------------------------------------------------- +// +void CAiCpsExecuteParam::AddActionL(const TDesC8& aAction) + { + iActions.Append(aAction.AllocL()); + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aiecomobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aiecomobserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CAiEcomObserver class implementation. +* +*/ + +// System includes + +// User incldues +#include "aiecomobserver.h" + + +// Constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== +//----------------------------------------------------------------------------- +// CAiEcomObserver::CAiEcomObserver +// +//----------------------------------------------------------------------------- +// +CAiEcomObserver::CAiEcomObserver() + : CActive( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::NewLC +// +//----------------------------------------------------------------------------- +// +CAiEcomObserver* CAiEcomObserver::NewLC() + { + CAiEcomObserver* self = new ( ELeave ) CAiEcomObserver(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::NewL +// +//----------------------------------------------------------------------------- +// +CAiEcomObserver* CAiEcomObserver::NewL() + { + CAiEcomObserver* self = CAiEcomObserver::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::ConstructL +// +//----------------------------------------------------------------------------- +// +void CAiEcomObserver::ConstructL() + { + iEComSession = REComSession::OpenL(); + StartObserving(); + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::~CAiEcomObserver +// +//----------------------------------------------------------------------------- +// +CAiEcomObserver::~CAiEcomObserver() + { + // Cancel any request, if outstanding + Cancel(); + + // Clean up memebers + iObservers.Close(); + + iEComSession.Close(); + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::DoCancel +// +//----------------------------------------------------------------------------- +// +void CAiEcomObserver::DoCancel() + { + iEComSession.CancelNotifyOnChange( iStatus ); + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::StartObserving +// +//----------------------------------------------------------------------------- +// +void CAiEcomObserver::StartObserving() + { + iEComSession.NotifyOnChange( iStatus ); + SetActive(); + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::AddObserverL +// +//----------------------------------------------------------------------------- +// +void CAiEcomObserver::AddObserverL( MAiEcomObserver* aObserver ) + { + if ( aObserver ) + { + iObservers.AppendL( aObserver ); + } + } + +//----------------------------------------------------------------------------- +// CAiEcomObserver::RunL +// +//----------------------------------------------------------------------------- +// +void CAiEcomObserver::RunL() + { + // Store completion status + TInt status( iStatus.Int() ); + + // Continue request + StartObserving(); + + // Notify observers + if ( status == KErrNone ) + { + NotifyObservers(); + } + } + +//------------------------------------------------------------------------------ +// CAiEcomObserver::NotifyObservers +// +//------------------------------------------------------------------------------ +// +void CAiEcomObserver::NotifyObservers() + { + TInt count( iObservers.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + iObservers[i]->NotifyEcomRegistryChanged(); + } + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aienvironmentchangeobserver.cpp --- a/idlefw/src/framework/aienvironmentchangeobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Environment change observer for AI2 -* -*/ - - -#include // for CEnvironmentChangeNotifier -#include -#include // for KEikDynamicLayoutVariantSwitch -#include "aienvironmentchangeobserver.h" -#include "aistatemanager.h" -#include "aifwpanic.h" -#include "debug.h" - -CAiEnvironmentChangeObserver::CAiEnvironmentChangeObserver() - { - } - -CAiEnvironmentChangeObserver::~CAiEnvironmentChangeObserver() - { - if( iEnvironmentChangeNotifier ) - { - iEnvironmentChangeNotifier->Cancel(); - delete iEnvironmentChangeNotifier; - } - } - -CAiEnvironmentChangeObserver* CAiEnvironmentChangeObserver::NewL( MAiStateManager* aStateManager ) - { - CAiEnvironmentChangeObserver* self = new (ELeave) CAiEnvironmentChangeObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiEnvironmentChangeObserver::ConstructL( MAiStateManager* aStateManager ) - { - iStateManager = aStateManager; - iEnvironmentChangeNotifier = CEnvironmentChangeNotifier::NewL( - EActivePriorityLogonA, - TCallBack( EnvironmentChangeCallBack, this ) ); - iEnvironmentChangeNotifier->Start(); - } - -TAiStateChanges CAiEnvironmentChangeObserver::Status() - { - // No statuses to report - return ESMAIUnknownState; - } - -TInt CAiEnvironmentChangeObserver::EnvironmentChangeCallBack(TAny* aPtr) - { - CAiEnvironmentChangeObserver* self = - static_cast( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - const TInt changes( self->iEnvironmentChangeNotifier->Change() ); - - // report environment changes - if( changes & EChangesMidnightCrossover ) - { - __PRINTS("XAI: Event: Midnight crossover"); - self->iStateManager->ReportStateChange( ESMAIMidnightCrossover ); - } - if( changes & EChangesSystemTime ) - { - __PRINTS("XAI: Event: Time changed"); - self->iStateManager->ReportStateChange( ESMAITimeChanged ); - } - if( changes & EChangesLocale ) - { - __PRINTS("XAI: Event: Locale setting changed"); - self->iStateManager->ReportStateChange( ESMAILocaleChanged ); - } - - return EFalse; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aieventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aieventhandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Content plugin event handler +* +*/ + +// System includes + +// User includes +#include +#include +#include + +#include "aipluginfactory.h" +#include "aiconsts.h" +#include "debug.h" + +#include "aieventhandler.h" + +// Constants +const TInt KAILenOfParenthesis( 2 ); + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiEventHandler::NewL() +// +// ---------------------------------------------------------------------------- +// +CAiEventHandler* CAiEventHandler::NewL( + CAiPluginFactory& aFactory ) + { + CAiEventHandler* self = + new ( ELeave ) CAiEventHandler( aFactory ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::ConstructL() +// +// ---------------------------------------------------------------------------- +// +void CAiEventHandler::ConstructL() + { + iPluginTool = AiUtility::CreatePluginToolL(); + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::~CAiEventHandler() +// +// ---------------------------------------------------------------------------- +// +CAiEventHandler::~CAiEventHandler() + { + Release( iPluginTool ); + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::CAiEventHandler() +// +// ---------------------------------------------------------------------------- +// +CAiEventHandler::CAiEventHandler( CAiPluginFactory& aFactory ) + : iFactory( aFactory ) + { + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::HandlePluginEvent() +// +// ---------------------------------------------------------------------------- +// +void CAiEventHandler::HandlePluginEvent( const TDesC& aParam ) + { + const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); + + if( separatorPos == KErrNotFound ) + { + return; + } + + // Extract plugin name + TPtrC pluginName( aParam.Left( separatorPos ) ); + + // Extract event and parameter string + TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); + + // Find parameter string position + const TInt paramsPos( + eventNameAndParams.Locate( KEventParameterSeparator ) ); + + // Extract event name + TPtrC eventName( paramsPos < 0 ? eventNameAndParams : + eventNameAndParams.Left( paramsPos ) ); + + // Calculate actual parameter string length by ignoring parenthesis + TInt paramsLength( + eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); + + // Extract paramenters + TPtrC param( paramsPos < 0 ? KNullDesC() : + eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); + + // Resolve plugin + CHsContentPublisher* publisher( NULL ); + + __TIME( "FW: Lookup plug-in by name", + publisher = iFactory.PluginByName( pluginName ); + ); + + __PRINT( __DBG_FORMAT( + "\t[I]\t Event: %S to plug-in by addr 0x%x" ), &aParam, publisher ); + + if( publisher ) + { + // Resolve plugin specific event id + TInt eventId( KErrNotFound ); + + TRAP_IGNORE( GetIdL( *publisher, + CHsContentPublisher::EPublisherEvents, eventName, eventId ) ); + + if( eventId != KErrNotFound ) + { + publisher->HandleEvent( eventId, param ); + } + else + { + publisher->HandleEvent( eventName, param ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::HandlePluginEventL() +// +// ---------------------------------------------------------------------------- +// +void CAiEventHandler::HandlePluginEventL( + const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ) + { + // Resolve plugin + CHsContentPublisher* publisher( + iFactory.PluginByInfo( aPublisherInfo ) ); + + if( publisher ) + { + const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); + + // Extract event and parameter string + TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); + + // Find parameter string position + const TInt paramsPos( + eventNameAndParams.Locate( KEventParameterSeparator ) ); + + // Extract event name + TPtrC eventName( paramsPos < 0 ? + eventNameAndParams : eventNameAndParams.Left( paramsPos ) ); + + // Calculate actual parameter string length by ignoring parenthesis + TInt paramsLength( + eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); + + // Extract paramenters + TPtrC param( paramsPos < 0 ? KNullDesC() : + eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); + + // Resolve plugin specific event id + TInt eventId( KErrNotFound ); + + GetIdL( *publisher, + CHsContentPublisher::EPublisherEvents, eventName, eventId ); + + if( eventId != KErrNotFound ) + { + publisher->HandleEvent( eventId, param ); + } + else + { + publisher->HandleEvent( eventName, param ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::HasMenuItemL() +// +// ---------------------------------------------------------------------------- +// +TBool CAiEventHandler::HasMenuItemL( const THsPublisherInfo& aPublisherInfo, + const TDesC& aMenuItem ) + { + // Resolve plugin + CHsContentPublisher* publisher( + iFactory.PluginByInfo( aPublisherInfo ) ); + + if( publisher ) + { + return publisher->HasMenuItem( aMenuItem ); + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::RefreshContent() +// +// ---------------------------------------------------------------------------- +// +TBool CAiEventHandler::RefreshContent( const TDesC& aContentCid ) + { + TRAPD( error, RefreshContentL( aContentCid ) ); + + return ( error == KErrNone ); + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::RefreshContent() +// +// ---------------------------------------------------------------------------- +// +TBool CAiEventHandler::RefreshContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) + { + // Resolve plugin + CHsContentPublisher* publisher( + iFactory.PluginByInfo( aPublisherInfo ) ); + + if( publisher ) + { + TInt id( KErrNotFound ); + + TRAP_IGNORE( GetIdL( *publisher, + CHsContentPublisher::EPublisherContent, aContentCid, id ) ); + + if ( id != KErrNotFound ) + { + MAiContentRequest* handler = static_cast< MAiContentRequest* >( + publisher->GetProperty( CHsContentPublisher::EContentRequest ) ); + + if ( handler ) + { + return handler->RefreshContent( id ); + } + } + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::SuspendContent() +// +// ---------------------------------------------------------------------------- +// +TBool CAiEventHandler::SuspendContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) + { + // Resolve plugin + CHsContentPublisher* publisher( + iFactory.PluginByInfo( aPublisherInfo ) ); + + if( publisher ) + { + TInt id( KErrNotFound ); + + TRAP_IGNORE( GetIdL( *publisher, + CHsContentPublisher::EPublisherContent, aContentCid, id ) ); + + if ( id != KErrNotFound ) + { + MAiContentRequest* handler = static_cast< MAiContentRequest* >( + publisher->GetProperty( CHsContentPublisher::EContentRequest ) ); + + if ( handler ) + { + return handler->SuspendContent( id ); + } + } + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::GetIdL() +// +// ---------------------------------------------------------------------------- +// +void CAiEventHandler::GetIdL( CHsContentPublisher& aContentPublisher, + CHsContentPublisher::TProperty aProperty, const TDesC& aName, TInt& aId ) + { + MAiContentItemIterator* iterator = + iPluginTool->ContentItemIterator( aContentPublisher, aProperty ); + + if( iterator ) + { + const TAiContentItem& ci( iterator->ItemL( aName ) ); + aId = ci.id; + } + else + { + aId = KErrNotFound; + } + } + +// ---------------------------------------------------------------------------- +// CAiEventHandler::RefreshContentL() +// +// ---------------------------------------------------------------------------- +// +TInt CAiEventHandler::RefreshContentL( const TDesC& aContentCid ) + { + TInt retval( KErrNotFound ); + + // Look up plug-in and content item and delegate to plug-in's + // MAiContentRequest implementation. + + // Find plugin name + TInt pos( aContentCid.Locate( KPluginEventSeparator ) ); + + if( pos == KErrNotFound ) + { + return retval; + } + + TPtrC pluginName( aContentCid.Left( pos ) ); + + CHsContentPublisher* publisher( iFactory.PluginByName( pluginName ) ); + + if( !publisher ) + { + return retval; + } + + // Extract content id + TPtrC cid( aContentCid.Mid( ++pos ) ); + TInt id( 0 ); + + MAiContentRequest* handler( NULL ); + + TRAPD( error, GetIdL( *publisher, + CHsContentPublisher::EPublisherContent, cid, id ) ); + + if ( !error ) + { + handler = static_cast< MAiContentRequest* >( + publisher->GetProperty( CHsContentPublisher::EContentRequest ) ); + } + else + { + GetIdL( *publisher, + CHsContentPublisher::EPublisherResources, cid, id ); + + handler = static_cast< MAiContentRequest* >( + publisher->GetProperty( CHsContentPublisher::EResourceRequest ) ); + } + + // Forward event to plugin + if( handler && handler->RefreshContent( id ) ) + { + retval = KErrNone; + } + + return retval; + } + +// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aifocusobserver.cpp --- a/idlefw/src/framework/aifocusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Focus observer for Active idle 2 -* -*/ - - -#include -#include -#include "aistatemanager.h" -#include "aifocusobserver.h" -#include "aifwpanic.h" -#include "debug.h" - -CAiFocusObserver::CAiFocusObserver() - { - } - -CAiFocusObserver::~CAiFocusObserver() - { - } - -CAiFocusObserver* CAiFocusObserver::NewL( - MAiStateManager* aStateManager ) - { - CAiFocusObserver* self = new (ELeave) CAiFocusObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiFocusObserver::ConstructL( MAiStateManager* aStateManager ) - { - //++HV - BaseConstructL( TCallBack( StaticHandleFocusChangeEvent, this ), - KPSUidAiInformation, - KActiveIdleState, - aStateManager ); -//--HV - } - -TAiStateChanges CAiFocusObserver::Status() - { - TInt value = 0; - TInt err = iObserver->Get( value ); - if( ( value == EPSAiForeground ) && - ( err == KErrNone ) ) - { - return ESMAIIdleForeground; - } - else - { - return ESMAIIdleBackground; - } - } - - //++HV - - TInt CAiFocusObserver::StaticHandleFocusChangeEvent( TAny* aPtr ) - { - CAiFocusObserver* self = - static_cast( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - return( self->HandleFocusChangeEvent() ); - } - - -TInt CAiFocusObserver::HandleFocusChangeEvent() - { - if( iTfxEffectActive ) - { - return KErrNone; - } - - TInt value = 0; - TInt err = iObserver->Get( value ); - - // Check the PS keys value and call manager with approriate parameter. - // Repowrt either "idle foreground" or "idle background" - if( ( value == EPSAiForeground ) && - ( err == KErrNone ) ) - { - // Check if the transition effect is active - - // This has to be called first, otherwise the state might not be valid. - CAknTransitionUtils::AddObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); - - TInt redirState = 0; - CAknTransitionUtils::GetState( CAknTransitionUtils::EEventWsBufferRedirection, &redirState ); - if ( (TBool)redirState ) - { - // The effect is on-going. Prevent view refresh until the effect is finished. - iTfxEffectActive = ETrue; - } - else - { - // No effect on-going. Observer is not needed. - CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); - iStateManager->ReportStateChange( ESMAIIdleForeground ); - } - } - else if( value == EPSAiBackground ) - { - // Do not receive callbacks in background. Remove observer if it still exists. - CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); - iTfxEffectActive = EFalse; - - iStateManager->ReportStateChange( ESMAIIdleBackground ); - } - - return KErrNone; - } - - -TInt CAiFocusObserver::AknTransitionCallback( TInt aEvent, TInt aState, const TDesC8* /*aParams*/ ) - { - if ( ( aEvent & CAknTransitionUtils::EEventWsBufferRedirection ) && ( !(TBool)aState ) ) - { - // The effect has been finished - iTfxEffectActive = EFalse; - // Observer is not needed any more. - CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); - - // Issue one focus change event - TInt value = 0; - TInt err = iObserver->Get( value ); - if( ( value == EPSAiForeground ) && - ( err == KErrNone ) ) - { - iStateManager->ReportStateChange( ESMAIIdleForeground ); - } - else if( value == EPSAiBackground ) - { - iStateManager->ReportStateChange( ESMAIIdleBackground ); - } - } - - return 0; - } - - -//--HV diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aifw.cpp --- a/idlefw/src/framework/aifw.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/framework/aifw.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,49 +15,41 @@ * */ +// System includes +#include +#include +#include -#include -#include -#include -#include -#include +// User includes +#include "aiuicontrollermanager.h" +#include "aiuicontroller.h" +#include "aieventhandler.h" +#include "aistatemanager.h" +#include "aistateprovider.h" +#include "aipluginfactory.h" +#include "aiwspluginmanager.h" +#include "aiidleappregister.h" + +#include #include -#include -#include #include #include -#include -#include -#include - - -#include -#include +#include "aiutility.h" +#include "aifwpanic.h" #include "aifw.h" -#include "aifwpanic.h" -#include "aiutility.h" -#include "aiuicontrollermanager.h" -#include "aiuicontroller.h" -#include "aicontentmodel.h" -#include "aicontentpluginmanager.h" -#include "aiwspluginmanager.h" -#include "aipluginstatemanager.h" -#include "aiidleappregister.h" + #include "debug.h" -#include -#include -#include "ainetworklistener.h" +// Constants -#include - // ======== MEMBER FUNCTIONS ======== // ---------------------------------------------------------------------------- -// CAiFw::NewL() +// CAiFw::CAiFw() +// // ---------------------------------------------------------------------------- // CAiFw::CAiFw() @@ -66,10 +58,13 @@ // ---------------------------------------------------------------------------- // CAiFw::ConstructL() +// // ---------------------------------------------------------------------------- // void CAiFw::ConstructL() { + __PRINTS( "*** CAiFw::ConstructL" ); + __TIME_MARK( time ); #if 0 // For AI3_test RProcess proc; @@ -78,105 +73,109 @@ if( secId == 0x2001CB4F ) { - iAIRepository = CRepository::NewL( TUid::Uid( 0x2001952B ) ); + iRepository = CRepository::NewL( TUid::Uid( 0x2001952B ) ); } else { - iAIRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + iRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); } #else - iAIRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + iRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); #endif TInt value( 0 ); - iAIRepository->Get( KAiMainUIController, value ); + iRepository->Get( KAiMainUIController, value ); - if( !( value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + if ( !( value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE || value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ) ) { // Someone wrote an invalid configuration! Reset repository. - iAIRepository->Reset( KAiMainUIController ); - iAIRepository->Reset( KAiFirstUIController ); - iAIRepository->Delete( KAiFirstUIController + 1 ); + iRepository->Reset( KAiMainUIController ); + iRepository->Reset( KAiFirstUIController ); + iRepository->Delete( KAiFirstUIController + 1 ); } - iUiControllerManager = CAiUiControllerManager::NewL(); - - iPluginManager = CAiContentPluginManager::NewL(); - - // Hook framework as UI event observer - iUiControllerManager->SetEventHandler( *this ); + iUiControllerManager = CAiUiControllerManager::NewL( this ); + + iFactory = CAiPluginFactory::NewL( *iUiControllerManager ); + + iStateManager = CAiStateManager::NewL( *iFactory ); + + iStateProvider = CAiStateProvider::NewL( *iStateManager ); + + iEventHandler = CAiEventHandler::NewL( *iFactory ); + + iUiControllerManager->SetStateHandler( *iStateProvider ); + + __TIME_ENDMARK( "CAiFw::ConstructL, done", time ); } // ---------------------------------------------------------------------------- // CAiFw::NewLC() +// // ---------------------------------------------------------------------------- // EXPORT_C CAiFw* CAiFw::NewLC() { + __TICK( "CAiFw::NewLC" ); + CAiFw* self = new ( ELeave ) CAiFw; CleanupStack::PushL( self ); + self->ConstructL(); - __TICK( "FW: Core FW constructed" ); - __HEAP( "FW: Core FW constructed" ); + __PRINTS( "*** CAiFw::NewLC - done" ); return self; } // ---------------------------------------------------------------------------- // CAiFw::~CAiFw() +// // ---------------------------------------------------------------------------- // CAiFw::~CAiFw() - { - if( iPluginManager ) - { - delete iPluginManager; - iPluginManager = NULL; - } - - if( iIdleRestartObserver ) - { - Release( iIdleRestartObserver ); - iIdleRestartObserver = NULL; - } - - if( iWsPluginManager ) - { - delete iWsPluginManager; - iWsPluginManager = NULL; - } - - if( iUiControllerManager ) - { - delete iUiControllerManager; - iUiControllerManager = NULL; - } - - if( iNotifyHandler ) + { + if ( iNotifyHandler ) { iNotifyHandler->StopListening(); - delete iNotifyHandler; - iNotifyHandler = NULL; } + + delete iNotifyHandler; + iNotifyHandler = NULL; - if( iNotifyHandlerESS ) + if ( iNotifyHandlerESS ) { iNotifyHandlerESS->StopListening(); - delete iNotifyHandlerESS; - iNotifyHandlerESS = NULL; } + + delete iNotifyHandlerESS; + iNotifyHandlerESS = NULL; + + delete iWsPluginManager; + iWsPluginManager = NULL; + + delete iEventHandler; + iEventHandler = NULL; - if( iAIRepository ) - { - delete iAIRepository; - iAIRepository = NULL; - } + delete iStateProvider; + iStateProvider = NULL; + + delete iStateManager; + iStateManager = NULL; + delete iFactory; + iFactory = NULL; + + delete iUiControllerManager; + iUiControllerManager = NULL; + + delete iRepository; + iRepository = NULL; + iLibrary1.Close(); iLibrary2.Close(); iLibrary3.Close(); @@ -184,95 +183,93 @@ // ---------------------------------------------------------------------------- // CAiFw::RunL() +// // ---------------------------------------------------------------------------- // EXPORT_C void CAiFw::RunL() { - CAiIdleAppRegister* idleReg = CAiIdleAppRegister::NewLC(); - idleReg->RegisterL(); - CleanupStack::PopAndDestroy( idleReg ); + __TICK( "CAiFw::RunL" ); + + __PRINTS( "*** CAiFw::RunL - CAiIdleAppRegister::NewLC" ); + __TIME_MARK( time ); + + CAiIdleAppRegister* registry = CAiIdleAppRegister::NewLC(); + registry->RegisterL(); + CleanupStack::PopAndDestroy( registry ); + __TIME_ENDMARK( "CAiFw::RunL - CAiIdleAppRegister::NewLC, done", time ); + // Tell UI controller manager to start application framework and event loop. - // This function returns only when the application is shut down. - // See in CAiFw::HandleUiReadyEventL how the framework initialization continues. + // This function returns only when the application is shut down. iUiControllerManager->RunApplicationL(); + + __PRINTS( "*** CAiFw::RunL - done" ); } // ---------------------------------------------------------------------------- // CAiFw::AppEnvReadyL() +// // ---------------------------------------------------------------------------- // void CAiFw::AppEnvReadyL() { + __TICK( "CAiFw::AppEnvReadyL" ); + __TIME_MARK( time ); + // Initialize members which need to be connected to the app environment's // active scheduler or depend on the app environment being initialized. - // Create state managers system state observers - CAiPluginStateManager& stateManager( iPluginManager->StateManager() ); - - stateManager.CreateSystemStateObserversL(); - - // Connect state managers UI observer to UI controllers - MAiUiFrameworkObserver* fwObserver( stateManager.UiFwObserver() ); - - if ( fwObserver ) - { - iUiControllerManager->AddObserverL( *fwObserver ); - } + CCoeEnv& env( iUiControllerManager->CoeEnv() ); // Create WS pluign manager - iWsPluginManager = CAiWsPluginManager::NewL - ( iUiControllerManager->CoeEnv() ); - - // CenRep notifier to listen key changes in cenrep. Application is restarted - // if key value is changed. - iNotifyHandler = CCenRepNotifyHandler::NewL( *this, - *iAIRepository, - CCenRepNotifyHandler::EIntKey, - KAiMainUIController ); + iWsPluginManager = CAiWsPluginManager::NewL( env ); + + // Start state provider + iStateProvider->StartL( env ); + + // CenRep notifier to listen key changes in cenrep. + // Application is restarted if key value is changed. + iNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iRepository, + CCenRepNotifyHandler::EIntKey, KAiMainUIController ); + iNotifyHandler->StartListeningL(); - // Cenrep notifier to listen ESS changes in cenrep - // - iNotifyHandlerESS = CCenRepNotifyHandler::NewL( *this, - *iAIRepository, - CCenRepNotifyHandler::EIntKey, - KAIExternalStatusScreen ); + // Cenrep notifier to listen ESS changes in cenrep + iNotifyHandlerESS = CCenRepNotifyHandler::NewL( *this, *iRepository, + CCenRepNotifyHandler::EIntKey, KAIExternalStatusScreen ); + iNotifyHandlerESS->StartListeningL(); - - iIdleRestartObserver = AiUtility::CreatePSPropertyObserverL( - TCallBack( HandleRestartEvent, this ), - KPSUidAiInformation, - KActiveIdleRestartAI2 ); - stateManager.ReportStateChange( ESMAISystemBoot ); + __PRINTS( "*** CAiFw::AppEnvReadyL - done" ); } // ---------------------------------------------------------------------------- // CAiFw::HandleUiReadyEventL() +// // ---------------------------------------------------------------------------- // void CAiFw::HandleUiReadyEventL( CAiUiController& aUiController ) { - if( iUiControllerManager->IsMainUiController( aUiController ) ) - { - iUiControllerManager->LoadUIDefinition(); - + __TICK( "CAiFw::HandleUiReadyEventL" ); + + if ( iUiControllerManager->IsMainUiController( aUiController ) ) + { TInt value( EIdlePhase1Ok ); - RProperty::Get( KPSUidStartup, - KPSIdlePhase1Ok, - value ); - - if( value == EIdlePhase1NOK ) + RProperty::Get( KPSUidStartup, KPSIdlePhase1Ok, value ); + + if ( value == EIdlePhase1NOK ) { - RProperty::Set( KPSUidStartup, - KPSIdlePhase1Ok, - EIdlePhase1Ok ); - } - - if( !iLibrariesLoaded ) + __TICK( "CAiFw::HandleUiReadyEventL - Setting EIdlePhase1Ok" ); + + RProperty::Set( KPSUidStartup, KPSIdlePhase1Ok, EIdlePhase1Ok ); + } + + if ( !iLibrariesLoaded ) { + __PRINTS( "*** CAiFw::HandleUiReadyEventL - load libraries" ); + __TIME_MARK( time ); + _LIT( KAIVoiceUIDialer, "VoiceUiNameDialer.dll" ); _LIT( KAIVoiceUIRecog, "VoiceUiRecognition.dll" ); _LIT( KAIVCommandHandler, "vcommandhandler.dll" ); @@ -282,154 +279,132 @@ iLibrary3.Load( KAIVCommandHandler ); iLibrariesLoaded = ETrue; - } - + + __TIME_ENDMARK( "CAiFw::HandleUiReadyEventL - load libraries, done", time ); + } } + + __PRINTS( "*** CAiFw::HandleUiReadyEventL - done" ); } // --------------------------------------------------------------------------- // CAiFw::HandleActivateUI() +// // ---------------------------------------------------------------------------- // void CAiFw::HandleActivateUI() { - iUiControllerManager->ActivateUI(); + __PRINTS( "*** CAiFw::HandleActivateUI" ); + __TIME_MARK( time ); + + iUiControllerManager->LoadUIDefinition(); + + iUiControllerManager->ActivateUI(); + + __TIME_ENDMARK( "CAiFw::HandleActivateUI, done", time ); } // --------------------------------------------------------------------------- // CAiFw::HandleUiShutdown() +// // ---------------------------------------------------------------------------- // void CAiFw::HandleUiShutdown( CAiUiController& aUiController ) { - if( iUiControllerManager->IsMainUiController( aUiController ) ) + if ( iUiControllerManager->IsMainUiController( aUiController ) ) { - if( iNotifyHandler ) + if ( iNotifyHandler ) { iNotifyHandler->StopListening(); - delete iNotifyHandler; - iNotifyHandler = NULL; } - if( iNotifyHandlerESS ) + delete iNotifyHandler; + iNotifyHandler = NULL; + + if ( iNotifyHandlerESS ) { iNotifyHandlerESS->StopListening(); - delete iNotifyHandlerESS; - iNotifyHandlerESS = NULL; } + + delete iNotifyHandlerESS; + iNotifyHandlerESS = NULL; - iPluginManager->PluginFactory().DestroyPlugins(); - - iPluginManager->StateManager().DestroySystemStateObservers(); - iUiControllerManager->DestroySecondaryUiControllers(); - iUiControllerManager->RemoveObserver( - *iPluginManager->StateManager().UiFwObserver() ); + delete iWsPluginManager; + iWsPluginManager = NULL; - if( iWsPluginManager ) - { - delete iWsPluginManager; - iWsPluginManager = NULL; - } - - if( iIdleRestartObserver ) - { - Release( iIdleRestartObserver ); - iIdleRestartObserver = NULL; - } + iStateProvider->Stop(); } } // ---------------------------------------------------------------------------- -// CAiFw::HandleLoadPluginL() -// ---------------------------------------------------------------------------- +// CAiFw::HandlePluginEvent() // -void CAiFw::HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ) - { - iPluginManager->PluginFactory().CreatePluginL( - aPublisherInfo, iUiControllerManager->UiControllers() ); - } - -// ---------------------------------------------------------------------------- -// CAiFw::HandleDestroyPluginL() -// ---------------------------------------------------------------------------- -// -void CAiFw::HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ) - { - iPluginManager->PluginFactory().DestroyPluginL( - aPublisherInfo, iUiControllerManager->UiControllers() ); - } - -// ---------------------------------------------------------------------------- -// CAiFw::HandlePluginEvent() // ---------------------------------------------------------------------------- // void CAiFw::HandlePluginEvent( const TDesC& aParam ) { - iPluginManager->HandlePluginEvent( aParam ); + iEventHandler->HandlePluginEvent( aParam ); } // ---------------------------------------------------------------------------- // CAiFw::HandlePluginEventL() +// // ---------------------------------------------------------------------------- // -void CAiFw::HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, +void CAiFw::HandlePluginEventL( const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ) { - iPluginManager->HandlePluginEventL( aPublisherInfo, aParam ); + iEventHandler->HandlePluginEventL( aPublisherInfo, aParam ); } // ---------------------------------------------------------------------------- // CAiFw::HasMenuItemL() +// // ---------------------------------------------------------------------------- // -TBool CAiFw::HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, +TBool CAiFw::HasMenuItemL( const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ) { - return iPluginManager->HasMenuItemL( aPublisherInfo, aMenuItem ); + return iEventHandler->HasMenuItemL( aPublisherInfo, aMenuItem ); } // ---------------------------------------------------------------------------- // CAiFw::RefreshContent() +// // ---------------------------------------------------------------------------- // TBool CAiFw::RefreshContent( const TDesC& aContentCid ) { - return iPluginManager->RefreshContent( aContentCid ); + return iEventHandler->RefreshContent( aContentCid ); } // ---------------------------------------------------------------------------- -// CAiFw::ProcessStateChange() +// CAiFw::RefreshContent() +// // ---------------------------------------------------------------------------- // -void CAiFw::ProcessStateChange( TAifwStates aState ) +TBool CAiFw::RefreshContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) { - switch ( aState ) - { - case EAifwOnline : - { - iPluginManager->ProcessOnlineState( ETrue ); - } - break; - case EAifwOffline : - { - iPluginManager->ProcessOnlineState( EFalse ); - } - break; - case EAifwPageSwitch: - { - iPluginManager->StateManager().ReportStateChange( ESMAIPageSwitch ); - } - break; - default : - break; - } - + return iEventHandler->RefreshContent( aPublisherInfo, aContentCid ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::SuspendContent() +// +// ---------------------------------------------------------------------------- +// +TBool CAiFw::SuspendContent( const THsPublisherInfo& aPublisherInfo, + const TDesC& aContentCid ) + { + return iEventHandler->SuspendContent( aPublisherInfo, aContentCid ); } // ---------------------------------------------------------------------------- // CAiFw::QueryIsMenuOpen() +// // ---------------------------------------------------------------------------- // TBool CAiFw::QueryIsMenuOpen() @@ -439,14 +414,15 @@ // ---------------------------------------------------------------------------- // CAiFw::HandleNotifyInt() +// // ---------------------------------------------------------------------------- // void CAiFw::HandleNotifyInt( TUint32 aId, TInt aNewValue ) { - switch( aId ) + switch ( aId ) { case KAiMainUIController: - if( aNewValue == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + if ( aNewValue == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || aNewValue == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE || aNewValue == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || aNewValue == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ) @@ -455,17 +431,14 @@ } else { - // Someone wrote an invalid configuration! Reset repository. - if( iAIRepository ) - { - iAIRepository->Reset( KAiMainUIController ); - iAIRepository->Reset( KAiFirstUIController ); - iAIRepository->Delete( KAiFirstUIController + 1 ); - } + // Someone wrote an invalid configuration! Reset repository. + iRepository->Reset( KAiMainUIController ); + iRepository->Reset( KAiFirstUIController ); + iRepository->Delete( KAiFirstUIController + 1 ); } break; case KAIExternalStatusScreen: - if( ( aNewValue & 0x7FFFFFFF ) != 0 ) + if ( ( aNewValue & 0x7FFFFFFF ) != 0 ) { TRAP_IGNORE( SwapUiControllerL( EFalse ) ); } @@ -481,62 +454,46 @@ // ---------------------------------------------------------------------------- // CAiFw::SwapUiControllerL() +// // ---------------------------------------------------------------------------- // void CAiFw::SwapUiControllerL( TBool aToExtHS ) - { - TUid uid = { KCRUidActiveIdleLV }; - CRepository* cenRep = CRepository::NewL( uid ); - + { if( !aToExtHS ) // Switch to XML UI { - cenRep->Create( KAiFirstUIController, + iRepository->Create( KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); - cenRep->Set( KAiFirstUIController, + iRepository->Set( KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); - cenRep->Delete( KAiFirstUIController + 1 ); - cenRep->Set( KAiMainUIController, + iRepository->Delete( KAiFirstUIController + 1 ); + + iRepository->Set( KAiMainUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML ); } else // Switch to ExtHS { - cenRep->Delete( KAiFirstUIController ); - cenRep->Delete( KAiFirstUIController + 1 ); - cenRep->Set( KAiMainUIController, - AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); + iRepository->Delete( KAiFirstUIController ); + + iRepository->Delete( KAiFirstUIController + 1 ); + + iRepository->Set( KAiMainUIController, + AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); } - - delete cenRep; - + // Restart iUiControllerManager->ExitMainController(); } // ---------------------------------------------------------------------------- -// CAiFw::HandleRestartEvent() +// CAiFw::Repository() +// // ---------------------------------------------------------------------------- // -TInt CAiFw::HandleRestartEvent( TAny* aSelf ) +CRepository& CAiFw::Repository() const { - CAiFw* self = static_cast( aSelf ); - - TInt value( 0 ); - - if( self->iIdleRestartObserver ) - { - TInt err( self->iIdleRestartObserver->Get( value ) ); - - // Check the PS keys value and call manager with approriate parameter. - // Report either "idle foreground" or "idle background" - if( value == KActiveIdleRestartCode ) - { - self->iUiControllerManager->ExitMainController(); - } - } - - return KErrNone; + return *iRepository; } // End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aifwstartupscheduler.cpp --- a/idlefw/src/framework/aifwstartupscheduler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: AvtiveIdle2 startup scheduler -* -*/ - - -#include "aifwstartupscheduler.h" - -CAiFwStartupScheduler::CAiFwStartupScheduler() - : iResult(KErrNone) - { - } - -CAiFwStartupScheduler* CAiFwStartupScheduler::NewLC() - { - CAiFwStartupScheduler* self = new(ELeave) CAiFwStartupScheduler; - CleanupStack::PushL(self); - return self; - } - -CAiFwStartupScheduler::~CAiFwStartupScheduler() - { - } - -TInt CAiFwStartupScheduler::Result() - { - return iResult; - } - -// All RunL leaves from active objects which execute during Active Idle -// Framework startup end up here -void CAiFwStartupScheduler::Error(TInt aError) const - { - // Store any error code - if (aError != KErrNone && iResult == KErrNone) - { - iResult = aError; - } - - // Stop the scheduler as all errors during Active Idle Framework startup - // are fatal - Stop(); - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aikeylockobserver.cpp --- a/idlefw/src/framework/aikeylockobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Focus observer for Active idle 2 -* -*/ - - -#include -#include -#include // KPSUidAvkonDomain, KAknKeyguardStatus, TAknKeyguardStatus -#include "aistatemanager.h" -#include "aikeylockobserver.h" -#include "aifwpanic.h" -#include "debug.h" - -CAiKeylockObserver::CAiKeylockObserver() - { - } - -CAiKeylockObserver::~CAiKeylockObserver() - { - } - -CAiKeylockObserver* CAiKeylockObserver::NewL( - MAiStateManager* aStateManager ) - { - CAiKeylockObserver* self = new (ELeave) CAiKeylockObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiKeylockObserver::ConstructL( MAiStateManager* aStateManager ) - { - BaseConstructL( TCallBack( HandleKeylockStatusEvent, this ), - KPSUidAvkonDomain, - KAknKeyguardStatus, - aStateManager ); - } - -TAiStateChanges CAiKeylockObserver::Status() - { - TInt value; - TInt err = iObserver->Get( value ); - if( err != KErrNone ) - { - return ESMAIKeylockDisabled; - } - - switch( value ) - { - case EKeyguardLocked: - case EKeyguardAutolockEmulation: // fallthorugh - { - return ESMAIKeylockEnabled; - } - case EKeyguardNotActive: - default: // fallthorugh - { - return ESMAIKeylockDisabled; - } - } - } - -TInt CAiKeylockObserver::HandleKeylockStatusEvent( TAny* aPtr ) - { - CAiKeylockObserver* self = - static_cast( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - TAiStateChanges stateChange = self->Status(); - self->iStateManager->ReportStateChange( stateChange ); - return KErrNone; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/ailightstatusobserver.cpp --- a/idlefw/src/framework/ailightstatusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Light status observer for AI2 -* -*/ - - -#include -#include "ailightstatusobserver.h" -#include "aistatemanager.h" -#include "debug.h" - -CAiLightStatusObserver::CAiLightStatusObserver() - { - } - -CAiLightStatusObserver::~CAiLightStatusObserver() - { - delete iLight; - } - -CAiLightStatusObserver* CAiLightStatusObserver::NewL( MAiStateManager* aStateManager ) - { - CAiLightStatusObserver* self = new (ELeave) CAiLightStatusObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiLightStatusObserver::ConstructL( MAiStateManager* aStateManager ) - { - iStateManager = aStateManager; - iLight = CHWRMLight::NewL( this ); - } - -TAiStateChanges CAiLightStatusObserver::Status() - { - // In future handle other screen lights here also.. - CHWRMLight::TLightStatus status = iLight->LightStatus( CHWRMLight::EPrimaryDisplay ); - if( status == CHWRMLight::ELightOn ) - { - return ESMAIBacklightOn; - } - else if( status == CHWRMLight::ELightOff ) - { - return ESMAIBacklightOff; - } - return ESMAIBacklightOn; - } - -void CAiLightStatusObserver::LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus ) - { - if( aTarget == CHWRMLight::EPrimaryDisplay || - aTarget == CHWRMLight::EPrimaryDisplayAndKeyboard ) - { - if( aStatus == CHWRMLight::ELightOn ) - { - __PRINTS("XAI: Light = ON"); - iStateManager->ReportStateChange( ESMAIBacklightOn ); - } - else if( aStatus == CHWRMLight::ELightOff ) - { - __PRINTS("XAI: Light = OFF"); - iStateManager->ReportStateChange( ESMAIBacklightOff ); - } - } - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/ainetworklistener.cpp --- a/idlefw/src/framework/ainetworklistener.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Network info listener -* -*/ - -#include -#include -#include "ainetworklistener.h" -#include "ainetworkobserver.h" - -/// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// Two-phased constructor. Can leave. -// ----------------------------------------------------------------------------- -// -CAiNetworkListener* CAiNetworkListener::NewL(MAiNetworkObserver& aNetworkObserver) - { - CAiNetworkListener* self = new (ELeave) CAiNetworkListener(aNetworkObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -CAiNetworkListener::CAiNetworkListener(MAiNetworkObserver& aNetworkObserver) -:iObserver(aNetworkObserver) - { - } - -void CAiNetworkListener::ConstructL() - { - //Create network handling engine session. - iSession = CreateL( *this, iInfo ); - iCurrentNwState = MAiNetworkObserver::ENone; - } - -CAiNetworkListener::~CAiNetworkListener() - { - delete iSession; - } - -void CAiNetworkListener::HandleNetworkMessage( const TNWMessages aMessage ) - { - TBool hasNetInfoChanged = HasNetworkInfoChanged( aMessage ); - if ( !hasNetInfoChanged ) - { - return; - } - - // Interpret new nw state - MAiNetworkObserver::TNetworkState newState; - newState= InterpretNWMessage(aMessage,iInfo); - - // Inform observer of only new nw states (TNetworkState) - if (newState != iCurrentNwState) - { - iObserver.HandleNetworkStateChange(newState); - } - - // Store new nw state - iCurrentNwState= newState; - - } - -MAiNetworkObserver::TNetworkState CAiNetworkListener::InterpretNWMessage(const TNWMessages aMessage, const TNWInfo aNWInfo) - { - MAiNetworkObserver::TNetworkState nwstate = MAiNetworkObserver::ENone; - - switch (aMessage) - { - case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange: - case MNWMessageObserver::ENWMessageCurrentHomeZoneMessage: - { - switch (aNWInfo.iRegistrationStatus) - { - case ENWRegisteredRoaming: - nwstate = MAiNetworkObserver::ERoaming; - break; - case ENWRegisteredOnHomeNetwork: - nwstate = MAiNetworkObserver::EHomeNetwork; - break; - - default: - // unknown state - break; - } - } - } - - return nwstate; - } - -void CAiNetworkListener::HandleNetworkError( const TNWOperation aOperation, TInt /*aErrorCode*/ ) - { - switch ( aOperation ) - { - case MNWMessageObserver::ENWGetNetworkProviderName: - iReceivedMessageFlags |= ENetworkProviderNameReceived; - iReceivedMessageFlags &= ~ENetworkProviderNameOk; - iInfo.iNPName.Zero(); - break; - case MNWMessageObserver::ENWGetProgrammableOperatorName: - iReceivedMessageFlags |= EProgrammableOperatorInfoReceived; - iReceivedMessageFlags &= ~EProgrammableOperatorInfoReceivedOk; - iInfo.iOperatorNameInfo.iName.Zero(); - break; - case MNWMessageObserver::ENWGetServiceProviderName: - iReceivedMessageFlags |= EServiceProviderNameReceived; - iReceivedMessageFlags &= ~EServiceProviderNameOk; - iInfo.iServiceProviderNameDisplayReq = RMobilePhone::KDisplaySPNNotRequired; - iInfo.iSPName.Zero(); - iInfo.iPLMNField.Zero(); - break; - default: - break; - } - - HandleNetworkMessage( TNWMessages( KErrGeneral ) ); - } - -TBool CAiNetworkListener::HasNetworkInfoChanged( const TNWMessages aMessage ) - { - TBool result = ETrue; - - // pass through - if ( aMessage == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage || - aMessage == MNWMessageObserver::ENWMessageNetworkConnectionFailure || - aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage || - aMessage == MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ) - { - return result; - } - - result = ( iReceivedMessageFlags != iOldReceivedMessageFlags ); - - if ( !result ) - { - result = - iInfo.iRegistrationStatus != iOldInfo.iRegistrationStatus; - } - - iOldReceivedMessageFlags = iReceivedMessageFlags; - iOldInfo = iInfo; - - return result; - } - -MAiNetworkObserver::TNetworkState CAiNetworkListener::NetworkState() - { - return iCurrentNwState; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/ainwsdlgcontroller.cpp --- a/idlefw/src/framework/ainwsdlgcontroller.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Network selection dialog controller -* -*/ - - -#include -#include -#include -#include - -#include -#include - -#include "ainwsdlgcontroller.h" -#include "debug.h" - - -// 1-minute timeout before showing soft notification -const TInt KPhoneNetworkLostTimeout = 60*1000000; - -// Offline profile, from ProfileEngineSDKCRKeys.h -const TInt KOfflineProfileId = 5; - - -CAiNwSDlgController* CAiNwSDlgController::NewL() - { - CAiNwSDlgController* self = new(ELeave) CAiNwSDlgController(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); // self - return self; - } - -CAiNwSDlgController::CAiNwSDlgController() - { - iRegistered = ETrue; - } - -void CAiNwSDlgController::ConstructL() - { - __PRINTS( "XAI: CAiNwSDlgController is initializing" ); - - iSoftNotifier = CAknSoftNotifier::NewL(); - iSession = CreateL( *this, iInfo ); - iProfileApi = CRepository::NewL( KCRUidProfileEngine ); - iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); - - HandleStateChange(); - - __PRINTS( "XAI: CAiNwSDlgController initialized succesfully" ); - } - -CAiNwSDlgController::~CAiNwSDlgController() - { - delete iPeriodic; - delete iProfileApi; - delete iSession; - delete iSoftNotifier; - } - -void CAiNwSDlgController::HandleStateChange() - { - switch( iInfo.iRegistrationStatus ) - { - case ENWNotRegisteredNoService: - // Fall-through - case ENWNotRegisteredEmergencyOnly: - // Fall-through - case ENWNotRegisteredSearching: - // Fall-through - case ENWRegistrationDenied: - HandleNetworkLost(); - break; - - case ENWRegisteredBusy: - // Fall-through - case ENWRegisteredOnHomeNetwork: - // Fall-through - case ENWRegisteredRoaming: - HandleNetworkFound(); - break; - - case ENWRegistrationUnknown: - // Take no action - default: - break; - } - } - -void CAiNwSDlgController::HandleNetworkFound() - { - __PRINTS( "XAI: Network found" ); - iRegistered = ETrue; - iPeriodic->Cancel(); - CancelDialog(); - } - -void CAiNwSDlgController::HandleNetworkLost() - { - if( iInfo.iSelectionSetting == ENWNetworkSelectionManual ) - { - // See if we were registered before - if( iRegistered ) - { - iRegistered = EFalse; - - if(!IsOffLineMode() && !IsBluetoothSAPConnected()) - { - __PRINTS( "XAI: Network lost, show dialog in 1 minute" ); - iPeriodic->Start( KPhoneNetworkLostTimeout, - KPhoneNetworkLostTimeout, TCallBack( DelayCallBack, this )); - } - } - } - } - -void CAiNwSDlgController::LaunchDialog() - { - iPeriodic->Cancel(); - TRAP_IGNORE( iSoftNotifier->AddNotificationL( ESelectNetworkNotification, 1 ); ); - } - -void CAiNwSDlgController::CancelDialog() - { - TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( ESelectNetworkNotification ); ); - } - -TInt CAiNwSDlgController::DelayCallBack(TAny* aParam) - { - CAiNwSDlgController* self = (CAiNwSDlgController*) aParam; - self->LaunchDialog(); - return KErrNone; - } - -void CAiNwSDlgController::HandleNetworkMessage( const TNWMessages aMessage ) - { - switch(aMessage) - { - case ENWMessageNetworkRegistrationStatusChange: - HandleStateChange(); - break; - - default: - break; - } - } - -void CAiNwSDlgController::HandleNetworkError( const TNWOperation /*aOperation*/, - TInt /*aErrorCode*/ ) - { - // Take no action. - } - -TBool CAiNwSDlgController::IsOffLineMode() const - { - TInt profileId; - TInt err = iProfileApi->Get( KProEngActiveProfile, profileId ); - return profileId == KOfflineProfileId && err == KErrNone; - } - -TBool CAiNwSDlgController::IsBluetoothSAPConnected() const - { - TInt btSapState( EBTSapNotConnected ); - TInt err = RProperty::Get( KPSUidBluetoothSapConnectionState, - KBTSapConnectionState, - btSapState ); - return btSapState != EBTSapNotConnected && err == KErrNone; - } - -// End of file. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aipluginactivitypstool.cpp --- a/idlefw/src/framework/aipluginactivitypstool.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin activity PS tool -* -*/ - - -#include "aipluginactivitypstool.h" -#include "aipropertyextension.h" -#include -#include // for User -#include // for RProperty -#include - -// Unnamed namespace for local definitions -namespace - { - - const TInt KStartOrdinal( KAIActivePluginRangeStart ); - - // All reads are allowed. - _LIT_SECURITY_POLICY_PASS( KPluginActivityRegistryReadPolicy ); - - // Write requires WriteDeviceData capability - _LIT_SECURITY_POLICY_C1( KPluginActivityRegistryWritePolicy, ECapabilityWriteDeviceData ); - - } - -CAiPluginActivityRegistry::CAiPluginActivityRegistry() - : iRegistryOrdinal( KStartOrdinal ) - { - } - -CAiPluginActivityRegistry* CAiPluginActivityRegistry::NewL() - { - CAiPluginActivityRegistry* self = - new (ELeave) CAiPluginActivityRegistry(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -void CAiPluginActivityRegistry::ConstructL() - { - } - -CAiPluginActivityRegistry::~CAiPluginActivityRegistry() - { - CleanRegistry(); - } - -TInt CAiPluginActivityRegistry::SetPluginActive( const TAiPublisherInfo& aPubInfo ) - { - TInt psErr = KErrArgument; - TInt uid = aPubInfo.iUid.iUid; - - // Make sure the keys are within their assigned ranges - if( uid >= KAIPluginNameRangeStart && - uid <= KAIPluginNameRangeEnd && - iRegistryOrdinal >= KAIActivePluginRangeStart && - iRegistryOrdinal <= KAIActivePluginRangeEnd ) - { - psErr = UpdateOrdinalRegister( uid ); - - ++iPluginCount; // now there is partial data in registry for next item - // so update count allready here, so that - // the data may be cleaned in case on error - - psErr |= UpdateNameRegister( uid, aPubInfo.iName ); - - psErr |= UpdateCountRegister(); - - if( psErr != KErrNone ) - { - CleanLastEntry( uid, - iRegistryOrdinal, - iPluginCount - 1 ); - // Decrement only after rollback so failures may be cleaned properly - // in case there is interrupting error situations - --iPluginCount; - return psErr; - } - - ++iRegistryOrdinal; - } - - return psErr; - } - -void CAiPluginActivityRegistry::CleanRegistry() - { - // The count in p&s might not be updated before - // we end up here that why we use iPluginCount for count. - for( TInt i = 0; i < iPluginCount; ++i ) - { - TInt categoryKey = i + KStartOrdinal; - TInt pluginUid = 0; - TInt err = RProperty::Get( - KPSUidActiveIdle2, - categoryKey, - pluginUid ); - if( err == KErrNone ) - { - // Delete name - RProperty::Delete( KPSUidActiveIdle2, pluginUid ); - } - // Delete ordinal - RProperty::Delete( KPSUidActiveIdle2, categoryKey ); - } - // Delete count - RProperty::Delete( KPSUidActiveIdle2, KAIActivePluginCount ); - iRegistryOrdinal = KStartOrdinal; - } - -TInt CAiPluginActivityRegistry::UpdateCountRegister() - { - TInt err = RProperty::Define( - KPSUidActiveIdle2, - KAIActivePluginCount, - RProperty::EInt, - KPluginActivityRegistryReadPolicy, - KPluginActivityRegistryWritePolicy ); - if( err == KErrAlreadyExists && - iRegistryOrdinal == KStartOrdinal ) - { - // Some error has occured - CleanRegistry(); - err = RProperty::Define( - KPSUidActiveIdle2, - KAIActivePluginCount, - RProperty::EInt, - KPluginActivityRegistryReadPolicy, - KPluginActivityRegistryWritePolicy ); - } - if( err != KErrAlreadyExists && - err != KErrNone ) - { - return err; - } - - // iRegistryOrdinal starts from 1, so it can be used as count, but only - // before incrementation. - err = RProperty::Set( - KPSUidActiveIdle2, - KAIActivePluginCount, - iPluginCount ); - return err; - } - -TInt CAiPluginActivityRegistry::UpdateOrdinalRegister( TInt aPluginUid ) - { - TInt categoryKey = iRegistryOrdinal; - TInt err = RProperty::Define( - KPSUidActiveIdle2, - categoryKey, - RProperty::EInt, - KPluginActivityRegistryReadPolicy, - KPluginActivityRegistryWritePolicy ); - - if( err == KErrNone || - err == KErrAlreadyExists ) - { - // Set plugin uid to ordinal key - err = RProperty::Set( - KPSUidActiveIdle2, - categoryKey, - aPluginUid ); - } - return err; - } - -TInt CAiPluginActivityRegistry::UpdateNameRegister( TInt aPluginUid, - const TDesC& aName ) - { - TInt err = RProperty::Define( - KPSUidActiveIdle2, - aPluginUid, - RProperty::EText, - KPluginActivityRegistryReadPolicy, - KPluginActivityRegistryWritePolicy ); - - if( err == KErrNone || - err == KErrAlreadyExists ) - { - // Set plugin uid to ordinal key - err = RProperty::Set( - KPSUidActiveIdle2, - aPluginUid, - aName ); - } - return err; - } - -void CAiPluginActivityRegistry::CleanLastEntry( TInt aPluginUid, - TInt aOrdinal, - TInt aLastCount ) - { - RProperty::Delete( KPSUidActiveIdle2, aOrdinal ); - RProperty::Delete( KPSUidActiveIdle2, aPluginUid ); - if( aLastCount == 0 ) - { - RProperty::Delete( KPSUidActiveIdle2, KAIActivePluginCount ); - } - else - { - RProperty::Set( - KPSUidActiveIdle2, - KAIActivePluginCount, - aLastCount ); - } - } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aipluginfactory.cpp --- a/idlefw/src/framework/aipluginfactory.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/framework/aipluginfactory.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,86 +18,107 @@ // System includes #include #include -#include -#include -#include // For RProperty // User includes +#include +#include +#include #include -#include -#include -#include // PubSub category -#include // PubSub category key and values - +#include +#include "caicpscommandbuffer.h" +#include "aiuicontrollermanager.h" #include "aipluginfactory.h" -#include "aicontentpluginmanager.h" -#include "aipluginlifecycleobserver.h" +#include "debug.h" + +// Constants +const TUid KDeviceStatusPluginUid = + { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN }; -#include "aiuicontroller.h" -#include "aifwpanic.h" -#include "debug.h" +const TUid KProfilePluginUid = + { AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN }; + +_LIT( KDeviceStatusPluginName, "DeviceStatus" ); +_LIT( KProfilePluginName, "Profile" ); // ======== LOCAL FUNCTIONS ======== // ---------------------------------------------------------------------------- -// CleanupResetAndDestroy() +// IsRecyclable() +// // ---------------------------------------------------------------------------- // -template -static void CleanupResetAndDestroy( TAny* aObj ) +TBool IsRecyclable( const THsPublisherInfo& aInfo ) { - if( aObj ) + if ( ( aInfo.Name() == KProfilePluginName && + aInfo.Uid() == KProfilePluginUid ) || + ( aInfo.Name() == KDeviceStatusPluginName && + aInfo.Uid() == KDeviceStatusPluginUid ) ) { - static_cast( aObj )->ResetAndDestroy(); + return ETrue; } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// +// ---------------------------------------------------------------------------- +// +template< class T > +static void CleanupResetAndDestroy( TAny* aObj ) + { + static_cast< T* >( aObj )->ResetAndDestroy(); } // ---------------------------------------------------------------------------- // CleanupResetAndDestroyPushL() +// // ---------------------------------------------------------------------------- // -template -static void CleanupResetAndDestroyPushL(T& aArray) +template< class T > +static void CleanupResetAndDestroyPushL( T& aArray ) { - CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy, &aArray ) ); + CleanupStack::PushL( + TCleanupItem( &CleanupResetAndDestroy< T >, &aArray ) ); } // ======== MEMBER FUNCTIONS ======== // ---------------------------------------------------------------------------- // CAiPluginFactory::CAiPluginFactory() +// // ---------------------------------------------------------------------------- // -CAiPluginFactory::CAiPluginFactory( - RPointerArray& aPlugins, - CAiContentPluginManager& aManager ) - : iPlugins( aPlugins ), iManager( aManager ) +CAiPluginFactory::CAiPluginFactory( CAiUiControllerManager& aManager ) + : iUiControllerManager( aManager ) { } // ---------------------------------------------------------------------------- // CAiPluginFactory::~CAiPluginFactory() +// // ---------------------------------------------------------------------------- // CAiPluginFactory::~CAiPluginFactory() - { - Release( iPluginTool ); - - iEComPlugins.ResetAndDestroy(); - - iLifecycleObservers.Reset(); + { + // All publishers should be already deleted from CAiFw::HandleUiShutdown + iPublishers.ResetAndDestroy(); + + iEComPlugins.ResetAndDestroy(); + + REComSession::FinalClose(); } // ---------------------------------------------------------------------------- // CAiPluginFactory::NewL() +// // ---------------------------------------------------------------------------- // -CAiPluginFactory* CAiPluginFactory::NewL( - RPointerArray& aPlugins, - CAiContentPluginManager& aManager ) +CAiPluginFactory* CAiPluginFactory::NewL( CAiUiControllerManager& aManager ) { CAiPluginFactory* self = - new ( ELeave ) CAiPluginFactory( aPlugins, aManager ); + new ( ELeave ) CAiPluginFactory( aManager ); CleanupStack::PushL( self ); self->ConstructL(); @@ -107,222 +128,201 @@ // ---------------------------------------------------------------------------- // CAiPluginFactory::ConstructL() +// // ---------------------------------------------------------------------------- // void CAiPluginFactory::ConstructL() - { - iPluginTool = AiUtility::CreatePluginToolL(); + { + REComSession::ListImplementationsL( + KInterfaceUidHsContentPlugin, iEComPlugins ); } // ---------------------------------------------------------------------------- -// CAiPluginFactory::AddLifecycleObserverL() -// ---------------------------------------------------------------------------- +// CAiPluginFactory::CreatePluginL() // -void CAiPluginFactory::AddLifecycleObserverL( - MAiPluginLifecycleObserver& aObserver ) - { - if( iLifecycleObservers.Find( &aObserver ) == KErrNotFound ) - { - iLifecycleObservers.AppendL( &aObserver ); - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginFactory::CreatePluginL() // ---------------------------------------------------------------------------- // -void CAiPluginFactory::CreatePluginL( - const TAiPublisherInfo& aPublisherInfo, - RPointerArray& aControllerArray ) - { - iEComPlugins.ResetAndDestroy(); - - // Discover Plugin implementations. - __TIME_MARK( ecomOverhead ); - - REComSession::ListImplementationsL( - KInterfaceUidContentPlugin, iEComPlugins ); - - __TIME_ENDMARK( "FW: ECom Discover plug-ins", ecomOverhead ); - - iPlugins.ReserveL( iPlugins.Count() + 1 ); - +TInt CAiPluginFactory::CreatePlugin( + const THsPublisherInfo& aPublisherInfo ) + { + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Start ***" ); + + if ( IsRecyclable( aPublisherInfo ) ) + { + CHsContentPublisher* plugin( PluginByUid( aPublisherInfo.Uid() ) ); + + if ( plugin ) + { + if ( aPublisherInfo.Namespace() == KNullDesC8 ) + { + // No namespace available + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Failed to Load Plug-in: KErrNotSupported ***" ); + return KErrNotSupported; + } + + // Plugin already exists, update its namespace + THsPublisherInfo& info( + const_cast< THsPublisherInfo& >( plugin->PublisherInfo() ) ); + + info.iNamespace.Copy( aPublisherInfo.Namespace() ); + + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Plugin recycled ***" ); + + return KErrNone; + } + } + TBool implFound( EFalse ); - + for( TInt i = 0; i < iEComPlugins.Count(); i++ ) { CImplementationInformation* information( iEComPlugins[i] ); - - if( information->ImplementationUid().iUid == aPublisherInfo.iUid.iUid ) + + if( information->ImplementationUid().iUid == aPublisherInfo.Uid().iUid ) { implFound = ETrue; break; } } - if( aPublisherInfo.iNamespace == KNullDesC8 || !implFound ) + if( aPublisherInfo.Namespace() == KNullDesC8 || !implFound ) { - // No namespace available or no ecom implementation available - User::Leave( KErrNotSupported ); - } - - CAiContentPublisher* plugin( PluginByInfoL( aPublisherInfo ) ); - - if( plugin ) - { - User::Leave( KErrAlreadyExists ); + // No namespace available or no ecom implementation available + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Failed to Load Plug-in: KErrNotSupported ***" ); + + return KErrNotSupported; } - __PRINT( __DBG_FORMAT( "\t[I]\t Loading plug-in uid=%x name=%S"), - aPublisherInfo.iUid, &(aPublisherInfo.iName) ); - - __TIME( "FW: Create plug-in:", - plugin = CreatePluginLC( aPublisherInfo ); - ) // __TIME - - __TIME( "FW: Subscribe content observers", - SubscribeContentObserversL( *plugin, - aPublisherInfo, aControllerArray ); - ) // __TIME - - // Plug-in settings - __TIME( "FW: Configure Plugin", - ConfigurePluginL( aControllerArray, *plugin, aPublisherInfo ); - ) // __TIME - - __PRINTS( "*** FW: Done - Load Plug-in ***" ); + CHsContentPublisher* plugin( PluginByInfo( aPublisherInfo ) ); + + if( plugin ) + { + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done -\ + Failed to Load Plug-in: KErrAlreadyExists ***" ); + + return KErrAlreadyExists; + } + + TInt err( KErrNone ); + + TRAP( err, CreatePluginL( aPublisherInfo ) ); - // This might fail and the plugin ends up destroyed - for( TInt i = 0; i < iLifecycleObservers.Count(); ++i ) - { - iLifecycleObservers[i]->PluginCreatedL( *plugin ); - } - - for( TInt i = 0; i < iLifecycleObservers.Count(); ++i ) - { - iLifecycleObservers[i]->AllPluginsCreated(); - } - - // Move plugins to manager - iPlugins.Append( plugin ); - CleanupStack::Pop( plugin ); - - iEComPlugins.ResetAndDestroy(); + __PRINTS( "*** CAiPluginFactory::CreatePlugin: Done - Load Plug-in ***" ); + + return err; } - + // ---------------------------------------------------------------------------- -// CAiPluginFactory::DestroyPluginL() +// CAiPluginFactory::DestroyPlugin() +// // ---------------------------------------------------------------------------- // -void CAiPluginFactory::DestroyPluginL( - const TAiPublisherInfo& aPublisherInfo, - RPointerArray< CAiUiController >& /*aControllerArray*/ ) +void CAiPluginFactory::DestroyPlugin( const THsPublisherInfo& aPublisherInfo ) { - // TODO: check is there need to call - // iUiControllerManager->RemovePluginFromUI( aPlugin ); - // it will clean the published content. + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Start ***" ); - if( iPlugins.Count() == 0 ) + if ( IsRecyclable( aPublisherInfo ) ) { + // Don't destroy recyclable plugin + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done - Keeping recyclable Plug-in ***" ); + return; } - - CAiContentPublisher* plugin( PluginByInfoL( aPublisherInfo ) ); - - TInt index( iPlugins.Find( plugin ) ); + + CHsContentPublisher* plugin( PluginByInfo( aPublisherInfo ) ); - if( plugin && index != KErrNotFound ) - { - for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) - { - iLifecycleObservers[i]->PluginDestroyed( *plugin ); - } - - iPlugins.Remove( index ); + if ( plugin ) + { + iPublishers.Remove( iPublishers.Find( plugin ) ); delete plugin; - plugin = NULL; + plugin = NULL; } - - if( iPlugins.Count() == 0 ) - { - for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) - { - iLifecycleObservers[i]->AllPluginsDestroyed(); - } - } + + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" ); } // ---------------------------------------------------------------------------- -// CAiPluginFactory::DestroyPlugins() +// CAiPluginFactory::DestroyPlugin() +// // ---------------------------------------------------------------------------- // -void CAiPluginFactory::DestroyPlugins() +void CAiPluginFactory::DestroyPlugin( const TUid& aUid ) { - for( TInt i = 0; i < iPlugins.Count(); i++ ) + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Start ***" ); + + CHsContentPublisher* plugin( PluginByUid( aUid ) ); + + while ( plugin ) { - CAiContentPublisher* plugin( iPlugins[i] ); + iPublishers.Remove( iPublishers.Find( plugin ) ); - for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) - { - iLifecycleObservers[i]->PluginDestroyed( *plugin ); - } + __PRINT( __DBG_FORMAT( + "CAiPluginFactory::DestroyPlugin: name: %S" ), &plugin->PublisherInfo().Name() ); + + delete plugin; + plugin = NULL; } + + __PRINTS( "*** CAiPluginFactory::DestroyPlugin: Done ***" ); + } - iPlugins.ResetAndDestroy(); - - for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) - { - iLifecycleObservers[i]->AllPluginsDestroyed(); - } - } - // ---------------------------------------------------------------------------- -// CAiPluginFactory::CreatePluginLC() +// CAiPluginFactory::CreatePluginL() +// // ---------------------------------------------------------------------------- // -CAiContentPublisher* CAiPluginFactory::CreatePluginLC( - const TAiPublisherInfo& aPluginInfo ) - { - CAiContentPublisher* plugin = - CAiContentPublisher::NewL( aPluginInfo.iUid ); +void CAiPluginFactory::CreatePluginL( + const THsPublisherInfo& aPublisherInfo ) + { + __PRINT( __DBG_FORMAT( "\t[I]\t Loading plug-in uid=%x name=%S"), + aPublisherInfo.Uid(), &(aPublisherInfo.Name() ) ); + + iPublishers.ReserveL( iPublishers.Count() + 1 ); + + CHsContentPublisher* plugin( NULL ); + + __TIME( "CAiPluginFactory::CreatePluginL Create plug-in:", + plugin = CHsContentPublisher::NewL( aPublisherInfo ) ); CleanupStack::PushL( plugin ); - - MAiPropertyExtension* ext( iPluginTool->PropertyExt( *plugin ) ); - if( !ext ) - { - User::Leave( KErrNotFound ); - } + // Ensure interface is available + iCommandBuffer->GetCPSInterfaceL(); - ext->SetPropertyL( EAiPublisherInfo, (TAny*)&aPluginInfo ); + plugin->SetProperty( CHsContentPublisher::ECpsCmdBuffer, + static_cast< MAiCpsCommandBuffer* >( iCommandBuffer ) ); - const TAiPublisherInfo* info( ext->PublisherInfoL() ); + __TIME( "FW: Subscribe content observers", + SubscribeContentObserversL( *plugin, aPublisherInfo ) ); + + __TIME( "FW: Configure Plugin", + ConfigurePluginL( *plugin, aPublisherInfo ) ); - if( info->iNamespace != aPluginInfo.iNamespace ) - { - // SetPropertyL is not implemented correctly - User::Leave( KErrNotSupported ); - } - - return plugin; + // Take plugin's ownership + iPublishers.Append( plugin ); + CleanupStack::Pop( plugin ); } // ---------------------------------------------------------------------------- // CAiPluginFactory::SubscribeContentObserversL() +// // ---------------------------------------------------------------------------- // void CAiPluginFactory::SubscribeContentObserversL( - CAiContentPublisher& aContentPublisher, - const TAiPublisherInfo& aPublisherInfo, - RPointerArray& aControllerArray ) - { - - for( TInt i = 0; i < aControllerArray.Count(); i++ ) + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ) + { + RPointerArray< CAiUiController >& + controllers( iUiControllerManager.UiControllers() ); + + for( TInt i = 0; i < controllers.Count(); i++ ) { MAiContentObserver& observer( - aControllerArray[i]->GetContentObserver() ); + controllers[i]->GetContentObserver() ); if ( observer.RequiresSubscription( aPublisherInfo ) ) { @@ -334,44 +334,46 @@ // ---------------------------------------------------------------------------- // CAiPluginFactory::ConfigurePluginL() +// // ---------------------------------------------------------------------------- // -void CAiPluginFactory::ConfigurePluginL( - RPointerArray& aControllerArray, - CAiContentPublisher& aContentPublisher, - const TAiPublisherInfo& aPubInfo ) +void CAiPluginFactory::ConfigurePluginL( + CHsContentPublisher& aContentPublisher, + const THsPublisherInfo& aPublisherInfo ) { - RAiSettingsItemArray pluginSettings; - CleanupResetAndDestroyPushL( pluginSettings ); + RAiSettingsItemArray settings; + CleanupResetAndDestroyPushL( settings ); - for( TInt i = 0; i < aControllerArray.Count(); i++ ) + RPointerArray< CAiUiController >& + controllers( iUiControllerManager.UiControllers() ); + + for( TInt i = 0; i < controllers.Count(); i++ ) { // Get settings for plug-in - aControllerArray[i]->GetSettingsL( aPubInfo, pluginSettings ); + controllers[i]->GetSettingsL( aPublisherInfo, settings ); } // Configure plug-in with its settings - aContentPublisher.ConfigureL( pluginSettings ); + aContentPublisher.ConfigureL( settings ); - CleanupStack::PopAndDestroy( &pluginSettings ); + CleanupStack::PopAndDestroy( &settings ); } // ---------------------------------------------------------------------------- -// CAiPluginFactory::PluginByInfoL() +// CAiPluginFactory::PluginByInfo() +// Gets plugin by publisher info. Only this overload returns the exact match // ---------------------------------------------------------------------------- // -CAiContentPublisher* CAiPluginFactory::PluginByInfoL( - const TAiPublisherInfo& aInfo ) const +CHsContentPublisher* CAiPluginFactory::PluginByInfo( + const THsPublisherInfo& aPublisherInfo ) const { - for( TInt i = 0; i < iPlugins.Count(); i++ ) + for( TInt i = 0; i < iPublishers.Count(); i++ ) { - const TAiPublisherInfo* info( NULL ); - - info = iPluginTool->PublisherInfoL( *iPlugins[i] ); - - if( info && ( aInfo == *info ) ) + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( aPublisherInfo == info ) { - return iPlugins[i]; + return iPublishers[i]; } } @@ -379,25 +381,64 @@ } // ---------------------------------------------------------------------------- -// CAiPluginFactory::PluginByNameL() +// CAiPluginFactory::PluginByUid() +// Gets plugin by UID // ---------------------------------------------------------------------------- // -CAiContentPublisher* CAiPluginFactory::PluginByNameL( +CHsContentPublisher* CAiPluginFactory::PluginByUid( const TUid& aUid ) const + { + for( TInt i = 0; i < iPublishers.Count(); i++ ) + { + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( info.Uid() == aUid ) + { + return iPublishers[i]; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByName() +// Gets plugin by name +// ---------------------------------------------------------------------------- +// +CHsContentPublisher* CAiPluginFactory::PluginByName( const TDesC& aName ) const { - for( TInt i = 0; i < iPlugins.Count(); i++ ) + for( TInt i = 0; i < iPublishers.Count(); i++ ) { - const TAiPublisherInfo* info( NULL ); - - TRAP_IGNORE( info = iPluginTool->PublisherInfoL( *iPlugins[i] ) ); - - if( info && info->iName == aName ) + const THsPublisherInfo& info( iPublishers[i]->PublisherInfo() ); + + if( info.Name() == aName ) { - return iPlugins[i]; + return iPublishers[i]; } } return NULL; } +// ---------------------------------------------------------------------------- +// CAiPluginFactory::Publishers() +// +// ---------------------------------------------------------------------------- +// +RPointerArray< CHsContentPublisher >& CAiPluginFactory::Publishers() const + { + return iPublishers; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::SetCommandBuffer() +// +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::SetCommandBuffer( CAiCpsCommandBuffer* aCommandBuffer ) + { + iCommandBuffer = aCommandBuffer; + } + // End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aipluginstatemachineimpl.cpp --- a/idlefw/src/framework/aipluginstatemachineimpl.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plugin state machine impl -* -*/ - - -#include "aipluginstatemachineimpl.h" -#include "aipluginstatemachine.h" -#include "aipluginlifecycleobserver.h" -#include "aipluginstate.h" -#include "aifwpanic.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::CAiPluginStateMachine() -// ---------------------------------------------------------------------------- -// -CAiPluginStateMachine::CAiPluginStateMachine( - MAiPluginStateResources& aPluginStateResource, - CAiContentPublisher& aPlugin ) - : iAlive( *this ), - iCurrentState( NULL ), - iPluginStateResource( aPluginStateResource ), - iPlugin( aPlugin ) - { - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::SwitchToState() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateMachine::SwitchToState( TAiState aState, - TAiStateChanges aStateChange ) - { - // Store previous state - MAiPluginState* previousState( iCurrentState ); - - // Determine new current state - switch( aState ) - { - case EAiAlive: - { - iCurrentState = &iAlive; - break; - } - case EAiSuspended: - { - iCurrentState = &iSuspended; - break; - } - case EAiIdle: - { - iCurrentState = &iIdle; - break; - } - default: - { -#ifdef _DEBUG - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_IllegalPluginStateChange ); -#endif - break; - } - } - - if( previousState != iCurrentState ) - { - if( previousState ) - { - // Exit the previous state - previousState->Exit( *this, aStateChange ); - } - - if( iCurrentState ) - { - // Enter the new state - iCurrentState->Enter( *this, aStateChange ); - } - } - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::StateVariable() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateMachine::StateVariable( TAiStateVariable aStateVariable ) - { - return iPluginStateResource.StateVariable( aStateVariable ); - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::Plugin() -// ---------------------------------------------------------------------------- -// -CAiContentPublisher& CAiPluginStateMachine::Plugin() const - { - return iPlugin; - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateMachine::HandleEvent( TAiStateChanges aStateChange ) - { - // State machine handles some state changes directly. - switch( aStateChange ) - { - case ESMAISystemBoot: - { - // State machine handles startup event(boot/theme change). - // Check if backup is ongoing - if( iPluginStateResource.StateVariable( ESMAIBackupRestoreStatus ) ) - { - SwitchToState( EAiIdle, aStateChange ); - } - else - { - SwitchToState( EAiAlive, aStateChange ); - } - break; - } - case ESMAIBackupOn: - { - // Backup/restore directs straight to idle state. - SwitchToState( EAiIdle, aStateChange ); - break; - } - case ESMAIReportThemeChangeStarted: - case ESMAISystemShutdown: - { - // Shutdown drives directly to idle state. - ChangePluginState( iPluginStateResource.TranslateReason( aStateChange ), - CAiContentPublisher::Stop ); - break; - } - case ESMAIOnLine: - { - if( !iOnline && iCurrentState ) - { - iOnline = ETrue; - - return iCurrentState->HandleEvent( *this, aStateChange ); - } - break; - } - case ESMAIOffLine: - { - if( iCurrentState ) - { - iOnline = EFalse; - - return iCurrentState->HandleEvent( *this, aStateChange ); - } - break; - } - default: - { - if( ( aStateChange == ESMAIBacklightOn ) && - !iPluginStateResource.StateVariable( ESMAIIdleFocusStatus ) ) - { - // Ignore lights on when on background - return ETrue; - } - - if( iCurrentState ) - { - // Other events are handled by the current set state. - // Current state determines return value. - return iCurrentState->HandleEvent( *this, aStateChange ); - } - } - } - - // Return event handled. - return ETrue; - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::TranslateReason() -// ---------------------------------------------------------------------------- -// -TAiTransitionReason CAiPluginStateMachine::TranslateReason( - TAiStateChanges aStateChange ) - { - return iPluginStateResource.TranslateReason( aStateChange ); - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::RestartSuspendTimer() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateMachine::RestartSuspendTimer() - { - iPluginStateResource.RestartSuspendTimer(); - } - -// --------------------------------------------------------------------------- -// CAiPluginStateMachine::ChangePluginState() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateMachine::ChangePluginState( TAiTransitionReason aReason, - void (CAiContentPublisher::*aStateChangeMethod)( TAiTransitionReason ) ) - { - TRAP_IGNORE( ( iPlugin.*aStateChangeMethod)( aReason ) ); - } - -// End of file. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aipluginstatemanager.cpp --- a/idlefw/src/framework/aipluginstatemanager.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,549 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: System state observer and notifier -* -*/ - - -#include -#include -#include // for KSettingsScreenSaverPeriod -#include -#include -#include -#include -#include -#include "aifwpanic.h" -#include "aipluginstatemanager.h" -#include "aipluginstatemachineimpl.h" -#include "ailightstatusobserver.h" -#include "aicallstatusobserver.h" -#include "aifocusobserver.h" -#include "aikeylockobserver.h" -#include "aibackuprestorestatusobserver.h" -#include "aienvironmentchangeobserver.h" -#include "aiuiframeworkobserverimpl.h" - -#include // this include needs to be last - -#include "debug.h" - -const TInt KMinuteInSeconds( 60 ); -const TInt KSecondInMikroSeconds( 1000*1000 ); -const TInt KAIFadeOutEstimateMikroSeconds( 10 * KSecondInMikroSeconds ); -const TInt KTwoMinutesInMikroSeconds( 2 * KMinuteInSeconds * KSecondInMikroSeconds ); - -#define AI2_OPTION_RESUME_AT_CREATION - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::NewL() -// ---------------------------------------------------------------------------- -// -CAiPluginStateManager* CAiPluginStateManager::NewL() - { - CAiPluginStateManager* self = new (ELeave) CAiPluginStateManager; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::~CAiPluginStateManager() -// ---------------------------------------------------------------------------- -// -CAiPluginStateManager::~CAiPluginStateManager() - { - iStateMachines.ResetAndDestroy(); - - DestroySystemStateObservers(); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::CAiPluginStateManager() -// ---------------------------------------------------------------------------- -// -CAiPluginStateManager::CAiPluginStateManager() - { - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ConstructL() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ConstructL() - { - TInt value( 0 ); - - TInt err( RProperty::Get( KCRUidPersonalizationSettings, - KSettingsScreenSaverPeriod, value ) ); - - if( err == KErrNone ) - { - iT1Delay = ( value * KMinuteInSeconds * KSecondInMikroSeconds ) - + KAIFadeOutEstimateMikroSeconds; - } - else - { - // default when error to 2 minutes - iT1Delay = KTwoMinutesInMikroSeconds; - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::CreateSystemStateObserversL() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::CreateSystemStateObserversL() - { - iT1Timer = CPeriodic::NewL( CActive::EPriorityStandard ); - - iBackupOperationObserver = CAiBackupRestoreStatusObserver::NewL( this ); - - iCallStateObserver = CAiCallStatusObserver::NewL( this ); - - iLightStateObserver = CAiLightStatusObserver::NewL( this ); - - iFocusObserver = CAiFocusObserver::NewL( this ); - - iKeylockObserver = CAiKeylockObserver::NewL( this ); - - // Environment change observer notifies time/date/midnight/language - // changes - iEnvironmentObserver = CAiEnvironmentChangeObserver::NewL( this ); - - // Ui framework observer notifies currently general theme changes - iFrameworkObserver = CAiUiFrameworkObserverImpl::NewL( *this ); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::DestroySystemStateObservers() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::DestroySystemStateObservers() - { - if( iT1Timer ) - { - iT1Timer->Cancel(); - - delete iT1Timer; - iT1Timer = NULL; - } - - delete iBackupOperationObserver; - iBackupOperationObserver = NULL; - - delete iCallStateObserver; - iCallStateObserver = NULL; - - delete iLightStateObserver; - iLightStateObserver = NULL; - - delete iFocusObserver; - iFocusObserver = NULL; - - delete iKeylockObserver; - iKeylockObserver = NULL; - - delete iEnvironmentObserver; - iEnvironmentObserver = NULL; - - delete iFrameworkObserver; - iFrameworkObserver = NULL; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::UiFwObserver() -// ---------------------------------------------------------------------------- -// -MAiUiFrameworkObserver* CAiPluginStateManager::UiFwObserver() const - { - return iFrameworkObserver; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ReportStateChange() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ReportStateChange( TAiStateChanges aState ) - { - if( !iIsDeviceStarted ) - { - if( aState == ESMAISystemBoot ) - { - iIsDeviceStarted = ETrue; - } - } - - if( aState == ESMAISystemBoot ) - { - return; - } - - ProcessStateChangeForAll( aState ); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::StateVariable() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateManager::StateVariable( TAiStateVariable aStateChange ) - { - switch ( aStateChange ) - { - case ESMAICallStatus: - { - return CallOngoing(); - } - case ESMAILightStatus: - { - return LightsOn(); - } - case ESMAIBackupRestoreStatus: - { - return BackupOngoing(); - } - case ESMAIIdleFocusStatus: - { - return IdleFocused(); - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::RestartSuspendTimer() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::RestartSuspendTimer() - { - if( iT1Timer ) - { - iT1Timer->Cancel(); - - iT1Timer->Start( iT1Delay, iT1Delay, - TCallBack( T1TimerCallback, this ) ); - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::PluginCreatedL() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::PluginCreatedL( CAiContentPublisher& aPlugin ) - { - // Create a new state machine for the plugin from the heap - // and append the machine to our local array. - CAiPluginStateMachine* machine = - new ( ELeave ) CAiPluginStateMachine( *this, aPlugin ); - - // Important to append first so failure will be handled properly - CleanupStack::PushL( machine ); - iStateMachines.AppendL( machine ); - CleanupStack::Pop( machine ); - - // This will effectively resume the plugin NOW. - ProcessStateChange( ESMAISystemBoot, *machine ); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::PluginDestroyed() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::PluginDestroyed( CAiContentPublisher& aPlugin ) - { - // plugin has beed destroyed, remove the state machine also - for( TInt i = 0; i < iStateMachines.Count(); i++ ) - { - if( &iStateMachines[i]->Plugin() == &aPlugin ) - { - iStateMachines[i]->HandleEvent( ESMAISystemShutdown ); - delete iStateMachines[i]; - - iStateMachines.Remove( i ); - break; - } - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::AllPluginsCreated() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::AllPluginsCreated() - { - // Currently we get this event via pluginmanager -> aifw -> EAISMSystemBoot event - // so no implementation required. We might want to handle this locally in the - // future though. Current impl is such because RefreshUI for ui controller - // needs to after the plugins are resumed -> If we handle this here it is not - // garanteed. - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::AllPluginsDestroyed() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::AllPluginsDestroyed() - { - // Plugins have been destroyed, so destroy the state machines also. - iStateMachines.ResetAndDestroy(); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::TranslateReason() -// ---------------------------------------------------------------------------- -// -TAiTransitionReason CAiPluginStateManager::TranslateReason( - TAiStateChanges aStateChange ) - { - switch ( aStateChange ) - { - case ESMAIBacklightOn: - { - return EAiBacklightOn; - } - case ESMAIBacklightOff: - { - return EAiBacklightOff; - } - case ESMAIBackupOn: - { - return EAiBackupRestoreStarted; - } - case ESMAIBackupOff: - { - return EAiBackupRestoreEnded; - } - case ESMAIInCall: - { - return EAiPhoneCallStarted; - } - case ESMAINoCall: - { - return EAiPhoneCallEnded; - } - case ESMAISystemBoot: - { - return EAiSystemStartup; - } - case ESMAILocaleChanged: - { - return EAiLanguageChanged; - } - case ESMAIIdleForeground: - { - return EAiIdleForeground; - } - case ESMAIIdleBackground: - { - return EAiIdleBackground; - } - case ESMAITimeChanged: - { - return EAiTimeChanged; - } - case ESMAIMidnightCrossover: - { - return EAiMidnightPassed; - } - case ESMAIRelayoutScreen: - { - return EAiScreenLayoutChanged; - } - case ESMAIReportThemeChangeStarted: - { - return EAiUiDefinitionChangeStarted; - } - case ESMAIReportThemeChangeReady: - { - return EAiUiDefinitionChangeEnded; - } - case ESMAIGeneralThemeChanged: - { - return EAiGeneralThemeChanged; - } - case ESMAISystemShutdown: - { - return EAiSystemShutdown; - } - case ESMAIT1Timeout: - { - return EAiSuspendPlugins; - } - case ESMAIKeylockEnabled: - { - return EAiKeylockEnabled; - } - case ESMAIKeylockDisabled: - { - return EAiKeylockDisabled; - } - case ESMAIOffLine: - { - return EAiIdleOffLine; - } - case ESMAIOnLine: - { - return EAiIdleOnLine; - } - case ESMAIPageSwitch: - { - return EAiIdlePageSwitch; - } - case ESMAIUnknownState: // fallthrough - default: - { - return EAiUnknownTransitionReason; - } - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ProcessStateChange() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ProcessStateChange( TAiStateChanges aState, - CAiPluginStateMachine& aMachine ) - { - aMachine.HandleEvent( aState ); - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ProcessOnlineState() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ProcessOnlineState( CAiContentPublisher& aPlugin ) - { - for ( TInt i = 0; i < iStateMachines.Count(); i++ ) - { - if( &iStateMachines[i]->Plugin() == &aPlugin ) - { - iStateMachines[i]->HandleEvent( ESMAIOnLine ); - break; - } - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ProcessOfflineState() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ProcessOfflineState( CAiContentPublisher& aPlugin ) - { - for ( TInt i = 0; i < iStateMachines.Count(); i++ ) - { - if( &iStateMachines[i]->Plugin() == &aPlugin ) - { - iStateMachines[i]->HandleEvent( ESMAIOffLine ); - break; - } - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::ProcessStateChangeForAll() -// ---------------------------------------------------------------------------- -// -void CAiPluginStateManager::ProcessStateChangeForAll( TAiStateChanges aState ) - { - for ( TInt i = 0; i < iStateMachines.Count(); ++i ) - { - iStateMachines[i]->HandleEvent( aState ); - } - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::IdleFocused() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateManager::IdleFocused() const - { - if ( iFocusObserver ) - { - return ( iFocusObserver->Status() == ESMAIIdleForeground ); - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::BackupOngoing() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateManager::BackupOngoing() const - { - if ( iBackupOperationObserver ) - { - return ( iBackupOperationObserver->Status() == ESMAIBackupOn ); - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::LightsOn() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateManager::LightsOn() const - { - if ( iLightStateObserver ) - { - return ( iLightStateObserver->Status() == ESMAIBacklightOn ); - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::CallOngoing() -// ---------------------------------------------------------------------------- -// -TBool CAiPluginStateManager::CallOngoing() const - { - if ( iCallStateObserver ) - { - return ( iCallStateObserver->Status() == ESMAIInCall ); - } - - return EFalse; - } - -// ---------------------------------------------------------------------------- -// CAiPluginStateManager::T1TimerCallback() -// ---------------------------------------------------------------------------- -// -TInt CAiPluginStateManager::T1TimerCallback( TAny* aPtr ) - { - CAiPluginStateManager* self = - static_cast< CAiPluginStateManager* >( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - self->iT1Timer->Cancel(); - -// self->ProcessStateChangeForAll( ESMAIT1Timeout ); - - return KErrNone; - } - -// End of file - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aipsstatusobserver.cpp --- a/idlefw/src/framework/aipsstatusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Generic PS observer base class -* -*/ - - -#include -#include -#include "aipsstatusobserver.h" - -CAiPSStatusObserver::~CAiPSStatusObserver() - { - if( iObserver ) - iObserver->Release(); - } - -TAiStateChanges CAiPSStatusObserver::Status() - { - return ESMAIUnknownState; - } - -CAiPSStatusObserver::CAiPSStatusObserver() - { - } - -void CAiPSStatusObserver::BaseConstructL( TCallBack aCallBack, - TUid aCategory, - TInt aKey, - MAiStateManager* aStateManager ) - { - iStateManager = aStateManager; - iObserver = AiUtility::CreatePSPropertyObserverL( aCallBack, aCategory, aKey ); - } - -// End of File. diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aissaverstatusobserver.cpp --- a/idlefw/src/framework/aissaverstatusobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include "aissaverstatusobserver.h" -#include // this include needs to be last -#include "aifwpanic.h" -#include "debug.h" - -CAiSSaverStatusObserver::CAiSSaverStatusObserver() - { - } - -CAiSSaverStatusObserver::~CAiSSaverStatusObserver() - { - } - -CAiSSaverStatusObserver* CAiSSaverStatusObserver::NewL( MAiStateManager* aStateManager ) - { - CAiSSaverStatusObserver* self = new (ELeave) CAiSSaverStatusObserver(); - CleanupStack::PushL(self); - self->ConstructL( aStateManager ); - CleanupStack::Pop(self); - return self; - } - -void CAiSSaverStatusObserver::ConstructL( MAiStateManager* aStateManager ) - { - BaseConstructL( TCallBack( HandleScreenSaverStateChanged, this ), - KPSUidScreenSaver, - KScreenSaverOn, - aStateManager ); - } - -TAiStateChanges CAiSSaverStatusObserver::Status() - { - TInt value = 0; - Tint err = iObserver->Get( value ); - if( ( value == 0 ) || - ( err != KErrNone ) ) - { - return ESMAIScreensaverInactive; - } - else - { - return ESMAIScreensaverActive; - } - } - -TInt CAiSSaverStatusObserver::HandleScreenSaverStateChanged( TAny* aPtr ) - { - CAiSSaverStatusObserver* self = - static_cast( aPtr ); - - __ASSERT_DEBUG( self, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - TInt value = 0; - TInt err = self->iObserver->Get( value ); - - if ( ( value == 0 ) || - ( err != KErrNone ) ) - { - // screensaver off - __PRINTS("XAI: Screen saver = OFF"); - self->iStateManager->ReportStateChange( ESMAIScreensaverInactive ); - } - else - { - // screensaver on - __PRINTS("XAI: Screen saver = ON"); - self->iStateManager->ReportStateChange( ESMAIScreensaverActive ); - } - - return KErrNone; - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aistatealive.cpp --- a/idlefw/src/framework/aistatealive.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,387 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State class for alive states -* -*/ - - -#include "aistatealive.h" -#include "aipluginstatemachine.h" -#include "debug.h" - - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateAliveActive::TAiStateAliveActive() -// ---------------------------------------------------------------------------- -// -TAiStateAliveActive::TAiStateAliveActive() - { - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveActive::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveActive::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Enter Alive active" ); - - const TAiTransitionReason reason( - aStateMachine.TranslateReason( aStateChange ) ); - - aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveActive::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateAliveActive::HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Alive active handles event" ); - switch( aStateChange ) - { - case ESMAIBacklightOff: - { - aStateMachine.SwitchToState( EAiAliveInactive, aStateChange ); - return ETrue; - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveActive::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveActive::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges /*aStateChange*/ ) - { - __PRINTS( "XAI: Exit alive active" ); - } - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateAliveInactive::TAiStateAliveInactive() -// ---------------------------------------------------------------------------- -// -TAiStateAliveInactive::TAiStateAliveInactive() - { - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveInactive::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveInactive::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Enter alive inactive" ); - const TAiTransitionReason reason( - aStateMachine.TranslateReason( aStateChange ) ); - - aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); - - aStateMachine.RestartSuspendTimer(); - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveInactive::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateAliveInactive::HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: alive inactive handles event" ); - switch( aStateChange ) - { - case ESMAIIdleForeground: - case ESMAIBacklightOn: - { - aStateMachine.SwitchToState( EAiAliveActive, aStateChange ); - return ETrue; - } - case ESMAIT1Timeout: - { - aStateMachine.SwitchToState( EAiSuspended, aStateChange ); - return ETrue; - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveInactive::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveInactive::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges /*aStateChange*/ ) - { - __PRINTS( "XAI: Exit alive inactive" ); - } - - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateAliveIncall::TAiStateAliveIncall() -// ---------------------------------------------------------------------------- -// -TAiStateAliveIncall::TAiStateAliveIncall() - { - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveIncall::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveIncall::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Enter alive incall" ); - - const TAiTransitionReason reason( - aStateMachine.TranslateReason( aStateChange ) ); - - aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveIncall::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateAliveIncall::HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: alive incall handles event" ); - switch( aStateChange ) - { - case ESMAINoCall: - { - // To alive switch - aStateMachine.SwitchToState( EAiAlive, aStateChange ); - return ETrue; - } - case ESMAIInCall: - { - // prevent master state from handling this - return ETrue; - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// TAiStateAliveIncall::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateAliveIncall::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges /*aStateChange*/ ) - { - __PRINTS( "XAI: Exit alive incall" ); - } - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateAlive::TAiStateAlive() -// ---------------------------------------------------------------------------- -// -TAiStateAlive::TAiStateAlive( MAiPluginStateMachine& aParentStateMachine ) - : iCurrentState( &iStateAliveInactive ), - iParentStateMachine( &aParentStateMachine ) - { - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::SwitchToState() -// ---------------------------------------------------------------------------- -// -void TAiStateAlive::SwitchToState( TAiState aState, - TAiStateChanges aStateChange ) - { - switch( aState ) - { - case EAiAliveInactive: - { - iCurrentState = &iStateAliveInactive; - break; - } - case EAiAliveActive: - { - iCurrentState = &iStateAliveActive; - break; - } - case EAiAliveIncall: - { - iCurrentState = &iStateAliveIncall; - break; - } - default: - { - iParentStateMachine->SwitchToState( aState, aStateChange ); - return; - } - } - iCurrentState->Enter( *this, aStateChange ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::StateVariable() -// ---------------------------------------------------------------------------- -// -TBool TAiStateAlive::StateVariable( TAiStateVariable aStateVariable ) - { - return iParentStateMachine->StateVariable( aStateVariable ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::Plugin() -// ---------------------------------------------------------------------------- -// -CAiContentPublisher& TAiStateAlive::Plugin() const - { - return iParentStateMachine->Plugin(); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::TranslateReason() -// ---------------------------------------------------------------------------- -// -TAiTransitionReason TAiStateAlive::TranslateReason( - TAiStateChanges aStateChange ) - { - return iParentStateMachine->TranslateReason( aStateChange ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::RestartSuspendTimer() -// ---------------------------------------------------------------------------- -// -void TAiStateAlive::RestartSuspendTimer() - { - iParentStateMachine->RestartSuspendTimer(); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateAlive::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Alive switch - enter" ); - if( aStateMachine.StateVariable( ESMAICallStatus ) ) - { - // If call is ongoing enter alive in call - iCurrentState = &iStateAliveIncall; - } - else if( !aStateMachine.StateVariable( ESMAILightStatus ) ) - { - // If light is off enter alive inactive - iCurrentState = &iStateAliveInactive; - } - else - { - // Otherwise alive active - iCurrentState = &iStateAliveActive; - } - // finally call the Enter() method - iCurrentState->Enter( *this, aStateChange ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateAlive::HandleEvent( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Alive switch handle event" ); - - if( !iCurrentState->HandleEvent( *this, aStateChange ) ) - { - // Only master state machine handles the "backup/restore on" and - // screen layout changed cases. - // Other event are forwarded to the currently active sub state. - // Other common events may be added here in the future also. - switch( aStateChange ) - { - case ESMAIOffLine: - case ESMAIOnLine: - case ESMAIKeylockEnabled: - case ESMAIKeylockDisabled: - case ESMAIRelayoutScreen: - case ESMAIIdleForeground: - case ESMAIIdleBackground: - case ESMAIPageSwitch: - case ESMAIGeneralThemeChanged: // fallthrough - { - iCurrentState->Enter( *this, aStateChange ); - // Handled the event ok - break; - } - case ESMAIInCall: - { - SwitchToState( EAiAliveIncall, aStateChange ); - // Handled the event ok - break; - } - default: - { - // Neither current state or master handled this event - return EFalse; - } - } - } - // Current state handled the event - return ETrue; - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateAlive::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Alive switch exit" ); - iCurrentState->Exit( *this, aStateChange ); - } - -// ---------------------------------------------------------------------------- -// TAiStateAlive::ChangePluginState() -// ---------------------------------------------------------------------------- -// -void TAiStateAlive::ChangePluginState( TAiTransitionReason aReason, - void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ) - { - iParentStateMachine->ChangePluginState( aReason, aStateChangeMethod ); - } - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aistateidle.cpp --- a/idlefw/src/framework/aistateidle.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State class for idle state -* -*/ - - -#include "aistateidle.h" -#include "aipluginstatemachine.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateIdle::TAiStateIdle() -// ---------------------------------------------------------------------------- -// -TAiStateIdle::TAiStateIdle() - { - } - -// ---------------------------------------------------------------------------- -// TAiStateIdle::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateIdle::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Enter idle backup restore" ); - const TAiTransitionReason reason( - aStateMachine.TranslateReason( aStateChange ) ); - - aStateMachine.ChangePluginState( reason, CAiContentPublisher::Stop ); - } - -// ---------------------------------------------------------------------------- -// TAiStateIdle::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateIdle::HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Idle backup restore handle event" ); - switch( aStateChange ) - { - case ESMAIBackupOff: - { - aStateMachine.SwitchToState( EAiAlive, aStateChange ); - return ETrue; - } - case ESMAIKeylockEnabled: - case ESMAIKeylockDisabled: // fallthrough - { - Enter( aStateMachine, aStateChange ); - return ETrue; - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// TAiStateIdle::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateIdle::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges /*aStateChange*/ ) - { - __PRINTS( "XAI: Exit idle backup restore" ); - } - -// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aistatemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aistatemanager.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,633 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: State Manager +* +*/ + +// System includes + +// User includes +#include +#include +#include +#include +#include +#include + +#include "caicpscommandbuffer.h" +#include "aipluginfactory.h" + +#include "aistatemanager.h" + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// StartReason +// +// ---------------------------------------------------------------------------- +// +static CHsContentPublisher::TStartReason StartReason( TAiFwLoadReason aReason ) + { + CHsContentPublisher::TStartReason reason; + + if ( aReason == EAiFwPageStartup ) + { + reason = CHsContentPublisher::EPageStartup; + } + else if ( aReason == EAiFwPluginStartup ) + { + reason = CHsContentPublisher::EPluginStartup; + } + else + { + reason = CHsContentPublisher::ESystemStartup; + } + + return reason; + } + +// ---------------------------------------------------------------------------- +// StopReason +// +// ---------------------------------------------------------------------------- +// +static CHsContentPublisher::TStopReason StopReason( TAiFwDestroyReason aReason ) + { + CHsContentPublisher::TStopReason reason; + + if ( aReason == EAiFwPageShutdown ) + { + reason = CHsContentPublisher::EPageShutdown; + } + else if ( aReason == EAiFwPluginShutdown ) + { + reason = CHsContentPublisher::EPluginShutdown; + } + else + { + reason = CHsContentPublisher::ESystemShutdown; + } + + return reason; + } + +// ======== MEMBER FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CAiStateManager::NewL() +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAiStateManager* CAiStateManager::NewL( CAiPluginFactory& aFactory ) + { + CAiStateManager* self = CAiStateManager::NewLC( aFactory ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NewLC() +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAiStateManager* CAiStateManager::NewLC( CAiPluginFactory& aFactory ) + { + CAiStateManager* self = new ( ELeave ) CAiStateManager( aFactory ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::~CAiStateManager() +// C++ default destructor. +// ---------------------------------------------------------------------------- +// +CAiStateManager::~CAiStateManager() + { + delete iCommandBuffer; + iReloadPlugins.Close(); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::CAiStateManager() +// C++ default constructor. +// ---------------------------------------------------------------------------- +// +CAiStateManager::CAiStateManager( CAiPluginFactory& aFactory ) + : iFactory( aFactory ) + { + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::ConstructL() +// 2nd phase constructor +// ---------------------------------------------------------------------------- +// +void CAiStateManager::ConstructL() + { + iCommandBuffer = CAiCpsCommandBuffer::NewL(); + + iFactory.SetCommandBuffer( iCommandBuffer ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NotifyStateChange() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::NotifyStateChange( TAiFwState aState ) + { + if ( aState == EAiFwUiShutdown ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwUiShutdown" ); + + iFlags.Set( EShutdown ); + + DestroyPlugins(); + + return; + } + else if ( aState == EAiFwUiStartup ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwUiStartup" ); + + iFlags.Clear( EShutdown ); + + return; + } + + TBitFlags32 flags( iFlags ); + + if ( aState == EAiFwForeground ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwForeground" ); + + iFlags.Set( EIsForeground ); + } + else if ( aState == EAiFwBackground ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwBackground" ); + + iFlags.Clear( EIsForeground ); + } + else if ( aState == EAiFwBacklightOn ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwBacklightOn" ); + + iFlags.Set( EIsLightsOn ); + } + else if ( aState == EAiFwBacklightOff ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwBacklightOff" ); + + iFlags.Clear( EIsLightsOn ); + } + else if ( aState == EAiFwOnline ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwOnline" ); + + iFlags.Set( EIsOnline ); + + ProcessOnlineStateChange(); + } + else if ( aState == EAiFwOffline ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwOffline" ); + + iFlags.Clear( EIsOnline ); + + ProcessOnlineStateChange(); + } + else if ( aState == EAiFwGeneralThemeChange ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwGeneralThemeChange" ); + + ProcessGeneralThemeChange(); + } + else if ( aState == EAiFwBackupRestoreStart || + aState == EAiFwBackupRestoreEnd ) + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: EAiFwBackupRestoreStart/End" ); + + ProcessBackupRestore( aState == EAiFwBackupRestoreStart ); + } + else + { + __PRINTS( "CAiStateManager::NotifyStateChange, aState: Unknown" ); + } + + // State change evaluation and state change trial is done always here + __PRINTS( "CAiStateManager::NotifyStateChange, Run state change" ); + ProcessStateChange( EvaluateNextState() ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NotifyLoadPlugin() +// +// ---------------------------------------------------------------------------- +// +TInt CAiStateManager::NotifyLoadPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwLoadReason aReason ) + { + __PRINT( __DBG_FORMAT( + "CAiStateManager::NotifyLoadPlugin: name: %S, reason: %d " ), + &aPublisherInfo.Name(), (TInt) aReason ); + + __TIME_MARK( time ); + + // Create plugin + TInt retval( iFactory.CreatePlugin( aPublisherInfo ) ); + + if ( retval == KErrNone ) + { + CHsContentPublisher* plugin( iFactory.PluginByInfo( aPublisherInfo ) ); + + if( plugin ) + { + // Do startup state transition + StartPlugin( *plugin, StartReason( aReason ) ); + } + } + + __TIME_ENDMARK( "CAiStateManager::NotifyLoadPlugin, construction", time ); + + return retval; + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NotifyDestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::NotifyDestroyPlugin( + const THsPublisherInfo& aPublisherInfo, TAiFwDestroyReason aReason ) + { + __PRINT( __DBG_FORMAT( + "CAiStateManager::NotifyDestroyPlugin: name: %S, reason: %d " ), + &aPublisherInfo.Name(), (TInt)aReason ); + + __TIME_MARK( time ); + + // Resolve plugin + CHsContentPublisher* plugin( iFactory.PluginByInfo( aPublisherInfo ) ); + + if ( plugin ) + { + // Do shutdown state transition + StopPlugin( *plugin, StopReason( aReason ) ); + + // Destroy plugin + iFactory.DestroyPlugin( aPublisherInfo ); + } + + __TIME_ENDMARK( "CAiStateManager::DestroyPlugin, done", time ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NotifyReloadPlugins() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::NotifyReloadPlugins() + { + __PRINTS( "CAiStateManager::NotifyReloadPlugins" ); + + for ( TInt i = 0; i < iReloadPlugins.Count(); i++ ) + { + // Reload plugin + NotifyLoadPlugin( iReloadPlugins[ i ], EAiFwSystemStartup ); + } + + __PRINTS( "CAiStateManager::NotifyReloadPlugins, done" ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::EvaluateNextState() +// +// ---------------------------------------------------------------------------- +// +CAiStateManager::TState CAiStateManager::EvaluateNextState() const + { + TState nextState( iCurrentState ); + + if ( iFlags.IsSet( EIsForeground ) && iFlags.IsSet( EIsLightsOn ) ) + { + nextState = EAlive; + } + else + { + nextState = ESuspended; + } + + __PRINT( __DBG_FORMAT( + "CAiStateManager::EvaluateNextState: current state: %d, next state: %d" ), + (TInt)iCurrentState, (TInt)nextState ); + + return nextState; + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::ProcessStateChange() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::ProcessStateChange( TState aNextState ) + { + __PRINT( __DBG_FORMAT( + "CAiStateManager::ProcessStateChange: current state: %d, next state: %d, halt: %d" ), + (TInt)iCurrentState, (TInt)aNextState, iHalt ); + + __TIME_MARK( time ); + + if ( aNextState != iCurrentState ) + { + // Update state + iCurrentState = aNextState; + + RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() ); + + // Process state for all + for( TInt i = 0; !iHalt && i < plugins.Count(); i++ ) + { + CHsContentPublisher* plugin( plugins[i] ); + + const THsPublisherInfo& info( plugin->PublisherInfo() ); + + __PRINT( __DBG_FORMAT( + "CAiStateManager::ProcessStateChange: name: %S" ), &info.Name() ); + + if ( iCurrentState == EAlive ) + { + __TIME( "CAiStateManager::ProcessStateChange, EAlive", + + plugin->Resume( CHsContentPublisher::EForeground ) ); + } + else if ( iCurrentState == ESuspended ) + { + __TIME( "CAiStateManager::ProcessStateChange, ESuspended", + + plugin->Suspend( CHsContentPublisher::EBackground ) ); + } + } + + FlushCommandBuffer(); + } + else + { + __PRINTS( "CAiStateManager::ProcessStateChange, no state change" ); + } + + __TIME_ENDMARK( "CAiStateManager::ProcessStateChange, done", time ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::ProcessGeneralThemeChange() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::ProcessGeneralThemeChange() + { + __PRINTS( "CAiStateManager::ProcessGeneralThemeChange" ); + __TIME_MARK( time ); + + RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() ); + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + CHsContentPublisher* plugin( plugins[i] ); + + plugin->Suspend( CHsContentPublisher::EGeneralThemeChange ); + + // Resume publisher immediately if in alive state + if( !iHalt && iCurrentState == EAlive ) + { + plugin->Resume( CHsContentPublisher::EForeground ); + } + } + + FlushCommandBuffer(); + + __TIME_ENDMARK( "CAiStateManager::ProcessGeneralThemeChange, done", time ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::ProcessBackupRestore() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::ProcessBackupRestore( TBool aStart ) + { + __PRINTS( "CAiStateManager::ProcessBackupRestore" ); + __TIME_MARK( time ); + + iHalt = aStart; + + RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() ); + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + CHsContentPublisher* plugin( plugins[i] ); + + if ( aStart ) + { + plugin->Suspend( CHsContentPublisher::EBackupRestore ); + } + else + { + // Resume publisher immediately if in alive state + if ( !iHalt && iCurrentState == EAlive ) + { + plugin->Resume( CHsContentPublisher::EForeground ); + } + } + } + + FlushCommandBuffer(); + + __TIME_ENDMARK( "CAiStateManager::ProcessBackupRestore, done", time ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::ProcessOnlineStateChange() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::ProcessOnlineStateChange() + { + __PRINTS( "CAiStateManager::ProcessOnlineStateChange" ); + + RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() ); + + for( TInt i = 0; i < plugins.Count(); i++ ) + { + CHsContentPublisher* plugin( plugins[i] ); + + if ( iFlags.IsSet( EIsOnline ) ) + { + plugin->SetOnline(); + } + else + { + plugin->SetOffline(); + } + } + + FlushCommandBuffer(); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::StartPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::StartPlugin( CHsContentPublisher& aPlugin, + CHsContentPublisher::TStartReason aReason ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + __PRINT( __DBG_FORMAT( + "CAiStateManager::StartPlugin: name: %S, reason: %d" ), &info.Name(), (TInt)aReason ); + + aPlugin.Start( aReason ); + + if ( iCurrentState == EAlive ) + { + __TIME( "CAiStateManager::StartPlugin, enter EAlive", + + aPlugin.Resume( CHsContentPublisher::EForeground ) ); + } + else if ( iCurrentState == ESuspended ) + { + __TIME( "CAiStateManager::StartPlugin, enter ESuspended", + + aPlugin.Suspend( CHsContentPublisher::EBackground ) ); + } + + if ( iFlags.IsSet( EIsOnline ) ) + { + __TIME( "CAiStateManager::StartPlugin, Set Online", + + aPlugin.SetOnline() ); + } + else + { + __TIME( "CAiStateManager::StartPlugin, Set Offline", + + aPlugin.SetOffline() ); + } + + FlushCommandBuffer(); + + __PRINTS( "CAiStateManager::StartPlugin - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::StopPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::StopPlugin( CHsContentPublisher& aPlugin, + CHsContentPublisher::TStopReason aReason ) + { + const THsPublisherInfo& info( aPlugin.PublisherInfo() ); + + __PRINT( __DBG_FORMAT( + "CAiStateManager::StopPlugin: name: %S, reason: %d" ), &info.Name(), (TInt)aReason ); + + if ( iCurrentState == EAlive ) + { + __TIME( "CAiStateManager::StopPlugin, enter ESuspended", + + aPlugin.Suspend( CHsContentPublisher::EBackground ) ); + } + + aPlugin.Stop( aReason ); + + FlushCommandBuffer(); + + __PRINTS( "CAiStateManager::StopPlugin - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::DestroyPlugins() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::DestroyPlugins() + { + __PRINTS( "CAiStateManager::DestroyPlugins, start" ); + __TIME_MARK( time ); + + RPointerArray< CHsContentPublisher >& plugins( iFactory.Publishers() ); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + CHsContentPublisher* plugin( plugins[i] ); + + // Do shutdown state transition + StopPlugin( *plugin, CHsContentPublisher::ESystemShutdown ); + } + + FlushCommandBuffer(); + + // Finally get rid of all plugins + plugins.ResetAndDestroy(); + + __TIME_ENDMARK( "CAiStateManager::DestroyPlugins, done", time ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::FlushCommandBuffer();() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::FlushCommandBuffer() + { + __PRINTS( "CAiStateManager::FlushCommandBuffer, start" ); + + if ( iCommandBuffer ) + { + __TIME( "CAiStateManager::FlushCommandBuffer, flush", + + iCommandBuffer->Flush() ); + } + + __PRINTS( "CAiStateManager::FlushCommandBuffer - done" ); + } + +// ---------------------------------------------------------------------------- +// CAiStateManager::NotifyReleasePlugins() +// +// ---------------------------------------------------------------------------- +// +void CAiStateManager::NotifyReleasePlugins( const RArray& aUidList ) + { + __PRINTS( "CAiStateManager::NotifyReleasePlugins" ); + + iReloadPlugins.Reset(); + + for ( TInt i = 0; i < aUidList.Count(); i++ ) + { + CHsContentPublisher* plugin = iFactory.PluginByUid( aUidList[ i ] ); + if ( plugin ) + { + StopPlugin( *plugin, CHsContentPublisher::ESystemShutdown ); + THsPublisherInfo info = plugin->PublisherInfo(); + iReloadPlugins.Append( info ); + iFactory.DestroyPlugin( aUidList[ i ] ); + } + } + __PRINTS( "CAiStateManager::NotifyReleasePlugins: return void" ); + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aistateprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aistateprovider.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,341 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: State Provider +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include // KSWIUidsCurrentlyBeingProcessed + +// User includes +#include +#include +#include +#include "aiecomobserver.h" +#include "aistateobserver.h" + +#include "aistateprovider.h" + +#include "debug.h" + +// Constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiStateProvider::NewL() +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAiStateProvider* CAiStateProvider::NewL( MAiStateObserver& aObserver ) + { + CAiStateProvider* self = + CAiStateProvider::NewLC( aObserver ); + + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::NewLC() +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAiStateProvider* CAiStateProvider::NewLC( MAiStateObserver& aObserver ) + { + CAiStateProvider* self = + new ( ELeave ) CAiStateProvider( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::~CAiStateProvider() +// C++ default destructor. +// ---------------------------------------------------------------------------- +// +CAiStateProvider::~CAiStateProvider() + { + Stop(); + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::CAiStateProvider() +// C++ default constructor. +// ---------------------------------------------------------------------------- +// +CAiStateProvider::CAiStateProvider( MAiStateObserver& aObserver ) + : iObserver( aObserver ) + { + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::ConstructL() +// 2nd phase constructor +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::StartL() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::StartL( CCoeEnv& aCoeEnv ) + { + if ( !iStarted ) + { + iStarted = ETrue; + + iObserver.NotifyStateChange( EAiFwUiStartup ); + + iLightObserver = CHWRMLight::NewL( this ); + + iBackupRestoreObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( BackupRestoreEvent, this ), + KUidSystemCategory, conn::KUidBackupRestoreKey ); + + iSwiUidListObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( SwiUidListEvent, this ), + KUidSystemCategory, KSWIUidsCurrentlyBeingProcessed ); + + User::LeaveIfError( iSkinSrv.Connect( this ) ); + + iEcomObserver = CAiEcomObserver::NewL(); + iEcomObserver->AddObserverL( this ); + + iCoeEnv = &aCoeEnv; + + iCoeEnv->AddMessageMonitorObserverL( *this ); + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::Stop() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::Stop() + { + if ( iStarted ) + { + iStarted = EFalse; + + iObserver.NotifyStateChange( EAiFwUiShutdown ); + + if ( iCoeEnv ) + { + iCoeEnv->RemoveMessageMonitorObserver( *this ); + } + + iCoeEnv = NULL; + + delete iEcomObserver; + iEcomObserver = NULL; + + iSkinSrv.Close(); + + Release( iBackupRestoreObserver ); + iBackupRestoreObserver = NULL; + + Release( iSwiUidListObserver ); + iSwiUidListObserver = NULL; + + delete iLightObserver; + iLightObserver = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::MonitorWsMessage() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::MonitorWsMessage( const TWsEvent& aEvent ) + { + TInt type( aEvent.Type() ); + + if ( type == KAknFullOrPartialForegroundGained ) + { + iObserver.NotifyStateChange( EAiFwForeground ); + } + else if ( type == KAknFullOrPartialForegroundLost ) + { + iObserver.NotifyStateChange( EAiFwBackground ); + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::LightStatusChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::LightStatusChanged( TInt aTarget, + CHWRMLight::TLightStatus aStatus ) + { + if ( aTarget == CHWRMLight::EPrimaryDisplay ) + { + if ( aStatus == CHWRMLight::ELightOn ) + { + iObserver.NotifyStateChange( EAiFwBacklightOn ); + } + else if ( aStatus == CHWRMLight::ELightOff ) + { + iObserver.NotifyStateChange( EAiFwBacklightOff ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::SkinContentChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::SkinContentChanged() + { + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::SkinConfigurationChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ) + { + if ( aReason == EAknsSkinStatusConfigurationDeployed ) + { + iObserver.NotifyStateChange( EAiFwGeneralThemeChange ); + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::SkinPackageChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason /*aReason*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::NotifyEcomRegistryChanged() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::NotifyEcomRegistryChanged() + { + __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged" ); + iObserver.NotifyReloadPlugins(); + __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged - return void" ); + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::LoadPlugin() +// +// ---------------------------------------------------------------------------- +// +TInt CAiStateProvider::LoadPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwLoadReason aReason ) + { + return iObserver.NotifyLoadPlugin( aPublisherInfo, aReason ); + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::DestroyPlugin() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::DestroyPlugin( const THsPublisherInfo& aPublisherInfo, + TAiFwDestroyReason aReason ) + { + iObserver.NotifyDestroyPlugin( aPublisherInfo, aReason ); + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::ChangePluginState() +// +// ---------------------------------------------------------------------------- +// +void CAiStateProvider::ChangePluginState( TAiFwState aState ) + { + if ( aState == EAiFwOnline || aState == EAiFwOffline ) + { + iObserver.NotifyStateChange( aState ); + } + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::BackupRestoreEvent() +// +// ---------------------------------------------------------------------------- +// +/* static */ TInt CAiStateProvider::BackupRestoreEvent( TAny* aAny ) + { + CAiStateProvider* self = static_cast< CAiStateProvider* >( aAny ); + + const TUint mask( conn::KBURPartTypeMask ^ conn::EBURNormal ); + + TInt value( 0 ); + + if ( self->iBackupRestoreObserver->Get( value ) == KErrNone ) + { + if ( value & mask ) + { + // Any type of backup or restore operation + self->iObserver.NotifyStateChange( EAiFwBackupRestoreStart ); + } + else + { + self->iObserver.NotifyStateChange( EAiFwBackupRestoreEnd ); + } + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CAiStateProvider::SwiUidLIstEvent() +// +// ---------------------------------------------------------------------------- +// +/* static */ TInt CAiStateProvider::SwiUidListEvent( TAny* aAny ) + { + CAiStateProvider* self = static_cast< CAiStateProvider* >( aAny ); + + RArray uidList; + if ( KErrNone == Swi::GetAllUids( uidList ) ) + { + self->iObserver.NotifyReleasePlugins( uidList ); + } + + return KErrNone; + } + +// End of file + diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aistatesuspended.cpp --- a/idlefw/src/framework/aistatesuspended.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2005-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: State class for suspended state -* -*/ - - -#include "aistatesuspended.h" -#include "aipluginstatemachine.h" -#include "debug.h" - -// ======== MEMBER FUNCTIONS ======== - -// ---------------------------------------------------------------------------- -// TAiStateSuspended::TAiStateSuspended() -// ---------------------------------------------------------------------------- -// -TAiStateSuspended::TAiStateSuspended() - { - } - -// ---------------------------------------------------------------------------- -// TAiStateSuspended::Enter() -// ---------------------------------------------------------------------------- -// -void TAiStateSuspended::Enter( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Enter Suspended" ); - const TAiTransitionReason reason( - aStateMachine.TranslateReason( aStateChange ) ); - - aStateMachine.ChangePluginState( reason, &CAiContentPublisher::Suspend ); - } - -// ---------------------------------------------------------------------------- -// TAiStateSuspended::HandleEvent() -// ---------------------------------------------------------------------------- -// -TBool TAiStateSuspended::HandleEvent( MAiPluginStateMachine& aStateMachine, - TAiStateChanges aStateChange ) - { - __PRINTS( "XAI: Suspended handle event" ); - switch( aStateChange ) - { - case ESMAIIdleForeground: - case ESMAIBacklightOn: - case ESMAILocaleChanged: - case ESMAITimeChanged: - case ESMAIMidnightCrossover: - case ESMAIRelayoutScreen: - case ESMAIGeneralThemeChanged: - case ESMAIInCall: // fallthrough - { - aStateMachine.SwitchToState( EAiAlive, aStateChange ); - return ETrue; - } - case ESMAIKeylockEnabled: - case ESMAIKeylockDisabled: - { - Enter( aStateMachine, aStateChange ); - return ETrue; - } - default: - { - return EFalse; - } - } - } - -// ---------------------------------------------------------------------------- -// TAiStateSuspended::Exit() -// ---------------------------------------------------------------------------- -// -void TAiStateSuspended::Exit( MAiPluginStateMachine& /*aStateMachine*/, - TAiStateChanges /*aStateChange*/ ) - { - __PRINTS( "XAI: Exit Suspended" ); - } - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aiuicontrollermanager.cpp --- a/idlefw/src/framework/aiuicontrollermanager.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/framework/aiuicontrollermanager.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,18 +15,19 @@ * */ +// System includes +#include -#include "aiuicontrollermanager.h" +// User includes +#include #include "aiuicontroller.h" -#include "aicontentpublisher.h" #include "aicontentobserver.h" #include "activeidle2domaincrkeys.h" +#include "aifw.h" + +#include "aiuicontrollermanager.h" + #include "aifwpanic.h" -#include -#include -#include - -#include #include "debug.h" @@ -34,6 +35,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::CAiUiControllerManager() +// // ---------------------------------------------------------------------------- // CAiUiControllerManager::CAiUiControllerManager() @@ -42,15 +44,15 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::LoadMainControllerL() +// // ---------------------------------------------------------------------------- // -void CAiUiControllerManager::LoadMainControllerL( - CRepository& aCenRepConfig ) +void CAiUiControllerManager::LoadMainControllerL( CRepository& aRepository ) { TInt value( 0 ); // Main UI Controller must be configured correctly - User::LeaveIfError( aCenRepConfig.Get( KAiMainUIController, value ) ); + User::LeaveIfError( aRepository.Get( KAiMainUIController, value ) ); CAiUiController* controller = CAiUiController::NewL( TUid::Uid( value ) ); @@ -67,24 +69,22 @@ } iUiControllerArray.AppendL( controller ); - CleanupStack::Pop( controller ); - - // Register this as a UI framework observer of the main UI controller - iMainUiController->SetUiFrameworkObserver( *this ); + CleanupStack::Pop( controller ); } // ---------------------------------------------------------------------------- // CAiUiControllerManager::LoadSecondaryControllersL() +// // ---------------------------------------------------------------------------- // void CAiUiControllerManager::LoadSecondaryControllersL( - CRepository& aCenRepConfig ) + CRepository& aRepository ) { TInt value( 0 ); // Instantiate rest of the UI controllers. for( TInt key = KAiFirstUIController; - key <= KAiLastUIController && aCenRepConfig.Get( key, value ) == KErrNone; + key <= KAiLastUIController && aRepository.Get( key, value ) == KErrNone; ++key ) { // skip empty entries @@ -106,77 +106,48 @@ CleanupStack::PushL( controller ); iUiControllerArray.AppendL( controller ); - CleanupStack::Pop( controller ); - - // Get the secondary interface - MAiSecondaryUiController* secController( - controller->SecondaryInterface() ); - - if( secController ) - { - MAiUiFrameworkObserver* uiFwObserver( - secController->UiFrameworkObserver() ); - - if( uiFwObserver ) - { - // Add secondary controller as UI framework event observer. - User::LeaveIfError( - iUiFrameworkObservers.InsertInAddressOrder( uiFwObserver ) ); - } - } + CleanupStack::Pop( controller ); } } // ---------------------------------------------------------------------------- // CAiUiControllerManager::ConstructL() +// // ---------------------------------------------------------------------------- // -void CAiUiControllerManager::ConstructL() +void CAiUiControllerManager::ConstructL( CAiFw* aAiFw ) { __HEAP("FW: Init - Create UI Ctrls"); __TIME_MARK(t); - - CRepository* cenRep( NULL ); - -#if 0 - // For AI3_test - RProcess proc; - // 0x102750F0 in AI3, 0x2001CB4F in AI3_Test - TSecureId secId( proc.SecureId() ); - - if( secId == 0x2001CB4F ) - { - cenRep = CRepository::NewL( TUid::Uid( 0x2001952B ) ); - } - else - { - cenRep = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); - } -#else - cenRep = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); -#endif - - LoadMainControllerL( *cenRep ); + + CRepository& repository( aAiFw->Repository() ); + + LoadMainControllerL( repository ); // Failing on secondary is not fatal. Ignore leaves. - TRAP_IGNORE( LoadSecondaryControllersL( *cenRep ) ); - - CleanupStack::PopAndDestroy( cenRep ); - + TRAP_IGNORE( LoadSecondaryControllersL( repository ) ); + + for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->SetEventHandler( *aAiFw ); + } + __TIME_ENDMARK("FW: Create UI Ctrls", t); __HEAP("FW: Done - Create UI Ctrls"); } // ---------------------------------------------------------------------------- // CAiUiControllerManager::NewL() +// // ---------------------------------------------------------------------------- // -CAiUiControllerManager* CAiUiControllerManager::NewL() +CAiUiControllerManager* CAiUiControllerManager::NewL( CAiFw* aAiFw ) { - CAiUiControllerManager* self = new (ELeave) CAiUiControllerManager; + CAiUiControllerManager* self = + new ( ELeave ) CAiUiControllerManager; CleanupStack::PushL( self ); - self->ConstructL(); + self->ConstructL( aAiFw ); CleanupStack::Pop( self ); // self return self; @@ -184,19 +155,19 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::~CAiUiControllerManager() +// // ---------------------------------------------------------------------------- // CAiUiControllerManager::~CAiUiControllerManager() { iUiControllerArray.ResetAndDestroy(); - - iUiFrameworkObservers.Reset(); - + iCreatedUICList.Reset(); } // ---------------------------------------------------------------------------- -// CAiUiControllerManager::UiControllers() +// CAiUiControllerManager::UiControllers() +// // ---------------------------------------------------------------------------- // RPointerArray< CAiUiController >& CAiUiControllerManager::UiControllers() const @@ -206,6 +177,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::IsMainUiController() +// // ---------------------------------------------------------------------------- // TBool CAiUiControllerManager::IsMainUiController( @@ -215,20 +187,8 @@ } // ---------------------------------------------------------------------------- -// CAiUiControllerManager::SetEventHandler() -// ---------------------------------------------------------------------------- +// CAiUiControllerManager::RunApplicationL() // -void CAiUiControllerManager::SetEventHandler( - MAiFwEventHandler& aEventHandler ) - { - for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) - { - iUiControllerArray[i]->SetEventHandler( aEventHandler ); - } - } - -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::RunApplicationL() // ---------------------------------------------------------------------------- // void CAiUiControllerManager::RunApplicationL() @@ -238,6 +198,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::ActivateUI() +// // ---------------------------------------------------------------------------- // void CAiUiControllerManager::ActivateUI() @@ -250,6 +211,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::LoadUIDefinition() +// // ---------------------------------------------------------------------------- // void CAiUiControllerManager::LoadUIDefinition() @@ -290,6 +252,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::CoeEnv() +// // ---------------------------------------------------------------------------- // CCoeEnv& CAiUiControllerManager::CoeEnv() const @@ -299,6 +262,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::MainUiController() +// // ---------------------------------------------------------------------------- // MAiMainUiController& CAiUiControllerManager::MainUiController() const @@ -308,6 +272,7 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::DestroySecondaryUiControllers() +// // ---------------------------------------------------------------------------- // void CAiUiControllerManager::DestroySecondaryUiControllers() @@ -328,82 +293,25 @@ // ---------------------------------------------------------------------------- // CAiUiControllerManager::ExitMainController() +// // ---------------------------------------------------------------------------- // void CAiUiControllerManager::ExitMainController() { iMainUiController->Exit(); } - -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::AddObserverL() -// ---------------------------------------------------------------------------- -// -void CAiUiControllerManager::AddObserverL( - MAiUiFrameworkObserver& aUiFwObserver ) - { - User::LeaveIfError( - iUiFrameworkObservers.InsertInAddressOrder( &aUiFwObserver ) ); - } - -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::RemoveObserver() + // ---------------------------------------------------------------------------- +// CAiUiControllerManager::SetStateHandler() // -void CAiUiControllerManager::RemoveObserver( - MAiUiFrameworkObserver& aUiFwObserver ) - { - TInt index( iUiFrameworkObservers.FindInAddressOrder( &aUiFwObserver ) ); - - if( index != KErrNotFound ) - { - iUiFrameworkObservers.Remove( index ); - } - } - -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::RemovePluginFromUI() // ---------------------------------------------------------------------------- // -void CAiUiControllerManager::RemovePluginFromUI( CAiContentPublisher& aPlugin ) +void CAiUiControllerManager::SetStateHandler( MAiFwStateHandler& aHandler ) { - // Get MAiPropertyExtension from plugin - MAiPropertyExtension* plugin = - static_cast< MAiPropertyExtension* >( - aPlugin.Extension( KExtensionUidProperty ) ); - - // Inform all UI controller that this plugin need to be removed from UI. - if( plugin ) + for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) { - for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) - { - iUiControllerArray[i]->RemovePluginFromUI( *plugin ); - } - } + iUiControllerArray[i]->SetStateHandler( aHandler ); + } } -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::HandleResourceChange() -// ---------------------------------------------------------------------------- -// -void CAiUiControllerManager::HandleResourceChange( TInt aType ) - { - for( TInt i = 0; i < iUiFrameworkObservers.Count(); i++ ) - { - iUiFrameworkObservers[i]->HandleResourceChange( aType ); - } - } - -// ---------------------------------------------------------------------------- -// CAiUiControllerManager::HandleForegroundEvent() -// ---------------------------------------------------------------------------- -// -void CAiUiControllerManager::HandleForegroundEvent( TBool aForeground ) - { - for( TInt i = 0; i < iUiFrameworkObservers.Count(); i++ ) - { - iUiFrameworkObservers[i]->HandleForegroundEvent( aForeground ); - } - } - // End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/aiuiframeworkobserverimpl.cpp --- a/idlefw/src/framework/aiuiframeworkobserverimpl.cpp Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: UI framework observer for Active Idle framework -* -*/ - - -#include // for KAknsMessageSkinChange equal general theme changed -#include "aiuiframeworkobserverimpl.h" -#include "debug.h" - -CAiUiFrameworkObserverImpl::CAiUiFrameworkObserverImpl( MAiStateManager& aManager ) - : iManager( aManager ) - { - } - -void CAiUiFrameworkObserverImpl::ConstructL() - { - } - -CAiUiFrameworkObserverImpl* CAiUiFrameworkObserverImpl::NewL( MAiStateManager& aManager ) - - { - CAiUiFrameworkObserverImpl* self = - new(ELeave) CAiUiFrameworkObserverImpl( aManager ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -CAiUiFrameworkObserverImpl::~CAiUiFrameworkObserverImpl() - { - } - -// --------------------------------------------------------------------------- -// From class MAiUiFrameworkObserver. -// -// --------------------------------------------------------------------------- -// -void CAiUiFrameworkObserverImpl::HandleResourceChange( TInt aType ) - { - switch( aType ) - { - case KAknsMessageSkinChange: - { - iManager.ReportStateChange( ESMAIGeneralThemeChanged ); - break; - } - default: - { - // Do nothing - break; - } - } - } - -// --------------------------------------------------------------------------- -// From class MAiUiFrameworkObserver. -// -// --------------------------------------------------------------------------- -// -void CAiUiFrameworkObserverImpl::HandleForegroundEvent( TBool /*aForeground*/ ) - { - // Focus observer disabled from this location - } - -// --------------------------------------------------------------------------- -// From class MAiDeviceStatusObserver. -// -// --------------------------------------------------------------------------- -// -TAiStateChanges CAiUiFrameworkObserverImpl::Status() - { - // Resource change event are by nature single shot, so no status can - // be defined for them. - return ESMAIUnknownState; - } diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/framework/homescreen.rss diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/idleint/aiidleappregister.cpp --- a/idlefw/src/idleint/aiidleappregister.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/idleint/aiidleappregister.cpp Wed May 12 13:36:47 2010 +0300 @@ -89,33 +89,6 @@ KTelephonyInformationReadPolicy, KTelephonyInformationWritePolicy ); } - - TInt DefineIdleAI2RestartPS() - { - return RProperty::Define( - KPSUidAiInformation, - KActiveIdleRestartAI2, - RProperty::EInt, - KTelephonyInformationReadPolicy, - KTelephonyInformationWritePolicy ); - } - TInt SetIdleAI2RestartPS() - { - return RProperty::Set( - KPSUidAiInformation, - KActiveIdleRestartAI2, - 0 ); - } - - TInt DefineIdleLaunchPS() - { - return RProperty::Define( - KPSUidAiInformation, - KActiveIdleLaunch, - RProperty::EInt, - ECapabilityReadDeviceData, - ECapabilityWriteDeviceData ); - } TInt DefineIdleSendNumKeysToPhonePS() { @@ -166,8 +139,6 @@ DefineIdleSimRegFailedReceivedPS(); - DefineIdleLaunchPS(); - // Set the default value to 1 so the send key press is reacted SetIdleSendKeyPS(); @@ -177,10 +148,6 @@ // Define idle state key DefineIdleStatePS(); - DefineIdleAI2RestartPS(); - - SetIdleAI2RestartPS(); - DefineIdleSendNumKeysToPhonePS(); SetIdleSendNumKeysToPhonePS(); diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/idleint/aiuiidleintegration.cpp --- a/idlefw/src/idleint/aiuiidleintegration.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/idleint/aiuiidleintegration.cpp Wed May 12 13:36:47 2010 +0300 @@ -11,35 +11,32 @@ * * Contributors: * -* Description: Window server plug-in manager. +* Description: Idle integration * */ -#include "aiuiidleintegrationimpl.h" -#include "aifweventhandler.h" - -#include +// System includes +#include #include #include -#include #include #include -#include #include -#include -#include +#include +#include + +// User includes +#include #include #include -#include - +#include "activeidle2domainpskeys.h" +#include "aiuiidleintegrationimpl.h" +#include "aifweventhandler.h" #include "aistate.h" #include "aifwpanic.h" -#include "activeidle2domainpskeys.h" +#include "debug.h" -#include - -#include // ======== MEMBER FUNCTIONS ======== @@ -70,11 +67,9 @@ delete iIncallBubble; - Release( iSystemStateObserver ); + Release( iCallStatusObserver ); Release( iUiStartupStateObserver ); - - Release( iCallStatusObserver ); } // ---------------------------------------------------------------------------- @@ -95,6 +90,9 @@ void CAiUiIdleIntegrationImpl::ConstructL( const TAiIdleKeySoundConfig& aKeySoundConfig ) { + __PRINTS( "*** CAiUiIdleIntegrationImpl::ConstructL" ); + __TIME_MARK( time ); + iIncallBubble = CAknIncallBubble::NewL(); iActiveIdleState = CActiveIdleState::NewL(); @@ -102,45 +100,37 @@ // Set up keysounds if( aKeySoundConfig.iKeySounds ) { - aKeySoundConfig.iKeySounds - ->PushContextL( aKeySoundConfig.iContextResId ); + aKeySoundConfig.iKeySounds->PushContextL( + aKeySoundConfig.iContextResId ); } - // Set Active Idle application to be system application and disable - // priority switching performed by window server. iEikEnv.SetSystem( ETrue ); - iEikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); - // Eikon server window group - iThisApplicationWgId = iEikEnv.RootWin().Identifier(); - - iEikEnv.RootWin().EnableFocusChangeEvents(); - iEikEnv.RootWin().EnableGroupChangeEvents(); + TInt wgId( iEikEnv.RootWin().Identifier() ); + TInt focusWgId( iEikEnv.WsSession().GetFocusWindowGroup() ); - CApaWindowGroupName::FindByAppUid( KAknCapServerUid, - iEikEnv.WsSession(), - iEikonServerWgId ); - - iActiveIdleState->SetIsIdleForeground( iThisApplicationForeground ); + if ( focusWgId == wgId ) + { + __PRINTS( "*** CAiUiIdleIntegrationImpl::ConstructL - iForeground: 1" ); + + iForeground = ETrue; + } + + iActiveIdleState->SetIsIdleForeground( iForeground ); - iSystemStateObserver = AiUtility::CreatePSPropertyObserverL( - TCallBack( HandleSystemStateChange, this ), - KPSUidStartup, - KPSGlobalSystemState ); - - iUiStartupStateObserver = AiUtility::CreatePSPropertyObserverL( - TCallBack( HandleUiStartupStateChange, this ), - KPSUidStartup, - KPSStartupUiPhase ); - iCallStatusObserver = AiUtility::CreatePSPropertyObserverL( TCallBack( HandleCallEvent, this ), KPSUidCtsyCallInformation, KCTsyCallState ); - // Update state flags. - CAiUiIdleIntegrationImpl::HandleSystemStateChange( this ); - CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( this ); + iUiStartupStateObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleUiStartupStateChange, this ), + KPSUidStartup, + KPSStartupUiPhase ); + + HandleUiStartupStateChange( this ); + + __TIME_ENDMARK( "CAiUiIdleIntegrationImpl::ConstructL, done", time ); } // ---------------------------------------------------------------------------- @@ -148,24 +138,23 @@ // ---------------------------------------------------------------------------- // void CAiUiIdleIntegrationImpl::ActivateUI() - { - if( iUiStartupPhaseOk && iSystemStateOk ) - { - RWsSession& wsSession( iEikEnv.WsSession() ); - - TInt focusWgId( wsSession.GetFocusWindowGroup() ); + { + __TICK( "CAiUiIdleIntegrationImpl::ActivateUI" ); + + Release( iUiStartupStateObserver ); + iUiStartupStateObserver = NULL; + + iAiFwEventHandler->HandleActivateUI(); + + RWsSession& wsSession( iEikEnv.WsSession() ); + + TApaTaskList taskList( wsSession ); + + TApaTask task( taskList.FindApp( TUid::Uid( AI_UID3_AIFW_EXE ) ) ); + + task.BringToForeground(); - if( iThisApplicationWgId != focusWgId ) - { - TApaTaskList taskList( wsSession ); - - TApaTask task( taskList.FindApp( TUid::Uid( AI_UID3_AIFW_EXE ) ) ); - - task.SendSystemEvent( EApaSystemEventBroughtToForeground ); - } - - iAiFwEventHandler->HandleActivateUI(); - } + __PRINTS( "*** CAiUiIdleIntegrationImpl::ActivateUI - done" ); } // ---------------------------------------------------------------------------- @@ -175,64 +164,52 @@ void CAiUiIdleIntegrationImpl::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* /*aDestination*/ ) { - if( !iSystemStateOk || !iUiStartupPhaseOk ) - { - return; - } - - switch ( aEvent.Type() ) - { - case KAknFullOrPartialForegroundGained: - { - if ( !iThisApplicationForeground ) - { - iThisApplicationForeground = ETrue; - iActiveIdleState->SetIsIdleForeground( ETrue ); - SetCallBubbleIfNeededL(); - } - break; - } - - case KAknFullOrPartialForegroundLost: - { - if ( iThisApplicationForeground ) - { - iThisApplicationForeground = EFalse; - iActiveIdleState->SetIsIdleForeground( EFalse ); - ClearCallBubbleL(); - } - break; - } + TInt type( aEvent.Type() ); + + if ( type == KAknFullOrPartialForegroundGained ) + { + __PRINTS( "*** CAiUiIdleIntegrationImpl::HandleWsEventL - Foreground" ); - case EEventKeyDown: - { - if( aEvent.Key()->iScanCode == EStdKeyDevice0 ) - { - TBool isDialog( iEikEnv.AppUi()->IsDisplayingMenuOrDialog() ); - - if( isDialog || iAiFwEventHandler->QueryIsMenuOpen() ) - { - RProperty::Set( - KPSUidAiInformation, - KActiveIdlePopupState, - EPSAiDisplayingMenuOrDialog ); - } - else - { - RProperty::Set( - KPSUidAiInformation, - KActiveIdlePopupState, - EPSAiNotDisplayingMenuOrDialog ); - } - } - break; - } - - default: - { - break; - } - } + if ( !iForeground ) + { + iForeground = ETrue; + iActiveIdleState->SetIsIdleForeground( ETrue ); + SetCallBubbleIfNeededL(); + } + } + else if ( type == KAknFullOrPartialForegroundLost ) + { + __PRINTS( "*** CAiUiIdleIntegrationImpl::HandleWsEventL - Background" ); + + if ( iForeground ) + { + iForeground = EFalse; + iActiveIdleState->SetIsIdleForeground( EFalse ); + ClearCallBubbleL(); + } + } + else if ( type == EEventKeyDown ) + { + if( aEvent.Key()->iScanCode == EStdKeyDevice0 ) + { + TBool isDialog( iEikEnv.AppUi()->IsDisplayingMenuOrDialog() ); + + if( isDialog || iAiFwEventHandler->QueryIsMenuOpen() ) + { + RProperty::Set( + KPSUidAiInformation, + KActiveIdlePopupState, + EPSAiDisplayingMenuOrDialog ); + } + else + { + RProperty::Set( + KPSUidAiInformation, + KActiveIdlePopupState, + EPSAiNotDisplayingMenuOrDialog ); + } + } + } } // ---------------------------------------------------------------------------- @@ -284,110 +261,49 @@ } // ---------------------------------------------------------------------------- -// CAiUiIdleIntegrationImpl::HandleSystemStateChange() -// ---------------------------------------------------------------------------- -// -TInt CAiUiIdleIntegrationImpl::HandleSystemStateChange( TAny* aPtr ) - { - __ASSERT_DEBUG( aPtr, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - CAiUiIdleIntegrationImpl* self = - static_cast( aPtr ); - - if( !self->iSystemStateOk ) - { - TInt state( 0 ); - - self->iSystemStateObserver->Get( state ); - - if ( state == ESwStateCriticalPhaseOK || - state == ESwStateNormalRfOn || - state == ESwStateNormalRfOff || - state == ESwStateNormalBTSap ) - { - self->iSystemStateOk = ETrue; - self->ActivateUI(); - } - } - - return KErrNone; - } - -// ---------------------------------------------------------------------------- -// CAiUiIdleIntegrationImpl::HandleUiStartupStateChange() -// ---------------------------------------------------------------------------- -// -TInt CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( TAny *aPtr ) - { - __ASSERT_DEBUG( aPtr, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); - - CAiUiIdleIntegrationImpl* self = - static_cast( aPtr ); - - if( !self->iUiStartupPhaseOk ) - { - TInt state( 0 ); - - self->iUiStartupStateObserver->Get( state ); - - if( state == EStartupUiPhaseAllDone ) - { - self->iUiStartupPhaseOk = ETrue; - - self->ActivateUI(); - } - } - - return KErrNone; - } - -// ---------------------------------------------------------------------------- // CAiUiIdleIntegrationImpl::HandleCallEvent() // ---------------------------------------------------------------------------- // TInt CAiUiIdleIntegrationImpl::HandleCallEvent( TAny* aPtr ) { __ASSERT_DEBUG( aPtr, - AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); CAiUiIdleIntegrationImpl* self = - static_cast( aPtr ); + static_cast< CAiUiIdleIntegrationImpl* >( aPtr ); TInt callStatus( EPSCTsyCallStateNone ); TInt err( self->iCallStatusObserver->Get( callStatus ) ); - if( err == KErrNone ) + if ( err == KErrNone ) { // Call ongoing => show bubble if not showing already TBool allowed = EFalse; - if( !self->iIncallBubbleAllowed && - self->iThisApplicationForeground && + if ( !self->iIncallBubbleAllowed && + self->iForeground && ( callStatus > EPSCTsyCallStateNone ) ) { allowed = ETrue; TRAP( err, self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); - - - if( err == KErrNone ) + + if ( err == KErrNone ) { self->iIncallBubbleAllowed = allowed; } } // No call ongoing => hide if bubble is visible - else if( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) + else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) { allowed = EFalse; TRAP( err, self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); - if( err == KErrNone ) + if ( err == KErrNone ) { self->iIncallBubbleAllowed = allowed; } @@ -397,5 +313,33 @@ return err; } -// End of file. +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::HandleUiStartupStateChange() +// ---------------------------------------------------------------------------- +// +TInt CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( TAny *aPtr ) + { + __ASSERT_DEBUG( aPtr, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + CAiUiIdleIntegrationImpl* self = + static_cast< CAiUiIdleIntegrationImpl* >( aPtr ); + if ( !self->iUiStartupPhaseOk ) + { + TInt state( 0 ); + + self->iUiStartupStateObserver->Get( state ); + + if ( state == EStartupUiPhaseAllDone ) + { + self->iUiStartupPhaseOk = ETrue; + + self->ActivateUI(); + } + } + + return KErrNone; + } + +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/idleint/aiuiidleintegrationimpl.h --- a/idlefw/src/idleint/aiuiidleintegrationimpl.h Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/idleint/aiuiidleintegrationimpl.h Wed May 12 13:36:47 2010 +0300 @@ -19,9 +19,13 @@ #ifndef C_AIUIIDLEINTEGRATIONIMPL_H #define C_AIUIIDLEINTEGRATIONIMPL_H +// System includes +#include + +// User includes #include "aiuiidleintegration.h" -#include +// Forward declarations class CActiveIdleState; class CAknIncallBubble; class MAiPSPropertyObserver; @@ -32,7 +36,8 @@ */ NONSHARABLE_CLASS( CAiUiIdleIntegrationImpl ) : public CAiUiIdleIntegration { -public: // constructor and destructor +public: + // constructor and destructor static CAiUiIdleIntegrationImpl* NewL( CEikonEnv& aEikEnv, const TAiIdleKeySoundConfig& aKeySoundConfig, @@ -40,65 +45,75 @@ ~CAiUiIdleIntegrationImpl(); -public: // new functions +public: + // new functions void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); -private: // constructors +private: + // constructors CAiUiIdleIntegrationImpl(CEikonEnv& aEikEnv, MAiFwEventHandler* aAiFwEventHandler); void ConstructL(const TAiIdleKeySoundConfig& aKeySoundConfig); -private: // new functions +private: + // new functions void ActivateUI(); void SetCallBubbleIfNeededL(); void ClearCallBubbleL(); - static TInt HandleSystemStateChange( TAny *aPtr ); - static TInt HandleUiStartupStateChange( TAny *aPtr ); static TInt HandleCallEvent( TAny *aPtr ); -private: // data - - CEikonEnv& iEikEnv; - CActiveIdleState* iActiveIdleState; - TBool iThisApplicationForeground; - TBool iIncallBubbleAllowed; - TInt iThisApplicationWgId; - TInt iEikonServerWgId; - CAknIncallBubble* iIncallBubble; + static TInt HandleUiStartupStateChange( TAny *aPtr ); + +private: + // data /** - * Observer for system state Publish&Subscribe key. - * Owned. + * EikonEnv + * Not owned */ - MAiPSPropertyObserver* iSystemStateObserver; - + CEikonEnv& iEikEnv; + /** - * Observer for system state Publish&Subscribe key. - * Owned. + * Active idle state + * Owned */ - MAiPSPropertyObserver* iUiStartupStateObserver; + CActiveIdleState* iActiveIdleState; + + /** + * Incall bubble + * Owned + */ + CAknIncallBubble* iIncallBubble; /** * Observer telephony state * Owned */ MAiPSPropertyObserver* iCallStatusObserver; + + /** + * Ui startup state + * Owned + */ + MAiPSPropertyObserver* iUiStartupStateObserver; + /** * Framework event handler. For notifying critical startup over. * Not owned. */ MAiFwEventHandler* iAiFwEventHandler; - TBool iSystemStateOk; - TBool iUiStartupPhaseOk; + TBool iForeground; + TBool iIncallBubbleAllowed; + TBool iUiStartupPhaseOk; }; - #endif // C_AIUIIDLEINTEGRATION_H +// End of file diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/utility/caiplugintool.cpp --- a/idlefw/src/utility/caiplugintool.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/utility/caiplugintool.cpp Wed May 12 13:36:47 2010 +0300 @@ -15,14 +15,29 @@ * */ +// System includes -#include +// User includes +#include + #include "caiplugintool.h" +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiPluginTool::CAiPluginTool +// +// ---------------------------------------------------------------------------- +// CAiPluginTool::CAiPluginTool() { } +// ---------------------------------------------------------------------------- +// CAiPluginTool::NewL +// +// ---------------------------------------------------------------------------- +// CAiPluginTool* CAiPluginTool::NewL() { CAiPluginTool* self = new ( ELeave ) CAiPluginTool(); @@ -32,59 +47,37 @@ return self; } +// ---------------------------------------------------------------------------- +// CAiPluginTool::ConstructL +// +// ---------------------------------------------------------------------------- +// void CAiPluginTool::ConstructL() { } +// ---------------------------------------------------------------------------- +// CAiPluginTool::Release +// +// ---------------------------------------------------------------------------- +// void CAiPluginTool::Release() { delete this; } - -const TAiPublisherInfo* CAiPluginTool::PublisherInfoL( - CAiContentPublisher& aContentPublisher ) + +// ---------------------------------------------------------------------------- +// CAiPluginTool::ContentItemIterator +// +// ---------------------------------------------------------------------------- +// +MAiContentItemIterator* CAiPluginTool::ContentItemIterator( + CHsContentPublisher& aContentPublisher, + CHsContentPublisher::TProperty aType ) { - const TAiPublisherInfo* result = NULL; - MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); - if ( propExt ) - { - result = propExt->PublisherInfoL(); - } - return result; + return static_cast< MAiContentItemIterator* >( + aContentPublisher.GetProperty( aType ) ); } -MAiContentItemIterator* CAiPluginTool::ContentItemIteratorL( - CAiContentPublisher& aContentPublisher, - TInt aContentType ) - { - MAiContentItemIterator* result = NULL; - MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); - if ( propExt ) - { - TAny* prop = NULL; - prop = propExt->GetPropertyL( aContentType ); - if ( prop ) - { - result = static_cast( prop ); - } - } - return result; - } - -MAiPropertyExtension* CAiPluginTool::PropertyExt( - CAiContentPublisher& aContentPublisher ) - { - return static_cast( - aContentPublisher.Extension( KExtensionUidProperty ) ); - } - -MAiEventHandlerExtension* CAiPluginTool::EventHandlerExt( - CAiContentPublisher& aContentPublisher ) - { - return static_cast( - aContentPublisher.Extension( KExtensionUidEventHandler ) ); - } - // End of File. - diff -r 2f40063dfb5c -r dbbebe55c824 idlefw/src/utility/caipspropertyobserver.cpp --- a/idlefw/src/utility/caipspropertyobserver.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/idlefw/src/utility/caipspropertyobserver.cpp Wed May 12 13:36:47 2010 +0300 @@ -38,7 +38,7 @@ CPSPropertyObserver::CPSPropertyObserver( TCallBack aCallBack, TUid aCategory, TInt aKey ) - : CActive( EPriorityStandard ), + : CActive( EPriorityHigh ), iCallBack( aCallBack ), iCategory( aCategory ), iKey( aKey ) diff -r 2f40063dfb5c -r dbbebe55c824 layers.sysdef.xml --- a/layers.sysdef.xml Wed Mar 03 15:38:34 2010 +0200 +++ b/layers.sysdef.xml Wed May 12 13:36:47 2010 +0300 @@ -16,13 +16,19 @@ - + + + + + + + diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/conf/s60mcs.confml Binary file menucontentsrv/conf/s60mcs.confml has changed diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/extinc/mcssathandler.h --- a/menucontentsrv/extinc/mcssathandler.h Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/extinc/mcssathandler.h Wed May 12 13:36:47 2010 +0300 @@ -21,7 +21,7 @@ #include -#include +#include #include #ifdef SIM_ATK_SERVICE_API_V1 #include // MCL diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/extsrc/mcsmenuiconutility.cpp --- a/menucontentsrv/extsrc/mcsmenuiconutility.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/extsrc/mcsmenuiconutility.cpp Wed May 12 13:36:47 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: The API supports requesting raw bitmaps -* Version : %version: 11 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: ou1s60ui#12 % << Don't touch! Updated by Synergy at check-out. * */ @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/group/mcsmenuhandler.mmp --- a/menucontentsrv/group/mcsmenuhandler.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/group/mcsmenuhandler.mmp Wed May 12 13:36:47 2010 +0300 @@ -32,6 +32,7 @@ SOURCE menuurlhandler.cpp SOURCE menuuninstalloperation.cpp SOURCE menulinkhandler.cpp +SOURCE menutasklist.cpp USERINCLUDE ../inc USERINCLUDE ../handlerinc @@ -56,6 +57,7 @@ LIBRARY cone.lib LIBRARY efsrv.lib LIBRARY avkon.lib +LIBRARY charconv.lib SOURCEPATH ../data START RESOURCE 200113DE.rss diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/group/mcsmenusrv.mmp --- a/menucontentsrv/group/mcsmenusrv.mmp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/group/mcsmenusrv.mmp Wed May 12 13:36:47 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: sa1spcx1#5.1.7 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: sa1spcx1#5.1.9 % << Don't touch! Updated by Synergy at check-out. * */ @@ -46,4 +46,3 @@ LIBRARY mcsmenuutils.lib - diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/handlerinc/menutasklist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlerinc/menutasklist.h Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef MENUTASKLIST_H +#define MENUTASKLIST_H + +// INCLUDES + +#include +#include + +// CLASS DECLARATION + +/** +* Class for finding out about running applications. +* +* This is a modification of the original CAknTaskList class, which +* differs in that it does not discriminate applications based on their +* window group priority. +* @since Series 60 3.0 +*/ +class CMenuTaskList : public CBase + { +public: + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CMenuTaskList + */ + static CMenuTaskList* NewL(RWsSession& aWsSession); + /** + * Factory function + * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() + * @return a new fully constructed instance of CMenuTaskList, which is on the cleanup stack + */ + static CMenuTaskList* NewLC(RWsSession& aWsSession); + /** + * Destructor. + */ + ~CMenuTaskList(); + + /** + * Refresh the window group array + */ + void UpdateListL(); + /** + * Accessor for the window group array + * @return an array containing the window groups of running applications. + */ + const RArray& WgArray() const; + + /** + * Find an application with the requested UID 3, which is running as a root application + * @param aAppUid the UID 3 of the target application. + * @return a TApaTask which refers to the running instance of the application. + * if the application is not running, the TApaTask's Exists() function will return EFalse. + */ + TApaTask FindRootApp(TUid aAppUid) const; + /** + * Query whether an application's window group is running as a root application. + * @param aWgId the window group identifier of the target application. + * @return ETrue if this window group is running as a root window group. + */ + TBool IsRootWindowGroup(TInt aWgId) const; + +private: + CMenuTaskList(RWsSession& aWsSession); + void ConstructL(); + +private: + RWsSession& iWs; + RArray iWgs; + }; + +#endif diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/handlerinc/menuuninstalloperation.h --- a/menucontentsrv/handlerinc/menuuninstalloperation.h Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/handlerinc/menuuninstalloperation.h Wed May 12 13:36:47 2010 +0300 @@ -21,6 +21,7 @@ #include #include +#include class RMenu; class CMenuItem; @@ -51,11 +52,11 @@ void ConstructL( CMenuItem& aItem ); - void AppInfoL( const TUid& aAppUid, TPtrC8& aMimeType, TUid& aPackageUid ); + void AppInfoL( const TUid& aAppUid, RBuf8& aMimeType, TUid& aPackageUid ); TBool GetInstallPkgUidL( const TDesC& aAppFullName, TUid& aPackageUid ); void GetJavaSuitUidL( const TUid& aAppUid, TUid& aPackageUid ); - TBool IsWidgetL( const TUid& aAppUid ); + TBool IsWidget( const TUid& aAppUid ); private: // from CActive @@ -73,6 +74,7 @@ } iState; SwiUI::RSWInstLauncher iUninstaller; CMenuOperation* iRemoveOperation; + RWidgetRegistryClientSession iWidgetRegistry; TInt iId; }; diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/handlersrc/menuapphandler.cpp --- a/menucontentsrv/handlersrc/menuapphandler.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/handlersrc/menuapphandler.cpp Wed May 12 13:36:47 2010 +0300 @@ -18,6 +18,7 @@ #include "mcsmenuitem.h" #include "menucompletedoperation.h" #include "menuuninstalloperation.h" +#include "menutasklist.h" #include #include @@ -26,7 +27,6 @@ #include #include #include -#include // ================= MEMBER FUNCTIONS ======================= @@ -158,9 +158,8 @@ User::LeaveIfError( wsSession.Connect() ); CleanupClosePushL( wsSession ); - TApaTaskList* taskList = new (ELeave) TApaTaskList( wsSession ); - TApaTask task = taskList->FindApp( aUid ); - + CMenuTaskList* taskList = CMenuTaskList::NewL( wsSession ); + TApaTask task = taskList->FindRootApp( aUid ); delete taskList; if ( task.Exists() ) diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/handlersrc/menutasklist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menutasklist.cpp Wed May 12 13:36:47 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +#include "menutasklist.h" + +CMenuTaskList* CMenuTaskList::NewL(RWsSession& aWsSession) + { + CMenuTaskList* self = NewLC(aWsSession); + CleanupStack::Pop(self); + return self; + } + +CMenuTaskList* CMenuTaskList::NewLC(RWsSession& aWsSession) + { + CMenuTaskList* self = new(ELeave) CMenuTaskList(aWsSession); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CMenuTaskList::CMenuTaskList(RWsSession& aWsSession) +: iWs(aWsSession) + { + } + +void CMenuTaskList::ConstructL() + { + UpdateListL(); + } + +CMenuTaskList::~CMenuTaskList() + { + iWgs.Close(); + } + +void CMenuTaskList::UpdateListL() + { + User::LeaveIfError(iWs.WindowGroupList(&iWgs)); + } + + +TApaTask CMenuTaskList::FindRootApp(TUid aAppUid) const + { + TApaTask task(iWs); + task.SetWgId(0); // initialise task to non-existant task + // wgId = 0 tells FindAppByUid to start looking for apps + TInt wgId=0; + FOREVER + { + CApaWindowGroupName::FindByAppUid(aAppUid, iWs, wgId); + // KErrNotFound means that no more apps can be found + if (wgId == KErrNotFound) + break; + if (IsRootWindowGroup(wgId)) + { + // Found a root wg with the right app UID, return it. + task.SetWgId(wgId); + break; + } + } + return task; + } + +TBool CMenuTaskList::IsRootWindowGroup(TInt aWgId) const + { + TInt count = iWgs.Count(); + for (TInt ii=0; ii #include #include -#include #include #include #include #include +#include #include "mcsdef.h" #include "mcsmenu.h" #include "mcsmenuitem.h" @@ -44,6 +44,7 @@ Cancel(); iUninstaller.Close(); delete iRemoveOperation; + iWidgetRegistry.Close(); } // --------------------------------------------------------- @@ -84,12 +85,12 @@ // void CMenuUninstallOperation::ConstructL( CMenuItem& aItem ) { + User::LeaveIfError( iWidgetRegistry.Connect() ); TBool exists; TPtrC uidAttr( aItem.GetAttributeL( KMenuAttrUid, exists ) ); TUint uid; TUid packageUid = KNullUid; - TPtrC8 mimeType; - + if( !exists ) { @@ -112,13 +113,16 @@ // Prepare parameters MenuUtils::GetTUint( uidAttr, uid ); + + RBuf8 mimeType; + mimeType.CleanupClosePushL(); AppInfoL( TUid::Uid( uid ), mimeType, packageUid ); // Commence the uninstallations iUninstaller.Uninstall( iStatus, packageUid, mimeType ); iObserverStatus = KRequestPending; if( mimeType == KMidletMimeType() - && IsWidgetL( TUid::Uid( uid ) ) ) + && IsWidget( TUid::Uid( uid ) ) ) { //we remove java type app(it will gain different uid //during next install) and widget type app(it MIGHT get @@ -131,7 +135,7 @@ //appscanner will hide it for later passible reinstallation iState = ERemoving; } - + CleanupStack::PopAndDestroy( &mimeType ); SetActive(); } @@ -139,7 +143,8 @@ // CMenuUninstallOperation::AppInfo // --------------------------------------------------------- // -void CMenuUninstallOperation::AppInfoL( const TUid& aAppUid, TPtrC8& aMimeType, TUid& aPackageUid ) +void CMenuUninstallOperation::AppInfoL( const TUid& aAppUid, + RBuf8& aMimeType, TUid& aPackageUid ) { TUid typeUid; RApaLsSession apaLsSession; @@ -152,12 +157,27 @@ typeUid == KMidletType ) { GetJavaSuitUidL( aAppUid, aPackageUid ); - aMimeType.Set( KMidletMimeType ); + User::LeaveIfError( aMimeType.Create( KMidletMimeType() ) ); } - else if( IsWidgetL( aAppUid ) ) + else if( IsWidget( aAppUid ) ) { aPackageUid = aAppUid; - aMimeType.Set( KWidgetMimeType ); + CWidgetPropertyValue* widgetProperty( iWidgetRegistry. + GetWidgetPropertyValueL( aAppUid, EMimeType ) ); + CleanupStack::PushL( widgetProperty ); + TPtrC mimeType( *widgetProperty ); + if (mimeType.Length() == 0) + { + User::LeaveIfError( aMimeType.Create( KWidgetMimeType() ) ); + } + else + { + HBufC8* mimeType8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( mimeType ); + CleanupStack::PushL( mimeType8 ); + User::LeaveIfError( aMimeType.Create( *mimeType8 ) ); + CleanupStack::PopAndDestroy( mimeType8 ); + } + CleanupStack::PopAndDestroy( widgetProperty ); } else { @@ -167,7 +187,7 @@ { aPackageUid = aAppUid; } - aMimeType.Set( KAppMimeType ); + User::LeaveIfError( aMimeType.Create( KAppMimeType() ) ); } CleanupStack::PopAndDestroy( &apaLsSession ); @@ -278,21 +298,10 @@ // --------------------------------------------------------- // -TBool CMenuUninstallOperation::IsWidgetL( const TUid& aAppUid ) - { - RWidgetRegistryClientSession widgetReg; - TBool isWidget; - - if( KErrNone != widgetReg.Connect() ) - { - return EFalse; - } - CleanupClosePushL( widgetReg); - isWidget = widgetReg.IsWidget( aAppUid ); - CleanupStack::PopAndDestroy( &widgetReg ); - - return isWidget; - } +TBool CMenuUninstallOperation::IsWidget( const TUid& aAppUid ) + { + return iWidgetRegistry.IsWidget( aAppUid ); + } // --------------------------------------------------------- // CMenuUninstallOperation::RunL diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/srvsrc/mcsrunningappswgmonitor.cpp --- a/menucontentsrv/srvsrc/mcsrunningappswgmonitor.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/srvsrc/mcsrunningappswgmonitor.cpp Wed May 12 13:36:47 2010 +0300 @@ -24,6 +24,9 @@ #include "mcsrunningappshandler.h" #include "menueng.h" +const TInt KWindowGroupPosition = -1; +const TInt KWindowGroupPriority = -1; + // --------------------------------------------------------- // CMcsRunningAppsWgMonitor::NewL // --------------------------------------------------------- @@ -91,9 +94,8 @@ iWg.DisableModifierChangedEvents(); iWg.DisableOnEvents(); iWg.DisableScreenChangeEvents(); - + iWg.SetOrdinalPosition( KWindowGroupPosition, KWindowGroupPriority ); User::LeaveIfError( iWg.EnableGroupListChangeEvents() ); - //it makes the soft keys working iWg.EnableReceiptOfFocus( EFalse ); diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/srvsrc/menusrvengutils.cpp --- a/menucontentsrv/srvsrc/menusrvengutils.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/srvsrc/menusrvengutils.cpp Wed May 12 13:36:47 2010 +0300 @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff -r 2f40063dfb5c -r dbbebe55c824 menucontentsrv/srvsrc/menusrvmain.cpp --- a/menucontentsrv/srvsrc/menusrvmain.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/menucontentsrv/srvsrc/menusrvmain.cpp Wed May 12 13:36:47 2010 +0300 @@ -16,7 +16,6 @@ */ // INCLUDE FILES - #include "menusrv.h" // ==================== LOCAL FUNCTIONS ==================== @@ -27,6 +26,5 @@ */ GLDEF_C TInt E32Main() { - TInt err = RunMenuServer(); - return err; + return RunMenuServer(); } diff -r 2f40063dfb5c -r dbbebe55c824 package_definition.xml --- a/package_definition.xml Wed Mar 03 15:38:34 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2f40063dfb5c -r dbbebe55c824 xcfw/src/xcfwlocalizer.cpp --- a/xcfw/src/xcfwlocalizer.cpp Wed Mar 03 15:38:34 2010 +0200 +++ b/xcfw/src/xcfwlocalizer.cpp Wed May 12 13:36:47 2010 +0300 @@ -159,9 +159,8 @@ do { lcstring.Num( (TInt64)langs[current] ); codelen = lcstring.Length()>1?lcstring.Length():KMinLangCodeLen; - locfile->Des().Copy( PathInfo::RomRootPath().Left( KPathStartLoc ) ); - locfile->Des().Append( filepath ); - locfile->Des().Format( locfile->Des(), codelen, langs[current] ); + locfile->Des().Format( filepath, codelen, langs[current] ); + locfile->Des().Insert( 0, PathInfo::RomRootPath().Left( KPathStartLoc ) ); current--; } while ( current >= 0 && !BaflUtils::FileExists( aFileSystem, locfile->Des() ) );