⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shoppinglistappview.h

📁 为symbian7.0c操作系统series60系列开发的购物软件
💻 H
字号:
/* Copyright (c) 2003, Nokia. All rights reserved */

#ifndef __SHOPPINGLIST_APPVIEW_H__
#define __SHOPPINGLIST_APPVIEW_H__

#include <aknlists.h>
#include <coecntrl.h>

class CShoppingListDocument;
class CShoppingItem;

/*! 
  @class CShoppingListAppView
  
  @discussion An instance of CShoppingListAppView is the Application View object
  for the ShoppingList example application
  */
class CShoppingListAppView : public CCoeControl
    {
public:

/*!
  @function NewL
   
  @discussion Create a CShoppingListAppView object, which will draw itself to aRect
  @param aRect The rectangle this view will be drawn to
  @param aDocument The application document that the veiew is of.
  @result A pointer to the created instance of CShoppingListAppView
  */
    static CShoppingListAppView* NewL(const TRect& aRect, CShoppingListDocument* aDocument);

/*!
  @function NewLC
   
  @discussion Create a CShoppingListAppView object, which will draw itself to aRect
  @param aRect The rectangle this view will be drawn to.
  @param aDocument The application document that the veiew is of.
  @result A pointer to the created instance of CShoppingListAppView
  */
    static CShoppingListAppView* NewLC(const TRect& aRect, CShoppingListDocument* aDocument);

/*!
  @function ~CShoppingListAppView
  
  @discussion Destroy the object
  */
     ~CShoppingListAppView();

/*!
  @function UpdateL
  
  @discussion  Update this view so that it corresponds to the Document
  */
	void UpdateL();


/*!
  @function ListBox
  
  @discussion Get the ListBox that is displaying the shopping list
  @result the ListBox that is displaying the shopping list
  */
	CAknSingleStyleListBox* ListBox();


/*!
  @function CurrentItemIndex

  @discussion Return the index number of the current item in the view.
  @result the index number of the current item in the view.
  */
	TInt CurrentItemIndex() const;


/*!
  @function SetCurrentItemIndex

  @discussion Set the current item in the view to aIndex.
  @param aIndex the index of the item to be set as the current item
  */
	void SetCurrentItemIndex(TInt aIndex);


/*!
  @function PrependLC
  
  @discussion Create a new HBufC string by prepending aString1 to aString2

  @param aString1 the first string
  @param aString2 the second string
  @result a new HBufC string comprising aString1 prepended to aString2
  */
	HBufC* PrependLC( const TDesC& aString1, TDesC& aString2 );

public:  // from CCoeControl
/*!
  @function Draw
  
  @discussion Draw this CShoppingListAppView to the screen
  @param aRect The rectangle of this view that needs updating
  */
    void Draw(const TRect& aRect) const;

/*!
  @function OfferKeyEventL
  
  @discussion Handle key events.
  @param aKeyEvent The key event.
  @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
  @result Was the key event used by this control.
  */
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

/*!
  @function CountComponentControls
  
  @discussion Get the number of controls contained in a compound control.
  @result The number of component controls contained by this control.
  */
    TInt CountComponentControls() const;

/*!
  @function ComponentControl
 
  @discussion Get the specified component of a compound control.
  @param aIndex the index of the control to return.
  @result The component control with an index of aIndex.
  */
    CCoeControl* ComponentControl(TInt aIndex) const;

private:
/*!
  @function ConstructL
  
  @discussion  Perform the second phase construction of a CShoppingListAppView object
  @param aRect The rectangle this view will be drawn to
  */
    void ConstructL(const TRect& aRect);

/*!
  @function CShoppingListAppView
  
  @discussion Perform the first phase of two phase construction
  @param aDocument The document containing the list of shopping items
  */
    CShoppingListAppView(CShoppingListDocument* aDocument);

private:

    /*! @var iDocument the document containing the list of shopping items */
	CShoppingListDocument* const iDocument;

    /*! @var iListBox the ListBox displaying the shopping list */
    CAknSingleStyleListBox* iListBox;

	/*! @var iListBoxRows the contents of the ListBox */
	CDesCArrayFlat* iListBoxRows;

    };


#endif // __SHOPPINGLIST_APPVIEW_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -