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: checklbx.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 ************************************************************************/
30 #ifndef _SVX_CHECKLBX_HXX
31 #define _SVX_CHECKLBX_HXX
33 // include ---------------------------------------------------------------
36 #include <svtools/svtreebx.hxx>
37 #include <svtools/svlbitm.hxx>
39 #ifndef _LSTBOX_HXX //autogen
40 #include <vcl/lstbox.hxx>
42 #include "svx/svxdllapi.h"
44 // class SvxCheckListBox -------------------------------------------------
46 class SVX_DLLPUBLIC SvxCheckListBox
: public SvTreeListBox
48 using Window::GetText
;
51 SvLBoxButtonData
* pCheckButton
;
53 #ifdef _SVX_CHECKLBX_CXX
54 SVX_DLLPRIVATE
void Init_Impl();
57 using SvTreeListBox::InsertEntry
;
58 // Avoid ambiguity with new InsertEntry:
59 virtual SvLBoxEntry
* InsertEntry( const XubString
& rText
, SvLBoxEntry
* pParent
,
61 ULONG nPos
, void* pUserData
,
62 SvLBoxButtonKind eButtonKind
);
65 SvxCheckListBox( Window
* pParent
, WinBits nWinStyle
= 0 );
66 SvxCheckListBox( Window
* pParent
, const ResId
& rResId
);
67 SvxCheckListBox( Window
* pParent
, const ResId
& rResId
,
68 const Image
& rNormalStaticImage
,
69 const Image
& rHighContrastStaticImage
);
72 void InsertEntry ( const String
& rStr
,
73 USHORT nPos
= LISTBOX_APPEND
,
74 void* pUserData
= NULL
,
75 SvLBoxButtonKind eButtonKind
=
76 SvLBoxButtonKind_enabledCheckbox
);
77 void RemoveEntry ( USHORT nPos
);
79 void SelectEntryPos ( USHORT nPos
, BOOL bSelect
= TRUE
);
80 USHORT
GetSelectEntryPos () const;
82 String
GetText ( USHORT nPos
) const;
83 USHORT
GetCheckedEntryCount() const;
84 void CheckEntryPos ( USHORT nPos
, BOOL bCheck
= TRUE
);
85 BOOL
IsChecked ( USHORT nPos
) const;
86 void ToggleCheckButton ( SvLBoxEntry
* pEntry
);
88 void* SetEntryData ( USHORT nPos
, void* pNewData
);
89 void* GetEntryData ( USHORT nPos
) const;
91 virtual void MouseButtonDown ( const MouseEvent
& rMEvt
);
92 virtual void KeyInput ( const KeyEvent
& rKEvt
);