LibreOffice Module sc (master) 1
datatableview.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 <com/sun/star/awt/XWindow.hpp>
24#include <vcl/ctrl.hxx>
25#include <types.hxx>
26#include "hdrcont.hxx"
27
28class ScDocument;
29
31{
34
35public:
36 ScDataTableColView(vcl::Window* pParent, ScDocument* pDoc, SelectionEngine* pSelectionEngine);
37
38 void SetPos(SCCOLROW nRow);
39
40 virtual SCCOLROW GetPos() const override;
41 virtual sal_uInt16 GetEntrySize(SCCOLROW nPos) const override;
42 virtual OUString GetEntryText(SCCOLROW nPos) const override;
43 virtual bool IsLayoutRTL() const override;
44 virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nWidth) override;
45 virtual void HideEntries(SCCOLROW nPos, SCCOLROW nEndPos) override;
46};
47
49{
52
53public:
54 ScDataTableRowView(vcl::Window* pParent, ScDocument* pDoc, SelectionEngine* pSelectionEngine);
55
56 void SetPos(SCCOLROW nRow);
57
58 virtual SCCOLROW GetPos() const override;
59 virtual sal_uInt16 GetEntrySize(SCCOLROW nPos) const override;
60 virtual OUString GetEntryText(SCCOLROW nPos) const override;
61 virtual bool IsLayoutRTL() const override;
62 virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nWidth) override;
63 virtual void HideEntries(SCCOLROW nPos, SCCOLROW nEndPos) override;
64};
65
66/*
67 * A simple UI component that presents a data table.
68 *
69 * Shares as much code as possible with the normal
70 * Calc grid rendering.
71 *
72 * This class should only depend on ScDocument and not
73 * on some of the Calc view shells.
74 */
76{
77 std::shared_ptr<ScDocument> mpDoc;
78 std::unique_ptr<SelectionEngine> mpSelectionEngine;
83
84 sal_uInt16 mnScrollBarSize;
85
88
89 std::unique_ptr<MouseEvent> mpMouseEvent;
90
91 DECL_LINK(VertScrollHdl, weld::Scrollbar&, void);
92 DECL_LINK(HorzScrollHdl, weld::Scrollbar&, void);
93
94public:
95 ScDataTableView(const css::uno::Reference<css::awt::XWindow>& rParent,
96 std::shared_ptr<ScDocument> pDoc);
97 ~ScDataTableView() override;
98
99 virtual void dispose() override;
100
101 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
102 virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
103 virtual void Resize() override;
104 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
105 virtual Size GetOptimalSize() const override;
106
107 void getColRange(SCCOL& rStartCol, SCCOL& rEndCol) const;
108 void getRowRange(SCROW& rStartRow, SCROW& rEndRow) const;
109};
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetPos(SCCOLROW nRow)
virtual OUString GetEntryText(SCCOLROW nPos) const override
virtual SCCOLROW GetPos() const override
ScDocument * mpDoc
ScDataTableColView(vcl::Window *pParent, ScDocument *pDoc, SelectionEngine *pSelectionEngine)
virtual void HideEntries(SCCOLROW nPos, SCCOLROW nEndPos) override
virtual sal_uInt16 GetEntrySize(SCCOLROW nPos) const override
virtual bool IsLayoutRTL() const override
virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nWidth) override
void SetPos(SCCOLROW nRow)
virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nWidth) override
virtual SCCOLROW GetPos() const override
ScDocument * mpDoc
virtual sal_uInt16 GetEntrySize(SCCOLROW nPos) const override
virtual void HideEntries(SCCOLROW nPos, SCCOLROW nEndPos) override
ScDataTableRowView(vcl::Window *pParent, ScDocument *pDoc, SelectionEngine *pSelectionEngine)
virtual OUString GetEntryText(SCCOLROW nPos) const override
virtual bool IsLayoutRTL() const override
void getRowRange(SCROW &rStartRow, SCROW &rEndRow) const
virtual void dispose() override
VclPtr< ScDataTableRowView > mpRowView
std::unique_ptr< SelectionEngine > mpSelectionEngine
DECL_LINK(HorzScrollHdl, weld::Scrollbar &, void)
~ScDataTableView() override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void getColRange(SCCOL &rStartCol, SCCOL &rEndCol) const
std::shared_ptr< ScDocument > mpDoc
virtual Size GetOptimalSize() const override
DECL_LINK(VertScrollHdl, weld::Scrollbar &, void)
VclPtr< ScrollAdaptor > mpHScroll
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
std::unique_ptr< MouseEvent > mpMouseEvent
VclPtr< ScDataTableColView > mpColView
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
VclPtr< ScrollAdaptor > mpVScroll
ScDataTableView(const css::uno::Reference< css::awt::XWindow > &rParent, std::shared_ptr< ScDocument > pDoc)
virtual void Resize() override
sal_uInt16 mnScrollBarSize
tools::Long nWidth
Definition: hdrcont.hxx:47
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17