breakdeps/SVGEngineImpl.cpp
author William Roberts <williamr@symbian.org>
Fri, 12 Nov 2010 16:39:06 +0000
changeset 122 bbbba97ac260
parent 56 865fbeda552a
permissions -rw-r--r--
Mark econseik.dll as "In", to support eshell and other console-based test code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     1
/*
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     8
*
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    11
*
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    12
* Contributors:
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    13
*
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    14
* Description:  SVG Engine source file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    15
 *
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    16
*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    17
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    18
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    19
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    20
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    21
#if !defined(__E32BASE_H__)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    22
#include <e32base.h>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    23
#endif
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    24
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    25
#include <utf.h>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    26
#include <s32mem.h>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    27
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    28
#include "SVGDOMImplementationImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    29
#include "SVGElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    30
#include "SVGDocumentImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    31
#include "SVGSvgElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    32
#include "SVGUseElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    33
#include "SVGAnimationElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    34
#include "SVGTextElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    35
56
865fbeda552a Create stem_SVGEngine.dll, which breaks the dependency on mediaclientaudio.dll
William Roberts <williamr@symbian.org>
parents: 54
diff changeset
    36
//#include "SVGAudioElementImpl.h"
48
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    37
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    38
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    39
#include "Gfx2dGcOpenVG.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    40
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    41
#include "SVGSchemaData.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    42
#include "SVGPathElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    43
#include "SVGAnimationBase.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    44
#include "SVGElementTimeControl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    45
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    46
#include "SVGRequestObserver.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    47
#include "SVGHyperlinkListener.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    48
#include "SVGListener.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    49
#include "SVGAnimationListener.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    50
#include "SVGAElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    51
#include "SVGTextAreaElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    52
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    53
#include "SVGTimer.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    54
#include "SVGEventHandler.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    55
#include "SVGEngineImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    56
#include "SVGErrorImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    57
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    58
#include "SVGFloatCssValueImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    59
#include "SVGTimeContainer.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    60
#include "SVGMediaAnimationElementImpl.h"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    61
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    62
// Constants
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    63
// length of </text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    64
const TInt KClosingTextTagLength = 7;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    65
// Length of </textArea>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    66
const TInt KClosingTextAreaTagLength = 11;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    67
// Length of <
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    68
const TInt KClosingBracesLength = 1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    69
// Number of chars to be converted at a time to Unicode
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    70
const TInt KMaxConversionChars = 20;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    71
_LIT(KClosingTextTag,"</text>");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    72
_LIT(KClosingTextAreaTag,"</textArea>");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    73
_LIT(KClosingBraces,">");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    74
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    75
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    76
// Two phase constructor for this class
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    77
// JSR 226 API
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    78
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    79
CSvgEngineImpl* CSvgEngineImpl::NewL(CSvgBitmapFontProvider *aSvgBitmapFontProvider)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    80
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    81
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    82
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    83
    self->ConstructL(aSvgBitmapFontProvider);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    84
    CleanupStack::Pop();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    85
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    86
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    87
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    88
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    89
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    90
// CSvgEngineImpl* CSvgEngineImpl::NewLC()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    91
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    92
CSvgEngineImpl* CSvgEngineImpl::NewLC(CSvgBitmapFontProvider *aSvgBitmapFontProvider)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    93
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    94
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    95
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    96
    self->ConstructL(aSvgBitmapFontProvider);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    97
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    98
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
    99
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   100
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   101
// CSvgEngineImpl::CSvgEngineImpl() : iTextAreaHandle( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   102
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   103
CSvgEngineImpl::CSvgEngineImpl() : iTextAreaHandle( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   104
                                   iRequestObserver( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   105
                                   iFrameBuffer( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   106
                                   iFrameBufferSize(TSize(0,0)),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   107
                                   iFontHashMap ( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   108
                                   iSvgDocument( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   109
                                   iBackgroundColor(0x00000000),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   110
                                   iShowDebugInfo( EFalse ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   111
                                   iSvgEngineState(ESVGEngineNotStarted),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   112
                                   iTimeoutSeconds( 0 ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   113
                                   iRenderQuality(2), // Set To Rendering quality "high"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   114
                                   iCustomOption( ETrue ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   115
                                   iFrameBufferOverridesViewport( EFalse ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   116
                                   iClientDefinedViewPort(EFalse)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   117
                                   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   118
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   119
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   120
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   121
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   122
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   123
// void CSvgEngineImpl::ConstructL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   124
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   125
void CSvgEngineImpl::ConstructL(CSvgBitmapFontProvider *aSvgBitmapFontProvider)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   126
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   127
    iGfxContext = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   128
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   129
	iSvgBitmapFontProvider = aSvgBitmapFontProvider ; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   130
    // create CSvgErrorImpl object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   131
    iSvgError = CSvgErrorImpl::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   132
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   133
    iFontHashMap = CSvgFontHashMap::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   134
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   135
    SetIgnoreUpdateScreen( EFalse );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   136
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   137
   // The iCustomOption need to be initialized for JSR
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   138
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   139
	iCustomOption = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   140
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   141
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   142
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   143
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   144
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   145
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   146
// Two phase constructor for this class
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   147
// Accepts a frame buffer and a MSvgRequestObserver object from the client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   148
// Buffer is used for rasterization of SVG content
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   149
// Observer object, if provided, is used for notifying the client on updates
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   150
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   151
CSvgEngineImpl* CSvgEngineImpl::NewL( CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   152
                                      MSvgRequestObserver* aReqObserver, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   153
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   154
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl( aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   155
                                                             aReqObserver );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   156
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   157
    self->ConstructL(aFontSpec, aSvgBitmapFontProvider);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   158
    CleanupStack::Pop();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   159
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   160
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   161
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   162
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   163
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   164
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   165
// Two phase constructor for this class
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   166
// Accepts a frame buffer and a MSvgRequestObserver object from the client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   167
// Buffer is used for rasterization of SVG content
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   168
// Observer object, if provided, is used for notifying the client on updates
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   169
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   170
CSvgEngineImpl* CSvgEngineImpl::NewLC( CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   171
                                       MSvgRequestObserver* aReqObserver, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   172
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   173
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl( aFrameBuffer, aReqObserver );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   174
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   175
    self->ConstructL(aFontSpec, aSvgBitmapFontProvider);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   176
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   177
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   178
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   179
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   180
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   181
// Symbian style private method that is used to construct heap objects
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   182
// Builds the Graphics device objects with the client's frame buffer info
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   183
// Builds the event handler object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   184
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   185
void CSvgEngineImpl::ConstructL( TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   186
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   187
    iBitmapFontSpec = aFontSpec;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   188
// iGfxContext is created through CSvgEngineInterfaceImpl::ConstructL
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   189
   // iGfxContext = CGfx2dGcVGR::NewL( iFrameBuffer->SizeInPixels(), iBitmapFontSpec );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   190
    iSvgBitmapFontProvider = aSvgBitmapFontProvider ; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   191
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   192
    iGfxContext = CGfx2dGcOpenVG::NewL( iFrameBuffer->SizeInPixels(), iBitmapFontSpec, iSvgBitmapFontProvider );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   193
    // create CSvgErrorImpl object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   194
    iSvgError = CSvgErrorImpl::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   195
    iFontHashMap = CSvgFontHashMap::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   196
    iSvgNames = new (ELeave) CDesC16ArrayFlat(5);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   197
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   198
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   199
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   200
CSvgEngineImpl* CSvgEngineImpl::NewL( CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   201
                                      MSvgRequestObserver* aReqObserver, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider ,SVGRendererId aRendererType)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   202
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   203
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl( aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   204
                                                             aReqObserver );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   205
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   206
    self->ConstructL(aFontSpec, aSvgBitmapFontProvider,aRendererType);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   207
    CleanupStack::Pop();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   208
	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   209
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   210
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   211
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   212
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   213
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   214
// Two phase constructor for this class
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   215
// Accepts a frame buffer and a MSvgRequestObserver object from the client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   216
// Buffer is used for rasterization of SVG content
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   217
// Observer object, if provided, is used for notifying the client on updates.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   218
//This contains the renderer selector parameter
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   219
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   220
CSvgEngineImpl* CSvgEngineImpl::NewLC( CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   221
                                       MSvgRequestObserver* aReqObserver, TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   222
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   223
    CSvgEngineImpl* self    = new ( ELeave ) CSvgEngineImpl( aFrameBuffer, aReqObserver );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   224
    CleanupStack::PushL( self );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   225
    self->ConstructL(aFontSpec, aSvgBitmapFontProvider,aRendererType);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   226
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   227
    return self;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   228
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   229
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   230
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   231
// Symbian style private method that is used to construct heap objects
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   232
// Builds the Graphics device objects with the client's frame buffer info
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   233
// Builds the event handler object.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   234
//This contains the renderer selector parameter NGA
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   235
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   236
void CSvgEngineImpl::ConstructL( TFontSpec& aFontSpec, CSvgBitmapFontProvider* aSvgBitmapFontProvider,SVGRendererId aRendererType)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   237
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   238
    iBitmapFontSpec = aFontSpec;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   239
// iGfxContext is created through CSvgEngineInterfaceImpl::ConstructL
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   240
   // iGfxContext = CGfx2dGcVGR::NewL( iFrameBuffer->SizeInPixels(), iBitmapFontSpec );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   241
    iSvgBitmapFontProvider = aSvgBitmapFontProvider ; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   242
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   243
    iGfxContext = CGfx2dGcOpenVG::NewL( iFrameBufferSize, iBitmapFontSpec, iSvgBitmapFontProvider ,aRendererType);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   244
    // create CSvgErrorImpl object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   245
    iSvgError = CSvgErrorImpl::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   246
    iFontHashMap = CSvgFontHashMap::NewL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   247
    iSvgNames = new (ELeave) CDesC16ArrayFlat(5);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   248
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   249
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   250
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   251
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   252
// Private constructor
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   253
// Initializes private attributes
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   254
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   255
CSvgEngineImpl::CSvgEngineImpl( CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   256
                                MSvgRequestObserver* aReqObserver ) : iTextAreaHandle( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   257
                                                                      iRequestObserver( aReqObserver ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   258
                                                                      iFrameBuffer( aFrameBuffer ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   259
                                                                      iFrameBufferSize(TSize(0,0)),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   260
                                                                      iFontHashMap ( NULL),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   261
                                                                      iSvgDocument( NULL ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   262
                                                                      iBackgroundColor(0x00000000),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   263
                                                                      iShowDebugInfo( EFalse ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   264
                                                                      iSvgEngineState(ESVGEngineNotStarted),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   265
                                                                      iCustomOption( ETrue ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   266
                                                                      iFrameBufferOverridesViewport( EFalse )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   267
                                                                      
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   268
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   269
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   270
        if(aFrameBuffer && aFrameBuffer->Handle()>0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   271
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   272
                iFrameBufferSize = aFrameBuffer->SizeInPixels();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   273
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   274
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   275
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   276
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   277
// Destructor
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   278
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   279
CSvgEngineImpl::~CSvgEngineImpl()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   280
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   281
    Destroy();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   282
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   283
    if ( iFontHashMap )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   284
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   285
		delete iFontHashMap;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   286
		iFontHashMap = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   287
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   288
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   289
	iSvgTextBoundingBoxes.ResetAndDestroy();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   290
	iSvgTextBoundingBoxes.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   291
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   292
    if ( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   293
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   294
        delete iGfxContext;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   295
        iGfxContext = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   296
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   297
    if ( iSvgError )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   298
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   299
        delete iSvgError;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   300
        iSvgError = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   301
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   302
    if (iTextAreaHandle)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   303
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   304
    delete iTextAreaHandle;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   305
    iTextAreaHandle = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   306
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   307
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   308
    iTextAreaListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   309
    iTextListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   310
    iHyperlinkListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   311
    iAnimationListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   312
    iSvgMouseListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   313
    iInteractiveElementListeners.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   314
    delete iSvgNames;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   315
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   316
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   317
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   318
// Draws aRootElement and calls itself for children.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   319
// Handles switch element differently, as it only draws one of its children.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   320
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   321
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   322
void CSvgEngineImpl::DrawElementsL( CSvgElementImpl* aRootElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   323
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   324
    if ( aRootElement != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   325
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   326
        TInt32 displayValue = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   327
        //  while we have next elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   328
        CSvgElementImpl* newElement = aRootElement;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   329
        while( newElement != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   330
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   331
		    if(newElement->GetAttributeIntL( KCSS_ATTR_DISPLAY, displayValue ) == KErrNoAttribute)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   332
		        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   333
		        newElement = ( CSvgElementImpl* ) newElement->FirstChild();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   334
		        while ( newElement != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   335
		            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   336
		            DrawElementsL( newElement );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   337
		            newElement = ( CSvgElementImpl * ) newElement->NextSibling();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   338
		            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   339
		            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   340
		         }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   341
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   342
            if(displayValue != KDisplayEnumNone) // is it a hidden element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   343
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   344
                CCssValue*  CssValue = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   345
                TReal32 opacity = 1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   346
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   347
                // check visisbility
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   348
                TInt32  visbilityValue = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   349
                TInt visibility = newElement->GetAttributeIntL( KCSS_ATTR_VISIBILITY, visbilityValue );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   350
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   351
                newElement->FindProperty( KCSS_ATTR_GROUP_OPACITY, CssValue, newElement );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   352
                if ( CssValue )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   353
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   354
                    opacity = ((CFloatCssValueImpl*)CssValue)->Value();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   355
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   356
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   357
                if( opacity != 1 && !newElement->IsInherited( KCSS_ATTR_GROUP_OPACITY ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   358
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   359
                    iGfxContext->BindToImageL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   360
                    // Group opacity
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   361
                    if ( newElement->ElemID() == KSvgGElement && newElement->FirstChild() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   362
                        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   363
                        // recurse with right context.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   364
                        DrawElementsL( ( CSvgElementImpl* )newElement->FirstChild());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   365
                        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   366
                    // Element opacity
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   367
                    else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   368
                        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   369
                        TBool canDraw = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   370
                        if( (visibility == KErrNone) && (visbilityValue == 0) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   371
                            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   372
                            canDraw = newElement->DrawL( iGfxContext, NULL ) ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   373
                             }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   374
                        if( canDraw && newElement->FirstChild() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   375
                            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   376
                            DrawElementsL( ( CSvgElementImpl* )newElement->FirstChild() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   377
                            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   378
                        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   379
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   380
                    // Blend opacity context buffer with parent's gfx context buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   381
                    iGfxContext->UnbindFromImageL( opacity );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   382
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   383
                else // no opacity or is inherited from above....
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   384
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   385
                    TBool canDraw = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   386
                    if( (visibility == KErrNone) && (visbilityValue == 0) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   387
                        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   388
                        canDraw = newElement->DrawL(iGfxContext, NULL );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   389
                        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   390
                    if( canDraw && newElement->FirstChild() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   391
                        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   392
                        DrawElementsL( ( CSvgElementImpl* )newElement->FirstChild());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   393
                        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   394
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   395
				}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   396
            newElement = ( CSvgElementImpl * )newElement->NextSibling();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   397
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   398
            }// end while....
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   399
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   400
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   401
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   402
//--------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   403
//CFbsBitmap* CSvgEngineImpl::CreateOpacityFrameBufferL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   404
//--------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   405
CFbsBitmap* CSvgEngineImpl::CreateOpacityFrameBufferL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   406
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   407
    CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   408
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   409
    if ( iFrameBuffer != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   410
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   411
/*NGA reverse*/if ( bitmap->Create( iFrameBufferSize, EColor16MU ) != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   412
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   413
            delete bitmap;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   414
            bitmap = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   415
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   416
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   417
    return bitmap;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   418
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   419
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   420
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   421
// Copy 32-bit buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   422
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   423
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   424
void CSvgEngineImpl::CopyBuffer( TUint32* aSrc, TUint32* aDest, const TSize aSize )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   425
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   426
    if ( aSrc && aDest )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   427
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   428
        Mem::Copy( aDest, aSrc, aSize.iWidth * aSize.iHeight * sizeof( TUint32 ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   429
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   430
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   431
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   432
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   433
// Positions the root element and calls itself (recursively) for all the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   434
// descendant elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   435
// CTM stands for 'Current Transformation Matrix'.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   436
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   437
void CSvgEngineImpl::UpdateCTM(CSvgDocumentImpl* aSvgDocument)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   438
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   439
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   440
    if (aSvgDocument)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   441
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   442
        ((CSvgElementImpl*)aSvgDocument->RootElement())->UpdateCTM();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   443
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   444
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   445
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   446
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   447
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   448
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   449
// Initializes the SVG Engine primarily with width and height informtion
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   450
// This is based on the attribute specifications for the root 'svg' element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   451
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   452
void CSvgEngineImpl::InitializeEngineL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   453
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   454
    // VIEWBOX
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   455
    // If x, y, w, h of outmost svg not defined, then put default values: 0 0 100% 100%
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   456
    // return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   457
    // Set locale, so that there is no thousands separator
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   458
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   459
    if( !iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   460
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   461
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   462
    iSvgDocument->iInitialDrawFlag = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   463
    if(!((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iIsWidthSet)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   464
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   465
        ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iIsWidthSet = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   466
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   467
    if(!((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iIsHeightSet)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   468
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   469
        ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iIsHeightSet = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   470
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   471
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   472
    TLocale locale; // locale object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   473
    locale.SetCurrencyTriadsAllowed( EFalse ); // change setting
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   474
    TSize   lSize   = GetSize();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   475
    iSvgDocument->iReqExReqFtrSysLTested = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   476
    if ( iSvgDocument->RootElement() != NULL &&
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   477
         ((CSvgElementImpl*)iSvgDocument->RootElement())->ElemID() == KSvgSvgElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   478
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   479
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   480
        // Scale width & height to fit to screen size
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   481
        CSvgSvgElementImpl*     el      = ( CSvgSvgElementImpl* )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   482
                                          (iSvgDocument->RootElement());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   483
        TFloatFixPt                  width, height;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   484
        TInt                    widthInt, heightInt;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   485
        TFloatFixPt scrnW( lSize.iWidth ), scrnH( lSize.iHeight );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   486
        TFloatFixPt                  zero    ( 0 );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   487
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   488
        if ( iFrameBufferOverridesViewport )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   489
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   490
        		//special case for Aknicon
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   491
    				//the don't care what the contents viewport is they just want it to scale to the framebuffer's size
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   492
        		width = scrnW;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   493
        		height= scrnH;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   494
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   495
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   496
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   497
            //bitmap from the client overrides width height specified in svg
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   498
      
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   499
            if(iViewPortListener != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   500
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   501
                TInt tempWidth=0,tempHeight=0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   502
                iViewPortListener->GetViewPort(
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   503
                ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iWidthInUserCoordinate, 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   504
                ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iHeightInUserCoordinate, 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   505
                ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iWidthInPercentage, 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   506
                ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iHeightInPercentage,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   507
                tempWidth,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   508
                tempHeight);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   509
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   510
                width = (TFloatFixPt) tempWidth;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   511
                height = (TFloatFixPt) tempHeight;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   512
                
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   513
                //used in SetWindowViewportTrans of svgSvgElementImpl
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   514
                iClientDefinedViewPort = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   515
                     
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   516
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   517
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   518
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   519
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   520
                TReal32 per = 100;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   521
                if(((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iWidthInPercentage)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   522
                {   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   523
                    width = ( TFloatFixPt ) (( lSize.iWidth/per ) * ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iWidthInUserCoordinate);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   524
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   525
                else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   526
                {   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   527
                    width  = (TFloatFixPt)  (((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iWidthInUserCoordinate);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   528
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   529
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   530
                if(((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iHeightInPercentage)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   531
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   532
                    height = ( TFloatFixPt ) (( lSize.iHeight/per ) * ((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iHeightInUserCoordinate);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   533
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   534
                else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   535
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   536
                    height  = (TFloatFixPt)  (((CSvgSvgElementImpl *)(iSvgDocument->RootElement()))->iHeightInUserCoordinate);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   537
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   538
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   539
        //default to XmidYmid_meet
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   540
        TSvgPreserveAspectAlignType lPreserverAspectAlignment = ESvgPreserveAspectRatio_XmidYmid;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   541
  			TSvgMeetOrSliceType lMeetOrSlice = ESvgMeetOrSlice_Meet;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   542
  		
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   543
  		MSvgPreserveAspectRatio* aPreserveAspectRatio;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   544
        el->GetPreserveAspectRatio(aPreserveAspectRatio);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   545
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   546
        if (aPreserveAspectRatio)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   547
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   548
        	lPreserverAspectAlignment = aPreserveAspectRatio->GetAlign();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   549
        	lMeetOrSlice = aPreserveAspectRatio->GetMeetOrSlice();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   550
        	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   551
        	//el->SetPreserveAspectRatioL(  lPreserverAspectAlignment, lMeetOrSlice);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   552
        	if( lPreserverAspectAlignment == ESvgPreserveAspectRatio_None && lMeetOrSlice == ESvgMeetOrSlice_Meet )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   553
        	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   554
            width = scrnW;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   555
            height = scrnH;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   556
        	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   557
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   558
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   559
        if( lMeetOrSlice == ESvgMeetOrSlice_Meet && !(lPreserverAspectAlignment == ESvgPreserveAspectRatio_None) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   560
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   561
            widthInt = ( TInt ) width;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   562
            heightInt = ( TInt ) height;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   563
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   564
            // to avoid division by zero.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   565
            TInt    rh  = lSize.iWidth ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   566
            if (widthInt != 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   567
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   568
                rh  = heightInt* lSize.iWidth / widthInt;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   569
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   570
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   571
            if ( rh <= lSize.iHeight )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   572
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   573
                width = scrnW;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   574
                height = TFloatFixPt( rh );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   575
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   576
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   577
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   578
                // to avoid division by zero.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   579
                if (heightInt != 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   580
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   581
                    width = TFloatFixPt( ((TReal32)(widthInt * lSize.iHeight)) / heightInt );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   582
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   583
                height = scrnH;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   584
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   585
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   586
        else if( lMeetOrSlice == ESvgMeetOrSlice_Slice )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   587
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   588
            widthInt = ( TInt ) width;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   589
            heightInt = ( TInt ) height;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   590
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   591
            // to avoid division by zero.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   592
            TInt    rh  = lSize.iWidth ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   593
            if (widthInt != 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   594
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   595
                rh  = heightInt* lSize.iWidth / widthInt;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   596
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   597
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   598
            if ( rh <= lSize.iHeight )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   599
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   600
                // to avoid division by zero.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   601
                if (heightInt != 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   602
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   603
                    width = TFloatFixPt( ((TReal32)(widthInt * lSize.iHeight)) / heightInt );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   604
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   605
                height = scrnH;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   606
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   607
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   608
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   609
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   610
                width = scrnW;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   611
                height = TFloatFixPt( rh );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   612
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   613
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   614
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   615
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   616
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   617
            }//Normal viewer| end of else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   618
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   619
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   620
        if ( ( width <= zero ) || ( height <= zero ) ) //.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   621
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   622
            width = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   623
            height = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   624
            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   625
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   626
        // Set initial viewport
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   627
        el->SetAttributeFloatL( KAtrX, zero );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   628
        el->SetAttributeFloatL( KAtrY, zero );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   629
        el->SetAttributeFloatL( KAtrWidth, width );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   630
        el->SetAttributeFloatL( KAtrHeight, height );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   631
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   632
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   633
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   634
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   635
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   636
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   637
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   638
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   639
// This method is called after the SVG file is read and all elements are
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   640
// constructed
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   641
// It also looks for rendering properties such as Anti Aliasing at this
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   642
// point
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   643
// It calibrates the system for rasterization quality based on contents
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   644
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   645
TBool CSvgEngineImpl::StartFrameLoopL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   646
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   647
    if( iRequestObserver != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   648
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   649
        if(iSvgDocument != NULL && iSvgDocument->iEventHandler != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   650
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   651
            iRequestObserver->UpdatePresentation(
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   652
                         iSvgDocument->iEventHandler->AnimationElementsCount());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   653
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   654
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   655
    if(iSvgDocument != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   656
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   657
        if ( iSvgDocument->RootElement() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   658
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   659
            InitializeEngineL(); // set the viewport and viewbox
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   660
            return ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   661
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   662
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   663
    return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   664
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   665
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   666
// UpdatePresentation()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   667
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   668
void  CSvgEngineImpl::UpdatePresentation(const TInt32& aParam)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   669
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   670
    if( iRequestObserver != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   671
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   672
        iRequestObserver->UpdatePresentation (aParam);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   673
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   674
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   675
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   676
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   677
//---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   678
// SetRenderingQuality
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   679
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   680
// @param : aRenderQuality
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   681
// The function is called from JSR226 API. Specific to M2G/JSR226 only.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   682
//---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   683
void  CSvgEngineImpl::SetRenderingQuality( const TInt32 aRenderQuality)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   684
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   685
	// Bydefault iRenderQuality is set to 2 i.e. Rendering Quality high.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   686
	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   687
	if( iRenderQuality != aRenderQuality )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   688
	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   689
		iRenderQuality = aRenderQuality;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   690
		
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   691
		if( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   692
		{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   693
			iGfxContext->SetAntialiasingMode( iRenderQuality );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   694
		}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   695
	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   696
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   697
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   698
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   699
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   700
// Invalidate the current raster (and frame buffer) and
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   701
// update the buffer with new  raster.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   702
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   703
void CSvgEngineImpl::RedrawL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   704
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   705
    // Clear the frame buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   706
    if( iGfxContext && iSvgDocument)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   707
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   708
        // Set Clipping rectangle
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   709
        CSvgSvgElementImpl* el  = ( CSvgSvgElementImpl* ) (iSvgDocument->RootElement());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   710
        if ( !el )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   711
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   712
            return; // No DOM tree, nothing to draw.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   713
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   714
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   715
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   716
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   717
     	// If viewBox has been set and width or height is zero
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   718
     	// Do not render the content    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   719
        TGfxRectangle2D viewBoxRect;    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   720
        if(el->GetViewBox(viewBoxRect))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   721
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   722
                if(viewBoxRect.iWidth == TFloatFixPt(0) || 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   723
                    viewBoxRect.iHeight == TFloatFixPt(0))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   724
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   725
                    return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   726
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   727
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   728
           
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   729
        iGfxContext->SetupContextL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   730
        iGfxContext->Clear(iBackgroundColor);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   731
        iGfxContext->SetFillOpacity( 1.0f );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   732
        iGfxContext->SetStrokeOpacity( 1.0f );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   733
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   734
        TFloatFixPt  width, height;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   735
        el->GetAttributeFloat( KAtrWidth, width );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   736
        el->GetAttributeFloat( KAtrHeight, height );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   737
        TGfxRectangle2D clipRect    ( 0, 0, width, height );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   738
        iGfxContext->SetClip( clipRect );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   739
        iClipRect = clipRect;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   740
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   741
        UpdateCTM(iSvgDocument);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   742
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   743
        iSvgDocument->iIsRendering = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   744
        DrawElementsL( (CSvgElementImpl*)iSvgDocument->RootElement());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   745
        iSvgDocument->iIsRendering = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   746
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   747
        iGfxContext->Flush();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   748
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   749
        // Get the redering result onto CFbsBitmap.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   750
        if(iFrameBufferSize.iWidth > 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   751
            iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask,iFrameBufferSize,iRenderDspMode,iMaskDspMode );    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   752
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   753
         iGfxContext->UpdateFramebufferL( iFrameBuffer, iMask );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   754
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   755
        if ( !iIgnoreUpdateScreen && iRequestObserver != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   756
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   757
            iRequestObserver->UpdateScreen();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   758
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   759
        if ( iSvgDocument->iInitSortList )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   760
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   761
            iSvgDocument->SortEventList();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   762
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   763
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   764
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   765
            iSvgDocument->iInitSortList=EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   766
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   767
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   768
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   769
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   770
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   771
// Delete the objects associated with the last loaded SVG file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   772
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   773
void CSvgEngineImpl::Destroy()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   774
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   775
    //if ( iSvgDocument )    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   776
    //    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   777
        // Stop timer and reset time
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   778
    //    iSvgDocument->TimeContainer()->UserStop();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   779
    //    iSvgDocument->TimeContainer()->UserResetTime();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   780
    //    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   781
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   782
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   783
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   784
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   785
// Set the URI information
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   786
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   787
void CSvgEngineImpl::LinkRequest( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   788
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   789
    iLinkUri.Set( aUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   790
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   791
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   792
// Set the Link:Show information
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   793
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   794
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   795
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   796
void CSvgEngineImpl::LinkRequestWithShow(const TDesC& aUri ,const TDesC& aLinkShow )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   797
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   798
    iLinkUri.Set( aUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   799
    iLinkShow.Set( aLinkShow );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   800
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   801
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   802
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   803
// Initiate the process of getting an svg font from the client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   804
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   805
TBool CSvgEngineImpl::FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   806
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   807
		if ( iRequestObserver == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   808
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   809
        return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   810
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   811
    else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   812
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   813
        if (iRequestObserver->FetchFont( aUri, aSession, aFileHandle ) == KErrNone)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   814
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   815
            return ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   816
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   817
            return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   818
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   819
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   820
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   821
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   822
// Initiate the process of getting an embedded image from the client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   823
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   824
TBool CSvgEngineImpl::FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   825
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   826
    if ( iRequestObserver == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   827
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   828
        return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   829
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   830
    else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   831
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   832
        if (iRequestObserver->FetchImage( aUri, aSession, aFileHandle ) == KErrNone)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   833
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   834
            return ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   835
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   836
            return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   837
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   838
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   839
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   840
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   841
// Accessor for Graphics Context object
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   842
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   843
CGfx2dGc* CSvgEngineImpl::GraphicsContext()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   844
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   845
    return iGfxContext;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   846
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   847
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   848
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   849
// Accessor for the Engine's current time
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   850
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   851
TInt32 CSvgEngineImpl::CurrentTIme()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   852
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   853
    if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   854
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   855
        return iSvgDocument->CurrentTime();        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   856
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   857
    return KErrGeneral;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   858
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   859
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   860
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   861
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   862
// void CSvgEngineImpl::ImageLoadingCompleted( TInt /* aErrorStatus */ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   863
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   864
// ImageLoadingObserver interface
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   865
void CSvgEngineImpl::ImageLoadingCompleted( TInt /* aErrorStatus */ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   866
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   867
    TRAP_IGNORE(RedrawL());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   868
    //aErrorStatus = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   869
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   870
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   871
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   872
// void CSvgEngineImpl::UpdatePath( CGfxGeneralPath* hPath, CSvgElementImpl* hElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   873
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   874
void CSvgEngineImpl::UpdatePath( CGfxGeneralPath* hPath, CSvgElementImpl* hElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   875
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   876
    if ((hElement != NULL) && (hElement->ElemID() == KSvgPathElement))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   877
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   878
        TRAPD(error,hElement->SetAttributePathL(KAtrData, hPath));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   879
        if ( error != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   880
           {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   881
            // Error Processing
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   882
            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   883
           }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   884
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   885
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   886
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   887
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   888
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   889
// Accessor for the document object for the currently loaded SVG source
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   890
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   891
CSvgDocumentImpl* CSvgEngineImpl::Document()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   892
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   893
    return iSvgDocument;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   894
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   895
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   896
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   897
// Restrict Thumbnail documents
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   898
// Do not render to frame buffer when is in thumbnail mode and
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   899
// frame buffer size width or height is larger than 80x80.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   900
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   901
TBool CSvgEngineImpl::PassesThumbNailRestriction()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   902
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   903
    if ( iSvgDocument && iFrameBuffer && iSvgDocument->IsThumbNailOnly() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   904
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   905
        TSize size = iFrameBuffer->SizeInPixels();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   906
        if ( size.iWidth > 80 || size.iHeight > 80 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   907
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   908
           return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   909
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   910
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   911
    return ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   912
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   913
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   914
//***************************************************************
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   915
// Event handling
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   916
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   917
// Initiate the process of handling an event from the client for the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   918
// SVG source
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   919
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   920
void CSvgEngineImpl::ProcessEventL( CSvgDocumentImpl* aSvgDocument, 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   921
    MSvgEvent* aEvent, TBool aRedraw )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   922
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   923
    // Check for Thumbnail restrictions
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   924
    if ( !PassesThumbNailRestriction() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   925
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   926
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   927
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   928
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   929
    // Timer event
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   930
    //if(!aEvent || !iGfxContext)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   931
    if(!aEvent)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   932
    return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   933
    if ( aEvent->EventType() == ESvgEngineEventTimer )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   934
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   935
        // Update current time
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   936
        if ( aSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   937
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   938
            aSvgDocument->SetCurrentTime( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   939
                ( ( MSvgTimerEvent * ) aEvent )->Time() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   940
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   941
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   942
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   943
    if( aSvgDocument &&  aSvgDocument->iEventHandler)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   944
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   945
        if (( aSvgDocument->iEventHandler->ProcessEventL( aEvent ) ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   946
              aSvgDocument->iInitialDrawFlag) && aEvent->EventType() == ESvgEngineEventTimer )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   947
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   948
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   949
      if(aSvgDocument->iInitSortList)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   950
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   951
            aSvgDocument->SortEventList();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   952
            aSvgDocument->iInitSortList = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   953
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   954
        aSvgDocument->iInitialDrawFlag = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   955
        aSvgDocument->iEventHandler->DoAnimProcL(aEvent);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   956
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   957
        if (aRedraw)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   958
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   959
        	// Redraw is performed for iSvgDocument
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   960
            RedrawL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   961
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   962
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   963
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   964
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   965
        // this is to keep the dom in its final state.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   966
            if(aEvent->EventType() == ESvgEngineEventTimer)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   967
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   968
                aSvgDocument->iEventHandler->DoAnimProcL(aEvent);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   969
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   970
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   971
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   972
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   973
    // Process Link
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   974
    if ( aEvent->EventMask() == KSvgEventMaskExternalUI )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   975
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   976
            if ( iLinkUri.Length() > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   977
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   978
                DoHyperLinkingL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   979
                // reset link description
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   980
                iLinkUri.Set( NullString );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   981
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   982
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   983
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   984
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   985
// Show FPS debug info. note. only write data to STI port
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   986
#ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   987
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   988
    if ( aEvent->EventType() == ESvgEngineInternalEvent )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   989
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   990
        MSvgInternalEvent*  evt = ( MSvgInternalEvent* ) aEvent;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   991
        if (evt->SvgEvent() == ESvgEventEndEvent)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   992
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   993
            iAnimationState = KAnimFinished;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   994
            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   995
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   996
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   997
        if (evt->SvgEvent() == ESvgEventBeginEvent)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   998
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
   999
            iAnimationState = KAnimActive;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1000
            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1001
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1002
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1003
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1004
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1005
    // time display for debug
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1006
    if ( iShowDebugInfo && iGfxContext && aEvent->EventType() == ESvgEngineEventTimer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1007
        && iAnimationState != KAnimFinished /*&& iTimer*/)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1008
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1009
        TInt fps = iSvgDocument->TimeContainer()->UserFps() / 10; //iTimer->Fps() / 10;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1010
        _LIT(msg, "\n%3d.%d\n");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1011
        RDebug::Print(msg, fps, iSvgDocument->TimeContainer()->UserFps()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1012
             - fps * 10 );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1013
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1014
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1015
#endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1016
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1017
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1018
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1019
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1020
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1021
// This method is for future extension, in which an external script engine
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1022
// could be used to evaluate a script description.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1023
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1024
TBool CSvgEngineImpl::ScriptCall( const TDesC& aScript,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1025
                                  CSvgElementImpl* aCallerElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1026
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1027
    if ( iRequestObserver == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1028
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1029
        return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1030
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1031
    else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1032
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1033
        return iRequestObserver->ScriptCall( aScript, aCallerElement );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1034
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1035
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1036
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1037
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1038
//***************************************************************
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1039
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1040
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1041
// Obtain the longest duration for an animation given document
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1042
// NULL will assume the attached document.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1043
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1044
TUint32 CSvgEngineImpl::Duration( CSvgDocumentImpl* aDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1045
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1046
    if ( aDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1047
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1048
        if ( iSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1049
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1050
            return 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1051
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1052
        return iSvgDocument->AnimationDuration();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1053
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1054
    return aDocument->AnimationDuration();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1055
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1056
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1057
//*******************************************************/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1058
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1059
// void CSvgEngineImpl::SwitchDebugInfo()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1060
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1061
void CSvgEngineImpl::SwitchDebugInfo(TBool debug)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1062
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1063
    iShowDebugInfo = debug;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1064
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1065
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1066
void CSvgEngineImpl::CustomOption(TBool aCustomOption )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1067
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1068
        iCustomOption = aCustomOption;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1069
        delete iGfxContext;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1070
        iGfxContext = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1071
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1072
/*NGA reverse*/  TRAP_IGNORE( iGfxContext = CGfx2dGcOpenVG::NewL( iFrameBufferSize, iBitmapFontSpec, iSvgBitmapFontProvider ));            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1073
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1074
           
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1075
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1076
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1077
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1078
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1079
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1080
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1081
// Initiate the process of opening and reading an embedded hyperlink
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1082
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1083
void CSvgEngineImpl::DoHyperLinkingL()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1084
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1085
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1086
    if( iSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1087
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1088
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1089
    // Not full support of XPointer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1090
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1091
    _LIT( KTmpHttp, "http:" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1092
    _LIT( KTmpFile, "file:" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1093
    _LIT( KTmpHash, "#" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1094
    _LIT( KTmpSvgView, "SvgView" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1095
    if ( iLinkUri.Left( 1 ) == KTmpHash )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1096
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1097
        // internal linking
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1098
        // Extract id
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1099
        TLex    lex ( iLinkUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1100
        lex.Inc();  // skip '#'
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1101
        lex.Mark();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1102
        while ( !lex.Eos() && lex.Peek().IsAlpha() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1103
            lex.Inc();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1104
        TPtrC   targetId    = lex.MarkedToken();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1105
        if ( targetId == KTmpSvgView )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1106
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1107
            // need to parse next token = {viewBoxSpec| preserveAspectRatioSpec
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1108
            // |transformSpec|zoomAndPanSpec|viewTargetSpec}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1109
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1110
            // Not yet supported
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1111
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1112
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1113
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1114
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1115
            CSvgElementImpl*targetElement   = ( CSvgElementImpl* )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1116
                                              iSvgDocument->GetElementById( targetId );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1117
            if ( targetElement == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1118
                return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1119
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1120
            if  (   targetElement->IsAnimatedElement( ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1121
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1122
                // start animation
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1123
                ( ( CSvgAnimationBase * ) targetElement )->BeginElementL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1124
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1125
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1126
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1127
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1128
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1129
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1130
    else if ( iLinkUri.Length() >= 5 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1131
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1132
        if ( iLinkUri.Left( 5 ) == KTmpHttp || iLinkUri.Left( 5 ) == KTmpFile )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1133
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1134
            // notify observer of desire to follow http link
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1135
            NotifyHyperlinkActivated( iLinkUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1136
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1137
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1138
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1139
            // notify observer of desire to follow link
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1140
            if ( iLinkShow.Length() > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1141
                NotifyHyperlinkActivatedWithShow( iLinkUri, iLinkShow );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1142
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1143
                NotifyHyperlinkActivated( iLinkUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1144
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1145
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1146
    else if ( iLinkUri.Length() > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1147
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1148
        // notify observer of desire to follow link
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1149
        if ( iLinkShow.Length() > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1150
            NotifyHyperlinkActivatedWithShow( iLinkUri, iLinkShow );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1151
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1152
            NotifyHyperlinkActivated( iLinkUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1153
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1154
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1155
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1156
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1157
// Dump a completed raster to the off screen buffer provided by the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1158
// client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1159
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1160
TInt CSvgEngineImpl::RenderFileToBuffer( const TDesC8& aSvgData,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1161
                                           CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1162
                                           CFbsBitmap* aMask,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1163
                                           TBool aPreserveAspectRatio )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1164
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1165
    if ( !iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1166
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1167
        return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1168
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1169
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1170
    CFbsBitmap* OrgFrameBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1171
    CFbsBitmap* OrgMask;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1172
	OrgFrameBuffer = iFrameBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1173
	OrgMask = iMask;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1174
	CSvgDocumentImpl* lsvgorgdoc = iSvgDocument;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1175
	// We have moved all the leaving functions into RenderFileL 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1176
	TRAPD(err,RenderFileL(aSvgData,aFrameBuffer,aMask,aPreserveAspectRatio));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1177
	// No matter what...whether the RenderFileL returns properly or leave we need to set the 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1178
	//GDI context back to the original frame buffer and mask... and set back the engine to
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1179
	//how it was before all this happened..
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1180
	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1181
    SetDocument(lsvgorgdoc);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1182
    lsvgorgdoc->SetEngine(this);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1183
	// the setGDIContextL error is a very serious error and if it occurs then 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1184
	// there is no way of recovery. 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1185
	TRAP_IGNORE(SetGdiContextL(OrgFrameBuffer,OrgMask));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1186
	//So we are propagating the more probable error of the two which is the leaving of 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1187
	// RenderFileL.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1188
    return err;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1189
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1190
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1191
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1192
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1193
// Helper leaving function for the function RenderFileToBuffer.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1194
// The actual rendering happens in this function..while the calling function uses this to
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1195
// render the file.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1196
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1197
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1198
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1199
void CSvgEngineImpl::RenderFileL( const TDesC8& aSvgData,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1200
                                           CFbsBitmap* aFrameBuffer,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1201
                                           CFbsBitmap* aMask,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1202
                                           TBool aPreserveAspectRatio)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1203
   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1204
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1205
    CFont *lFont = iGfxContext->Font();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1206
    TFontSpec lFontSpec = lFont->FontSpecInTwips();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1207
		
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1208
    TSize imageSize;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1209
    imageSize = aFrameBuffer->SizeInPixels();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1210
	//iFrameBuffer = aFrameBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1211
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1212
    SetGdiContextL(aFrameBuffer, aMask);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1213
    CSvgDocumentImpl* lSvgDocument = CSvgDocumentImpl::NewLC(iSvgBitmapFontProvider);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1214
    SetDocument(lSvgDocument);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1215
    lSvgDocument->SetEngine(this);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1216
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1217
    // fileHandle is valid from client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1218
    lSvgDocument->Load( aSvgData, *iSvgError );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1219
    if ( iSvgError->HasError() && !iSvgError->IsWarning() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1220
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1221
        CleanupStack::PopAndDestroy(1);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1222
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1223
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1224
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1225
    StartFrameLoopL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1226
    CSvgSvgElementImpl* lRoot = (CSvgSvgElementImpl*)lSvgDocument->RootElement();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1227
    _LIT( KPreserveAspectRatio, "preserveAspectRatio" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1228
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1229
    if(lRoot)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1230
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1231
        if ( aPreserveAspectRatio )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1232
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1233
            _LIT( KXMidYMid, "xMidYMid" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1234
            lRoot->SetAttributeL( KPreserveAspectRatio, KXMidYMid );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1235
            lRoot->SetWidth( imageSize.iWidth );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1236
            lRoot->SetHeight( imageSize.iHeight );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1237
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1238
        else {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1239
            _LIT( KNone, "none" );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1240
            lRoot->SetAttributeL( KPreserveAspectRatio, KNone );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1241
            lRoot->SetWidth( imageSize.iWidth );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1242
            lRoot->SetHeight( imageSize.iHeight );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1243
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1244
        RedrawL();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1245
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1246
    CleanupStack::PopAndDestroy( 1 );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1247
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1248
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1249
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1250
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1251
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1252
// Generate a mask bitmap from alpha channel of the framebuffer.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1253
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1254
void CSvgEngineImpl::GenerateMask(CFbsBitmap* aMask)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1255
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1256
    if ( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1257
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1258
        iGfxContext->GenerateMask( aMask );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1259
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1260
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1261
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1262
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1263
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1264
// set background color
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1265
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1266
void CSvgEngineImpl::SetBackgroundColor(TUint32 aRGBA8888Color)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1267
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1268
    iBackgroundColor = aRGBA8888Color;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1269
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1270
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1271
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1272
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1273
// Get Size of render buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1274
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1275
TSize CSvgEngineImpl::GetSize()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1276
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1277
    	  return iFrameBufferSize;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1278
    	  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1279
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1280
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1281
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1282
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1283
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1284
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1285
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1286
// Return SVG Engine State
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1287
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1288
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1289
TSvgEngineState CSvgEngineImpl::SVGEngineState()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1290
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1291
    return iSvgEngineState;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1292
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1293
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1294
//
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1295
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1296
// Set SVG Engine State
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1297
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1298
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1299
void CSvgEngineImpl::SetSVGEngineState(TSvgEngineState aState)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1300
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1301
    iSvgEngineState = aState;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1302
    if( iSvgEngineState == ESVGEnginePaused )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1303
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1304
        if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1305
        	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1306
            iSvgDocument->TimeContainer()->UserPause();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1307
            NotifyAnimationPaused();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1308
        	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1309
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1310
    else if( iSvgEngineState == ESVGEngineRunning )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1311
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1312
        if (iSvgDocument && iSvgDocument->IsAnimationFile())
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1313
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1314
           	iSvgDocument->TimeContainer()->UserResume();	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1315
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1316
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1317
    else if(iSvgEngineState == ESVGEngineStopped ) 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1318
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1319
            if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1320
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1321
                iSvgDocument->TimeContainer()->UserStop();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1322
       	    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1323
     
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1324
        }   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1325
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1326
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1327
void CSvgEngineImpl::SeekEngine( TUint32 aTime)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1328
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1329
    iSvgEngineState = ESVGEngineRunning;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1330
    if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1331
    	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1332
    	iSvgDocument->TimeContainer()->UserSeek( aTime );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1333
    	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1334
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1335
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1336
void CSvgEngineImpl::ResetTimer()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1337
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1338
    if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1339
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1340
        iSvgDocument->TimeContainer()->UserResetTime();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1341
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1342
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1343
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1344
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1345
// SetGdiContext File
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1346
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1347
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1348
void CSvgEngineImpl::SetGdiContextL(CFbsBitmap* aCurrentBitmap, CFbsBitmap* aMask)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1349
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1350
    // Handle for both Non-NULL and NULL parameter
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1351
    iFrameBuffer = aCurrentBitmap;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1352
    iMask = aMask;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1353
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1354
    if ( aCurrentBitmap )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1355
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1356
        if ( !iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1357
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1358
                iGfxContext = CGfx2dGcOpenVG::NewL( iFrameBuffer->SizeInPixels(), iBitmapFontSpec, iSvgBitmapFontProvider );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1359
                
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1360
                // The API is called Only in case of JSR226. Incase if the midlet developer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1361
                // has changed the RedenderQuality of the midlet.ByDefualt the value of 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1362
                // iRenderQuality is 2 i.e. VG_RENDERING_QUALITY_BETTER.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1363
                iGfxContext->SetAntialiasingMode( iRenderQuality );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1364
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1365
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1366
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1367
            iGfxContext->ChangeBufferSizeL( iFrameBuffer->SizeInPixels() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1368
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1369
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1370
    else if ( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1371
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1372
        iGfxContext->ChangeBufferSizeL( TSize( 0,0 ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1373
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1374
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1375
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1376
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1377
// void CSvgEngineImpl::StartEngine(CSvgErrorImpl* aError)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1378
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1379
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1380
void CSvgEngineImpl::StartEngine(CSvgErrorImpl* aError)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1381
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1382
    if ( !iFrameBuffer || !iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1383
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1384
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1385
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1386
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1387
    iMouseoverElement = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1388
    if ( ((iFrameBufferSize.iHeight <= 0 )||(iFrameBufferSize.iWidth <= 0 )) &&(( iFrameBuffer->SizeInPixels().iWidth == 0 ) ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1389
         ( iFrameBuffer->SizeInPixels().iHeight == 0) ))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1390
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1391
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1392
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1393
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1394
    TBool initialized = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1395
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1396
    TRAPD( initError, initialized = StartFrameLoopL() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1397
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1398
    if ( initError != KErrNone || !initialized )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1399
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1400
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1401
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1402
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1403
    // Get the Engine State to Running
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1404
    SetSVGEngineState(ESVGEngineRunning);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1405
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1406
    // Document is an animation
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1407
    if( iSvgDocument->IsAnimationFile() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1408
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1409
            { // Atleast first frame should get drawn
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1410
                TRAPD(error, RedrawL() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1411
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1412
                    if ( error != KErrNone && aError != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1413
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1414
                       if( error == KErrNoMemory )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1415
                       {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1416
                           CSvgDocumentImpl::PrepareError( *aError, ESvgNoMemory, error,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1417
                           _L( "Unable to Draw: " ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1418
                           _L( "" ) );  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1419
                           return;  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1420
                       }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1421
                       
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1422
                       CSvgDocumentImpl::PrepareError( *aError, ESvgUnknown, error,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1423
                       _L( "Unable to Draw: " ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1424
                       _L( "" ) );  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1425
                       return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1426
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1427
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1428
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1429
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1430
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1431
        iSvgDocument->TimeContainer()->UserPlay();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1432
        iSvgDocument->iAnimationResetNeeded = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1433
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1434
    // Static svg file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1435
    else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1436
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1437
            TRAPD(error, RedrawL() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1438
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1439
                if ( error != KErrNone && aError != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1440
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1441
                   if( error == KErrNoMemory )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1442
                   {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1443
                       CSvgDocumentImpl::PrepareError( *aError, ESvgNoMemory, error,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1444
                       _L( "Unable to Draw: " ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1445
                       _L( "" ) );  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1446
                       return;  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1447
                   }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1448
                   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1449
                   CSvgDocumentImpl::PrepareError( *aError, ESvgUnknown, error,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1450
                   _L( "Unable to Draw: " ),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1451
                   _L( "" ) );  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1452
                   return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1453
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1454
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1455
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1456
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1457
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1458
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1459
// void CSvgEngineImpl::RenderFrame( TUint aCurrentTime )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1460
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1461
void CSvgEngineImpl::RenderFrame( TUint aCurrentTime )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1462
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1463
    if ( !iFrameBuffer || !iSvgDocument ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1464
         iFrameBuffer->SizeInPixels().iWidth == 0 || iFrameBuffer->SizeInPixels().iHeight == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1465
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1466
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1467
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1468
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1469
    if ( aCurrentTime == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1470
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1471
        SeekEngine( 0 );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1472
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1473
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1474
    iMouseoverElement = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1475
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1476
     	CSvgSvgElementImpl* rootElement = (CSvgSvgElementImpl*)iSvgDocument->RootElement();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1477
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1478
     	if (rootElement == NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1479
     	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1480
     		return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1481
     	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1482
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1483
     	TGfxRectangle2D viewBoxRect;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1484
     	if (rootElement->GetViewBox(viewBoxRect))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1485
     	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1486
     		//viewbox has been defined or set already
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1487
   			if (viewBoxRect.iWidth == TFloatFixPt(0) || viewBoxRect.iHeight == TFloatFixPt(0))
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1488
   			{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1489
   				//viewbox has no area so dont render
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1490
   				return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1491
   			}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1492
   		}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1493
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1494
    if( iRequestObserver && iSvgDocument->iEventHandler )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1495
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1496
        iRequestObserver->UpdatePresentation( iSvgDocument->iEventHandler->AnimationElementsCount() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1497
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1498
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1499
    iSvgDocument->iInitialDrawFlag = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1500
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1501
    // Fix for animation element for testApp   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1502
    TSvgTick lTick;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1503
    lTick.iRealTimeTick = aCurrentTime;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1504
    lTick.iParentTcTick = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1505
    iSvgDocument->TimeContainer()->ParentTimeContainerTick(lTick) ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1506
    // Fix for animation element for testApp   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1507
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1508
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1509
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1510
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1511
// Set SvgEngine Document
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1512
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1513
void CSvgEngineImpl::SetDocument(CSvgDocumentImpl* aDocument)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1514
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1515
    iSvgDocument = aDocument;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1516
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1517
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1518
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1519
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1520
// Change the duration of the timer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1521
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1522
void CSvgEngineImpl::ChangeDuration( TUint32 aTimerDuration )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1523
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1524
    if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1525
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1526
        iSvgDocument->TimeContainer()->UserChangeFrameDuration( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1527
            aTimerDuration );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1528
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1529
        // Check if there is animation element in the parent svg
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1530
    RPointerArray<CSvgElementImpl> lAnimationEleList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1531
    iSvgDocument->FindAllElements((CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1532
               KSvgMediaAnimationElement, lAnimationEleList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1533
    TInt lAnimationEleCnt = lAnimationEleList.Count();    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1534
    for ( TInt lCurAnimationEle = 0; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1535
             lCurAnimationEle < lAnimationEleCnt; lCurAnimationEle++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1536
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1537
        CSvgMediaAnimationElementImpl* lAnimationElement = 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1538
            (CSvgMediaAnimationElementImpl* )lAnimationEleList[ lCurAnimationEle ];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1539
        CSvgDocumentImpl* lChildDoc = lAnimationElement->GetChildDocument();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1540
        if ( lChildDoc )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1541
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1542
            lChildDoc->TimeContainer()->UserChangeFrameDuration( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1543
            aTimerDuration ); // Change Frame duration for child svg
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1544
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1545
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1546
        lAnimationEleList.Close();     
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1547
    	}	   
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1548
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1549
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1550
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1551
// void CSvgEngineImpl::Resume(TInt32 aTime)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1552
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1553
void CSvgEngineImpl::Resume(TInt32 aTime)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1554
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1555
    if ( iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1556
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1557
        iSvgDocument->TimeContainer()->UserResume( aTime );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1558
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1559
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1560
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1561
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1562
// void CSvgEngineImpl::FindBBoxesForRotatedText( const TDesC& aSearchString,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1563
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1564
void CSvgEngineImpl::FindBBoxesForRotatedText( const TDesC& aSearchString,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1565
                           RPointerArray<MRect>& aBoundingBoxes,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1566
                                        RArray<TPtrC>& aTexts,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1567
                                        RArray<TInt>& aElementIds,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1568
                                        TBool aCaseSensitive )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1569
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1570
    if ( iSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1571
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1572
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1573
    if ( iSvgTextBoundingBoxes.Count() > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1574
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1575
    	iSvgTextBoundingBoxes.ResetAndDestroy();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1576
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1577
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1578
    // Find all text elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1579
	HBufC* searchStr = aSearchString.AllocLC();    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1580
	TPtr searchStrPtr = searchStr->Des();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1581
    RPointerArray<CSvgElementImpl> textElements;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1582
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1583
                     KSvgTextElement, textElements );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1584
    // Himanshu: Find all animation elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1585
    RPointerArray<CSvgElementImpl> lAllAnimationElements;                                
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1586
    iSvgDocument->FindAllElements( (CSvgElementImpl*)iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1587
                                KSvgMediaAnimationElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1588
                                lAllAnimationElements );                                
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1589
    TInt lAllAnimationEleCnt = lAllAnimationElements.Count();                            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1590
    for ( TInt i = 0; i < lAllAnimationEleCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1591
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1592
          CSvgMediaAnimationElementImpl* element = (CSvgMediaAnimationElementImpl*)lAllAnimationElements[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1593
          CSvgDocumentImpl* ldoc = element->GetChildDocument();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1594
            if(ldoc)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1595
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1596
                // Find all text elements in child document
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1597
                ldoc->FindAllElements( (CSvgElementImpl*)ldoc->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1598
                                KSvgTextElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1599
                                textElements );  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1600
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1601
          
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1602
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1603
        lAllAnimationElements.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1604
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1605
    TSvgFourPointRect boundingBox;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1606
    TInt textEleCnt = textElements.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1607
    for ( TInt i = 0; i < textEleCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1608
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1609
        CSvgTextElementImpl* textElement = (CSvgTextElementImpl*)textElements[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1610
        TPtrC remainder( textElement->GetText() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1611
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1612
        TInt index = ( aCaseSensitive ) ? remainder.Find( aSearchString ) :
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1613
                                          remainder.FindF( aSearchString );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1614
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1615
        // continue to next element if nothing found
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1616
        if ( index == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1617
            continue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1618
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1619
		searchStrPtr.Copy( remainder.Mid(index,aSearchString.Length()) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1620
        // Get the bounding box for the whole text element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1621
        textElement->GetFourPointBBox( boundingBox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1622
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1623
        // Get bounding box for every occurrence
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1624
        TReal32 textAdvance = (TReal32)(textElement->TextAdvance( *searchStr, index ));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1625
        TReal32 leftAdvance = 0.0f;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1626
        //TReal32 aHeight = textElement->Ascent() + textElement->Descent();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1627
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1628
        while ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1629
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1630
            // Calculate boundingbox for searched-text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1631
            // indeterminate results with a string only one character long
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1632
            leftAdvance = leftAdvance + (TReal32)(textElement->TextAdvance( remainder.Left( index )));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1633
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1634
            // need to setup slope calculation here to determine where the new
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1635
            // four point rect should be for partial pieces of text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1636
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1637
            // need to do something for both vertical and horizontal text 0 and na slopes
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1638
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1639
            TReal32 dy = (TReal32)boundingBox.iPoint2.iY - (TReal32)boundingBox.iPoint1.iY;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1640
            TReal32 dx = (TReal32)boundingBox.iPoint2.iX - (TReal32)boundingBox.iPoint1.iX;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1641
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1642
            double aSlopeRan;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1643
            Math::ATan(aSlopeRan, dy, dx);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1644
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1645
            double aSinVal;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1646
            Math::Sin(aSinVal, aSlopeRan);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1647
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1648
            double aCosVal;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1649
            Math::Cos(aCosVal, aSlopeRan);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1650
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1651
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1652
            TReal32 x1 = aCosVal * leftAdvance + (TReal32)boundingBox.iPoint1.iX;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1653
            TReal32 x3 = aCosVal * leftAdvance + (TReal32)boundingBox.iPoint3.iX;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1654
            TReal32 y1 = aSinVal * leftAdvance + (TReal32)boundingBox.iPoint1.iY;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1655
            TReal32 y3 = aSinVal * leftAdvance + (TReal32)boundingBox.iPoint3.iY;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1656
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1657
            TReal32 x2 = aCosVal * textAdvance + x1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1658
            TReal32 x4 = aCosVal * textAdvance + x3;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1659
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1660
            TReal32 y2 = aSinVal * textAdvance + y1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1661
            TReal32 y4 = aSinVal * textAdvance + y3;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1662
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1663
			TSvgFourPointRect* bbox = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1664
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1665
            TRAP_IGNORE( bbox = new (ELeave) TSvgFourPointRect( TPoint(x1, y1),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1666
                        TPoint(x2, y2),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1667
                        TPoint(x3, y3),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1668
                        TPoint(x4, y4)) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1669
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1670
            if ( !bbox )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1671
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1672
            	#ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1673
            		RDebug::Printf("Four Point Rect Failed: Out of Memory");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1674
            	#endif
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1675
            	return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1676
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1677
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1678
            // store bound box pointers to go back to client
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1679
            aBoundingBoxes.Append( (MRect*)bbox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1680
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1681
            iSvgTextBoundingBoxes.Append( bbox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1682
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1683
            // store point to text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1684
            aTexts.Append( TPtrC( textElement->GetText() ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1685
            aElementIds.Append( (TInt)textElement );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1686
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1687
            remainder.Set( remainder.Right( remainder.Length() - index - aSearchString.Length() ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1688
            leftAdvance = leftAdvance + textAdvance;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1689
            index = ( aCaseSensitive ) ? remainder.Find( aSearchString ) :
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1690
                                         remainder.FindF( aSearchString );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1691
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1692
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1693
    CleanupStack::PopAndDestroy(searchStr);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1694
    textElements.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1695
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1696
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1697
//this is the old 2point rect way that only works for horizontal text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1698
/*void CSvgEngineImpl::FindBBoxesForHorizontalText( const TDesC& aSearchString,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1699
                           RArray<TRect>& aBoundingBoxes,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1700
                                        RArray<TPtrC>& aTexts,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1701
                                        RArray<TInt>& aElementIds,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1702
                                        TBool aCaseSensitive                                        )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1703
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1704
    if ( iSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1705
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1706
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1707
    // Find all text elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1708
    RPointerArray<CSvgElementImpl> textElements;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1709
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1710
                     KSvgTextElement, textElements );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1711
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1712
    TGfxRectangle2D boundingBox;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1713
    for ( TInt i = 0; i < textElements.Count(); i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1714
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1715
        CSvgTextElementImpl* textElement = (CSvgTextElementImpl*)textElements[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1716
        TPtrC remainder( textElement->GetText() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1717
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1718
        TInt index = ( aCaseSensitive ) ? remainder.Find( aSearchString ) :
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1719
                                          remainder.FindF( aSearchString );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1720
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1721
        // continue to next element if nothing found
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1722
        if ( index == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1723
            continue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1724
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1725
        // Get the bounding box for the whole text element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1726
        textElement->GetBBox( boundingBox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1727
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1728
        // Get bounding box for every occurrence
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1729
        TFloatFixPt textAdvance = textElement->TextAdvance( aSearchString, index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1730
        TFloatFixPt leftAdvance = 0.0f;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1731
        while ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1732
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1733
            // Calculate boundingbox for searched-text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1734
            leftAdvance = leftAdvance + textElement->TextAdvance( remainder.Left( index ), index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1735
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1736
            TRect bbox( (TInt)boundingBox.iX + (TInt)leftAdvance,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1737
                        (TInt)boundingBox.iY,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1738
                        (TInt)boundingBox.iX + (TInt)leftAdvance + (TInt)textAdvance,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1739
                        (TInt)boundingBox.iY + (TInt)boundingBox.iHeight );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1740
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1741
            // store bound box
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1742
            aBoundingBoxes.Append( bbox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1743
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1744
            // store point to text
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1745
            aTexts.Append( TPtrC( textElement->GetText() ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1746
            aElementIds.Append( (TInt)textElement );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1747
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1748
            remainder.Set( remainder.Right( remainder.Length() - index - aSearchString.Length() ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1749
            leftAdvance = leftAdvance + textAdvance;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1750
            index = ( aCaseSensitive ) ? remainder.Find( aSearchString ) :
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1751
                                         remainder.FindF( aSearchString );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1752
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1753
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1754
    textElements.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1755
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1756
*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1757
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1758
/************************ HyperLinking Functions ***********************/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1759
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1760
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1761
// void CSvgEngineImpl::CheckForHyperlinkMouseover( TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1762
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1763
void CSvgEngineImpl::CheckForHyperlinkMouseover( TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1764
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1765
   if ( iHyperlinkListeners.Count() == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1766
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1767
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1768
    if ( iSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1769
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1770
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1771
    // Gather <a> elements if first time
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1772
    RPointerArray<CSvgElementImpl> iAElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1773
    if ( iAElementList.Count() == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1774
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1775
        iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1776
                         KSvgAElement, iAElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1777
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1778
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1779
    // find the bounding box containing point
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1780
    TGfxPoint2D point( aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1781
    TGfxRectangle2D boundingBox;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1782
    TInt aEleListCnt = iAElementList.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1783
    for ( TInt i = 0; i < aEleListCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1784
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1785
        CSvgElementImpl* element = iAElementList[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1786
        CSvgGElementImpl::GetGroupBounding( boundingBox, element );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1787
        if ( boundingBox.Contains( point ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1788
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1789
            // no existing mouse over element: notify HyperlinkEntered
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1790
            if ( iMouseoverElement == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1791
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1792
                NotifyHyperlinkEntered( element->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1793
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1794
            // otherwise: notify HyperlinkExited, HyperlinkEntered
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1795
            else if ( iMouseoverElement != element )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1796
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1797
                NotifyHyperlinkExited( iMouseoverElement->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1798
                NotifyHyperlinkEntered( element->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1799
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1800
            iMouseoverElement = element;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1801
            return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1802
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1803
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1804
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1805
    // no bounding box containing point: notify HyperlinkExited
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1806
    if ( iMouseoverElement != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1807
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1808
        NotifyHyperlinkExited( iMouseoverElement->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1809
        iMouseoverElement = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1810
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1811
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1812
    iAElementList.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1813
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1814
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1815
/*-------------------------Animation Listeners-----------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1816
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1817
// void CSvgEngineImpl::AddAnimationListener( MSvgAnimationListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1818
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1819
void CSvgEngineImpl::AddAnimationListener( MSvgAnimationListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1820
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1821
    if ( aListener != NULL && iAnimationListeners.Find( aListener ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1822
        iAnimationListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1823
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1824
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1825
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1826
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1827
// void CSvgEngineImpl::RemoveAnimationListener( MSvgAnimationListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1828
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1829
void CSvgEngineImpl::RemoveAnimationListener( MSvgAnimationListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1830
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1831
    TInt index = iAnimationListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1832
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1833
        iAnimationListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1834
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1835
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1836
/*-------------------------Animation listener notification to client-------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1837
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1838
// void CSvgEngineImpl::NotifyAnimationStarted()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1839
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1840
void CSvgEngineImpl::NotifyAnimationStarted()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1841
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1842
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1843
    TBool isAnimationIndefinite = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1844
    if ( ( iSvgDocument == NULL ) || ( iSvgDocument->RootElement() == NULL ) ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1845
         ( iAnimationListeners.Count() == 0 ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1846
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1847
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1848
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1849
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1850
    RPointerArray<CSvgElementImpl> AnimationElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1851
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1852
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1853
                                 KSvgSetElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1854
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1855
                                 KSvgAnimateElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1856
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1857
                                 KSvgAnimateMotionElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1858
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1859
                                 KSvgAnimateTransformElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1860
    iSvgDocument->FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1861
                                 KSvgAnimateColorElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1862
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1863
    if ( AnimationElementList.Count() != 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1864
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1865
    	TInt animationEleListCnt = AnimationElementList.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1866
        for ( TInt i=0; i < animationEleListCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1867
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1868
             CSvgElementImpl * element = AnimationElementList[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1869
              if ( ((CSvgAnimationBase *)element)->CompleteDuration() == KTimeIndefinite )  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1870
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1871
                 isAnimationIndefinite = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1872
                 break;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1873
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1874
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1875
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1876
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1877
   AnimationElementList.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1878
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1879
   TInt animationListenersCnt = iAnimationListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1880
   for ( TInt i = 0; i < animationListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1881
        iAnimationListeners[i]->AnimationStarted( isAnimationIndefinite );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1882
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1883
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1884
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1885
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1886
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1887
// void CSvgEngineImpl::NotifyAnimationPaused()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1888
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1889
void CSvgEngineImpl::NotifyAnimationPaused()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1890
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1891
	TInt animationListenersCnt = iAnimationListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1892
    for ( TInt i = 0; i < animationListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1893
        iAnimationListeners[i]->AnimationPaused();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1894
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1895
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1896
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1897
// void CSvgEngineImpl::NotifyAnimationEnded()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1898
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1899
void CSvgEngineImpl::NotifyAnimationEnded()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1900
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1901
    if ( ( iSvgDocument == NULL ) || ( iSvgDocument->RootElement() == NULL ) ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1902
         ( iAnimationListeners.Count() == 0 ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1903
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1904
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1905
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1906
 #if 0
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1907
    RPointerArray<CSvgElementImpl> AnimationElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1908
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1909
    FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1910
                                 KSvgSetElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1911
    FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1912
                                 KSvgAnimateElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1913
    FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1914
                                 KSvgAnimateMotionElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1915
    FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1916
                                 KSvgAnimateTransformElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1917
    FindAllElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1918
                                 KSvgAnimateColorElement, AnimationElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1919
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1920
    if ( AnimationElementList.Count() != 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1921
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1922
    	TInt animationEleListCnt = AnimationElementList.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1923
        for ( TInt i=0; i < animationEleListCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1924
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1925
        CSvgElementImpl * element = AnimationElementList[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1926
        if ( ((CSvgAnimationBase *)element)->iAnimStatus == KAnimActive )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1927
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1928
             AnimationElementList.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1929
             return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1930
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1931
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1932
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1933
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1934
     AnimationElementList.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1935
#endif
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1936
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1937
	TInt animationListenersCnt = iAnimationListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1938
    for ( TInt i = 0; i < animationListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1939
        iAnimationListeners[i]->AnimationEnded();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1940
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1941
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1942
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1943
/*------------------Register Client Text Area listeners----------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1944
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1945
// void CSvgEngineImpl::AddTextAreaListener( MSvgTextAreaListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1946
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1947
void CSvgEngineImpl::AddTextAreaListener( MSvgTextAreaListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1948
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1949
    if ( aListener != NULL && iTextAreaListeners.Find( aListener ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1950
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1951
        iTextAreaListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1952
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1953
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1954
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1955
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1956
// void CSvgEngineImpl::RemoveTextAreaListener( MSvgTextAreaListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1957
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1958
void CSvgEngineImpl::RemoveTextAreaListener( MSvgTextAreaListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1959
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1960
    TInt index = iTextAreaListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1961
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1962
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1963
        iTextAreaListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1964
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1965
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1966
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1967
/*----------------Text Area listener notification to client--------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1968
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1969
// void CSvgEngineImpl::NotifyTextAreaEntered( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1970
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1971
void CSvgEngineImpl::NotifyTextAreaEntered( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1972
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1973
	TInt textAreaListenersCnt = iTextAreaListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1974
    for (TInt i=0; i < textAreaListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1975
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1976
        iTextAreaListeners[i]->TextAreaEntered( (TInt)aTextAreaHandle);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1977
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1978
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1979
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1980
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1981
// void CSvgEngineImpl::NotifyTextAreaExited( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1982
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1983
void CSvgEngineImpl::NotifyTextAreaExited( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1984
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1985
	TInt textAreaListenersCnt = iTextAreaListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1986
    for (TInt i=0; i < textAreaListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1987
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1988
        iTextAreaListeners[i]->TextAreaExited( (TInt)aTextAreaHandle);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1989
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1990
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1991
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1992
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1993
// void CSvgEngineImpl::NotifyTextAreaActivated( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1994
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1995
void CSvgEngineImpl::NotifyTextAreaActivated( CSvgTextAreaElementImpl* aTextAreaHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1996
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1997
	TInt textAreaListenersCnt = iTextAreaListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1998
	for (TInt i=0; i < textAreaListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  1999
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2000
        iTextAreaListeners[i]->TextAreaActivated( (TInt)aTextAreaHandle );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2001
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2002
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2003
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2004
/*------------------Register Client Text listeners----------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2005
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2006
// void CSvgEngineImpl::AddTextListener( MSvgTextListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2007
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2008
void CSvgEngineImpl::AddTextListener( MSvgTextListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2009
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2010
    if ( aListener != NULL && iTextListeners.Find( aListener ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2011
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2012
        iTextListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2013
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2014
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2015
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2016
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2017
// void CSvgEngineImpl::RemoveTextListener( MSvgTextListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2018
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2019
void CSvgEngineImpl::RemoveTextListener( MSvgTextListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2020
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2021
    TInt index = iTextListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2022
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2023
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2024
        iTextListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2025
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2026
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2027
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2028
/*----------------Text listener notification to client--------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2029
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2030
// void CSvgEngineImpl::NotifyTextEntered( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2031
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2032
void CSvgEngineImpl::NotifyTextEntered( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2033
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2034
	TInt textListenersCnt = iTextListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2035
    for (TInt i=0; i < textListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2036
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2037
        iTextListeners[i]->TextEntered( (TInt)aTextHandle);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2038
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2039
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2040
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2041
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2042
// void CSvgEngineImpl::NotifyTextExited( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2043
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2044
void CSvgEngineImpl::NotifyTextExited( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2045
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2046
	TInt textListenersCnt = iTextListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2047
    for (TInt i=0; i < textListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2048
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2049
        iTextListeners[i]->TextExited( (TInt)aTextHandle);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2050
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2051
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2052
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2053
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2054
// void CSvgEngineImpl::NotifyTextActivated( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2055
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2056
void CSvgEngineImpl::NotifyTextActivated( CSvgTextElementImpl* aTextHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2057
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2058
	TInt textListenersCnt = iTextListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2059
    for (TInt i=0; i < textListenersCnt; i++)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2060
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2061
        iTextListeners[i]->TextActivated( (TInt)aTextHandle );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2062
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2063
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2064
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2065
/*---------------------Register Client Hyperlink listeners----------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2066
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2067
// void CSvgEngineImpl::AddHyperlinkListener( MSvgHyperlinkListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2068
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2069
void CSvgEngineImpl::AddHyperlinkListener( MSvgHyperlinkListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2070
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2071
    if ( aListener != NULL && iHyperlinkListeners.Find( aListener ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2072
        iHyperlinkListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2073
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2074
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2075
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2076
// void CSvgEngineImpl::RemoveHyperlinkListener( MSvgHyperlinkListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2077
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2078
void CSvgEngineImpl::RemoveHyperlinkListener( MSvgHyperlinkListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2079
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2080
    TInt index = iHyperlinkListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2081
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2082
        iHyperlinkListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2083
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2084
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2085
void CSvgEngineImpl::AddViewPortListener(MSvgViewPortListener* aListener)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2086
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2087
    if ( aListener != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2088
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2089
        iViewPortListener = aListener ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2090
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2091
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2092
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2093
  
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2094
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2095
void CSvgEngineImpl::RemoveViewPortListener(MSvgViewPortListener* 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2096
        /* aListener */ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2097
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2098
    if(iViewPortListener != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2099
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2100
        iViewPortListener = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2101
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2102
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2103
/*----------------Hyperlink listener notification to client--------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2104
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2105
// void CSvgEngineImpl::NotifyHyperlinkEntered( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2106
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2107
void CSvgEngineImpl::NotifyHyperlinkEntered( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2108
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2109
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2110
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2111
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2112
        if (aAElementHandle)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2113
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2114
            iHyperlinkListeners[i]->LinkEntered( aAElementHandle->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2115
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2116
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2117
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2118
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2119
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2120
// void CSvgEngineImpl::NotifyHyperlinkEntered( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2121
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2122
void CSvgEngineImpl::NotifyHyperlinkEntered( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2123
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2124
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2125
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2126
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2127
        iHyperlinkListeners[i]->LinkEntered( aUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2128
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2129
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2130
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2131
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2132
// void CSvgEngineImpl::NotifyHyperlinkExited( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2133
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2134
void CSvgEngineImpl::NotifyHyperlinkExited( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2135
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2136
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2137
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2138
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2139
        if (aAElementHandle)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2140
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2141
            iHyperlinkListeners[i]->LinkExited( aAElementHandle->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2142
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2143
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2144
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2145
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2146
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2147
// void CSvgEngineImpl::NotifyHyperlinkExited( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2148
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2149
void CSvgEngineImpl::NotifyHyperlinkExited( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2150
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2151
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2152
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2153
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2154
        iHyperlinkListeners[i]->LinkExited( aUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2155
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2156
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2157
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2158
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2159
// void CSvgEngineImpl::NotifyHyperlinkActivated( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2160
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2161
void CSvgEngineImpl::NotifyHyperlinkActivated( CSvgAElementImpl* aAElementHandle )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2162
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2163
    if ( !aAElementHandle ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2164
          aAElementHandle->Href().Length() == 0 ||
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2165
          aAElementHandle->Href()[0] == '#' )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2166
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2167
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2168
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2169
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2170
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2171
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2172
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2173
        iHyperlinkListeners[i]->LinkActivated( aAElementHandle->Href() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2174
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2175
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2176
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2177
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2178
// void CSvgEngineImpl::NotifyHyperlinkActivated( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2179
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2180
void CSvgEngineImpl::NotifyHyperlinkActivated( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2181
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2182
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2183
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2184
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2185
        iHyperlinkListeners[i]->LinkActivated( aUri );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2186
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2187
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2188
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2189
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2190
// void CSvgEngineImpl::NotifyHyperlinkActivatedWithShow( const TDesC& aUri, const TDesC& aShow )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2191
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2192
void CSvgEngineImpl::NotifyHyperlinkActivatedWithShow( const TDesC& aUri, const TDesC& aShow )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2193
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2194
	TInt hyperLinkListenersCnt = iHyperlinkListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2195
    for ( TInt i = 0; i < hyperLinkListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2196
        iHyperlinkListeners[i]->LinkActivatedWithShow( aUri, aShow );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2197
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2198
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2199
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2200
// void CSvgEngineImpl::NotifyElementActivatedLinkEntered( CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2201
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2202
void CSvgEngineImpl::NotifyElementActivatedLinkEntered( CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2203
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2204
      if(iMouseoverElement  == NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2205
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2206
        const TDesC* myId = aElement->Id();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2207
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2208
        if (myId)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2209
        NotifyHyperlinkEntered( *(myId));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2210
        iMouseoverElement = aElement;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2211
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2212
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2213
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2214
// void CSvgEngineImpl::NotifyElementActivatedLinkExited(  CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2215
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2216
void CSvgEngineImpl::NotifyElementActivatedLinkExited(  CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2217
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2218
        if(iMouseoverElement == aElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2219
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2220
        const TDesC* myId = aElement->Id();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2221
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2222
        if (myId)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2223
        NotifyHyperlinkExited( *(myId));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2224
        iMouseoverElement  = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2225
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2226
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2227
void CSvgEngineImpl::GetViewPort(TInt getWidth, TInt getHeight, TBool isWidthInPer, TBool isHeightInPer, TInt &setWidth, TInt &setHeight)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2228
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2229
    if(iViewPortListener != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2230
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2231
        iViewPortListener->GetViewPort(getWidth, getHeight, isWidthInPer, isHeightInPer, setWidth, setHeight);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2232
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2233
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2234
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2235
/*------------------Register Client Interactive Element listeners------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2236
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2237
// void CSvgEngineImpl::AddInteractiveElementListener( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2238
//                                  MSvgInteractiveElementListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2239
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2240
void CSvgEngineImpl::AddInteractiveElementListener( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2241
                                    MSvgInteractiveElementListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2242
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2243
    if ( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2244
        aListener != NULL &&
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2245
        iInteractiveElementListeners.Find( aListener ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2246
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2247
        iInteractiveElementListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2248
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2249
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2250
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2251
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2252
// void CSvgEngineImpl::RemoveInteractiveElementListener( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2253
//                                  MSvgInteractiveElementListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2254
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2255
void CSvgEngineImpl::RemoveInteractiveElementListener( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2256
                                    MSvgInteractiveElementListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2257
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2258
    TInt index = iInteractiveElementListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2259
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2260
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2261
        iInteractiveElementListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2262
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2263
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2264
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2265
/*-----------Interactive Element listener notification to client------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2266
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2267
// void CSvgEngineImpl::NotifyInteractiveElementEntered(CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2268
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2269
void CSvgEngineImpl::NotifyInteractiveElementEntered(
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2270
                        CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2271
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2272
    TUint16 lsubeventmask=0; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2273
    TBool linteractivity;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2274
    linteractivity=this->iSvgDocument->iEventHandler->
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2275
    CheckInteractivityAndGetSubEventMask(aElement,lsubeventmask);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2276
    if(linteractivity)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2277
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2278
        TInt linteractiveElementListenersCnt = iInteractiveElementListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2279
        for ( TInt i = 0; i < linteractiveElementListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2280
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2281
            const TDesC* myId = aElement->Id();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2282
            TPtrC16 ptr;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2283
            if(myId)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2284
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2285
                ptr.Set(*myId);               
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2286
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2287
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2288
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2289
                _LIT(KEmptyString,"");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2290
                ptr.Set( KEmptyString);                      
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2291
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2292
            iInteractiveElementListeners[i]->InteractiveElementEntered( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2293
                                               ptr,lsubeventmask  ); 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2294
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2295
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2296
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2297
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2298
// void CSvgEngineImpl::NotifyInteractiveElementExited(CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2299
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2300
void CSvgEngineImpl::NotifyInteractiveElementExited(CSvgElementImpl* aElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2301
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2302
	TInt linteractiveElementListenersCnt = iInteractiveElementListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2303
    for ( TInt i = 0; i < linteractiveElementListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2304
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2305
        const TDesC* myId = aElement->Id();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2306
        TPtrC16 ptr;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2307
        if(myId)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2308
            {            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2309
            ptr.Set(*myId);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2310
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2311
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2312
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2313
            _LIT(KEmptyString,"");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2314
            ptr.Set(KEmptyString);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2315
            }               
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2316
        iInteractiveElementListeners[i]->InteractiveElementExited(ptr);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2317
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2318
	}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2319
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2320
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2321
// Set SVG Dimension to frame buffer size
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2322
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2323
void CSvgEngineImpl::SetSvgDimensionToFrameBufferL(TUint aWidth, TUint aHeight)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2324
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2325
     if (iSvgDocument == NULL )   return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2326
     if (iSvgDocument->RootElement() != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2327
         {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2328
         CSvgElementImpl* theElement = (CSvgElementImpl*)(iSvgDocument->RootElement());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2329
         ((CSvgSvgElementImpl*)theElement)->iWidthInUserCoordinate = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2330
         ((CSvgSvgElementImpl*)theElement)->iHeightInUserCoordinate = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2331
         TFloatFixPt wFix( (TInt)aWidth );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2332
         TFloatFixPt hFix( (TInt)aHeight );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2333
         theElement->SetAttributeFloatL(KAtrWidth, wFix );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2334
         theElement->SetAttributeFloatL(KAtrHeight, hFix );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2335
         }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2336
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2337
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2338
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2339
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2340
// void CSvgEngineImpl::SetMediaTime(TUint32 aTimeInMilliSeconds)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2341
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2342
void CSvgEngineImpl::SetMediaTime(TUint32 aTimeInMilliSeconds)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2343
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2344
    // Set Current Time in the document
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2345
    if(iSvgDocument != NULL)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2346
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2347
        //iSvgDocument->SetCurrentTime( aTimeInMilliSeconds );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2348
        
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2349
        iSvgDocument->iAnimationResetNeeded = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2350
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2351
    if(this->iSvgDocument && this->iSvgDocument->iEventHandler)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2352
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2353
        this->iSvgDocument->iEventHandler->SetCurrentTime(aTimeInMilliSeconds);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2354
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2355
   // Find all animation elements in the document    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2356
    RPointerArray<CSvgElementImpl> lAnimationEleList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2357
    if(iSvgDocument)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2358
	    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2359
    iSvgDocument->FindAllElements((CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2360
               KSvgMediaAnimationElement, lAnimationEleList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2361
    TInt lAnimationEleCnt = lAnimationEleList.Count();    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2362
    for ( TInt lCurAnimationEle = 0; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2363
             lCurAnimationEle < lAnimationEleCnt; lCurAnimationEle++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2364
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2365
        CSvgMediaAnimationElementImpl* lAnimationElement = 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2366
            (CSvgMediaAnimationElementImpl* )lAnimationEleList[ lCurAnimationEle ];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2367
        CSvgDocumentImpl* lChildDoc = lAnimationElement->GetChildDocument();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2368
        if ( lChildDoc )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2369
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2370
            lChildDoc->iAnimationResetNeeded = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2371
            if ( lChildDoc->iEventHandler )    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2372
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2373
                lChildDoc->iEventHandler->SetCurrentTime(aTimeInMilliSeconds); 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2374
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2375
            
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2376
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2377
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2378
    lAnimationEleList.Close();     
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2379
	    	
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2380
	    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2381
    this->SetSVGEngineState(ESVGEnginePaused);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2382
    this->SeekEngine(aTimeInMilliSeconds);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2383
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2384
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2385
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2386
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2387
// TBool CSvgEngineImpl::IsElementVisible( TInt aElementId )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2388
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2389
TBool CSvgEngineImpl::IsElementVisible( TInt aElementId )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2390
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2391
    if ( aElementId == 0 || iFrameBuffer == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2392
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2393
        return EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2394
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2395
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2396
    CSvgElementImpl* element = (CSvgElementImpl*)aElementId;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2397
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2398
    TInt32 visibleAttribute = -1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2399
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2400
    TRAPD(error,element->GetAttributeIntL( KCSS_ATTR_VISIBILITY, visibleAttribute ));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2401
    if (error != KErrNone)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2402
       {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2403
       // error processing
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2404
       }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2405
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2406
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2407
    return visibleAttribute == 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2408
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2409
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2410
// Set whether to call request observer's UpdateScreen method
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2411
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2412
// void CSvgEngineImpl::SetIgnoreUpdateScreen( TBool aBool )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2413
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2414
void CSvgEngineImpl::SetIgnoreUpdateScreen( TBool aBool )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2415
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2416
    iIgnoreUpdateScreen = aBool;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2417
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2418
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2419
/*---------------------------MouseListener---------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2420
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2421
// void CSvgEngineImpl::AddMouseListener( const MSvgMouseListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2422
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2423
void CSvgEngineImpl::AddMouseListener( const MSvgMouseListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2424
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2425
    TInt index = iSvgMouseListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2426
    if ( aListener != NULL && index == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2427
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2428
        iSvgMouseListeners.Append( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2429
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2430
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2431
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2432
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2433
// void CSvgEngineImpl::RemoveMouseListener( const MSvgMouseListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2434
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2435
void CSvgEngineImpl::RemoveMouseListener( const MSvgMouseListener* aListener )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2436
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2437
    TInt index = iSvgMouseListeners.Find( aListener );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2438
    if ( index != KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2439
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2440
        iSvgMouseListeners.Remove( index );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2441
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2442
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2443
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2444
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2445
// TInt CSvgEngineImpl::MouseListenerCount()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2446
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2447
TInt CSvgEngineImpl::MouseListenerCount()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2448
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2449
    return iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2450
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2451
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2452
/*-------------MouseListener Notifications back to client---------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2453
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2454
// void CSvgEngineImpl::NotifyMousePressed( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2455
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2456
void CSvgEngineImpl::NotifyMousePressed( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2457
                                          TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2458
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2459
    TInt svgMouseListenersCnt = iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2460
    for ( TInt i = 0; i < svgMouseListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2461
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2462
        iSvgMouseListeners[i]->MousePressed( aElements, aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2463
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2464
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2465
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2466
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2467
// void CSvgEngineImpl::NotifyMouseReleased( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2468
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2469
void CSvgEngineImpl::NotifyMouseReleased( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2470
                                          TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2471
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2472
    TInt svgMouseListenersCnt = iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2473
    for ( TInt i = 0; i < svgMouseListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2474
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2475
        iSvgMouseListeners[i]->MouseReleased( aElements, aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2476
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2477
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2478
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2479
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2480
// void CSvgEngineImpl::NotifyMouseEntered( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2481
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2482
void CSvgEngineImpl::NotifyMouseEntered( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2483
                                          TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2484
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2485
    TInt svgMouseListenersCnt = iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2486
    for ( TInt i = 0; i < svgMouseListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2487
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2488
        iSvgMouseListeners[i]->MouseEntered( aElements, aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2489
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2490
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2491
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2492
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2493
// void CSvgEngineImpl::NotifyMouseExited( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2494
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2495
void CSvgEngineImpl::NotifyMouseExited( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2496
                                          TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2497
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2498
    TInt svgMouseListenersCnt = iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2499
    for ( TInt i = 0; i < svgMouseListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2500
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2501
        iSvgMouseListeners[i]->MouseExited( aElements, aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2502
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2503
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2504
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2505
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2506
// void CSvgEngineImpl::NotifyMouseMoved( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2507
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2508
void CSvgEngineImpl::NotifyMouseMoved( RPointerArray<CSvgElementImpl>& aElements,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2509
                                       TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2510
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2511
    TInt svgMouseListenersCnt = iSvgMouseListeners.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2512
    for ( TInt i = 0; i < svgMouseListenersCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2513
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2514
        iSvgMouseListeners[i]->MouseMoved( aElements, aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2515
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2516
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2517
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2518
/*---------------------------------------------------------------------*/
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2519
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2520
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2521
// void CSvgEngineImpl::GetViewableElementsAtPoint( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2522
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2523
void CSvgEngineImpl::GetViewableElementsAtPoint( CSvgDocumentImpl* aSvgDocument, RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2524
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2525
   if ( aSvgDocument == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2526
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2527
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2528
	//JSR226 Change this could slow down event handling but it seems to be required to work
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2529
   UpdateCTM(aSvgDocument);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2530
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2531
    // Gather all "viewable" elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2532
    RPointerArray<CSvgElementImpl> iViewableElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2533
    if ( iViewableElementList.Count() == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2534
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2535
        FindAllViewableElements( (CSvgElementImpl* )aSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2536
                                 iViewableElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2537
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2538
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2539
    // find the bounding box containing point
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2540
    TGfxPoint2D point( aX, aY );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2541
    TGfxRectangle2D boundingBox;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2542
    TInt viewableEleListCnt =  iViewableElementList.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2543
    for ( TInt i = 0; i < viewableEleListCnt; i++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2544
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2545
        CSvgElementImpl* element = iViewableElementList[i];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2546
        element->GetBBox( boundingBox );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2547
        if ( boundingBox.Contains( point ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2548
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2549
            aElements.Append( element );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2550
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2551
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2552
    // Display of list
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2553
    iViewableElementList.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2554
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2555
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2556
// Return all viewable elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2557
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2558
// void CSvgEngineImpl::FindAllViewableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2559
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2560
void CSvgEngineImpl::FindAllViewableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2561
                                              RPointerArray<CSvgElementImpl>& iElementList )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2562
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2563
    if ( aStartElement == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2564
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2565
    // The child elements of the defs element should not be viewable. skip the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2566
    // tree traversing if the element id is defs element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2567
    if(aStartElement->ElemID() == KSvgDefsElement)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2568
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2569
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2570
    CSvgElementImpl* child = (CSvgElementImpl*)aStartElement->FirstChild();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2571
    while ( child != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2572
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2573
        // add to list if child is found
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2574
        TInt32 displayValue = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2575
        TRAP_IGNORE(child->GetAttributeIntL( KCSS_ATTR_DISPLAY, displayValue ));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2576
        if ( child->IsViewable() && child->IsVisible() && displayValue != KDisplayEnumNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2577
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2578
				//JSR226 CHANGE do we care if multiple signals are sent to some elements - would be faster without this check
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2579
            	if ( iElementList.Find( child ) == KErrNotFound )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2580
            	{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2581
            		iElementList.Append( child );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2582
				}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2583
			}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2584
        // find in grandchildren
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2585
        FindAllViewableElements( child, iElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2586
        child = (CSvgElementImpl*)child->NextSibling();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2587
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2588
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2589
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2590
// Return all non-viewable elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2591
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2592
// void CSvgEngineImpl::FindAllNonViewableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2593
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2594
void CSvgEngineImpl::FindAllNonViewableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2595
                                                 RPointerArray<CSvgElementImpl>& iElementList )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2596
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2597
    if ( aStartElement == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2598
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2599
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2600
    CSvgElementImpl* child = (CSvgElementImpl*)aStartElement->FirstChild();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2601
    while ( child != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2602
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2603
        // add to list if child is found
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2604
        if ( !child->IsViewable() && !child->IsVisible() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2605
            iElementList.Append( child );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2606
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2607
        // find in grandchildren
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2608
        FindAllNonViewableElements( child, iElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2609
        child = (CSvgElementImpl*)child->NextSibling();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2610
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2611
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2612
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2613
/**
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2614
 * Return the data pointed to by the given URI string,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2615
 * from an external source.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2616
 */
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2617
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2618
// HBufC8* CSvgEngineImpl::FetchExternalDataL( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2619
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2620
HBufC8* CSvgEngineImpl::FetchExternalDataL( const TDesC& aUri )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2621
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2622
    if ( iRequestObserver == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2623
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2624
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2625
        RDebug::Printf("CSvgEngineImpl::FetchExternalData--requestobserver is NULL\n");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2626
        #endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2627
        return NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2628
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2629
    // Connect session
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2630
    RFs session;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2631
    TInt connectError = session.Connect();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2632
    if ( connectError != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2633
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2634
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2635
        RDebug::Printf("CSvgEngineImpl::FetchExternalData--session.Connect() failed: %d\n", connectError );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2636
        #endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2637
        return NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2638
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2639
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2640
    RFile fileHandle;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2641
    // Check for FetchImage error code
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2642
    TInt fetchError = iRequestObserver->FetchImage( aUri, session, fileHandle );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2643
    if ( fetchError != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2644
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2645
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2646
        RDebug::Printf("CSvgEngineImpl::FetchExternalData--FetchImage error: %d\n", fetchError );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2647
        #endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2648
        session.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2649
        return NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2650
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2651
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2652
    // Read file size
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2653
    TInt fileSize = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2654
    TInt sizeError = fileHandle.Size( fileSize );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2655
    if ( sizeError != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2656
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2657
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2658
        RDebug::Printf("CSvgEngineImpl::FetchExternalData--fileHandle.Size error: %d\n", sizeError );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2659
        #endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2660
        session.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2661
        return NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2662
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2663
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2664
    // Allocate memory for file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2665
    HBufC8* data = HBufC8::NewL( fileSize );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2666
    TPtr8 des = data->Des();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2667
    TInt readError = fileHandle.Read( des );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2668
    if ( readError != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2669
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2670
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2671
        RDebug::Printf("CSvgEngineImpl::FetchExternalData--fileHandle.Read error: %d\n", readError );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2672
        #endif //_DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2673
        session.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2674
        delete data;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2675
        return NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2676
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2677
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2678
    // Successful
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2679
    session.Close();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2680
    return data;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2681
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2682
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2683
// void CSvgEngineImpl::SetAudioVolume( TInt aPercentage );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2684
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2685
void CSvgEngineImpl::SetAudioVolume( TInt aPercentage )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2686
    {
56
865fbeda552a Create stem_SVGEngine.dll, which breaks the dependency on mediaclientaudio.dll
William Roberts <williamr@symbian.org>
parents: 54
diff changeset
  2687
#if 0    
48
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2688
    if ( !iSvgDocument )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2689
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2690
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2691
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2692
    // Locate all the active audio elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2693
    RPointerArray<CSvgElementImpl> lAudioElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2694
    
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2695
    iSvgDocument->FindAllElements( 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2696
            (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2697
            KSvgAudioElement, lAudioElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2698
    // Set the volume on each audio element
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2699
    TInt lAudEleCnt = lAudioElementList.Count();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2700
    for ( TInt lCurAudioEle = 0; lCurAudioEle < lAudEleCnt; lCurAudioEle++ )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2701
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2702
        CSvgAudioElementImpl* lAudioElement = (CSvgAudioElementImpl*)lAudioElementList[ lCurAudioEle ];
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2703
        lAudioElement->SetVolume( aPercentage );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2704
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2705
    lAudioElementList.Close();
56
865fbeda552a Create stem_SVGEngine.dll, which breaks the dependency on mediaclientaudio.dll
William Roberts <williamr@symbian.org>
parents: 54
diff changeset
  2706
#endif
48
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2707
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2708
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2709
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2710
// TBool CSvgEngineImpl::ReadyToRender()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2711
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2712
TBool CSvgEngineImpl::ReadyToRender()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2713
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2714
    return iSvgDocument != NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2715
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2716
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2717
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2718
// TBool CSvgEngineImpl::IsEndedWithCompleteTextTag( TDes &BufferPtr,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2719
//                                                   TInt EndOffset)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2720
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2721
TBool CSvgEngineImpl::IsEndedWithCompleteTextTag(TDes &aBufferPtr,TInt aEndOffset)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2722
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2723
    TChar KOpeningBrace = '<';
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2724
    TChar KSlash = '/';
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2725
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2726
    // This function searches the buffer in reverse order from the end offset
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2727
    // to check whether the last element had a complete text tag.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2728
    // eg. of complete text tags
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2729
    //          <text>Hello</text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2730
    //          <text></text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2731
    // eg. of an incomplete text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2732
    //          <text />
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2733
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2734
    TPtrC currentSelectionPtr = aBufferPtr.Left( aEndOffset );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2735
    TInt OpeningBracePos = currentSelectionPtr.LocateReverse( KOpeningBrace );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2736
    TInt SlashPos = currentSelectionPtr.LocateReverse( KSlash );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2737
    TBool retVal = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2738
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2739
    // In case of a complete text tag the opening brace is one position behind
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2740
    // slash.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2741
    if ( SlashPos == ( OpeningBracePos + 1 ) )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2742
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2743
        retVal = ETrue;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2744
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2745
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2746
    return retVal;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2747
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2748
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2749
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2750
// void CSvgEngineImpl::SaveSvgL( const TDesC& aFileName )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2751
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2752
void CSvgEngineImpl::SaveSvgL( const TDesC& aFileName )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2753
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2754
    RFs  lFs;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2755
    RFileWriteStream  lStream;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2756
    TInt error ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2757
    TChar KOpeningBrace = '<';
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2758
    TChar KSlash = '/';
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2759
    // Connect to File Server to write the changed content to a file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2760
    CleanupClosePushL(lFs);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2761
    User::LeaveIfError(lFs.Connect() );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2762
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2763
    TBool isOpened = EFalse;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2764
    error = lFs.IsFileOpen( aFileName, isOpened ) ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2765
    // dont leave if file doesnt exist or there is no error
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2766
    if(error!= KErrNone && error!=KErrNotFound)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2767
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2768
        //usually will come here with KErrNotFound
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2769
        //since file wont exist
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2770
        User::Leave(error);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2771
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2772
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2773
    if ( isOpened )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2774
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2775
        #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2776
        RDebug::Printf( "Cannot SaveSvgL: File is still opened: ");
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2777
        RDebug::RawPrint( aFileName );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2778
        #endif
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2779
        CleanupStack::PopAndDestroy(1);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2780
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2781
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2782
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2783
    // Try to create the write stream using the file name
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2784
    if ( lStream.Create( lFs, aFileName, EFileWrite ) != KErrNone )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2785
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2786
        // If creation fails, file exists already, try to open the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2787
        // existing file
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2788
        User::LeaveIfError( lStream.Open(lFs, aFileName, EFileWrite) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2789
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2790
    CleanupClosePushL(lStream);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2791
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2792
    // Array to store list of all editable elements
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2793
    RPointerArray<CSvgElementImpl> lTextElementList;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2794
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2795
    FindEditableElements( (CSvgElementImpl* )iSvgDocument->RootElement(),
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2796
                          lTextElementList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2797
    CleanupClosePushL(lTextElementList);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2798
    TInt index=0, startoffset = 0, endoffset = 0;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2799
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2800
    // The content of the file is stored in the root <svg> node
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2801
    HBufC*  lBufferContent = ((CSvgSvgElementImpl* )iSvgDocument->RootElement())->iContent;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2802
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2803
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2804
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2805
    // While there are remaining editable elements do
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2806
    while(index < lTextElementList.Count())
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2807
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2808
        TBool EndedWithCompleteTextTag= true;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2809
        TInt OrgLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2810
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2811
        if ( lTextElementList[index]->ElemID() == KSvgTextElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2812
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2813
            // If the element is a <text> element invoke element specific function
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2814
            // to retrieve the offset and original length
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2815
            endoffset = ((CSvgTextElementImpl *)lTextElementList[index])->iOffset;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2816
            OrgLength = ((CSvgTextElementImpl *)lTextElementList[index])->GetOrgLength();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2817
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2818
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2819
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2820
            // If the element is a <textArea> element invoke element specific function
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2821
            // to retrieve the offset and original length
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2822
            endoffset = ((CSvgTextAreaElementImpl *)lTextElementList[index])->iOffset;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2823
            OrgLength = ((CSvgTextAreaElementImpl *)lTextElementList[index])->GetOrgLength();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2824
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2825
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2826
        // These are the cases which have to be processed
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2827
        //     a. Text Element: No Closing Tag: <text  ... />
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2828
        //     b. Text Element: No CData : <text ...></text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2829
        //     c. Text Element: CData : <text ...>Sample Text</text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2830
        //     d. TextArea Element: No Closing Tag: <textArea ... />
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2831
        //     e. TextArea Element: No CData: <textArea ...></textArea>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2832
        //     f. TextArea Element: CData: <textArea ...>Sample TextArea</textArea>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2833
        //     -> for a,b,d,e the endoffset represents the offset after the closing braces.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2834
        //        for e.g.  <text ... />
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2835
        //                              ^
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2836
        //        <text></text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2837
        //                     ^
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2838
        //     -> for c,f the EndOffset represents the offset to the first character in
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2839
        //        content.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2840
        //        <text>Hello</text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2841
        //
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2842
        //              ^
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2843
        if(!OrgLength)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2844
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2845
            //case a,b,d,e
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2846
            TPtr BufferPtr=lBufferContent->Des();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2847
            EndedWithCompleteTextTag = IsEndedWithCompleteTextTag(BufferPtr,endoffset);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2848
            if ( EndedWithCompleteTextTag )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2849
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2850
                // case b,e
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2851
                if(endoffset < startoffset)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2852
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2853
                    User::Leave(KErrNotFound);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2854
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2855
                TPtrC lPtrtoPresentText = lBufferContent->Mid( startoffset, ( endoffset - startoffset ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2856
                //end offset modified ot point to <text></text>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2857
                //                                      ^
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2858
                endoffset = startoffset + lPtrtoPresentText.LocateReverse( KOpeningBrace );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2859
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2860
            else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2861
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2862
                //case a,d
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2863
                if(endoffset < startoffset)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2864
                    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2865
                    User::Leave(KErrNotFound);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2866
                    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2867
                TPtrC lPtrtoPresentText = lBufferContent->Mid( startoffset, ( endoffset - startoffset ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2868
                 endoffset = startoffset + lPtrtoPresentText.LocateReverse( KSlash );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2869
                //end offset modified ot point to <text/>
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2870
                //                                     ^
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2871
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2872
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2873
        if(endoffset < startoffset)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2874
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2875
            User::Leave(KErrNotFound);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2876
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2877
        TPtrC lPtrtoWrBuffer = lBufferContent->Mid( startoffset, ( endoffset - startoffset ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2878
        TInt lWrBufLength = lPtrtoWrBuffer .Length();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2879
        User::LeaveIfError(WriteToStream(lStream,lPtrtoWrBuffer));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2880
        // If it was a text element ...
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2881
        if ( lTextElementList[index]->ElemID() == KSvgTextElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2882
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2883
            HBufC *lBufTextContent= NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2884
            //make startoffset point to opening tag '<' or '/' in case of a,d
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2885
            TPtrC lPtrtoTextContent= ( (CSvgTextElementImpl* ) lTextElementList[ index ] )->GetText();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2886
            startoffset = endoffset + ( (CSvgTextElementImpl* ) lTextElementList[ index ] )->iOrgLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2887
            lBufTextContent = TextTagProcessingL(&lPtrtoTextContent,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2888
                                    startoffset,OrgLength,EndedWithCompleteTextTag);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2889
            CleanupStack::PushL(lBufTextContent);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2890
            TPtr lTempPtr(lBufTextContent->Des());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2891
            lPtrtoTextContent.Set(lTempPtr);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2892
            User::LeaveIfError(WriteToStream(lStream,lPtrtoTextContent));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2893
            CleanupStack::PopAndDestroy(lBufTextContent);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2894
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2895
       else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2896
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2897
            HBufC *lBufTextAreaContent= NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2898
            HBufC* lBufPresentText = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2899
            TInt textlength = ((CSvgTextAreaElementImpl *)lTextElementList[index])->GetLength();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2900
            lBufTextAreaContent = HBufC::NewLC( textlength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2901
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2902
            TPtr lPtrtoGetTextAreaContent = lBufTextAreaContent->Des();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2903
            ((CSvgTextAreaElementImpl *)lTextElementList[index])->GetText( lPtrtoGetTextAreaContent );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2904
            TPtrC lPtrtoTextAreaContent=lPtrtoGetTextAreaContent;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2905
            startoffset = endoffset + ((CSvgTextAreaElementImpl *)lTextElementList[index])->iOrgLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2906
            lBufPresentText = TextAreaTagProcessingL(&lPtrtoTextAreaContent,startoffset,OrgLength,EndedWithCompleteTextTag);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2907
            CleanupStack::PushL(lBufPresentText);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2908
            TPtr lTempPtr(lBufPresentText->Des());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2909
            lPtrtoTextAreaContent.Set(lTempPtr);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2910
            User::LeaveIfError(WriteToStream(lStream,lPtrtoTextAreaContent));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2911
            CleanupStack::PopAndDestroy(lBufPresentText);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2912
            CleanupStack::PopAndDestroy(lBufTextAreaContent);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2913
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2914
            index++;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2915
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2916
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2917
    // Done using the list, close the list to avoid a memory leak
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2918
    CleanupStack::PopAndDestroy(&lTextElementList);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2919
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2920
    // After processing all the editable text elements, are there any characters in the buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2921
    if( startoffset < lBufferContent->Length() )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2922
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2923
        TPtrC lPtrtoRemainText = lBufferContent->Mid(startoffset,(lBufferContent->Length()-startoffset));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2924
        User::LeaveIfError(WriteToStream(lStream,lPtrtoRemainText));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2925
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2926
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2927
    // Close the stream
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2928
    CleanupStack::PopAndDestroy(&lStream);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2929
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2930
    // Close the file server session
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2931
    CleanupStack::PopAndDestroy(&lFs);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2932
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2933
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2934
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2935
//Function to process the text and add tags at the end
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2936
//HBufC* CSvgEngineImpl::TextTagProcessing(TPtr* aCData, TInt aStartOffset, TInt aOrgLength,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2937
//                              TBool aEndingWithTag)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2938
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2939
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2940
HBufC* CSvgEngineImpl::TextTagProcessingL(TPtrC* aCData,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2941
                    TInt &aStartOffset, TInt aOrgLength,TBool aEndingWithTag)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2942
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2943
        HBufC * lTextContentBuffer = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2944
        TPtrC lPtrToTextContent(*aCData) ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2945
        //Ending with complete text tag and original length is 0
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2946
        if( aEndingWithTag && aOrgLength == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2947
            {//case b
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2948
            lTextContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2949
                                    + KClosingTextTagLength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2950
            TPtr lPtrToTempBuf(lTextContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2951
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2952
            lPtrToTempBuf.Append(KClosingTextTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2953
            aStartOffset += KClosingTextTagLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2954
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2955
        else if( !aEndingWithTag && aOrgLength == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2956
            {//case a
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2957
            lTextContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2958
                                    + KClosingTextTagLength
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2959
                                    + KClosingBracesLength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2960
            TPtr lPtrToTempBuf(lTextContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2961
            lPtrToTempBuf.Append(KClosingBraces);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2962
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2963
            lPtrToTempBuf.Append(KClosingTextTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2964
            aStartOffset += 2;// the length of /> which is 2 characters.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2965
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2966
        else if(aEndingWithTag && aOrgLength!= 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2967
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2968
            lTextContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2969
                                    + KClosingTextTagLength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2970
            TPtr lPtrToTempBuf(lTextContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2971
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2972
            lPtrToTempBuf.Append(KClosingTextTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2973
            aStartOffset += KClosingTextTagLength ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2974
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2975
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2976
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2977
            //i.e !aEndingWithTag && OrgLength!=0
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2978
            //this case should never occur
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2979
            //becoz there is no possibility of
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2980
            //the quoted kind of text content definition in xml as shown below
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2981
            //"<text /> this is a text content"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2982
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2983
        // Pop the buffer from the cleanup stack as ownership is transferred
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2984
        // to caller
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2985
        CleanupStack::Pop(lTextContentBuffer);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2986
        return lTextContentBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2987
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2988
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2989
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2990
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2991
//Function to process the text and add tags at the end
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2992
//HBufC* CSvgEngineImpl::TextAreaTagProcessing(TPtr* aCData, TInt aStartOffset, TInt aOrgLength,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2993
//                              TBool aEndingWithTag)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2994
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2995
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2996
HBufC* CSvgEngineImpl::TextAreaTagProcessingL(TPtrC* aCData, TInt &aStartOffset, TInt aOrgLength,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2997
                                TBool aEndingWithTag)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2998
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  2999
        HBufC * lTextAreaContentBuffer = NULL;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3000
        TPtrC lPtrToTextAreaContent(*aCData) ;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3001
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3002
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3003
        //Ending with complete text tag and original length is 0
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3004
        if( aEndingWithTag && aOrgLength == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3005
            {//case e
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3006
            lTextAreaContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3007
                                        + KClosingTextAreaTagLength);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3008
            TPtr lPtrToTempBuf(lTextAreaContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3009
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3010
            lPtrToTempBuf.Append(KClosingTextAreaTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3011
            aStartOffset += KClosingTextAreaTagLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3012
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3013
        else if( !aEndingWithTag && aOrgLength == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3014
            {//case d
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3015
            lTextAreaContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3016
                                        + KClosingBracesLength
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3017
                                        + KClosingTextAreaTagLength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3018
            TPtr lPtrToTempBuf(lTextAreaContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3019
            lPtrToTempBuf.Append(KClosingBraces);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3020
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3021
            lPtrToTempBuf.Append(KClosingTextAreaTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3022
            aStartOffset += 2;// the length of /> which is 2 characters.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3023
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3024
        else if(aEndingWithTag && aOrgLength!= 0)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3025
            {//case f
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3026
            lTextAreaContentBuffer = HBufC::NewLC(aCData->Length()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3027
                                        + KClosingTextAreaTagLength );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3028
            TPtr lPtrToTempBuf(lTextAreaContentBuffer->Des());//point to buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3029
            lPtrToTempBuf.Append(*aCData);//append cdata
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3030
            lPtrToTempBuf.Append(KClosingTextAreaTag);//append closing text tag
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3031
            aStartOffset += KClosingTextAreaTagLength;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3032
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3033
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3034
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3035
            //i.e !aEndingWithTag && OrgLength!=0
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3036
            //this case should never occur
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3037
            //becoz there is no possibility of
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3038
            //the quoted kind of text content definition in xml as shown below
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3039
            //"<textArea /> this is a text content"
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3040
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3041
        // Pop the buffer from the cleanup stack as ownership is transferred
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3042
        // to caller
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3043
        CleanupStack::Pop(lTextAreaContentBuffer);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3044
        return lTextAreaContentBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3045
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3046
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3047
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3048
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3049
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3050
//Function to Write the buffer to the stream.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3051
//In SaveSVGL while editing text - used to write partial buffers into the stream.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3052
//TInt CSvgEngineImpl::WriteToStream(RFileWriteStream* aStream,TPtrC aWriteBuffer)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3053
//-----------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3054
TInt CSvgEngineImpl::WriteToStream(RFileWriteStream &aStream,TPtrC aWriteBuffer)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3055
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3056
    // Create a small output buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3057
    TBuf8<KMaxConversionChars> outputBuffer;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3058
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3059
    for(;;) // conversion loop
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3060
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3061
        // Start conversion. When the output buffer is full, return the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3062
        // number of characters that were not converted
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3063
        const TInt returnValue = CnvUtfConverter::ConvertFromUnicodeToUtf8(
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3064
            outputBuffer,   // Destination
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3065
            aWriteBuffer ); // Source
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3066
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3067
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3068
        // check to see that the descriptor isn’t corrupt - return with
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3069
        // err if it is
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3070
        if ( returnValue == CnvUtfConverter::EErrorIllFormedInput )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3071
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3072
            return( KErrCorrupt );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3073
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3074
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3075
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3076
            if ( returnValue < 0 ) // future-proof against "TError" expanding
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3077
                {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3078
                return( KErrGeneral );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3079
                }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3080
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3081
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3082
        // Store the converted contents of the output buffer into the stream
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3083
        TRAPD( err1, aStream.WriteL( outputBuffer ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3084
        if ( err1 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3085
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3086
            #ifdef _DEBUG
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3087
            RDebug::Printf("CSvgEngineImpl::WriteToStream error trapped=%d", err1);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3088
            return err1;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3089
            #endif
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3090
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3091
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3092
        // Finish conversion if there are no unconverted characters in the
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3093
        // remainder buffer
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3094
        if ( returnValue == 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3095
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3096
            break;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3097
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3098
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3099
        // Remove the converted source text from the remainder buffer.
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3100
        // The remainder buffer is then fed back into loop
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3101
        aWriteBuffer.Set( aWriteBuffer.Right( returnValue ));
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3102
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3103
    return KErrNone;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3104
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3105
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3106
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3107
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3108
// void CSvgEngineImpl::FindEditableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3109
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3110
void CSvgEngineImpl::FindEditableElements( CSvgElementImpl* aStartElement,
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3111
                                           RPointerArray<CSvgElementImpl>& aList )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3112
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3113
    if ( aStartElement == NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3114
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3115
        return;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3116
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3117
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3118
    CSvgElementImpl* child = (CSvgElementImpl*)aStartElement->FirstChild();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3119
    while ( child != NULL )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3120
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3121
        // add to list if child is found
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3122
        if ( child->ElemID() == KSvgTextElement || child->ElemID() == KSvgTextAreaElement  )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3123
            aList.Append( child );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3124
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3125
        // find in grandchildren if element is not a textArea
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3126
        if ( child->ElemID() != KSvgTextAreaElement )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3127
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3128
        FindEditableElements( child, aList );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3129
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3130
        child = (CSvgElementImpl*)child->NextSibling();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3131
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3132
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3133
TBool CSvgEngineImpl::IsSVGEnginePaused()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3134
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3135
	return (iSvgEngineState == ESVGEnginePaused );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3136
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3137
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3138
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3139
// --------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3140
// void CSvgEngineImpl::ResetContext()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3141
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3142
void CSvgEngineImpl::ResetContext()
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3143
{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3144
	if( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3145
		{
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3146
		iGfxContext->DestroyContext();
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3147
		}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3148
}
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3149
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3150
void CSvgEngineImpl::SetBitmapHeader(const TDesC* aHeaderData)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3151
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3152
    if (iGfxContext)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3153
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3154
        ((CGfx2dGcOpenVG *)iGfxContext)->SetBitmapHeader(aHeaderData);
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3155
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3156
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3157
//NGA
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3158
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3159
// SetGdiContext File
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3160
// ---------------------------------------------------------------------------
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3161
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3162
void CSvgEngineImpl::SetGdiContextL(CFbsBitmap* aCurrentBitmap, CFbsBitmap* aMask,TSize aCurrentBitmapSize,TDisplayMode aRenderDspMode,TDisplayMode aMaskDspMode)
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3163
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3164
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3165
    // Handle for both Non-NULL and NULL parameter
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3166
       iFrameBufferSize = aCurrentBitmapSize;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3167
       iRenderDspMode   = aRenderDspMode;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3168
       iMaskDspMode     = aMaskDspMode; 
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3169
       iFrameBuffer     = aCurrentBitmap;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3170
       iMask            = aMask;
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3171
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3172
    if ( aCurrentBitmapSize.iWidth > 0 && aCurrentBitmapSize.iHeight > 0 )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3173
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3174
        if ( !iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3175
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3176
                iGfxContext = CGfx2dGcOpenVG::NewL( aCurrentBitmapSize, iBitmapFontSpec, iSvgBitmapFontProvider,1 );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3177
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3178
        else
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3179
            {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3180
            iGfxContext->ChangeBufferSizeL( aCurrentBitmapSize );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3181
            }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3182
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3183
    else if ( iGfxContext )
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3184
        {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3185
        iGfxContext->ChangeBufferSizeL( TSize( 1, 1 ) );
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3186
        }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3187
    }
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3188
const TPtrC8 CSvgEngineImpl::TLVEncodedData() const
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3189
    {
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3190
    return (iGfxContext->TLVEncodedData());
90e0261ad33c Adding files needed to break SVGEngine dependency on MediaClientAudio.dll.
markw <markw@symbian.org>
parents:
diff changeset
  3191
    }