|
1 /* |
|
2 * Copyright (c) 1998-1999 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LAFBTPAN_H__ |
|
20 #define __LAFBTPAN_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <lafpublc.h> |
|
24 #include <gulutil.h> |
|
25 |
|
26 const TInt KLafButPanMaxLinesOfDlgButtons=5; // Change requires Uikon recompile. Must be same across all Uikon devices per Epoc release |
|
27 const TInt KLafButPanNoMinButWidth=0; |
|
28 |
|
29 |
|
30 /** |
|
31 * @internal |
|
32 * Do not use |
|
33 */ |
|
34 class LafButtonPanel |
|
35 { |
|
36 public: |
|
37 class TDimensions; |
|
38 public: |
|
39 IMPORT_C static TBool ButtonsAllSameSize(); |
|
40 IMPORT_C static void TranslateForExcessSpace(TInt aExcess, TInt& aShiftLeft, TInt& aShiftRight); |
|
41 IMPORT_C static void ReduceMarginsToFit( |
|
42 const TFixedArray<TDimensions,KLafButPanMaxLinesOfDlgButtons>& aArray, |
|
43 TInt8& aLeftBorder, TInt8& aRightBorder, TInt& aGapBetweenButtons); |
|
44 IMPORT_C static TMargins8 Margins(); |
|
45 inline static TInt DefaultStartCorner(); |
|
46 inline static TInt DefaultOrientation(); |
|
47 inline static TInt InterRowMargin(); |
|
48 inline static TInt VerGapBetweenButtons(); |
|
49 inline static TInt HorGapBetweenButtons(); |
|
50 inline static TInt MinButtonWidth(); |
|
51 private: |
|
52 enum TConstantType |
|
53 { |
|
54 EStartCorner, |
|
55 EOrientation, |
|
56 EInterRowMargin, |
|
57 EVerticalGap, |
|
58 EHorizontalGap, |
|
59 EMinWidth |
|
60 }; |
|
61 private: |
|
62 IMPORT_C static TInt Constant(TConstantType aConstant); |
|
63 }; |
|
64 |
|
65 /** |
|
66 * The LafButtonPanel::TDimensions is used to pass information about a row of |
|
67 * buttons from CEikButtonPanel to LafButtonPanel. |
|
68 */ |
|
69 class LafButtonPanel::TDimensions |
|
70 { |
|
71 public: |
|
72 TInt iNumButtons; |
|
73 TInt iExcess; |
|
74 }; |
|
75 |
|
76 /** |
|
77 * The DefaultStartCorner() function should return ELafBtPanFromTopLeft if the first button is |
|
78 * to be leftmost, or ELafBtPanFromTopRight if the first button is to be rightmost. |
|
79 */ |
|
80 inline TInt LafButtonPanel::DefaultStartCorner() |
|
81 {//static |
|
82 return Constant(EStartCorner); |
|
83 }; |
|
84 |
|
85 /** |
|
86 * The DefaultOrientation() function should return ELafBtPanLayVertically for a device allowing |
|
87 * vertical buttons, or ELafBtPanLayHorizontally for a device with only horizontal buttons. |
|
88 */ |
|
89 inline TInt LafButtonPanel::DefaultOrientation() |
|
90 {//static |
|
91 return Constant(EOrientation); |
|
92 }; |
|
93 |
|
94 /** |
|
95 * The InterRowMargin() function returns the size of the gap between two |
|
96 * rows of buttons. |
|
97 */ |
|
98 inline TInt LafButtonPanel::InterRowMargin() |
|
99 {//static |
|
100 return Constant(EInterRowMargin); |
|
101 }; |
|
102 |
|
103 /** |
|
104 * The VerGapBetweenButtons() function returns the size of the vertical gap between two |
|
105 * buttons in a vertical layout. |
|
106 */ |
|
107 inline TInt LafButtonPanel::VerGapBetweenButtons() |
|
108 {//static |
|
109 return Constant(EVerticalGap); |
|
110 }; |
|
111 |
|
112 /** |
|
113 * The HorGapBetweenButtons() function returns the size of the desired horizontal gap between two |
|
114 * buttons in a horizontal layout. |
|
115 */ |
|
116 inline TInt LafButtonPanel::HorGapBetweenButtons() |
|
117 {//static |
|
118 return Constant(EHorizontalGap); |
|
119 }; |
|
120 |
|
121 /** |
|
122 * The MinButtonWidth() function returns the minimum size of a dialog button. If set to |
|
123 * KLafButPanNoMinButWidth then the minimum width of the button will be used. |
|
124 */ |
|
125 inline TInt LafButtonPanel::MinButtonWidth() |
|
126 {//static |
|
127 return Constant(EMinWidth); |
|
128 }; |
|
129 |
|
130 |
|
131 #endif // __LAFBTPAN_H__ |