examples/ForumNokia/DBMS/inc/DBMSAppui.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 #ifndef __DBMSAPPUI_H__
00006 #define __DBMSAPPUI_H__
00007 
00008 #include <aknappui.h>
00009 #include "DBMSEngine.h"
00010 
00011 // Forward declarations
00012 class CDBMSAppView;
00013 class CDBMSListboxView;
00014 class CDBMSEditorView;
00015 class CDesC16ArrayFlat;
00016 
00017 // Name of database file in the application directory
00018 _LIT(KDatabaseFile,"DBMS.dat");
00019 
00020 
00032 class CDBMSAppUi : public CAknAppUi
00033     {
00034 public:
00035 
00043     void ConstructL();
00044 
00052     CDBMSAppUi();
00053 
00054 
00060     ~CDBMSAppUi();
00061 
00062 
00063 public: // from CAknAppUi
00064 
00077     void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
00078 
00079 
00087     void HandleCommandL(TInt aCommand);
00088     
00093     void HandleStatusPaneSizeChange();
00094 
00095 private: // Menu command helpers
00096 
00103     void OpenDatabaseL();
00104 
00111     void CreateDatabaseL();
00112 
00118     void RemoveDatabaseL();
00119 
00126     void CloseDatabaseL();
00127 
00133     void ShowBookEditorViewL();
00134 
00144     void AddBookL(TBool aUseSql);
00145 
00154     void RemoveBookL();
00155 
00161     void RemoveAllBooksL();
00162 
00168     void UpdateBookTitleL();
00169 
00176     void ShowAllBooksL();
00177 
00184     void SearchBooksL();
00185 
00193     void IndexFindL();
00194 
00201     void AddDateColumnL();
00202 
00210     void RemoveDateColumnL();
00211 
00217     void ShowColumnsL();
00218 
00219 private: // Other helpers
00220 
00226     TFileName ApplicationDriveAndPathL() const;
00227     
00233         TFileName DatabaseDriveAndPathL() const;
00234 
00236     enum TViewId
00237         {
00238         ENone,          // On the startup there is no view
00239         EMainView,      // Main view initially visible.
00240         EListView,  // Showing list of books
00241         EColumnsView,   // Showing columns of Books table
00242         EEditorView // For adding a new book to database
00243         };
00244 
00250     void ChangeViewL(TViewId aNewView);
00251 
00257     void ShowNoteL(const TDesC& aMessage) const;
00258 
00266     CDesCArrayFlat* TitlesArrayL(const CDesCArrayFlat* aFullInfoArray) const;
00267 
00273     TBool QueryTextL(TDesC& aPrompt, TDes& aResultText) const;
00274 
00275 private:
00276 
00277     TViewId iCurrentView;
00278 
00280     CDBMSAppView* iAppView;
00281 
00283     CDBMSListboxView* iListboxView;
00284 
00286     CDBMSEditorView* iBookEditorView;
00287 
00289     CBookDb* iBookDb;
00290 
00292     TFileName     iDatabaseFile;
00293     };
00294 
00295 #endif // __DBMSAPPUI_H__
00296 

Generated by  doxygen 1.6.2