1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: msgedit.hxx,v $
10 * $Revision: 1.11.40.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <svtools/svtreebx.hxx>
35 #include <basic/testtool.hxx>
36 #include "dataedit.hxx"
41 #define SelectChildren SelectChilds // Sonst wird mir schlecht
43 typedef USHORT TTFeatures
; // Bitfield for features of the entries
44 #define HasNothing TTFeatures(0x00)
45 #define HasError TTFeatures(0x01)
46 #define HasWarning TTFeatures(0x02)
47 #define HasAssertion TTFeatures(0x04)
48 #define HasQAError TTFeatures(0x08)
51 class TTTreeListBox
: public SvTreeListBox
54 // virtual void Command( const CommandEvent& rCEvt );
55 // USHORT nDeselectParent;
56 BasicFrame
*pBasicFrame
;
57 void InitEntry( SvLBoxEntry
*, const String
&, const Image
&,
58 const Image
&, SvLBoxButtonKind eButtonKind
);
61 BOOL
JumpToSourcecode( SvLBoxEntry
*pThisEntry
);
64 TTTreeListBox( AppError
* pParent
, BasicFrame
* pBF
, WinBits nWinStyle
=0 );
67 // virtual void SelectHdl();
68 // virtual void DeselectHdl();
69 virtual BOOL
DoubleClickHdl();
71 virtual void KeyInput( const KeyEvent
& rKEvt
);
73 // ULONG SelectChildren( SvLBoxEntry* pParent, BOOL bSelect );
74 TTFeatures
GetFeatures( SvLBoxEntry
* );
77 class MsgEdit
: public DataEdit
79 BasicFrame
*pBasicFrame
;
81 SvLBoxEntry
*pCurrentRun
;
82 SvLBoxEntry
*pCurrentTestCase
;
83 SvLBoxEntry
*pCurrentAssertion
;
84 SvLBoxEntry
*pCurrentError
;
87 BOOL bFileLoading
; // TRUE while loading a file
88 String
Impl_MakeText( SvLBoxEntry
*pEntry
) const;
89 String
Impl_MakeSaveText( SvLBoxEntry
*pEntry
) const;
90 String
Impl_MakeSaveText( TTDebugData aData
) const;
91 USHORT nVersion
; // Stores file version
95 static USHORT nMaxLogLen
;
96 static BOOL bLimitLogLen
;
97 static BOOL bPrintLogToStdout
;
98 static BOOL bPrintLogToStdoutSet
; // has it been initialized yet
100 MsgEdit( AppError
*, BasicFrame
*pBF
, const WinBits
& );
102 void AddAnyMsg( TTLogMsg
*LogMsg
);
103 void AddRun( String aMsg
, TTDebugData aDebugData
);
104 void AddTestCase( String aMsg
, TTDebugData aDebugData
);
105 void AddError( String aMsg
, TTDebugData aDebugData
);
106 void AddCallStack( String aMsg
, TTDebugData aDebugData
);
107 void AddMessage( String aMsg
, TTDebugData aDebugData
);
108 void AddWarning( String aMsg
, TTDebugData aDebugData
);
109 void AddAssertion( String aMsg
, TTDebugData aDebugData
);
110 void AddAssertionStack( String aMsg
, TTDebugData aDebugData
);
111 void AddQAError( String aMsg
, TTDebugData aDebugData
);
113 static void SetMaxLogLen( USHORT nLen
) { nMaxLogLen
= nLen
; bLimitLogLen
= TRUE
; }
114 DATA_FUNC_DEF( aEditTree
, TTTreeListBox
)