66
|
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: Implements the Form LCDUI component.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CMIDFORMROW_H
|
|
20 |
#define CMIDFORMROW_H
|
|
21 |
|
|
22 |
// CCoeControl inheritance in CMIDFormRow class
|
|
23 |
// and API from CCoeControl
|
|
24 |
#include <coecntrl.h>
|
|
25 |
|
|
26 |
#include <lcdui.h>
|
|
27 |
|
|
28 |
class CMIDForm;
|
|
29 |
class CMIDControlItem;
|
|
30 |
|
|
31 |
|
|
32 |
/**
|
|
33 |
* A row in a form. Manages form items that have been assigned to this
|
|
34 |
* row by the form.
|
|
35 |
*
|
|
36 |
* @see CMIDForm, CMIDControlItem
|
|
37 |
*/
|
|
38 |
NONSHARABLE_CLASS(CMIDFormRow) : public CCoeControl
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
static CMIDFormRow* NewL(CMIDForm& aForm);
|
|
42 |
~CMIDFormRow();
|
|
43 |
|
|
44 |
public: // From CCoeControl
|
|
45 |
TInt CountComponentControls() const;
|
|
46 |
CCoeControl* ComponentControl(TInt aIndex) const;
|
|
47 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
48 |
void Draw(const TRect& /*aRect*/) const;
|
|
49 |
#endif // RD_JAVA_S60_RELEASE_9_2
|
|
50 |
virtual void SizeChanged();
|
|
51 |
virtual TSize MinimumSize();
|
|
52 |
|
|
53 |
public: // interface to CMIDForm
|
|
54 |
void AppendL(CMIDControlItem* aItem);
|
|
55 |
void SetAlignment(MMIDItem::TLayout aAlignment);
|
|
56 |
void SizeItemsL();
|
|
57 |
TInt NumItems();
|
|
58 |
TInt Find(const CMIDControlItem* aItem) const;
|
|
59 |
CMIDControlItem* Item(TInt aIndex);
|
|
60 |
TBool HasFocusableItemOnOrAboveScreen();
|
|
61 |
TBool HasFocusableItemOnOrBelowScreen();
|
|
62 |
CMIDControlItem* FirstFocusableItemOnScreen();
|
|
63 |
CMIDControlItem* FirstFocusableItem();
|
|
64 |
CMIDControlItem* LastFocusableItem();
|
|
65 |
TBool RemoveItemIfExists(CMIDControlItem& aItem);
|
|
66 |
TInt CurrentWidth();
|
|
67 |
|
|
68 |
TBool HasNonSpacerItems() const;
|
|
69 |
|
|
70 |
inline void SetEmptyRowSize(const TSize& aEmptyRowSize);
|
|
71 |
inline const TSize& EmptyRowSize() const;
|
|
72 |
|
|
73 |
private:
|
|
74 |
CMIDFormRow(CMIDForm& aForm);
|
|
75 |
void ConstructL();
|
|
76 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
77 |
/**
|
|
78 |
* Checks whether the separator line must be drawn
|
|
79 |
* above this form row.
|
|
80 |
*/
|
|
81 |
void SetSeparator();
|
|
82 |
#endif // RD_JAVA_S60_RELEASE_9_2
|
|
83 |
|
|
84 |
private:
|
|
85 |
CMIDForm& iForm;
|
|
86 |
MMIDItem::TLayout iAlignment; // ELeft, ERight, or ECenter
|
|
87 |
RArray<CMIDControlItem*> iItems;
|
|
88 |
TSize iEmptyRowSize; // size used for empty rows
|
|
89 |
TInt iCurrentWidth; // used when adding items to the row. Keeps track of the total width of items added to row
|
|
90 |
#ifdef RD_JAVA_S60_RELEASE_9_2
|
|
91 |
/**
|
|
92 |
* Separator line is drawn between Form rows (except between Form rows that
|
|
93 |
* belong together e.g. concatenated StringItems).
|
|
94 |
*/
|
|
95 |
TBool iSeparator;
|
|
96 |
#endif // RD_JAVA_S60_RELEASE_9_2
|
|
97 |
};
|
|
98 |
|
|
99 |
|
|
100 |
inline void CMIDFormRow::SetEmptyRowSize(const TSize& aEmptyRowSize)
|
|
101 |
{
|
|
102 |
iEmptyRowSize = aEmptyRowSize;
|
|
103 |
}
|
|
104 |
|
|
105 |
inline const TSize& CMIDFormRow:: EmptyRowSize() const
|
|
106 |
{
|
|
107 |
return iEmptyRowSize;
|
|
108 |
}
|
|
109 |
|
|
110 |
#endif // CMIDFORMROW_H
|