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 .
20 #ifndef INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
21 #define INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
23 #include <svtools/table/tabletypes.hxx>
25 #include <rtl/ref.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
28 #include <boost/noncopyable.hpp>
33 namespace svt
{ namespace table
54 class MouseFunction
: public ::salhelper::SimpleReferenceObject
, public ::boost::noncopyable
58 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
59 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
60 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) = 0;
63 virtual ~MouseFunction() { }
69 class ColumnResize
: public MouseFunction
73 :m_nResizingColumn( COL_INVALID
)
79 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
80 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
81 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
84 ColPos m_nResizingColumn
;
90 class RowSelection
: public MouseFunction
100 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
101 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
102 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
109 //= ColumnSortHandler
111 class ColumnSortHandler
: public MouseFunction
115 :m_nActiveColumn( COL_INVALID
)
121 virtual FunctionResult
handleMouseMove( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
122 virtual FunctionResult
handleMouseDown( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
123 virtual FunctionResult
handleMouseUp( ITableControl
& i_tableControl
, MouseEvent
const & i_event
) SAL_OVERRIDE
;
126 ColPos m_nActiveColumn
;
130 } } // namespace svt::table
133 #endif // INCLUDED_SVTOOLS_SOURCE_TABLE_MOUSEFUNCTION_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */