LibreOffice Module vcl (master) 1
iconviewimpl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <svimpbox.hxx>
23
24class SvTreeListBox;
25class Point;
26
27class IconViewImpl : public SvImpLBox
28{
29public:
30 IconViewImpl(SvTreeListBox* pTreeListBox, SvTreeList* pTreeList, WinBits nWinStyle);
31
32 void KeyDown(bool bPageDown) override;
33
34 void KeyUp(bool bPageUp) override;
35
36 Point GetEntryPosition(const SvTreeListEntry* pEntry) const override;
37
38 SvTreeListEntry* GetClickedEntry(const Point& rPoint) const override;
39
40 bool IsEntryInView(SvTreeListEntry* pEntry) const override;
41
42 void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
43
44 // returns 0 if position is just past the last entry
45 SvTreeListEntry* GetEntry(const Point& rPoint) const override;
46
47 void UpdateAll() override;
48
49 bool KeyInput(const KeyEvent&) override;
50
51 void InvalidateEntry(tools::Long nId) const override;
52
53protected:
54 tools::Long GetEntryLine(const SvTreeListEntry* pEntry) const override;
55
56 void CursorUp() override;
57 void CursorDown() override;
58 void PageDown(sal_uInt16 nDelta) override;
59 void PageUp(sal_uInt16 nDelta) override;
60
61 void SyncVerThumb() override;
62 void AdjustScrollBars(Size& rSize) override;
63
64private:
65 enum class CallbackResult
66 {
68 Stop, // Stop iteration
69 };
71 {
73 short column;
74 tools::Rectangle area; // The area for the entry
75 };
76 using IterateEntriesFunc = std::function<CallbackResult(const EntryAreaInfo&)>;
77
78 void IterateVisibleEntryAreas(const IterateEntriesFunc& f, bool fromStartEntry = false) const;
79
80 Size GetEntrySize(const SvTreeListEntry& entry) const;
81 // Get first entry at most n rows above; nullptr if no rows above
82 SvTreeListEntry* GoToPrevRow(SvTreeListEntry* pEntry, int n) const;
83 // Get first entry at most n rows below; nullptr if no rows below
84 SvTreeListEntry* GoToNextRow(SvTreeListEntry* pEntry, int n) const;
85
86 tools::Long GetEntryRow(const SvTreeListEntry* entry) const;
87 void SetStartEntry(SvTreeListEntry* entry);
88 void ScrollTo(SvTreeListEntry* entry);
89};
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsEntryInView(SvTreeListEntry *pEntry) const override
Size GetEntrySize(const SvTreeListEntry &entry) const
void ScrollTo(SvTreeListEntry *entry)
bool KeyInput(const KeyEvent &) override
SvTreeListEntry * GoToPrevRow(SvTreeListEntry *pEntry, int n) const
void UpdateAll() override
std::function< CallbackResult(const EntryAreaInfo &)> IterateEntriesFunc
void SetStartEntry(SvTreeListEntry *entry)
void PageUp(sal_uInt16 nDelta) override
void IterateVisibleEntryAreas(const IterateEntriesFunc &f, bool fromStartEntry=false) const
void KeyDown(bool bPageDown) override
tools::Long GetEntryLine(const SvTreeListEntry *pEntry) const override
Point GetEntryPosition(const SvTreeListEntry *pEntry) const override
IconViewImpl(SvTreeListBox *pTreeListBox, SvTreeList *pTreeList, WinBits nWinStyle)
SvTreeListEntry * GetEntry(const Point &rPoint) const override
void AdjustScrollBars(Size &rSize) override
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void SyncVerThumb() override
void InvalidateEntry(tools::Long nId) const override
void CursorUp() override
tools::Long GetEntryRow(const SvTreeListEntry *entry) const
void KeyUp(bool bPageUp) override
SvTreeListEntry * GoToNextRow(SvTreeListEntry *pEntry, int n) const
SvTreeListEntry * GetClickedEntry(const Point &rPoint) const override
void CursorDown() override
void PageDown(sal_uInt16 nDelta) override
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
aCursorMoveIdle Stop()
long Long
sal_Int16 nId
sal_Int64 WinBits
Definition: wintypes.hxx:109