46
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: SVG Implementation source file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <e32base.h>
|
|
20 |
|
|
21 |
#include "SVGPreserveAspectRatioImpl.h"
|
|
22 |
|
|
23 |
|
|
24 |
// ---------------------------------------------------------------------------
|
|
25 |
//
|
|
26 |
// ---------------------------------------------------------------------------
|
|
27 |
CSvgPreserveAspectRatioImpl* CSvgPreserveAspectRatioImpl::NewL()
|
|
28 |
{
|
|
29 |
CSvgPreserveAspectRatioImpl* self = new ( ELeave )
|
|
30 |
CSvgPreserveAspectRatioImpl();
|
|
31 |
CleanupStack::PushL( self );
|
|
32 |
self->ConstructL();
|
|
33 |
CleanupStack::Pop();
|
|
34 |
|
|
35 |
return self;
|
|
36 |
}
|
|
37 |
|
|
38 |
// ---------------------------------------------------------------------------
|
|
39 |
//
|
|
40 |
// ---------------------------------------------------------------------------
|
|
41 |
CSvgPreserveAspectRatioImpl* CSvgPreserveAspectRatioImpl::NewLC()
|
|
42 |
{
|
|
43 |
CSvgPreserveAspectRatioImpl* self = new ( ELeave )
|
|
44 |
CSvgPreserveAspectRatioImpl();
|
|
45 |
CleanupStack::PushL( self );
|
|
46 |
self->ConstructL();
|
|
47 |
|
|
48 |
return self;
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
//
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
CSvgPreserveAspectRatioImpl::~CSvgPreserveAspectRatioImpl()
|
|
55 |
{
|
|
56 |
}
|
|
57 |
|
|
58 |
// *******************************************************
|
|
59 |
// From SVG DOM
|
|
60 |
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
// ---------------------------------------------------------------------------
|
|
64 |
TSvgPreserveAspectAlignType CSvgPreserveAspectRatioImpl::GetAlign()
|
|
65 |
{
|
|
66 |
return iAlign;
|
|
67 |
}
|
|
68 |
|
|
69 |
// ---------------------------------------------------------------------------
|
|
70 |
//
|
|
71 |
// ---------------------------------------------------------------------------
|
|
72 |
TSvgMeetOrSliceType CSvgPreserveAspectRatioImpl::GetMeetOrSlice()
|
|
73 |
{
|
|
74 |
return iMeetOrSlice;
|
|
75 |
}
|
|
76 |
|
|
77 |
// *******************************************************
|
|
78 |
// SVG Implementation
|
|
79 |
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
// ---------------------------------------------------------------------------
|
|
83 |
void CSvgPreserveAspectRatioImpl::SetAlign( TSvgPreserveAspectAlignType aType )
|
|
84 |
{
|
|
85 |
iAlign = aType;
|
|
86 |
}
|
|
87 |
|
|
88 |
// ---------------------------------------------------------------------------
|
|
89 |
//
|
|
90 |
// ---------------------------------------------------------------------------
|
|
91 |
void CSvgPreserveAspectRatioImpl::SetMeetOrSlice( TSvgMeetOrSliceType aType )
|
|
92 |
{
|
|
93 |
iMeetOrSlice = aType;
|
|
94 |
}
|
|
95 |
|
|
96 |
// *******************************************************
|
|
97 |
// Private
|
|
98 |
|
|
99 |
// ---------------------------------------------------------------------------
|
|
100 |
//
|
|
101 |
// ---------------------------------------------------------------------------
|
|
102 |
void CSvgPreserveAspectRatioImpl::ConstructL()
|
|
103 |
{
|
|
104 |
}
|
|
105 |
|
|
106 |
// ---------------------------------------------------------------------------
|
|
107 |
//
|
|
108 |
// ---------------------------------------------------------------------------
|
|
109 |
CSvgPreserveAspectRatioImpl::CSvgPreserveAspectRatioImpl() : iMeetOrSlice( ESvgMeetOrSlice_Meet ),
|
|
110 |
iAlign( ESvgPreserveAspectRatio_XmidYmid )
|
|
111 |
{
|
|
112 |
}
|
|
113 |
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
// ---------------------------------------------------------------------------
|
|
117 |
CSvgPreserveAspectRatioImpl* CSvgPreserveAspectRatioImpl::CloneL()
|
|
118 |
{
|
|
119 |
CSvgPreserveAspectRatioImpl* retValue = CSvgPreserveAspectRatioImpl::NewL();
|
|
120 |
retValue->iMeetOrSlice = iMeetOrSlice;
|
|
121 |
retValue->iAlign = iAlign;
|
|
122 |
return retValue;
|
|
123 |
}
|