atext/server/src/atextmetadata.cpp
branchRCL_3
changeset 22 786b94c6f0a4
parent 16 9f17f914e828
child 23 5b153be919d4
equal deleted inserted replaced
21:14e240312f6f 22:786b94c6f0a4
  2047         CreateSelfReplyData( aMessage );
  2047         CreateSelfReplyData( aMessage );
  2048         CleanupStack::PopAndDestroy();
  2048         CleanupStack::PopAndDestroy();
  2049         TRACE_FUNC_EXIT
  2049         TRACE_FUNC_EXIT
  2050         return;
  2050         return;
  2051         }
  2051         }
  2052     TATExtEntrySupport entrySupport( aAtCmdFull, aMessage, support );
  2052     TATExtEntrySupport entrySupport( aAtCmdFull,
       
  2053                                      const_cast<RMessage2&>(aMessage),
       
  2054                                      support );
  2053     TInt i;
  2055     TInt i;
  2054     aComplInfo.iProcessed = EFalse;
  2056     aComplInfo.iProcessed = EFalse;
  2055     TInt count = support->Count();
  2057     TInt count = support->Count();
  2056     for ( i=0; i<count; i++ )
  2058     for ( i=0; i<count; i++ )
  2057         {
  2059         {
  2139     // If HandleCommand() is implemented synchronously, the command must be
  2141     // If HandleCommand() is implemented synchronously, the command must be
  2140     // saved before executing as CompleteCommandMessage() closes the string
  2142     // saved before executing as CompleteCommandMessage() closes the string
  2141     HBufC8* atCmdFull = HBufC8::NewMaxLC( aEntrySupport.iAtCmdFull.Length() );
  2143     HBufC8* atCmdFull = HBufC8::NewMaxLC( aEntrySupport.iAtCmdFull.Length() );
  2142     TPtr8 atCmdFullPtr = atCmdFull->Des();
  2144     TPtr8 atCmdFullPtr = atCmdFull->Des();
  2143     atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
  2145     atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
       
  2146     // First send the entry to the observers
       
  2147     TATExtEntrySupport handleCommandEntry = aEntrySupport;
       
  2148     aEntrySupport.iStartIndex = aStartIndex;
       
  2149     SendToMultipleObserverL( aEntrySupport, atCmdFull );
       
  2150     aEntrySupport = handleCommandEntry;
  2144     // Now execute the HandleCommand()
  2151     // Now execute the HandleCommand()
  2145     iCmdData.iReplyExpected = ETrue;  // Set before HandleCommandL()
  2152     iCmdData.iReplyExpected = ETrue;  // Set before HandleCommandL()
  2146     HandleCommandL( aEntrySupport, ETrue );
  2153     HandleCommandL( aEntrySupport, ETrue );
  2147     aEntrySupport.iStartIndex = aStartIndex;
       
  2148     SendToMultipleObserverL( aEntrySupport, atCmdFull );
       
  2149     CleanupStack::PopAndDestroy( atCmdFull );
  2154     CleanupStack::PopAndDestroy( atCmdFull );
  2150     aReplyExpected = ETrue;
  2155     aReplyExpected = ETrue;
  2151     TRACE_FUNC_EXIT
  2156     TRACE_FUNC_EXIT
  2152     return ETrue;
  2157     return ETrue;
  2153     }
  2158     }
  2185         // saved before executing as CompleteCommandMessage() closes the string
  2190         // saved before executing as CompleteCommandMessage() closes the string
  2186         HBufC8* atCmdFull = HBufC8::NewMaxLC( aEntrySupport.iAtCmdFull.Length() );
  2191         HBufC8* atCmdFull = HBufC8::NewMaxLC( aEntrySupport.iAtCmdFull.Length() );
  2187         TPtr8 atCmdFullPtr = atCmdFull->Des();
  2192         TPtr8 atCmdFullPtr = atCmdFull->Des();
  2188         atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
  2193         atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
  2189         // Now execute the HandleCommand()
  2194         // Now execute the HandleCommand()
       
  2195         SendToMultipleObserverL( nextSupport, atCmdFull );
  2190         HandleCommandL( aEntrySupport, EFalse );
  2196         HandleCommandL( aEntrySupport, EFalse );
  2191         SendToMultipleObserverL( nextSupport, atCmdFull );
       
  2192         CleanupStack::PopAndDestroy( atCmdFull );
  2197         CleanupStack::PopAndDestroy( atCmdFull );
  2193         }
  2198         }
  2194     else
  2199     else
  2195         {
  2200         {
  2196         // No entry found; send one with reply request
  2201         // No entry found; send one with reply request
  2725             }
  2730             }
  2726         }
  2731         }
  2727     TRACE_FUNC_EXIT
  2732     TRACE_FUNC_EXIT
  2728     return KErrNone;
  2733     return KErrNone;
  2729     }
  2734     }
       
  2735 
       
  2736 // ---------------------------------------------------------------------------
       
  2737 // Assignment operator for ease of usage
       
  2738 // ---------------------------------------------------------------------------
       
  2739 //
       
  2740 TATExtEntrySupport& TATExtEntrySupport::operator=( TATExtEntrySupport& aEntrySupport )
       
  2741     {
       
  2742     if ( &aEntrySupport == this )
       
  2743         {
       
  2744         return aEntrySupport;
       
  2745         }
       
  2746     iAtCmdFull = aEntrySupport.iAtCmdFull;
       
  2747     iMessage = aEntrySupport.iMessage;
       
  2748     iSupport = aEntrySupport.iSupport;
       
  2749     iEntry = aEntrySupport.iEntry;
       
  2750     iStartIndex = aEntrySupport.iStartIndex;
       
  2751     iSupportFound = aEntrySupport.iSupportFound;
       
  2752     return *this;
       
  2753     }