|
1 /* |
|
2 * Copyright (c) 2008-2009 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: Layout blender |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_GLXBLENDLAYOUTBLEND_H |
|
22 #define C_GLXBLENDLAYOUTBLEND_H |
|
23 |
|
24 #include <glxlayout.h> |
|
25 |
|
26 /** |
|
27 * TGlxBlendLayout |
|
28 * |
|
29 * Blender of multiple MGlxLayouts based on coefficients |
|
30 * |
|
31 * @lib glxlayouts.lib |
|
32 */ |
|
33 |
|
34 //@TODO : Class wont be used - To be removed |
|
35 class TGlxBlendLayout : public TGlxLayout |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Constructor, reset the values |
|
41 */ |
|
42 IMPORT_C TGlxBlendLayout(); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 IMPORT_C ~TGlxBlendLayout(); |
|
48 |
|
49 /** |
|
50 * Add a layout to be blended |
|
51 * @param aLayout the layout to add, cannot be NULL |
|
52 */ |
|
53 IMPORT_C void AddLayoutL( MGlxLayout* aLayout ); |
|
54 |
|
55 /** |
|
56 * Remove an existing layout |
|
57 * @param aLayout the layout to remove |
|
58 */ |
|
59 IMPORT_C void RemoveLayout( const MGlxLayout* aLayout ); |
|
60 |
|
61 /** |
|
62 * Remove all existing layouts |
|
63 */ |
|
64 IMPORT_C void RemoveAllLayouts(); |
|
65 |
|
66 protected: // From TGlxLayout |
|
67 |
|
68 /// @ref TGlxLayout::DoSetLayoutValues |
|
69 void DoSetLayoutValues( TGlxLayoutInfo& aInfo ); |
|
70 /// @ref TGlxLayout::DoChanged |
|
71 TBool DoChanged() const; |
|
72 /// @ref TGlxLayout::DoClearChanged |
|
73 void DoClearChanged(); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * Helper struct to store the layout and layout info |
|
79 */ |
|
80 struct TLayout |
|
81 { |
|
82 /// Ref: the layout |
|
83 MGlxLayout* iLayout; |
|
84 /// Own: the layoutinfo for the layout |
|
85 TGlxLayoutInfoResetter iLayoutInfo; |
|
86 /** |
|
87 * Helper to tell whether two TLayout structs match |
|
88 */ |
|
89 static TBool Match( const TLayout& aLhs, const TLayout& aRhs ); |
|
90 }; |
|
91 /// Own: array of cached layout infos |
|
92 RArray< TLayout > iLayouts; |
|
93 |
|
94 /** |
|
95 * Changed flag to remember whether any layouts have been added or removed |
|
96 * since the las call to DoClearChanged |
|
97 */ |
|
98 TBool iChanged; |
|
99 }; |
|
100 |
|
101 #endif // C_GLXBLENDLAYOUTBLEND_H |