home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // File : OutputDoc.h
- // Project : MsgTrace
- // Component : MsgTracer
- //---------------------------------------------------------------------------
- // Description : document of output-view
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // SourceSafe Strings. Do not change.
- //---------------------------------------------------------------------------
- // $Author: jeskes $
- // $Date: $
- // $Revision: $
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #ifndef OUTPUTDOC_H
- #define OUTPUTDOC_H
-
- /////////////////////////////////////////////////////////////////////////////
-
- class COutputLine;
- class COutputLineFormat;
-
- /////////////////////////////////////////////////////////////////////////////
- // document notifictions
- /////////////////////////////////////////////////////////////////////////////
-
- #define OUTPUTDOC_LINEADDED 1
- #define OUTPUTDOC_CLEARED 2
-
- /////////////////////////////////////////////////////////////////////////////
-
- class COutputDoc : public CDocument
- {
- DECLARE_SERIAL( COutputDoc )
- //---------------------------------------------------------------------------
- // construction
- //---------------------------------------------------------------------------
- public:
- COutputDoc();
- virtual ~COutputDoc();
-
- public:
- virtual BOOL OnNewDocument();
-
- protected:
- virtual void OnChangedViewList();
- void DeleteContents();
-
- public:
- virtual HMENU GetDefaultMenu();
-
- //---------------------------------------------------------------------------
- // attributes
- //---------------------------------------------------------------------------
- private:
- COutputLine* m_psLineArray;
- // pointer to array of lines
-
- int m_nMaxBufferedLines;
- // size of array of lines
-
- int m_nMaxLines;
- // max lines in array
-
- int m_nNextFreeLine;
- // next free line in array
-
- int m_nMaxLineLen;
- // max length of lines in array
-
- public:
- int GetMaxLines() const;
- int GetMaxLineLen() const;
-
- int GetMaxBufferedLines() const;
- void SetMaxBufferedLines( int nMaxBufferedLines );
-
- //---------------------------------------------------------------------------
- // current output-line-format
- //---------------------------------------------------------------------------
- private:
- COutputLineFormat* m_pCurrentFormat;
-
- public:
- void InitTabStops( int nTabStops = 0 );
- void SetTabStop( int nIndex, int nTabPos );
-
- const COutputLineFormat& GetCurrentFormat() const;
-
- //---------------------------------------------------------------------------
- // operations
- //---------------------------------------------------------------------------
- protected:
- CMutex m_mutexAddLine;
-
- public:
- void AddLine( LPCSTR lpszText );
- COutputLine& GetLine( int nLine );
-
- //---------------------------------------------------------------------------
- // serialize
- //---------------------------------------------------------------------------
- protected:
- virtual void Serialize(CArchive& ar);
-
- //---------------------------------------------------------------------------
- // message map
- //---------------------------------------------------------------------------
- protected:
- CMutex m_mutexThreadSafeUpdateAllViews;
-
- typedef struct
- {
- CView* m_pView;
- LPARAM m_lHint;
- CObject* m_pHint;
-
- } SUpdateAllViews;
-
- SUpdateAllViews m_sUpdateAllViews;
-
- public:
- void ThreadSafeUpdateAllViews( CView*, LPARAM = 0L, CObject* = NULL );
-
- //---------------------------------------------------------------------------
- // message map
- //---------------------------------------------------------------------------
- protected:
- //{{AFX_MSG(COutputDoc)
- afx_msg void OnEditClearAll();
- //}}AFX_MSG
- afx_msg BOOL OnExtUpdateAllViews( UINT );
- DECLARE_MESSAGE_MAP()
-
- //---------------------------------------------------------------------------
- // friends
- //---------------------------------------------------------------------------
- friend class COutputView;
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- inline int COutputDoc::GetMaxLineLen() const
- {
- return( m_nMaxLineLen );
- }
-
- inline int COutputDoc::GetMaxLines() const
- {
- return( m_nMaxLines );
- }
-
- inline int COutputDoc::GetMaxBufferedLines() const
- {
- return( m_nMaxBufferedLines );
- }
-
- /////////////////////////////////////////////////////////////////////////////
- #endif
-