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: dbg_lay.hxx,v $
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 #define PROT_FILE_INIT 0x00000000
35 #define PROT_INIT 0x00000001
36 #define PROT_MAKEALL 0x00000002
37 #define PROT_MOVE_FWD 0x00000004
38 #define PROT_MOVE_BWD 0x00000008
39 #define PROT_GROW 0x00000010
40 #define PROT_SHRINK 0x00000020
41 #define PROT_GROW_TST 0x00000040
42 #define PROT_SHRINK_TST 0x00000080
43 #define PROT_SIZE 0x00000100
44 #define PROT_PRTAREA 0x00000200
45 #define PROT_POS 0x00000400
46 #define PROT_ADJUSTN 0x00000800
47 #define PROT_SECTION 0x00001000
48 #define PROT_CUT 0x00002000
49 #define PROT_PASTE 0x00004000
50 #define PROT_LEAF 0x00008000
51 #define PROT_TESTFORMAT 0x00010000
52 #define PROT_FRMCHANGES 0x00020000
53 #define PROT_SNAPSHOT 0x00040000
57 #define ACT_CREATE_MASTER 3
58 #define ACT_CREATE_FOLLOW 4
59 #define ACT_DEL_MASTER 5
60 #define ACT_DEL_FOLLOW 6
62 #define ACT_NEXT_SECT 8
63 #define ACT_PREV_SECT 9
65 #define SNAP_LOWER 0x00000001
66 #define SNAP_FLYFRAMES 0x00000002
67 #define SNAP_TABLECONT 0x00000004
71 #include "swtypes.hxx"
75 class SwImplEnterLeave
;
80 static SwImplProtocol
* pImpl
;
81 static BOOL
Start() { return 0 != ( PROT_INIT
& nRecord
); }
83 static ULONG
Record() { return nRecord
; }
84 static void SetRecord( ULONG nNew
) { nRecord
= nNew
; }
85 static BOOL
Record( ULONG nFunc
) { return 0 != (( nFunc
| PROT_INIT
) & nRecord
); }
86 static void Record( const SwFrm
* pFrm
, ULONG nFunction
, ULONG nAction
, void* pParam
);
89 static void SnapShot( const SwFrm
* pFrm
, ULONG nFlags
);
90 static void GetVar( const USHORT nNo
, long& rVar
);
95 SwImplEnterLeave
* pImpl
;
96 void Ctor( const SwFrm
* pFrm
, ULONG nFunc
, ULONG nAct
, void* pPar
);
99 SwEnterLeave( const SwFrm
* pFrm
, ULONG nFunc
, ULONG nAct
, void* pPar
)
100 { if( SwProtocol::Record( nFunc
) ) Ctor( pFrm
, nFunc
, nAct
, pPar
); else pImpl
= NULL
; }
101 ~SwEnterLeave() { if( pImpl
) Dtor(); }
104 #define PROTOCOL( pFrm, nFunc, nAct, pPar ) { if( SwProtocol::Record( nFunc ) )\
105 SwProtocol::Record( pFrm, nFunc, nAct, pPar ); }
106 #define PROTOCOL_INIT SwProtocol::Init();
107 #define PROTOCOL_STOP SwProtocol::Stop();
108 #define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar ) SwEnterLeave aEnter( pFrm, nFunc, nAct, pPar );
109 #define PROTOCOL_SNAPSHOT( pFrm, nFlags ) SwProtocol::SnapShot( pFrm, nFlags );
110 #define GET_VARIABLE( nNo, nVar ) SwProtocol::GetVar( nNo, nVar );
114 #define PROTOCOL( pFrm, nFunc, nAct, pPar )
115 #define PROTOCOL_INIT
116 #define PROTOCOL_STOP
117 #define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar )
118 #define PROTOCOL_SNAPSHOT( pFrm, nFlags )
119 #define GET_VARIABLE( nNo, nVar )