1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SVX_CHECKLBX_HXX
20 #define _SVX_CHECKLBX_HXX
22 #include <svtools/treelistbox.hxx>
23 #include <svtools/svlbitm.hxx>
25 #include <vcl/lstbox.hxx>
26 #include "svx/svxdllapi.h"
28 // class SvxCheckListBox -------------------------------------------------
30 class SVX_DLLPUBLIC SvxCheckListBox
: public SvTreeListBox
32 using Window::GetText
;
35 SvLBoxButtonData
* pCheckButton
;
37 SVX_DLLPRIVATE
void Init_Impl();
39 using SvTreeListBox::InsertEntry
;
40 // Avoid ambiguity with new InsertEntry:
41 virtual SvTreeListEntry
* InsertEntry( const XubString
& rText
, SvTreeListEntry
* pParent
,
42 sal_Bool bChildrenOnDemand
,
43 sal_uIntPtr nPos
, void* pUserData
,
44 SvLBoxButtonKind eButtonKind
);
47 SvxCheckListBox( Window
* pParent
, WinBits nWinStyle
= 0 );
48 SvxCheckListBox( Window
* pParent
, const ResId
& rResId
);
49 SvxCheckListBox( Window
* pParent
, const ResId
& rResId
,
50 const Image
& rNormalStaticImage
);
53 void InsertEntry ( const String
& rStr
,
54 sal_uInt16 nPos
= LISTBOX_APPEND
,
55 void* pUserData
= NULL
,
56 SvLBoxButtonKind eButtonKind
=
57 SvLBoxButtonKind_enabledCheckbox
);
58 void RemoveEntry ( sal_uInt16 nPos
);
60 void SelectEntryPos ( sal_uInt16 nPos
, sal_Bool bSelect
= sal_True
);
61 sal_uInt16
GetSelectEntryPos () const;
63 String
GetText ( sal_uInt16 nPos
) const;
64 sal_uInt16
GetCheckedEntryCount() const;
65 void CheckEntryPos ( sal_uInt16 nPos
, sal_Bool bCheck
= sal_True
);
66 sal_Bool
IsChecked ( sal_uInt16 nPos
) const;
67 void ToggleCheckButton ( SvTreeListEntry
* pEntry
);
69 void* SetEntryData ( sal_uInt16 nPos
, void* pNewData
);
70 void* GetEntryData ( sal_uInt16 nPos
) const;
72 virtual void MouseButtonDown ( const MouseEvent
& rMEvt
);
73 virtual void KeyInput ( const KeyEvent
& rKEvt
);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */