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

📄 shoppinglistdocument.h

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

#ifndef __SHOPPINGLIST_DOCUMENT_H__
#define __SHOPPINGLIST_DOCUMENT_H__

#include <akndoc.h>

class CShoppingListAppUi;
class CShoppingItem;
class CEikApplication;

/*! 
  @class CShoppingListDocument
  
  @discussion An instance of class CShoppingListDocument is the Document part of the AVKON
  application framework for the ShoppingList example application
  */

class CShoppingListDocument : public CAknDocument
    {
public:

/*!
  @function NewL
  
  @discussion Construct a CShoppingListDocument for the AVKON application aApp 
  using two phase construction, and return a pointer to the created object
  @param aApp The application creating this document
  @result A pointer to the created instance of CShoppingListDocument
  */
    static CShoppingListDocument* NewL(CEikApplication& aApp);

/*!
  @function NewLC
  
  @discussion Construct a CShoppingListDocument for the AVKON application aApp 
  using two phase construction, and return a pointer to the created object
  @param aApp The application creating this document
  @result A pointer to the created instance of CShoppingListDocument
  */
    static CShoppingListDocument* NewLC(CEikApplication& aApp);

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

public: // from CAknDocument
/*!
  @function CreateAppUiL 
  
  @discussion Create a CShoppingListAppUi object and return a pointer to it
  @result A pointer to the created instance of the AppUi created
  */
    CEikAppUi* CreateAppUiL();

/*!
  @function OpenFileL

  @discussion Called by the Uikon framework to open a file.

  @param aDoOpen open an existing file if ETrue; otherwise create a new file. 
  @param aFilename the file to open or create. 
  @param aFs file server session to use. 
  @result a file store object referring to the newly-opened file.
  */
	CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);

/*!
  @function ItemList
  
  @discussion Get the list of shopping items.
  @result The list of shopping items
  */
	RPointerArray<CShoppingItem>& ItemList();

/*!
  @function StoreL
  
  @discussion Store the document's content and state, recording the identity of any headstreams created.
  @param aStore stream store to which data is saved
  @param aStreamDic stream dictionary in which to record headstreams
  */
	void StoreL(CStreamStore& aStore, CStreamDictionary& aStreamDic) const;

/*!
  @function RestoreL
  
  @discussion Restore this document from a stream store.
  @param aStore stream store from which to read the new state and content 
  @param aStreamDic stream dictionary in which to look up head streams
  */
	void RestoreL(const CStreamStore& aStore, const CStreamDictionary& aStreamDic);

/*!
  @function Item
  
  @discussion Return the ShoppingItem at index aIndex.
  @param aIndex the index of the ShoppingItem to return
  @result a pointer to the ShoppingItem at index aIndex
  */
	CShoppingItem* Item(TInt aIndex);

/*!
  @function InsertItemL
  
  @discussion Insert the ShoppingItem aItem into the shopping list at aIndex.
  @param aItem the ShoppingItem to insert
  @param aIndex the index at which to insert the ShoppingItem
  */
	void InsertItemL(CShoppingItem* aItem, TInt aIndex);

/*!
  @function RemoveItem
  
  @discussion Remove and delete the item at aIndex in the shopping list.
  @param aIndex the index of the item to be removed
  */
	void RemoveItem(TInt aIndex);

/*!
  @function ItemCount
  
  @discussion Return the number of ShoppingItems in the list
  @result the number of ShoppingItems in the list
  */
	TInt ItemCount();

private:
/*!
  @function ConstructL
  
  @discussion Perform the second phase construction of a CShoppingListDocument object
  */
    void ConstructL();

/*!
  @function CShoppingListDocument
  
  @discussion Perform the first phase of two phase construction. 
  @param aApp The application creating this document
  */
    CShoppingListDocument(CEikApplication& aApp);

private:

	/*! @var iItemList the list of shopping items */
    RPointerArray<CShoppingItem> iItemList;

    };

#endif // __SHOPPINGLIST_DOCUMENT_H__

⌨️ 快捷键说明

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