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 .
22 #include "tabletypes.hxx"
24 #include <salhelper/simplereferenceobject.hxx>
45 class MouseFunction
: public ::salhelper::SimpleReferenceObject
49 MouseFunction(const MouseFunction
&) = delete;
50 MouseFunction
& operator=(const MouseFunction
&) = delete;
51 virtual FunctionResult
handleMouseMove(ITableControl
& i_tableControl
, MouseEvent
const& i_event
)
53 virtual FunctionResult
handleMouseDown(ITableControl
& i_tableControl
, MouseEvent
const& i_event
)
55 virtual FunctionResult
handleMouseUp(ITableControl
& i_tableControl
, MouseEvent
const& i_event
)
59 virtual ~MouseFunction() override
{}
64 class ColumnResize final
: public MouseFunction
68 : m_nResizingColumn(COL_INVALID
)
74 virtual FunctionResult
handleMouseMove(ITableControl
& i_tableControl
,
75 MouseEvent
const& i_event
) override
;
76 virtual FunctionResult
handleMouseDown(ITableControl
& i_tableControl
,
77 MouseEvent
const& i_event
) override
;
78 virtual FunctionResult
handleMouseUp(ITableControl
& i_tableControl
,
79 MouseEvent
const& i_event
) override
;
82 ColPos m_nResizingColumn
;
87 class RowSelection final
: public MouseFunction
97 virtual FunctionResult
handleMouseMove(ITableControl
& i_tableControl
,
98 MouseEvent
const& i_event
) override
;
99 virtual FunctionResult
handleMouseDown(ITableControl
& i_tableControl
,
100 MouseEvent
const& i_event
) override
;
101 virtual FunctionResult
handleMouseUp(ITableControl
& i_tableControl
,
102 MouseEvent
const& i_event
) override
;
108 //= ColumnSortHandler
110 class ColumnSortHandler final
: public MouseFunction
114 : m_nActiveColumn(COL_INVALID
)
120 virtual FunctionResult
handleMouseMove(ITableControl
& i_tableControl
,
121 MouseEvent
const& i_event
) override
;
122 virtual FunctionResult
handleMouseDown(ITableControl
& i_tableControl
,
123 MouseEvent
const& i_event
) override
;
124 virtual FunctionResult
handleMouseUp(ITableControl
& i_tableControl
,
125 MouseEvent
const& i_event
) override
;
128 ColPos m_nActiveColumn
;
131 } // namespace svt::table
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */