Revision: 201025 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 18:40:36 +0300
branchRCL_3
changeset 21 a7d8840c0b8c
parent 19 99b535de1dda
child 22 0f21a5ec0db7
Revision: 201025 Kit: 2010127
extras/about/data/about.rss
extras/about/group/bld.inf
extras/about/inc/AboutContainer.h
extras/about/inc/AboutImage.h
extras/about/loc/about.loc
extras/about/src/AboutContainer.cpp
extras/about/src/AboutImage.cpp
extras/calcsoft/src/CalcCont.cpp
extras/calcsoft/src/CalcFunc.cpp
--- a/extras/about/data/about.rss	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/data/about.rss	Thu Jul 15 18:40:36 2010 +0300
@@ -125,6 +125,12 @@
             {
             txt = r_about_legal_text_5;
             },
+#ifdef FF_VIDEO_AUDIO_BRANDING
+    	ABOUT_TEXT
+    		{
+    		txt = r_about_legal_text_193;
+    		},
+#endif
         ABOUT_TEXT
             {
 			txt = r_about_legal_text_6;
@@ -875,14 +881,6 @@
 			}
 		};
 	}
-
-RESOURCE ABOUT_SVGIMAGE r_about_svg_text
-    {  
-    svgid = EMbmAboutQgn_graf_s60_logo;       
-    svgmaskid = EMbmAboutQgn_graf_s60_logo_mask;   
-    height = 70;               
-    width = 46;
-    }
     
 RESOURCE TBUF r_about_legal_text_1   { buf = qtn_about_legal_text_1; }
 RESOURCE TBUF r_about_legal_text_2   { buf = qtn_about_legal_text_2; }
@@ -1076,6 +1074,7 @@
 RESOURCE TBUF r_about_legal_text_190  { buf = qtn_about_legal_text_190; }
 RESOURCE TBUF r_about_legal_text_191  { buf = qtn_about_legal_text_191; }
 RESOURCE TBUF r_about_legal_text_192  { buf = qtn_about_legal_text_192; }
+RESOURCE TBUF r_about_legal_text_193  { buf = qtn_about_legal_text_193; }
 
 RESOURCE LOCALISABLE_APP_INFO r_about_localisable_app_info
     {
--- a/extras/about/group/bld.inf	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/group/bld.inf	Thu Jul 15 18:40:36 2010 +0300
@@ -40,8 +40,7 @@
 OPTION TARGETFILE about.mif
 OPTION HEADERFILE about.mbg
 OPTION SOURCES -c8,8 qgn_menu_about_cxt\
-               -c8 qgn_graf_java_logo\
-               -c8,8 qgn_graf_s60_logo
+               -c8 qgn_graf_java_logo
 END
 
 START EXTENSION s60/mifconv
--- a/extras/about/inc/AboutContainer.h	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/inc/AboutContainer.h	Thu Jul 15 18:40:36 2010 +0300
@@ -96,6 +96,9 @@
         // Judge whether scroll bar is dragged. 
         TBool iScrollBarDragged;
         TInt iNumItem;
+        // Judge the break between "real" about box language and the full OSS texts 
+        TBool iBreakFlag;
+        TBool iIsSvg;
     };
 
 #endif
--- a/extras/about/inc/AboutImage.h	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/inc/AboutImage.h	Thu Jul 15 18:40:36 2010 +0300
@@ -39,7 +39,7 @@
     public: // Constructors and destructor
         
         static CAboutImage* NewLC( const TDesC& aFileName, TInt aBitmapId,
-                                   TInt aStartLine, TInt aBaseLineDelta );
+                                   TInt aStartLine, TInt aBaseLineDelta, TBool aTypeFlag );
 
         /**
         * Destructor
@@ -54,6 +54,7 @@
         TInt EndLine() const;
         TInt Lines() const;
         const CFbsBitmap* Bitmap() const;
+        const CFbsBitmap* BitmapMask() const;
 
     private: // private constructor
 
@@ -65,6 +66,7 @@
     private:  // Data
 
         CFbsBitmap* iBitmap; // owned
+        CFbsBitmap* iBitmapMask; //owned
         TInt iStartLine;
         TInt iEndLine;
     };
--- a/extras/about/loc/about.loc	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/loc/about.loc	Thu Jul 15 18:40:36 2010 +0300
@@ -49,7 +49,7 @@
 // d: Starts from a new line.
 // l: none
 //
-#define qtn_about_legal_text_3 "This product is based on Symbian^3 Edition software."
+#define qtn_about_legal_text_3 "This product is based on Symbian^3."
 
 // d: Nokia legal text
 // d: Starts from a new line.
@@ -1184,3 +1184,9 @@
 // l: none
 //
 #define qtn_about_legal_text_192 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+// d: Nokia legal text
+// d: Starts from a new line.
+// l: none
+//
+#define qtn_about_legal_text_193 "Manufactured under license from Dolby Laboratories. Dolby' and the 'double-D' symbol are trademarks of Dolby Laboratories. This product contains one or more programs protected under international and U.S. copyright laws as unpublished works. They are confidential and proprietary to Dolby Laboratories. The reproduction or disclosure, in whole or part, or the production of derivative works therefrom without the express permission of Dolby Laboratories is prohibited. Copyright 2003-2010 by Dolby Laboratories. All rights reserved."
--- a/extras/about/src/AboutContainer.cpp	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/src/AboutContainer.cpp	Thu Jul 15 18:40:36 2010 +0300
@@ -86,6 +86,8 @@
     CreateWindowL();
 
     iScrollBarDragged = EFalse;
+    iBreakFlag = EFalse;
+    iIsSvg = EFalse;
 	iSkinContext = NULL;
 	iText = NULL;
 	iImages = NULL;
@@ -228,17 +230,6 @@
             gc.BitBlt( position, image->Bitmap(), aRect );
             }
         }
-     /*   if(iCurrentScreen == 0)
-    {
-        TAknWindowLineLayout area = AknLayoutScalable_Apps::mce_icon_pane().LayoutLine();
- 	    TAknLayoutRect layoutRect;
- 	    TRect iconrect = Rect();
- 	    iconrect.iTl.iX = position.iX;
-	    layoutRect.LayoutRect(iconrect, area);
-  	    layoutRect.DrawImage(gc, iIcon->Bitmap(),iIcon->Mask());
-        
-    }*/
-
     }
 
 // -----------------------------------------------------------------------------
@@ -272,6 +263,17 @@
         {
         HBufC* line = (*wrappedArray)[i].AllocLC();
 
+		switch( aItem )
+			{
+			// The fourteen string's setting
+			case 14:
+				{
+				iBreakFlag = ETrue;
+				break;
+				}
+			default:
+				break;
+			}
         if(!line->Length())
             {
             iText->AppendL( NULL );
@@ -280,8 +282,29 @@
             }
         else
             {
-            iText->AppendL( line );
-            CleanupStack::Pop(line);  // line
+            if( iBreakFlag && ( numLines - 1 ) == i )
+            	{
+                iText->AppendL( line );
+                // Get the text's lines' count for set break
+                TInt textCount = iText->Count();
+                TInt count = iLinesPerScreen - ( textCount % ( iLinesPerScreen - 1 ) ) - 1;
+                if( iLinesPerScreen == count + 1 )
+                	{
+                	// When the last line has content, we should set count zero 
+                	count = 0;
+                	}
+                for( TInt j = 0; j < count; j++ )
+                	{
+                	iText->AppendL( NULL );
+                	}
+                CleanupStack::Pop( line );  // line
+                iBreakFlag = EFalse;
+            	}
+            else
+            	{
+                iText->AppendL( line );
+                CleanupStack::Pop( line );  // line
+            	}
             }
         }
 	iText->AppendL( NULL );
@@ -331,8 +354,9 @@
     {
     TInt firstLineOfImage( iText->Count() );
 
+    // If flag is ETrue, the file type is bmp 
     CAboutImage* image =
-    CAboutImage::NewLC( aFileName, aBitmapId, firstLineOfImage, iBaseLineDelta );
+    CAboutImage::NewLC( aFileName, aBitmapId, firstLineOfImage, iBaseLineDelta, ETrue );
 
     // new lines to make room for the picture
 
@@ -653,61 +677,13 @@
     TResourceReader reader;
     iEikonEnv->CreateResourceReaderLC( reader, R_ABOUT_MAIN_TEXT );
 #endif
-    
-    CFbsBitmap* bitmap,*mask;
-    bitmap = NULL;
-    mask= NULL;
-    TFileName bmpPath;
-    _LIT( KMbmFileName, "Z:about.mif" );
-
-    TParse* fpMbm = new(ELeave) TParse ();
-    fpMbm->Set ( KMbmFileName, &KDC_APP_BITMAP_DIR, NULL );
-    bmpPath.Copy( fpMbm ->FullName() );
-    delete fpMbm;
-    fpMbm=NULL;
-
-    TResourceReader readerSVG;                   
-    iEikonEnv->CreateResourceReaderLC( readerSVG, R_ABOUT_SVG_TEXT );
-    TInt svgId = readerSVG.ReadInt16();
-    TInt svgIdmask = readerSVG.ReadInt16();
-    TInt height = readerSVG.ReadInt16();
-    TInt width = readerSVG.ReadInt16();
-    CleanupStack::PopAndDestroy();      // readerSVG
-	  
-    MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
-    AknsUtils::CreateIconL( skinInstance, KAknsIIDQgnMenuSmsvoLst, bitmap, mask, bmpPath, svgId, svgIdmask );	
-    //AknsUtils::CreateIconL( skinInstance, KAknsIIDQgnMenuSmsvoLst, bitmap, bmpPath, EMbmAboutQgn_graf_java_logo );	
-    if ( iIcon )
-        {
-        delete( iIcon );
-        iIcon = NULL;
-        }
-    iIcon = CGulIcon::NewL( bitmap,mask );
-    
-    TRect rect1; 
-   	rect1.iTl.iX = 0;
-   	rect1.iTl.iY = 0;
-   	rect1.iBr.iX = height;
-   	rect1.iBr.iY = width;
-	  AknIconUtils::SetSize( iIcon->Bitmap(), rect1.Size() ); 
-	  AknIconUtils::SetSize( iIcon->Mask(), rect1.Size() );
-
-    TInt lines( bitmap->SizeInPixels().iHeight +
-                  KImageTopMargin + 
-                  KImageBottomMargin +
-                  ( iBaseLineDelta - 1 ) / iBaseLineDelta );
-
-/*        for(TInt i =0; i< 2; i++)
-		{
-		    iText->AppendL(NULL);    
-		}*/
+ 
     TInt NumItem( reader.ReadInt16() );
     iNumItem = NumItem;
 
     for ( TInt i = 0 ; i < iNumItem ; i++ )
         {
         TInt type = reader.ReadInt8();
-
         if ( type == EAboutTextItem )    
             { 
             HBufC* text;  
@@ -723,14 +699,28 @@
                 {
                 text = iEikonEnv->AllocReadResourceLC( reader.ReadInt32() );
                 }
-            SetTextL( *text , i );
-            CleanupStack::PopAndDestroy( text );
+			SetTextL( *text , i );
+			CleanupStack::PopAndDestroy( text );
             }
         else if ( type == EAboutImageItem )
             {
             TPtrC bitmapFile = reader.ReadTPtrC();
             TInt bitmapId = reader.ReadInt16();
-            SetImageL( bitmapFile, bitmapId );
+            if( iIsSvg )
+            	{
+            	TFileName svgPath;
+            	_LIT( KSvgFileName, "Z:about.mif" );
+            	TParse* fpSvg = new( ELeave ) TParse ();
+            	fpSvg->Set( KSvgFileName, &KDC_APP_BITMAP_DIR, NULL );
+            	svgPath.Copy( fpSvg ->FullName() );
+            	delete fpSvg;
+            	fpSvg = NULL;    
+            	SetImageL( svgPath, EMbmAboutQgn_graf_java_logo );
+            	}
+            else
+            	{
+            	SetImageL( bitmapFile, bitmapId );
+            	}
             }
         else
             {
--- a/extras/about/src/AboutImage.cpp	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/about/src/AboutImage.cpp	Thu Jul 15 18:40:36 2010 +0300
@@ -20,6 +20,18 @@
 #include <fbs.h>
 #include "AboutImage.h"
 #include <AknIconUtils.h>
+#include <aknenv.h>
+#include <AknUtils.h>
+#include <aknconsts.h>
+#include <AknBidiTextUtils.h>
+#include <AknsDrawUtils.h> 
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknsConstants.h>
+#include <AknDef.h>
+
+
+const TInt QtnJavaLogoWidth  = 46;
+const TInt QtnJavaLogoHeight = 70;
 
 // ================= MEMBER FUNCTIONS ==========================================
 
@@ -30,20 +42,32 @@
 CAboutImage::~CAboutImage()
     {
     delete iBitmap;
+    delete iBitmapMask;
     }
 
 CAboutImage* CAboutImage::NewLC( const TDesC& aFileName,
                                  TInt aBitmapId,
                                  TInt aStartLine,
-                                 TInt aBaseLineDelta )
+                                 TInt aBaseLineDelta,
+                                 TBool aTypeFlag )
     {
     CAboutImage* self = new( ELeave ) CAboutImage();
     CleanupStack::PushL( self );
 
-    /*self->iBitmap = new( ELeave ) CFbsBitmap;
-    self->iBitmap->Load( aFileName, aBitmapId );*/
-
+    if( aTypeFlag )
+    	{
+    	// bmp files
 	self->iBitmap  = AknIconUtils::CreateIconL(aFileName, aBitmapId );
+    	}
+    else
+    	{
+    	// svg files
+    	MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
+    	AknsUtils::CreateIconL( skinInstance, KAknsIIDQgnMenuSmsvoLst, self->iBitmap, self->iBitmapMask, 
+					aFileName, aBitmapId, aBitmapId + 1 );
+    	AknIconUtils::SetSize( self->iBitmap, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
+    	AknIconUtils::SetSize( self->iBitmapMask, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
+    	}
     self->iStartLine = aStartLine;
 
     // enough lines so that image and margins fit in them.
@@ -111,4 +135,12 @@
     return iBitmap;
     }
 
+// -----------------------------------------------------------------------------
+// CAboutImage::BitmapMask()
+// -----------------------------------------------------------------------------
+
+const CFbsBitmap* CAboutImage::BitmapMask() const
+	{
+	return iBitmapMask;
+	}
 // End of File  
--- a/extras/calcsoft/src/CalcCont.cpp	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/calcsoft/src/CalcCont.cpp	Thu Jul 15 18:40:36 2010 +0300
@@ -679,7 +679,9 @@
             aKeyEvent.iScanCode != EStdKeyRightArrow &&
             aKeyEvent.iScanCode != EStdKeyUpArrow &&
             aKeyEvent.iScanCode != EStdKeyDownArrow &&
-            aKeyEvent.iCode != EKeyOK)
+            aKeyEvent.iCode != EKeyOK &&
+            aKeyEvent.iCode != EKeyEnter &&
+            aKeyEvent.iScanCode != EStdKeyEnter )
                 {
                 iFuncmapPane->NotifyOtherThanOkKeyPressed();
                 }
--- a/extras/calcsoft/src/CalcFunc.cpp	Mon Jun 21 15:42:09 2010 +0300
+++ b/extras/calcsoft/src/CalcFunc.cpp	Thu Jul 15 18:40:36 2010 +0300
@@ -374,7 +374,7 @@
         
     //Get the selected button
     CAknButton* button = (CAknButton*)aControl;
-    
+
     for ( TInt i = 0; i < KCountOfButtons; ++i )
         {
         if ( button == iButtons[i] )
@@ -385,6 +385,13 @@
             //break;
             }
         }    
+
+    // Check if the button has been pressed.
+    CAknButtonState* state = button->State(EnNormal);
+    if ( aEventType == EEventStateChanged && state->Flags() == EnNormal )
+        {
+        iInputData = ETrue;
+        }
     
     if ( !button->IsDimmed() )
         {
@@ -413,9 +420,11 @@
             }
             else
             {
-             if ( iIsKeyLongPress )
+            // Input data if the button has been pressed or long pressed.
+            if ( iInputData || iIsKeyLongPress )
                 {
                 iContainer->View()->HandleCommandL(KButtonsIdTblTouch[iSelected]);
+                iInputData = EFalse;
                 }
             }   
 
@@ -857,11 +866,24 @@
     }
     else if (aType == EEventKeyDown)
     {
-        iIsOfferKeyEvent = ETrue;        
+    iIsOfferKeyEvent = ETrue; 
+    // If the enter key has been pressed, set the button and input data.
+    if ( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iScanCode == EStdKeyEnter )
+        {
+        exitCode = EKeyWasConsumed;
+        HandleMiddleSoftKeyOREKeyOKL();
+        iShiftKeyPressed = EPtiCaseLower;
+        return exitCode;
+        }       
     }
     else if (aType == EEventKeyUp)
     {
-        iIsOfferKeyEvent = EFalse;        
+    iIsOfferKeyEvent = EFalse;
+    // Release the button when enter key released.
+    if ( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iScanCode == EStdKeyEnter )
+        {
+        NotifyReleaseKeyL();
+        }
     }
     
    
@@ -920,7 +942,8 @@
             NULL,
             _L(""),
             _L(""),
-            0,
+            // Report the observer when the button recieve the key down event.
+            KAknButtonReportOnKeyDown, 
             0
             );     
             
@@ -935,7 +958,8 @@
             NULL,
             _L(""),
             _L(""),
-            0,
+            // Report the observer when the button recieve the key down event.
+            KAknButtonReportOnKeyDown,
             0
             );     
             /*if((count == ESqrtButton) && !iIsChangeSignDimmed)
@@ -1163,6 +1187,7 @@
 
     if( aOldId != aNewId )
         {
+        button->SetFocus( EFalse, EDrawNow );
         button = iButtons[aNewId];        
         }
     }
@@ -1197,7 +1222,7 @@
         button->SetFocus( EFalse, EDrawNow );      
         button = iButtons[aNewId];        
         button->SetFocus( ETrue, EDrawNow );
-        }
+        }  
     }
 // ---------------------------------------------------------
 // CCalcFuncmapSubPane::SetLayout
@@ -1649,11 +1674,28 @@
             {
             RedrawHighlight( oldSelect, iSelected );
             }
-        if( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        else
             {
-            iContainer->View()->HandleCommandL(KButtonsIdTblTouch[iSelected]);
-            iInputData = ETrue;
+            //when user drag outside of button,the Button Up event is missed always.
+            //Because the pointer is out of the button and it can't get the pointer
+            //event any more. We simulate the button up event to release the button
+            //when user drag out of button
+            if( aPointerEvent.iType == TPointerEvent::EDrag )
+                {
+                TPointerEvent event = aPointerEvent;
+                event.iType = TPointerEvent::EButton1Up;
+                iInputData = EFalse;
+                if( iErrorCode != KErrNone )
+                   {
+                   ErrorMsgL( iErrorCode );
+                   iErrorCode = KErrNone;
+                   }
+                CCoeControl::HandlePointerEventL( event );
+                return;
+                }
             }
+
+
         if( aPointerEvent.iType == TPointerEvent::EButton1Up )
             {
             iInputData = EFalse;
@@ -1764,24 +1806,21 @@
 
 void CCalcFuncmapSubPane::HandleMiddleSoftKeyOREKeyOKL()
    {
-         //get the selected button id
-        CAknButton* button = iButtons[iSelected];
-        //put the button in the pressed state
-        CAknButtonState* state = button->State(EnNormal);
-        //Put the button in pressed state
-        
-        TKeyEvent aKeyEvent;
-        aKeyEvent.iScanCode = EStdKeyEnter;
-        TEventCode aType = EEventKeyDown;
-        button->OfferKeyEventL(aKeyEvent,aType);
-        //put to pressed state
-        state->SetFlags(EnPressed);
-        button->DrawNow();
-        
-        if(!iIsOfferKeyEvent)
-        {
-            NotifyReleaseKeyL();
-        }
+     //get the selected button id
+    CAknButton* button = iButtons[iSelected];
+    //put the button in the pressed state
+    CAknButtonState* state = button->State(EnNormal);
+    //Put the button in pressed state
+    
+    TKeyEvent aKeyEvent;
+    aKeyEvent.iScanCode = EStdKeyEnter;
+    TEventCode aType = EEventKeyDown;
+    button->OfferKeyEventL(aKeyEvent,aType);
+
+    //put to pressed state
+    state->SetFlags(EnPressed);
+    button->DrawNow();
+
    }
    
 // ---------------------------------------------------------