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: marktree.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 ************************************************************************/
31 #ifndef _DBAUI_MARKTREE_HXX_
32 #define _DBAUI_MARKTREE_HXX_
34 #ifndef DBAUI_DBTREELISTBOX_HXX
35 #include "dbtreelistbox.hxx"
40 //.........................................................................
43 //.........................................................................
45 //========================================================================
46 //= OMarkableTreeListBox
47 //========================================================================
48 /** a tree list box where all entries can be marked (with a checkbox) and
49 unmarked. In addition, inner nodes know a third state which applies
50 if some, but not all of their descendants are marked.
52 class OMarkableTreeListBox
: public DBTreeListBox
54 SvLBoxButtonData
* m_pCheckButton
;
55 Link m_aCheckButtonHandler
;
58 OMarkableTreeListBox( Window
* pParent
59 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
60 , WinBits nWinStyle
=0 );
61 OMarkableTreeListBox( Window
* pParent
62 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
63 , const ResId
& rResId
);
64 ~OMarkableTreeListBox();
66 virtual void KeyInput( const KeyEvent
& rKEvt
);
67 virtual void CheckButtonHdl();
68 void CheckButtons(); // make the button states consistent (bottom-up)
70 /// the handler given is called whenever the check state of one or more items changed
71 void SetCheckHandler(const Link
& _rHdl
) { m_aCheckButtonHandler
= _rHdl
; }
74 virtual void Paint(const Rectangle
& _rRect
);
75 virtual void checkedButton_noBroadcast(SvLBoxEntry
* _pEntry
);
77 SvButtonState
implDetermineState(SvLBoxEntry
* _pEntry
);
78 // determines the check state of the given entry, by analyzing the states of all descendants
81 void InitButtonData();
84 //.........................................................................
86 //.........................................................................
88 #endif // _DBAUI_MARKTREE_HXX_