update dev300-m58
[ooovba.git] / dbaccess / source / ui / inc / marktree.hxx
blob7fe4bbe255db2a4fcea5e28f689d58e0f2f8e3b9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: marktree.hxx,v $
10 * $Revision: 1.9 $
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"
36 #endif
40 //.........................................................................
41 namespace dbaui
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;
57 public:
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; }
73 protected:
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
80 private:
81 void InitButtonData();
84 //.........................................................................
85 } // namespace dbaui
86 //.........................................................................
88 #endif // _DBAUI_MARKTREE_HXX_