database.h

来自「一个symbian操作系统的」· C头文件 代码 · 共 98 行

H
98
字号
/*
* ============================================================================
*  Name     : CHeatMeter2View from HeatMeter2View.h
*  Part of  : HeatMeter2
*  Created  : 2004.03.27. by 
*  Description:
*     Declares view for application.
*  Version  :
*  Copyright: 
* ============================================================================
*/

#ifndef DATABASE_H
#define DATABASE_H

// INCLUDES
#include <aknview.h>
#include <d32dbms.h>
#include "GprsClient.h"

// FORWARD DECLARATIONS

// CLASS DECLARATION

/**
*  CDataBase class.
* 
*/

class MContainerObserver
{
public:
	virtual void SynchReady() = 0;
	virtual void SynchFailed(TInt aReason) = 0;
};



class CDataBase : public MDbObserver
    {
    public: // Constructors and destructor

        /**
        * EPOC default constructor.
        */
		static CDataBase* NewL(MContainerObserver *aCallBack);
		static CDataBase* NewLC(MContainerObserver *aCallBack);

        /**
        * Destructor.
        */
        virtual ~CDataBase();

    public: // Functions from base classes
		//update the value of a database item
	    void UpdateItemValue(TInt aID, TInt aState);

		//start synchronisation
	    void Synch(TInetAddr& aIpAddress, TDesC& aPath);

		//fill the array with values from the database
	    void FillArrays(CDesCArray* aListBoxArray, CArrayFixFlat<TInt> *aValues, CArrayFixFlat<TInt> *aIDs);

		//called when response from the server has been received
		void ResponseReceived(TDesC8 &aResponse);
        

    private:
        void ConstructL(MContainerObserver *aCallBack);


	public:
		void ResetDataBase();
		TInt iClientID;

    private: // Data
		//save ini file
	    void SaveIniFile();

		//open database if any
	    TInt OpenDb();

		//create database
	    TInt CreateDb();
		RFs	iFs;
		RDbNamedDatabase iHeatMeterDb;
		RDbs iDbSession;
		TFileName fileName;
		TFileName iniFileName;
		CGprsClient *iGprsClient;
		TInt iVersion;
		MContainerObserver *iCallBack;
    };

#endif

// End of File

⌨️ 快捷键说明

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