activeapdb.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : ActiveApDb.h
00004 *  Part of  : Access Point Settings Handler UI
00005 *
00006 *  Description: Declaration of classes CActiveApDb
00007 *               and MActiveApDbObserver.
00008 *  Version:
00009 *
00010 *  Copyright (C) 2002 Nokia Corporation.
00011 *  This material, including documentation and any related 
00012 *  computer programs, is protected by copyright controlled by 
00013 *  Nokia Corporation. All rights are reserved. Copying, 
00014 *  including reproducing, storing,  adapting or translating, any 
00015 *  or all of this material requires the prior written consent of 
00016 *  Nokia Corporation. This material also contains confidential 
00017 *  information which may not be disclosed to others without the 
00018 *  prior written consent of Nokia Corporation.
00019 *
00020 * ============================================================================
00021 */
00022 
00023 #ifndef ACTIVE_APDB_H
00024 #define ACTIVE_APDB_H
00025 
00026 // Deprecation warning
00027 #warning This header file has been deprecated. Will be removed in one of the next SDK releases.
00028 
00029 
00030 //  INCLUDES
00031 #include <commdb.h>
00032 #include <ApEngineVer.h>
00033 
00034 /*
00035 // Enum for DATABASE_TYPE field
00036 // Will be deprecated in 7.0
00037 enum TCommDbDatabaseType
00038     {
00039     EUnspecified = 0,   // not specifying which type it is - any type of 
00040                         // database can be opened with this parameter
00041     EIAP,
00042     EISP
00043     };
00044 */
00045 
00046 // CONSTANTS
00047 const TInt KErrActiveApDbObserverNotFound = -500;
00048 
00049 // FORWARD DECLARATION
00050 class CActiveApDbNotifier;
00051 
00052 // CLASS DECLARATION
00053 
00058 class MActiveApDbObserver
00059     {
00060     public:     // types
00061         enum TEvent       
00062             {
00063             EDbChanged,   
00064             EDbClosing,   
00065             EDbAvailable  
00066             };
00067 
00068     public:     // new methods
00069 
00077         IMPORT_C virtual void HandleApDbEventL( TEvent anEvent ) = 0;
00078 
00079     };
00080 
00089 NONSHARABLE_CLASS( CActiveApDb ) : public CBase
00090     {
00091 
00092     public:     // Constructors and destructor
00101         IMPORT_C static CActiveApDb* NewL
00102             ( TCommDbDatabaseType aType = EDatabaseTypeIAP );
00103 
00104 
00105 
00111         IMPORT_C virtual ~CActiveApDb();
00112 
00113     protected:  // Constructors
00114 
00120         void ConstructL();
00121 
00122     public:     // new methods
00133         IMPORT_C void AddObserverL( MActiveApDbObserver* anObserver );
00134 
00135 
00142         IMPORT_C void RemoveObserver( MActiveApDbObserver* anObserver );
00143 
00144 
00151         IMPORT_C CCommsDatabase*  Database();
00152 
00153     private:
00160         void HandleDbEventL( TInt anEvent );
00161 
00162 
00167         void NotifyObserversL( MActiveApDbObserver::TEvent anEvent );
00168 
00169     friend class CActiveApDbNotifier;
00170 
00171     private:    // types
00175         CActiveApDb();
00176 
00177 
00178         enum TState             
00179             {
00180             EClosed,            
00181             EReady,             
00182             EWaitClose,         
00183             EWaitBackupRestore, 
00184             EWaitShutdown       
00185             };
00186 
00187     private:        // Data
00188         CArrayPtrFlat<MActiveApDbObserver>* iObservers;   
00189 
00190         CCommsDatabase*     iDb;    // Creates & owns it !
00191         // CommsDb has its own RDbNotifier...
00192         TState iState;  
00193         CActiveApDbNotifier*    iDbNotifier;
00194     };
00195 
00196 #endif
00197 
00198 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top