| 1 | /* |
|---|
| 2 | ----------------------------------------------------------------------------- |
|---|
| 3 | This source file is part of LEXIExporter |
|---|
| 4 | |
|---|
| 5 | Copyright 2006 NDS Limited |
|---|
| 6 | |
|---|
| 7 | Author(s): |
|---|
| 8 | Mark Folkenberg, |
|---|
| 9 | Bo Krohn |
|---|
| 10 | |
|---|
| 11 | This program is free software; you can redistribute it and/or modify it under |
|---|
| 12 | the terms of the GNU Lesser General Public License as published by the Free Software |
|---|
| 13 | Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 14 | version. |
|---|
| 15 | |
|---|
| 16 | This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 18 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
|---|
| 19 | |
|---|
| 20 | You should have received a copy of the GNU Lesser General Public License along with |
|---|
| 21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|---|
| 22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
|---|
| 23 | http://www.gnu.org/copyleft/lesser.txt. |
|---|
| 24 | ----------------------------------------------------------------------------- |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | #ifndef __NDS_LexiExporter_ExportProgressDialog__ |
|---|
| 28 | #define __NDS_LexiExporter_ExportProgressDialog__ |
|---|
| 29 | |
|---|
| 30 | #include <richedit.h> |
|---|
| 31 | |
|---|
| 32 | // |
|---|
| 33 | |
|---|
| 34 | class CExportProgressDlg : public GDI::Dialog |
|---|
| 35 | { |
|---|
| 36 | public: |
|---|
| 37 | CExportProgressDlg(Window* pParent); |
|---|
| 38 | ~CExportProgressDlg(); |
|---|
| 39 | |
|---|
| 40 | // Initialize global stepping |
|---|
| 41 | void InitGlobal(int iObjectCount); |
|---|
| 42 | |
|---|
| 43 | // Do a global step (once per ExportObject) |
|---|
| 44 | void GlobalStep(); |
|---|
| 45 | |
|---|
| 46 | // Initialize local progress |
|---|
| 47 | void InitLocal(int iStepCount); |
|---|
| 48 | |
|---|
| 49 | // Do a local step |
|---|
| 50 | void LocalStep(const char *pszDesc=NULL); |
|---|
| 51 | |
|---|
| 52 | // Signal all export done |
|---|
| 53 | void ExportDone(void); |
|---|
| 54 | |
|---|
| 55 | // Check if we want to abort current export |
|---|
| 56 | bool CheckAbort(); |
|---|
| 57 | |
|---|
| 58 | protected: |
|---|
| 59 | void OnInitDialog(); |
|---|
| 60 | void OnAbort(); |
|---|
| 61 | |
|---|
| 62 | private: |
|---|
| 63 | static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
|---|
| 64 | |
|---|
| 65 | // text buffer for global info |
|---|
| 66 | char m_InfoBuffer[1024]; |
|---|
| 67 | int m_iGlobalProgress; |
|---|
| 68 | int m_iTotalGlobal; |
|---|
| 69 | int m_iLocalProgress; |
|---|
| 70 | |
|---|
| 71 | bool m_bAbortRequest; |
|---|
| 72 | bool m_bAbortFlag; |
|---|
| 73 | |
|---|
| 74 | GDI::Window* m_pGlobalInfo; |
|---|
| 75 | GDI::Window* m_pGlobalProgress; |
|---|
| 76 | GDI::Window* m_pLocalInfo; |
|---|
| 77 | GDI::Window* m_pLocalProgress; |
|---|
| 78 | }; |
|---|
| 79 | |
|---|
| 80 | // |
|---|
| 81 | |
|---|
| 82 | #endif // __NDS_LexiExporter_ExportProgressDialog__ |
|---|