1 /* |
|
2 * Copyright (c) 2007 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: flow layout policy. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef I_ALFFLOWLAYOUTPOLICY |
|
20 #define I_ALFFLOWLAYOUTPOLICY |
|
21 |
|
22 #include <alf/ialfinterfacebase.h> |
|
23 #include <alf/alftypes.h> |
|
24 |
|
25 namespace Alf |
|
26 { |
|
27 |
|
28 namespace ialfflowlayoutpolicy |
|
29 { |
|
30 static const IfId Ident = |
|
31 { |
|
32 0, "flowlayoutpolicy" |
|
33 }; |
|
34 } |
|
35 |
|
36 /** |
|
37 * interface for flow layout policy. The policy-interface can be queried |
|
38 * from the layoutmanager using the makeInterface- call. |
|
39 * @see IAlfLayoutManager |
|
40 * |
|
41 * @lib alfwidgetmodel.lib |
|
42 * @since S60 ?S60_version |
|
43 * @status Draft |
|
44 */ |
|
45 class IAlfFlowLayoutPolicy : public IAlfInterfaceBase |
|
46 { |
|
47 public: |
|
48 |
|
49 /** Flow directions. */ |
|
50 enum flowDirection |
|
51 { |
|
52 /** |
|
53 * Flow horizontally. System wide layout mirroring is considered |
|
54 * to determine whether visuals are layed from left to right |
|
55 * or from right to left. |
|
56 */ |
|
57 EFlowHorizontal, |
|
58 |
|
59 /** Flow vertically. */ |
|
60 EFlowVertical |
|
61 }; |
|
62 |
|
63 /** Mode flags that specify how the flow is laid out. */ |
|
64 enum flowModeFlags |
|
65 { |
|
66 /** Center the children perpendicular to the flow direction. |
|
67 For example, if the flow direction is horizontal (left->right) |
|
68 this flag will center the children vertically along the flow. */ |
|
69 EFlowModeCenterPerpendicular = 0x1, |
|
70 |
|
71 /** Fit the children perpendicular to the flow direction. |
|
72 For example, if the flow direction is horizontal, the children |
|
73 will be vertically resized to fit the layout's rectangle. */ |
|
74 EFlowModeFitPerpendicular = 0x2 |
|
75 }; |
|
76 public: |
|
77 |
|
78 static inline const IfId& type() |
|
79 { |
|
80 return ialfflowlayoutpolicy::Ident; |
|
81 } |
|
82 |
|
83 virtual inline ~IAlfFlowLayoutPolicy() {} |
|
84 |
|
85 /** |
|
86 * Sets the direction of the flow. |
|
87 * |
|
88 * @param aDirection Flow direction. |
|
89 */ |
|
90 virtual void setFlowDirection(enum flowDirection aDirection) = 0; |
|
91 |
|
92 /** |
|
93 * returns the flow direction |
|
94 * |
|
95 * @param aDirection Flow direction. |
|
96 */ |
|
97 virtual enum flowDirection flowDirection() const = 0; |
|
98 |
|
99 /** |
|
100 * Sets the mode of the flow. The mode flags determine how the flow layout |
|
101 * behaves. |
|
102 * |
|
103 * @param aMode Mode flags (OR'd together). |
|
104 * |
|
105 * @see IAlfFlowLayoutPolicy::flowModeFlags |
|
106 */ |
|
107 virtual void setMode(int aMode) = 0; |
|
108 |
|
109 /** |
|
110 * Returns the mode flags of the flow. |
|
111 * |
|
112 * @see IAlfFlowLayoutPolicy::flowModeFlags |
|
113 * |
|
114 * @return Returns the current mode flags. |
|
115 */ |
|
116 virtual int mode() const = 0; |
|
117 |
|
118 public: |
|
119 // from base class IAlfInterfaceBase |
|
120 |
|
121 /** |
|
122 * Interface getter. |
|
123 * @see IAlfInterfaceBase::MakeInterface |
|
124 * |
|
125 * @since S60 ?S60_version |
|
126 * @param aType The type id of the queried interface. |
|
127 * @return The queried interface, or NULL if the interface is not |
|
128 * supported or available. |
|
129 */ |
|
130 virtual IAlfInterfaceBase* makeInterface( const IfId& aType ) = 0; |
|
131 }; |
|
132 |
|
133 } // namespace Alf |
|
134 |
|
135 #endif // I_ALFFLOWLAYOUTPOLICY |
|