Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / checklbx.hxx
blob63db8545c3bd6396132d64c1de74a1e030e1d402
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_SVX_CHECKLBX_HXX
20 #define INCLUDED_SVX_CHECKLBX_HXX
22 #include <svtools/treelistbox.hxx>
23 #include <svtools/svlbitm.hxx>
25 #include <svx/svxdllapi.h>
27 // class SvxCheckListBox -------------------------------------------------
29 class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
31 using Window::GetText;
33 private:
34 SvLBoxButtonData* pCheckButton;
36 SVX_DLLPRIVATE void Init_Impl();
38 using SvTreeListBox::InsertEntry;
39 // Avoid ambiguity with new InsertEntry:
40 virtual SvTreeListEntry* InsertEntry( const OUString& rText, SvTreeListEntry* pParent,
41 bool bChildrenOnDemand,
42 sal_uIntPtr nPos, void* pUserData,
43 SvLBoxButtonKind eButtonKind ) SAL_OVERRIDE;
45 public:
46 SvxCheckListBox( vcl::Window* pParent, WinBits nWinStyle = 0 );
47 void SetNormalStaticImage(const Image& rNormalStaticImage);
48 virtual ~SvxCheckListBox();
49 virtual void dispose() SAL_OVERRIDE;
51 void InsertEntry ( const OUString& rStr,
52 sal_uLong nPos = TREELIST_APPEND,
53 void* pUserData = NULL,
54 SvLBoxButtonKind eButtonKind =
55 SvLBoxButtonKind_enabledCheckbox );
56 void RemoveEntry ( sal_uLong nPos );
58 void SelectEntryPos ( sal_uLong nPos, bool bSelect = true );
59 sal_uLong GetSelectEntryPos () const;
60 void* GetSelectEntryData () const { return GetEntryData(GetSelectEntryPos()); }
62 OUString GetText ( sal_uLong nPos ) const;
63 sal_uLong GetCheckedEntryCount() const;
64 void CheckEntryPos ( sal_uLong nPos, bool bCheck = true );
65 bool IsChecked ( sal_uLong nPos ) const;
66 void ToggleCheckButton ( SvTreeListEntry* pEntry );
68 void* SetEntryData ( sal_uLong nPos, void* pNewData );
69 void* GetEntryData ( sal_uLong nPos ) const;
71 virtual void MouseButtonDown ( const MouseEvent& rMEvt ) SAL_OVERRIDE;
72 virtual void KeyInput ( const KeyEvent& rKEvt ) SAL_OVERRIDE;
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */