diff --git a/StockServer/MainFrm.h b/StockServer/MainFrm.h new file mode 100644 index 0000000..82928d2 --- /dev/null +++ b/StockServer/MainFrm.h @@ -0,0 +1,114 @@ +// MainFrm.h : interface of the CMainFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MAINFRM_H__4182CA6D_E675_44FF_8358_B148DFE49695__INCLUDED_) +#define AFX_MAINFRM_H__4182CA6D_E675_44FF_8358_B148DFE49695__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "..\\Common\\MainTray.h" +#include "DialogBarUtil.h" + +class CStockServerApp; +class CUserListView; +class CMessagesView; +class CServerSocket; + +class CMainFrame : public CMainTray +{ + +protected: // create from serialization only + CMainFrame(); + DECLARE_DYNCREATE(CMainFrame) + +// Attributes +protected: + CSplitterWnd m_wndSplitter; +private: + BCMenu m_menu; + CStockServerApp* m_pApp; + CUserListView* m_pUserListView; + CMessagesView* m_pMessagesView; + + BOOL m_bServerStarted; + BOOL m_bWindowOnTop; + + CServerSocket* m_pServerSocket; + CDialogBarUtil m_DlgBarUtil; + +public: + void AddMessage(CString szName, CString szMessage); + void UpdateClientsList(CPtrList* pClientstList); + CPtrList* GetClientsList(); + +protected: + void ClearAllViews(); + void UpdateAllView(); + void SaveWindowPlacement(); + void RestoreWindowPlacement(); + BOOL DisconnectServer(); + void UpdateMenu(); + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainFrame) + public: + virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainFrame(); + CMessagesView* GetMessagesView(); + CUserListView* GetUserListView(); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: // control bar embedded members + CStatusBar m_wndStatusBar; + CToolBar m_wndToolBar; + +// Generated message map functions +protected: + //{{AFX_MSG(CMainFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ); + afx_msg void OnClose(); + afx_msg void OnUpdateConnectionStatus(CCmdUI* pCmdUI); + afx_msg void OnUpdateConnectionClients(CCmdUI* pCmdUI); + afx_msg void OnUpdateNbMessages(CCmdUI* pCmdUI); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnViewParameters(); + afx_msg void OnUpdateViewParameters(CCmdUI* pCmdUI); + afx_msg void OnOptionsAlwaysvisible(); + afx_msg void OnUpdateOptionsAlwaysvisible(CCmdUI* pCmdUI); + afx_msg void OnFileSaveAs(); + afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI); + afx_msg void OnOperationsStartserver(); + afx_msg void OnUpdateOperationsStartserver(CCmdUI* pCmdUI); + afx_msg void OnOperationsStopserver(); + afx_msg void OnUpdateOperationsStopserver(CCmdUI* pCmdUI); + afx_msg LRESULT OnMenuChar( UINT nChar, UINT nFlags, CMenu* pMenu ); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + afx_msg void OnTraymenuShowStockServer(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAINFRM_H__4182CA6D_E675_44FF_8358_B148DFE49695__INCLUDED_)