javauis/lcdui_akn/lcdui/inc/CMIDFormRow.h
branchRCL_3
changeset 19 04becd199f91
child 60 6c158198356e
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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     virtual void SizeChanged();
       
    48     virtual TSize MinimumSize();
       
    49 
       
    50 public: // interface to CMIDForm
       
    51     void AppendL(CMIDControlItem* aItem);
       
    52     void SetAlignment(MMIDItem::TLayout aAlignment);
       
    53     void SizeItemsL();
       
    54     TInt NumItems();
       
    55     TInt Find(const CMIDControlItem* aItem) const;
       
    56     CMIDControlItem* Item(TInt aIndex);
       
    57     TBool HasFocusableItemOnOrAboveScreen();
       
    58     TBool HasFocusableItemOnOrBelowScreen();
       
    59     CMIDControlItem* FirstFocusableItemOnScreen();
       
    60     CMIDControlItem* FirstFocusableItem();
       
    61     CMIDControlItem* LastFocusableItem();
       
    62     TBool RemoveItemIfExists(CMIDControlItem& aItem);
       
    63     TInt CurrentWidth();
       
    64 
       
    65     TBool HasNonSpacerItems() const;
       
    66 
       
    67     inline void SetEmptyRowSize(const TSize& aEmptyRowSize);
       
    68     inline const TSize& EmptyRowSize() const;
       
    69 
       
    70 private:
       
    71     CMIDFormRow(CMIDForm& aForm);
       
    72     void ConstructL();
       
    73 
       
    74 private:
       
    75     CMIDForm& iForm;
       
    76     MMIDItem::TLayout iAlignment; // ELeft, ERight, or ECenter
       
    77     RArray<CMIDControlItem*> iItems;
       
    78     TSize  iEmptyRowSize; // size used for empty rows
       
    79     TInt iCurrentWidth;             // used when adding items to the row. Keeps track of the total width of items added to row
       
    80 };
       
    81 
       
    82 
       
    83 inline void CMIDFormRow::SetEmptyRowSize(const TSize& aEmptyRowSize)
       
    84 {
       
    85     iEmptyRowSize = aEmptyRowSize;
       
    86 }
       
    87 
       
    88 inline const TSize& CMIDFormRow:: EmptyRowSize() const
       
    89 {
       
    90     return iEmptyRowSize;
       
    91 }
       
    92 
       
    93 #endif // CMIDFORMROW_H