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>
23#include <vcl/ctrl.hxx>
24#include <vcl/scrbar.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;
84
87
88 std::unique_ptr<MouseEvent> mpMouseEvent;
89
90 DECL_LINK(ScrollHdl, ScrollBar*, void);
91
92public:
93 ScDataTableView(const css::uno::Reference<css::awt::XWindow>& rParent,
94 std::shared_ptr<ScDocument> pDoc);
95 ~ScDataTableView() override;
96
97 virtual void dispose() override;
98
99 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
100 virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
101 virtual void Resize() override;
102 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
103 virtual Size GetOptimalSize() const override;
104
105 void getColRange(SCCOL& rStartCol, SCCOL& rEndCol) const;
106 void getRowRange(SCROW& rStartRow, SCROW& rEndRow) const;
107};
108
109/* 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
VclPtr< ScrollBar > mpVScroll
void getRowRange(SCROW &rStartRow, SCROW &rEndRow) const
virtual void dispose() override
VclPtr< ScDataTableRowView > mpRowView
std::unique_ptr< SelectionEngine > mpSelectionEngine
~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
VclPtr< ScrollBarBox > mpTopLeft
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
std::unique_ptr< MouseEvent > mpMouseEvent
VclPtr< ScDataTableColView > mpColView
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
DECL_LINK(ScrollHdl, ScrollBar *, void)
ScDataTableView(const css::uno::Reference< css::awt::XWindow > &rParent, std::shared_ptr< ScDocument > pDoc)
VclPtr< ScrollBar > mpHScroll
virtual void Resize() override
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