📄 shoppinglistdocument.h
字号:
/* Copyright (c) 2004, Nokia. All rights reserved */
#ifndef __SHOPPINGLIST_DOCUMENT_H__
#define __SHOPPINGLIST_DOCUMENT_H__
// INCLUDES
#include <akndoc.h>
// FORWARD DECLARATIONS
class CShoppingListAppUi;
class CShoppingItem;
class CEikApplication;
// CLASS DECLARATION
/**
* CShoppingListDocument
* An instance of class CShoppingListDocument is the Document part of the AVKON
* application framework for the ShoppingList example application
*/
class CShoppingListDocument : public CAknDocument
{
public:
/**
* NewL
* 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
* @return A pointer to the created instance of CShoppingListDocument
*/
static CShoppingListDocument* NewL( CEikApplication& aApp );
/**
* NewLC
* 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
* @return A pointer to the created instance of CShoppingListDocument
*/
static CShoppingListDocument* NewLC( CEikApplication& aApp );
/**
* ~CShoppingListDocument
* Destroy the object
*/
virtual ~CShoppingListDocument();
public: // from CAknDocument
/**
* CreateAppUiL
* Create a CShoppingListAppUi object and return a pointer to it
* @return A pointer to the created instance of the AppUi created
*/
CEikAppUi* CreateAppUiL();
/**
* OpenFileL
* 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.
* @return a file store object referring to the newly-opened file.
*/
CFileStore* OpenFileL( TBool aDoOpen,const TDesC& aFilename,RFs& aFs );
/**
* ItemList
* Get the list of shopping items.
* @return The list of shopping items
*/
RPointerArray<CShoppingItem>& ItemList();
/**
* StoreL
* 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;
/**
* RestoreL
* 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 );
/**
* Item
* Return the ShoppingItem at index aIndex.
* @param aIndex the index of the ShoppingItem to return
* @return a pointer to the ShoppingItem at index aIndex
*/
CShoppingItem* Item( TInt aIndex );
/**
* InsertItemL
* 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 );
/**
* RemoveItem
* 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 );
/**
* ItemCount
* Return the number of ShoppingItems in the list
* @return the number of ShoppingItems in the list
*/
TInt ItemCount();
private:
/**
* ConstructL
* Perform the second phase construction of a CShoppingListDocument object
*/
void ConstructL();
/**
* CShoppingListDocument
* Perform the first phase of two phase construction.
* @param aApp The application creating this document
*/
CShoppingListDocument( CEikApplication& aApp );
private:
/**
* iItemList the list of shopping items
*/
RPointerArray<CShoppingItem> iItemList;
};
#endif // __SHOPPINGLIST_DOCUMENT_H__
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -